求解matlab solve求解方程问题

[复制链接]
查看11 | 回复2 | 2010-11-25 02:15:01 | 显示全部楼层 |阅读模式
各位高手:

下面是我的matlab程序:
syms beta gama xb yb zb theta0
l0=7.096; l1=8.980; l2=3.0; l3=0.6;
l4=8.0; l8=8.0;l5=5.0; l6=5.0; l7=5.0;l9=9.0;
xp=-5.4; zp=-3.0;
d=3.0;theta2=2*pi/3;
q1=0;q2=-1;q3=0;q4=0;q5=-0.3;
theta1=acos((l2^2+l0^2-(l1+q1)^2)/2/l2/l0);
theta3=(theta2-theta1)/pi*180;
a1=simple(((l2+l3)*cos(theta3)-l5/2*sin(beta)-xb)^2+(q5-l5/2+l5/2*cos(beta)-yb)^2+((l2+l3)*sin(theta3)+zb)^2-l6^2); %one
a2=simple(((l2+l3)*cos(theta3)+l5/2*sin(beta)-xb)^2+(q5+l5/2-l5/2*cos(beta)-yb)^2+((l2+l3)*sin(theta3)+zb)^2-l6^2); %two
a3=yb-l8*sin(beta)*cos(gama)-q4; %three
a4=simple(((l2+l3)*cos(theta3)-l4+l8*cos(beta)*cos(gama)-xb)^2+((l2+l3)*sin(theta3)+l8*sin(gama)+zb)^2-(l7+q2)^2); %four
a5=simple((d/l6*(l5/2*sin(beta)+xb-(l2+l3)*cos(theta3))+(l2+l3)*cos(theta3)-xp-l5/2*sin(theta0))^2+(d/l6*(-l5/2*cos(beta)+yb-q5+l5/2)+q5-l5/2+l5/2*cos(theta0))^2+(d/l6*(zb+(l2+l3)*sin(theta3))-(l2+l3)*sin(theta3)-zp)^2-(l9+q3)^2);
a6=simple((d/l6*(-l5/2*sin(beta)+xb-(l2+l3)*cos(theta3))+(l2+l3)*cos(theta3)-xp+l5/2*sin(theta0))^2+(d/l6*(l5/2*cos(beta)+yb-q5-l5/2)+q5+l5/2-l5/2*cos(theta0))^2+(d/l6*(zb+(l2+l3)*sin(theta3))-(l2+l3)*sin(theta3)-zp)^2-(l9+q3)^2);
[x0,y0,z0,u0,v0,w0]=solve(a1,a2,a3,a4,a5,a6,'beta','gama','xb','yb','zb','theta0')
下面是运行时出现的问题:
??? Error using ==> mupadengine.mupadengine>mupadengine.feval at 162
Error: Illegal indeterminate [poly];
during evaluation of 'Type::PolyExprTestProc'
Error in ==> solve>mupadSolve at 232

list = feval(symengine,'mlfsolve',eqns,vars);
Error in ==> solve at 93
[R,symvars,order] = mupadSolve(eqns,vars);
Error in ==> new1 at 15
[x0,y0,z0,u0,v0,w0]=solve(a1,a2,a3,a4,a5,a6,'beta','gama','xb','yb','zb','theta0')
不知道这是怎么回事?请高手指点!
solve函数怎么设定 变量的范围啊? 谢谢高手

回复

使用道具 举报

千问 | 2010-11-25 02:15:01 | 显示全部楼层
因为tanx是周期函数,定义域是R。所以有无穷个解。sovle不可以处理无穷解的情况。你可以给x设定范围。 如果还没解决你的问题,可以加我百度HI账号。
回复

使用道具 举报

千问 | 2010-11-25 02:15:01 | 显示全部楼层
因为tanx是周期函数,定义域是R。所以有无穷个解。sovle不可以处理无穷解的情况。你可以给x设定范围。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行