用Matlab解方程求m,
来源:学生作业帮 编辑:神马作文网作业帮 分类:数学作业 时间:2024/11/17 02:04:28
用Matlab解方程求m,
程序:
syms m n x y r p q
a=sqrt((x(1)-x(3))^2+(y(1)-y(3))^2);
b=sqrt((x(3)-m)^2+(y(3)-n)^2);
c=sqrt((x(1)-m)^2+(y(1)-n)^2);
d=sqrt((x(1)-x(4))^2+(y(1)-y(4))^2);
e=sqrt((x(4)-m)^2+(y(4)-n)^2);
sita1=acos(r/a);
sita2=acos((a^2+b^2-c^2)/(2*a*b));
sita3=acos((b^2+c^2-a^2)/(2*b*c));
sita4=acos((c^2+e^2-d^2)/(2*c*e));
sita5=acos(2*r/e);
alpha1=3*pi/2-sita1-sita2;
alpha2=3*pi/2-sita3-sita4-sita5;
alpha4=alpha2/2;
L2=[1,-(x(2)-n)/(y(2)-m)];
L=[p-m,q-n];
alpha5=acos((dot(L,L1))/(sqrt(dot(L,L))*sqrt(dot(L1,L1)));
x=[0,0,80,220];y=[0,0,210,530];r=10;p=300;q=300;
[m,n]=solve('alpha4=alpha5','(p-m)^2+(q-n)^2=100')
运行结果?Index exceeds matrix dimensions.
不知道哪里错了,写出正确的程序
程序:
syms m n x y r p q
a=sqrt((x(1)-x(3))^2+(y(1)-y(3))^2);
b=sqrt((x(3)-m)^2+(y(3)-n)^2);
c=sqrt((x(1)-m)^2+(y(1)-n)^2);
d=sqrt((x(1)-x(4))^2+(y(1)-y(4))^2);
e=sqrt((x(4)-m)^2+(y(4)-n)^2);
sita1=acos(r/a);
sita2=acos((a^2+b^2-c^2)/(2*a*b));
sita3=acos((b^2+c^2-a^2)/(2*b*c));
sita4=acos((c^2+e^2-d^2)/(2*c*e));
sita5=acos(2*r/e);
alpha1=3*pi/2-sita1-sita2;
alpha2=3*pi/2-sita3-sita4-sita5;
alpha4=alpha2/2;
L2=[1,-(x(2)-n)/(y(2)-m)];
L=[p-m,q-n];
alpha5=acos((dot(L,L1))/(sqrt(dot(L,L))*sqrt(dot(L1,L1)));
x=[0,0,80,220];y=[0,0,210,530];r=10;p=300;q=300;
[m,n]=solve('alpha4=alpha5','(p-m)^2+(q-n)^2=100')
运行结果?Index exceeds matrix dimensions.
不知道哪里错了,写出正确的程序
错误很多,只粗糙的改了一些.
syms m n
x=[0,0,80,220];y=[0,0,210,530];
r=10;p=300;q=300;
a=sqrt((x(1)-x(3))^2+(y(1)-y(3))^2);
b=sqrt((x(3)-m)^2+(y(3)-n)^2);
c=sqrt((x(1)-m)^2+(y(1)-n)^2);
d=sqrt((x(1)-x(4))^2+(y(1)-y(4))^2);
e=sqrt((x(4)-m)^2+(y(4)-n)^2);
sita1=a*cos(r/a);
sita2=a*cos((a^2+b^2-c^2)/(2*a*b));
sita3=a*cos((b^2+c^2-a^2)/(2*b*c));
sita4=a*cos((c^2+e^2-d^2)/(2*c*e));
sita5=a*cos(2*r/e);
alpha1=3*pi/2-sita1-sita2;
alpha2=3*pi/2-sita3-sita4-sita5;
alpha4=alpha2/2;
L2=[1,-(x(2)-n)/(y(2)-m)];
L=[p-m,q-n];
alpha5=a*cos((dot(L,L))/(sqrt(dot(L,L))*sqrt(dot(L,L))));
S=solve('alpha4=alpha5','(p-m)^2+(q-n)^2=100','m','n');
再问: 还有那些错误,能帮忙再修正一下吗?先谢谢了
syms m n
x=[0,0,80,220];y=[0,0,210,530];
r=10;p=300;q=300;
a=sqrt((x(1)-x(3))^2+(y(1)-y(3))^2);
b=sqrt((x(3)-m)^2+(y(3)-n)^2);
c=sqrt((x(1)-m)^2+(y(1)-n)^2);
d=sqrt((x(1)-x(4))^2+(y(1)-y(4))^2);
e=sqrt((x(4)-m)^2+(y(4)-n)^2);
sita1=a*cos(r/a);
sita2=a*cos((a^2+b^2-c^2)/(2*a*b));
sita3=a*cos((b^2+c^2-a^2)/(2*b*c));
sita4=a*cos((c^2+e^2-d^2)/(2*c*e));
sita5=a*cos(2*r/e);
alpha1=3*pi/2-sita1-sita2;
alpha2=3*pi/2-sita3-sita4-sita5;
alpha4=alpha2/2;
L2=[1,-(x(2)-n)/(y(2)-m)];
L=[p-m,q-n];
alpha5=a*cos((dot(L,L))/(sqrt(dot(L,L))*sqrt(dot(L,L))));
S=solve('alpha4=alpha5','(p-m)^2+(q-n)^2=100','m','n');
再问: 还有那些错误,能帮忙再修正一下吗?先谢谢了