Matlab 求积分后出现警告Warning:Explicit integral could not be foundr=1;syms Theta_2 a Phi_2 Phif1=sin(Theta_2)*sin(Theta_2)*cos(Phi_2);f2=sqrt(r^2+a^2-2*r*a*sin(Theta_2)*cos(Phi-Phi_2));f3=f1/f2;f4=int(f3,Theta_2,0,pi);f5=int(f4,Phi_2,0,pi);
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/29 10:16:35
Matlab 求积分后出现警告Warning:Explicit integral could not be foundr=1;syms Theta_2 a Phi_2 Phif1=sin(Theta_2)*sin(Theta_2)*cos(Phi_2);f2=sqrt(r^2+a^2-2*r*a*sin(Theta_2)*cos(Phi-Phi_2));f3=f1/f2;f4=int(f3,Theta_2,0,pi);f5=int(f4,Phi_2,0,pi);
Matlab 求积分后出现警告Warning:Explicit integral could not be found
r=1;
syms Theta_2 a Phi_2 Phi
f1=sin(Theta_2)*sin(Theta_2)*cos(Phi_2);
f2=sqrt(r^2+a^2-2*r*a*sin(Theta_2)*cos(Phi-Phi_2));
f3=f1/f2;
f4=int(f3,Theta_2,0,pi);
f5=int(f4,Phi_2,0,pi);
本人刚入手matlab,运算上述积分,在对f5积分时,出现Warning:Explicit integral could not be found,
Matlab 求积分后出现警告Warning:Explicit integral could not be foundr=1;syms Theta_2 a Phi_2 Phif1=sin(Theta_2)*sin(Theta_2)*cos(Phi_2);f2=sqrt(r^2+a^2-2*r*a*sin(Theta_2)*cos(Phi-Phi_2));f3=f1/f2;f4=int(f3,Theta_2,0,pi);f5=int(f4,Phi_2,0,pi);
Warning:Explicit integral could not be found
这是提示你matlab求不出上述积分的符号解.
此时,你可求数值积分.
% 以下代码在7.1版以上均可运行.
r=1;
a=2; % 输入a的值
Phi=3; % 输入Phi的值
f1 = @(Theta_2,Phi_2) sin(Theta_2).*sin(Theta_2).*cos(Phi_2);
f2 = @(Theta_2,Phi_2) sqrt(r^2+a^2-2*r*a.*sin(Theta_2).*cos(Phi-Phi_2));
f3 = @(Theta_2,Phi_2) f1(Theta_2,Phi_2)./f2(Theta_2,Phi_2);
f5 = dblquad(f3,0,pi,0,pi)