早教吧 育儿知识 作业答案 考试题库 百科 知识分享

用matlab求二元二次方程组的解,程序如下,十万火急!syms x y L1 L2 L3 L4 a1 a2 L5 a3 a4eq1=solve("(x-(L3*cos(a3)-L1*cos(a1)))^2+(y-(L3*sin(a3)+L1*sin(a1)))^2=L3^2")eq2=solve("(x-(L5+L2*cos(a2)))^2+(y-(L1*sin(a1)))^2=L5^2")[x,y]=solve(eq

题目详情
用matlab求二元二次方程组的解,程序如下,十万火急!
syms x y L1 L2 L3 L4 a1 a2 L5 a3 a4
eq1=solve('(x-(L3*cos(a3)-L1*cos(a1)))^2+(y-(L3*sin(a3)+L1*sin(a1)))^2=L3^2')
eq2=solve('(x-(L5+L2*cos(a2)))^2+(y-(L1*sin(a1)))^2=L5^2')
[x,y]=solve(eq1,eq2,x,y)
▼优质解答
答案和解析
你的问题出错在于
1、变量赋值错误.eq1和eq2应改为
eq1='(x-(L3*cos(a3)-L1*cos(a1)))^2+(y-(L3*sin(a3)+L1*sin(a1)))^2=L3^2';
eq2='(x-(L5+L2*cos(a2)))^2+(y-(L1*sin(a1)))^2=L5^2';
2、solve()函数格式不对.应改为[x,y]=solve(eq1,eq2,‘x’,‘y’)
正确代码为
>> syms x y L1 L2 L3 L4 a1 a2 L5 a3 a4
>> eq1='(x-(L3*cos(a3)-L1*cos(a1)))^2+(y-(L3*sin(a3)+L1*sin(a1)))^2=L3^2';
>> eq2='(x-(L5+L2*cos(a2)))^2+(y-(L1*sin(a1)))^2=L5^2';
>> [x,y]=solve(eq1,eq2,'x','y')
x =.
y=.