syms h g t
gamma_d = @(h,g) 500*h*g;
C_gamma_d = @(h,g) log2(1+gamma_d(h,g));
V_gamma_d = @(h,g) (1-1/(gamma_d(h,g)+1)^2)*(log2(exp(1)))^2;
z_gamma_d = @(h,g) (C_gamma_d(h,g) - 1.6)/sqrt(V_gamma_d(h,g)/100);
fun_E_eps_d = @(t,h,g) (h*g)^(2-1)*exp(-t^2/2-2*(h+g));
E_eps_d = int(int(int(fun_E_eps_d(t,h,g), t,z_gamma_d(h,g),inf), h, 0, inf), g, 0, inf);
ans = double(E_eps_d);
我试图与syms进行三重整合。但是当我将ans转换为double时,它会显示错误:
Error using symengine
DOUBLE cannot convert the input expression into a double array.
Error in sym/double (line 616)
Xstr = mupadmex('symobj::double', S.s, 0);
如果我只进行双重积分,它可以正常工作,即:
syms h g t
gamma_d = @(h,g) 500*h*g;
C_gamma_d = @(h,g) log2(1+gamma_d(h,g));
V_gamma_d = @(h,g) (1-1/(gamma_d(h,g)+1)^2)*(log2(exp(1)))^2;
z_gamma_d = @(h,g) (C_gamma_d(h,g) - 1.6)/sqrt(V_gamma_d(h,g)/100);
fun_E_eps_d = @(t,h,g) (h*g)^(2-1)*exp(-t^2/2-2*(h+g));
E_eps_d = int(int(fun_E_eps_d(t,h,1), t,z_gamma_d(h,1),inf), h, 0, inf);
ans = double(E_eps_d);
ans =
2.8865e-06
尝试使用vpa
,它显示了一些内容:
numeric::int((5734161139222659*numeric::int(-(2^(1/2)*g*h*pi^(1/2)*exp(- 2*g - 2*h)*(erf((2^(1/2)*(log(500*g*h + 1)/log(2) - 8/5))/(2*(2343413141819341/112589990684262400 - 2343413141819341/(112589990684262400*(500*g*h + 1)^2))^(1/2))) - 1))/2, g == 0..Inf))/4503599627370496, h == 0..Inf)
搜索了一段时间,大多数人对我有同样的问题是因为它在结果中包含符号。但g
和h
应该在我的案例中消失。