解方程时,突然中断,不知什么原因,请教matlab高手,程序如下
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/05 16:36:29
解方程时,突然中断,不知什么原因,请教matlab高手,程序如下
syms V Q2 p r2 a0 i23 r3 u x2 y2 z2 Q3 x3 y3;
u=atan(-r2.*i23./(r2.*cos(Q2)+a0));
x2=p.*cos(V)+r2;
y2=p.*cos(u).*sin(V);
z2=p.*sin(u).*sin(V);
Q3=Q2/i23;
x3=x2.*cos(Q3).*cos(Q2)-y2.*cos(Q3).*sin(Q2)-z2.*sin(Q3)+a0.*cos(Q3);
y3=-x2.*sin(Q3).*cos(Q2)+y2.*sin(Q3).*sin(Q2)-z2.*cos(Q3)-a0.*sin(Q3);
f=x2.*sin(Q2)+y2.*cos(Q2);
g=x3^2+y3^2-r3^2;
[V Q2]=solve(f,g);
V=simplify(V),Q2=simplify(Q2)
syms V Q2 p r2 a0 i23 r3 u x2 y2 z2 Q3 x3 y3;
u=atan(-r2.*i23./(r2.*cos(Q2)+a0));
x2=p.*cos(V)+r2;
y2=p.*cos(u).*sin(V);
z2=p.*sin(u).*sin(V);
Q3=Q2/i23;
x3=x2.*cos(Q3).*cos(Q2)-y2.*cos(Q3).*sin(Q2)-z2.*sin(Q3)+a0.*cos(Q3);
y3=-x2.*sin(Q3).*cos(Q2)+y2.*sin(Q3).*sin(Q2)-z2.*cos(Q3)-a0.*sin(Q3);
f=x2.*sin(Q2)+y2.*cos(Q2);
g=x3^2+y3^2-r3^2;
[V Q2]=solve(f,g);
V=simplify(V),Q2=simplify(Q2)
一切正常啊,只是有一个警告而已
Warning: The solutions are parametrized by the symbols:
表达式有点长.
再问: 能否把表达式 贴上来,万分谢谢~~ 我这里运行到一半就中断,
再答: z1 = RootOf(z^4*cos(Q2)^2*sin(Q2)^2 + i23^2*z^4*sin(Q2)^2 + 2*p*z^3*cos(Q2)^2*cos(V)*sin(Q2)^2 +2*i23^2*p*z^3*cos(V)*sin(Q2)^2 + 2*a0*z^3*cos(Q2)*sin(Q2)^2 + 4*a0*p*z^2*cos(Q2)*cos(V)*sin(Q2)^2 +p^2*z^2*cos(Q2)^2*cos(V)^2*sin(Q2)^2 + i23^2*p^2*z^2*cos(V)^2*sin(Q2)^2 - p^2*z^2*cos(Q2)^4*sin(V)^2 +a0^2*z^2*sin(Q2)^2 + 2*a0*p^2*z*cos(Q2)*cos(V)^2*sin(Q2)^2 + 2*a0^2*p*z*cos(V)*sin(Q2)^2 -2*a0*p^2*z*cos(Q2)^3*sin(V)^2 + a0^2*p^2*cos(V)^2*sin(Q2)^2 - a0^2*p^2*cos(Q2)^2*sin(V)^2, z) minus {a0/(-cos(Q2) + i23*I), -a0/cos(Q2), (a0*I)/(i23 - cos(Q2)*I)} V = z1 z1 Q2的表达式太长了,竟然贴不出来......有够复杂的
Warning: The solutions are parametrized by the symbols:
表达式有点长.
再问: 能否把表达式 贴上来,万分谢谢~~ 我这里运行到一半就中断,
再答: z1 = RootOf(z^4*cos(Q2)^2*sin(Q2)^2 + i23^2*z^4*sin(Q2)^2 + 2*p*z^3*cos(Q2)^2*cos(V)*sin(Q2)^2 +2*i23^2*p*z^3*cos(V)*sin(Q2)^2 + 2*a0*z^3*cos(Q2)*sin(Q2)^2 + 4*a0*p*z^2*cos(Q2)*cos(V)*sin(Q2)^2 +p^2*z^2*cos(Q2)^2*cos(V)^2*sin(Q2)^2 + i23^2*p^2*z^2*cos(V)^2*sin(Q2)^2 - p^2*z^2*cos(Q2)^4*sin(V)^2 +a0^2*z^2*sin(Q2)^2 + 2*a0*p^2*z*cos(Q2)*cos(V)^2*sin(Q2)^2 + 2*a0^2*p*z*cos(V)*sin(Q2)^2 -2*a0*p^2*z*cos(Q2)^3*sin(V)^2 + a0^2*p^2*cos(V)^2*sin(Q2)^2 - a0^2*p^2*cos(Q2)^2*sin(V)^2, z) minus {a0/(-cos(Q2) + i23*I), -a0/cos(Q2), (a0*I)/(i23 - cos(Q2)*I)} V = z1 z1 Q2的表达式太长了,竟然贴不出来......有够复杂的
请教matlab高手一段程序的意思
matlab菜鸟求教高手.程序大概如下:
MATLAB解方程高手进,就是一行程序,
急!请教matlab高手(解含有符号的方程)
请教matlab 循环怎么用啊 程序如下:
各位MATLAB高手,请问[]在plot的作用什么?谢谢(程序如下)
请教一段matlab程序.
我在用matlab编写一地震波数值模拟程序,运行时总显示有错,求高手指教.程序如下
matlab编程高手进!我需要一个求方程在一定范围内的解的程序,方程不难
matlab.程序如下
请教高手指点matlaB程序画图:如下要求:u(t)=sin(100t),dH(t)/dt=H(t)^3+u(t)H(t
求高手看看这个MATLAB的解方程的程序错在哪里?