用matlab解方程组
来源:学生作业帮 编辑:大师作文网作业帮 分类:数学作业 时间:2024/11/10 17:43:45
用matlab解方程组
方程一:L1+L2*COS(TH1)=L3*COS(TH2)-L4*COS(TH3);方程二:L2*SIN(TH1)+L3*SIN()TH2-L4*SIN(TH3),其中把L1,L2,L3,L4,TH1当做已知量求TH2和TH3
方程一:L1+L2*COS(TH1)=L3*COS(TH2)-L4*COS(TH3);方程二:L2*SIN(TH1)+L3*SIN()TH2-L4*SIN(TH3),其中把L1,L2,L3,L4,TH1当做已知量求TH2和TH3
clc,clear
syms L1 L2 L3 L4 TH1 TH2 TH3
[TH2,TH3]=solve('L1+L2*cos(TH1)-L3*cos(TH2)+L4*cos(TH3)','L2*sin(TH1)+L3*sin(TH2)-L4*sin(TH3)','TH2','TH3');
TH2=simplify(TH2)
TH3=simplify(TH3)
syms L1 L2 L3 L4 TH1 TH2 TH3
[TH2,TH3]=solve('L1+L2*cos(TH1)-L3*cos(TH2)+L4*cos(TH3)','L2*sin(TH1)+L3*sin(TH2)-L4*sin(TH3)','TH2','TH3');
TH2=simplify(TH2)
TH3=simplify(TH3)