搜索内容 搜索用户

[已解决] 如程序所见，错误使用 symengine Unable to convert expression into double array.希望有大佬能帮忙解决。最后一行sym转double错误

 本帖最后由 add. 于 2022-7-10 17:01 编辑 clear;clc syms y gt = 4.2374; atm = 2; utm = 2; A0t = 0.0620; hlt = 0.1219; hfm = 0.8660; xishut = utm/(A0t*hlt*hfm)^atm; k1 = 1 - gt^2/atm; k2 = (atm*utm - gt^2)/atm; k3 = -gt^2/atm; ft = y^(gt^2/2)* meijerG([k1], [1], [0, k2], [k3], xishut*y^(atm/2)); gf = 4.5749; afm = 4.4948; bfm = 2.5442; A0f = 0.3900; hlf = 0.8603; xishuf = ((afm*bfm)/(4*A0f*hlf))^2; k4 = (gf^2 + 1)/2; k5 = (gf^2 + 2)/2; k6 = (gf^2)/2; k7 = (gf^2 + 1)/2; k8 = (afm)/2; k9 = (afm + 1)/2; k10 = (bfm)/2; k11 = (bfm + 1)/2; ff = meijerG([1], [k4, k5], [k6, k7, k8, k9, k10, k11], [0], xishuf*y); fx = (1 - exp(-y))^(1 - 1)*(exp(-y))^(3 - 1 + 1); f=ft.*ff.*fx j2=int(f,y,-10.6855,50) j2=abs(double(j2)) 复制代码

20141303 发表于 2022-7-10 17:11:28
 仅供参考，估计积分区间存在奇异点 clear;clc syms y gt = 4.2374; atm = 2; utm = 2; A0t = 0.0620; hlt = 0.1219; hfm = 0.8660; xishut = utm/(A0t*hlt*hfm)^atm; k1 = 1 - gt^2/atm; k2 = (atm*utm - gt^2)/atm; k3 = -gt^2/atm; ft = y^(gt^2/2)* meijerG([k1], [1], [0, k2], [k3], xishut*y^(atm/2)); gf = 4.5749; afm = 4.4948; bfm = 2.5442; A0f = 0.3900; hlf = 0.8603; xishuf = ((afm*bfm)/(4*A0f*hlf))^2; k4 = (gf^2 + 1)/2; k5 = (gf^2 + 2)/2; k6 = (gf^2)/2; k7 = (gf^2 + 1)/2; k8 = (afm)/2; k9 = (afm + 1)/2; k10 = (bfm)/2; k11 = (bfm + 1)/2; ff = meijerG([1], [k4, k5], [k6, k7, k8, k9, k10, k11], [0], xishuf*y); fx = (1 - exp(-y))^(1 - 1)*(exp(-y))^(3 - 1 + 1); f=ft.*ff.*fx; fun=matlabFunction(f); j2=integral(fun,-10.6855,50) j2=abs(double(j2))复制代码

2 条回复

倒序浏览

20141303 发表于 2022-7-10 17:11:28
 仅供参考，估计积分区间存在奇异点 clear;clc syms y gt = 4.2374; atm = 2; utm = 2; A0t = 0.0620; hlt = 0.1219; hfm = 0.8660; xishut = utm/(A0t*hlt*hfm)^atm; k1 = 1 - gt^2/atm; k2 = (atm*utm - gt^2)/atm; k3 = -gt^2/atm; ft = y^(gt^2/2)* meijerG([k1], [1], [0, k2], [k3], xishut*y^(atm/2)); gf = 4.5749; afm = 4.4948; bfm = 2.5442; A0f = 0.3900; hlf = 0.8603; xishuf = ((afm*bfm)/(4*A0f*hlf))^2; k4 = (gf^2 + 1)/2; k5 = (gf^2 + 2)/2; k6 = (gf^2)/2; k7 = (gf^2 + 1)/2; k8 = (afm)/2; k9 = (afm + 1)/2; k10 = (bfm)/2; k11 = (bfm + 1)/2; ff = meijerG([1], [k4, k5], [k6, k7, k8, k9, k10, k11], [0], xishuf*y); fx = (1 - exp(-y))^(1 - 1)*(exp(-y))^(3 - 1 + 1); f=ft.*ff.*fx; fun=matlabFunction(f); j2=integral(fun,-10.6855,50) j2=abs(double(j2))复制代码