matlab求解方程的时候出现 is not a valid expression or equation.程序如下:syms theta fai psai alpha;syms x y z;eq1='x*x*(1-cos(alpha))+cos(alpha)=cos(theta)*cos(psai)';eq2= 'x*y*(1-cos(alpha))-z*sin(alpha)=cos(psai)*sin(fai)*sin(theta)-s
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 06:18:55
matlab求解方程的时候出现 is not a valid expression or equation.程序如下:syms theta fai psai alpha;syms x y z;eq1='x*x*(1-cos(alpha))+cos(alpha)=cos(theta)*cos(psai)';eq2= 'x*y*(1-cos(alpha))-z*sin(alpha)=cos(psai)*sin(fai)*sin(theta)-s
matlab求解方程的时候出现 is not a valid expression or equation.
程序如下:
syms theta fai psai alpha;
syms x y z;
eq1='x*x*(1-cos(alpha))+cos(alpha)=cos(theta)*cos(psai)';
eq2= 'x*y*(1-cos(alpha))-z*sin(alpha)=cos(psai)*sin(fai)*sin(theta)-sin(psai)*cos(fai)';
eq3= 'x*y*(1-cos(alpha))-z*sin(alpha)=cos(psai)*sin(fai)*sin(theta)-sin(psai)*cos(fai)';
eq4= 'x*y*(1-cos(alpha))+z*sin(alpha)=sin(fai)*cos(theta)';
eq5='y*y*(1-cos(alpha))+cos(alpha)=sin(psai)*sin(fai)*sin(theta)+cos(psai)*cos(fai)';
eq6= 'y*z*(1-cos(alpha))-x*sin(alpha)=sin(psai)*cos(fai)*sin(theta)-cos(psai)*sin(fai)';
eq7= 'x*z*(1-cos(alpha))-y*sin(alpha)=-sin(theta)';
eq8='y*z*(1-cos(alpha))+x*sin(alpha)=cos(theta)*sin(fai)';
eq9= 'z*z*(1-cos(alpha))+cos(alpha)=cos(theta)*cos(fai)';
[theta,fai,psai]=solve(eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9)
matlab求解方程的时候出现 is not a valid expression or equation.程序如下:syms theta fai psai alpha;syms x y z;eq1='x*x*(1-cos(alpha))+cos(alpha)=cos(theta)*cos(psai)';eq2= 'x*y*(1-cos(alpha))-z*sin(alpha)=cos(psai)*sin(fai)*sin(theta)-s
上述的写法有问题,应写成
eq1=x*x*(1-cos(alpha))+cos(alpha)-cos(theta)*cos(psai);
syms theta fai psai alpha;
syms x y z;
eq1=x*x*(1-cos(alpha))+cos(alpha)-cos(theta)*cos(psai);
eq2= x*y*(1-cos(alpha))-z*sin(alpha)-(cos(psai)*sin(fai)*sin(theta)-sin(psai)*cos(fai));
eq3= x*y*(1-cos(alpha))-z*sin(alpha)-(cos(psai)*sin(fai)*sin(theta)-sin(psai)*cos(fai));
eq4= x*y*(1-cos(alpha))+z*sin(alpha)-(sin(fai)*cos(theta));
eq5=y*y*(1-cos(alpha))+cos(alpha)-(sin(psai)*sin(fai)*sin(theta)+cos(psai)*cos(fai));
eq6= y*z*(1-cos(alpha))-x*sin(alpha)-(sin(psai)*cos(fai)*sin(theta)-cos(psai)*sin(fai));
eq7= x*z*(1-cos(alpha))-y*sin(alpha)+sin(theta);
eq8=y*z*(1-cos(alpha))+x*sin(alpha)-cos(theta)*sin(fai);
eq9=z*z*(1-cos(alpha))+cos(alpha)-cos(theta)*cos(fai);
[theta,fai,psai]=solve(eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,'theta','fai','psai')
Warning: 9 equations in 3 variables.
Warning: Explicit solution could not be found.
> In solve at 81
theta =
[ empty sym ]
fai =
[]
psai =
[]
没有解析解
你的方程太多了吧,未知数只有三个