程序如下:
syms J1 J2 J3 J4
la=375;
lb=785;
R=275;
r=102;
x=100;
y=100;
z=-600;
J=0;
[J1,J2,J3,J4]=solve((1.414*r*sin(0.785-J)*cos(J)+x-R-la*sin(J1))^2+(1.414*r*sin(0.785-J)*sin(J)+y)^2+(z+la*cos(J1))^2-lb^2,...
(-1.414*r*cos(0.785-J)*sin(J)+x)^2+(1.414*r*cos(0.785-J)*cos(J)+y-R-la*sin(J2))^2+(z+la*cos(J2))^2-lb^2,...
(1.414*r*sin(0.785-J)*cos(J)-x-R-la*sin(J3))^2+(1.414*r*sin(0.785-J)*sin(J)-y)^2+(z+la*cos(J3))^2-lb^2,...
(1.414*r*cos(0.785-J)*sin(J)+x)^2+(-1.414*r*cos(0.785-J)*cos(J)+y-R+la*sin(J4))^2+(z+la*cos(J4))^2-lb^2)
J1=vpa(J1)
J2=vpa(J2)
J3=vpa(J3)
J4=vpa(J4)
这时得到的解是:
J1 =
1.6726496034324791422369776889755
1.6726496034324791422369776889755
-1.9149768196177261917706095593390
-1.9149768196177261917706095593390
1.6726496034324791422369776889755
1.6726496034324791422369776889755
-1.9149768196177261917706095593390
-1.9149768196177261917706095593390
1.6726496034324791422369776889755
1.6726496034324791422369776889755
-1.9149768196177261917706095593390
-1.9149768196177261917706095593390
1.6726496034324791422369776889755
1.6726496034324791422369776889755
-1.9149768196177261917706095593390
-1.9149768196177261917706095593390
J2 =
1.6728134907996934474665869127185
1.6728134907996934474665869127185
1.6728134907996934474665869127185
1.6728134907996934474665869127185
-1.9148739472216682383904294004894
-1.9148739472216682383904294004894
-1.9148739472216682383904294004894
-1.9148739472216682383904294004894
1.6728134907996934474665869127185
1.6728134907996934474665869127185
1.6728134907996934474665869127185
1.6728134907996934474665869127185
-1.9148739472216682383904294004894
-1.9148739472216682383904294004894
-1.9148739472216682383904294004894
-1.9148739472216682383904294004894
J3 =
1.2065390806953418416441018033182
-2.0607020564450271187956692450830
1.2065390806953418416441018033182
-2.0607020564450271187956692450830
1.2065390806953418416441018033182
-2.0607020564450271187956692450830
1.2065390806953418416441018033182
-2.0607020564450271187956692450830
1.2065390806953418416441018033182
-2.0607020564450271187956692450830
1.2065390806953418416441018033182
-2.0607020564450271187956692450830
1.2065390806953418416441018033182
-2.0607020564450271187956692450830
1.2065390806953418416441018033182
-2.0607020564450271187956692450830
J4 =
-1.1965019139970002022096767620101
-1.1965019139970002022096767620101
-1.1965019139970002022096767620101
-1.1965019139970002022096767620101
-1.1965019139970002022096767620101
-1.1965019139970002022096767620101
-1.1965019139970002022096767620101
-1.1965019139970002022096767620101
2.0615980649040293018453204462917
2.0615980649040293018453204462917
2.0615980649040293018453204462917
2.0615980649040293018453204462917
2.0615980649040293018453204462917
2.0615980649040293018453204462917
2.0615980649040293018453204462917
2.0615980649040293018453204462917
可是我只想要:
J1 =1.6726496034324791422369776889755
J2 =1.6728134907996934474665869127185
J3 =1.2065390806953418416441018033182
J4 =2.0615980649040293018453204462917
有什么好办法吗?各位给点提示吧 谢谢了