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

matlab解方程组symsR0tx1x2xy[X,Y]=solve('R0*cos(t)=x2+(x2-x1)*(x*cos(y)-1)/(x^2+1-2*x*cos(y))','R0*sin(t)=(x2-x1)*x*sin(y)/(x^2+1-2*x*cos(y))','x','y');用matlab怎么解这两个方程啊?

题目详情
matlab解方程组
syms R0 t x1 x2 x y
[X,Y]=solve('R0*cos(t)=x2+(x2-x1)*(x*cos(y)-1)/(x^2+1-2*x*cos(y))','R0*sin(t)=(x2-x1)*x*sin(y)/(x^2+1-2*x*cos(y))','x','y');
用matlab怎么解这两个方程啊?
▼优质解答
答案和解析
syms R0 t x1 x2 x y
eq1=R0*cos(t)==x2+(x2-x1)*(x*cos(y)-1)/(x^2+1-2*x*cos(y));
eq2=R0*sin(t)==(x2-x1)*x*sin(y)/(x^2+1-2*x*cos(y));
[X,Y]=solve(eq1,eq2,x,y);
simplify(X)
simplify(Y)
X = +-
((cos(t) + 1)*(((R0^2 + x1^2 - 2*R0*x1*(2*cos(t/2)^2 - 1))*(R0^2 + x2^2 - 2*R0*x2*(2*cos(t/2)^2 - 1)))/cos(t/2)^4)^(1/2))/(2*(R0^2 - 2*cos(t)*R0*x2 + x2^2))
= +-
(1 + Cos[t]) Sqrt[(R0^2 + x1^2 - 2 R0 x1 Cos[t])/( R0^2 + x2^2 - 2 R0 x2 Cos[t])] Sec[t/2]^2 /2
Y =
2*atan((2*(((R0^2 - 2*cos(t)*R0*x1 + x1^2)*(R0^2 - 2*cos(t)*R0*x2 + x2^2))/(cos(t) + 1)^2)^(1/2) - R0*x1 - R0*x2 + x1*x2 + R0^2 + R0^2*tan(t/2)^2 + R0*x1*tan(t/2)^2 + R0*x2*tan(t/2)^2 + x1*x2*tan(t/2)^2)/(2*R0*tan(t/2)*(x1 - x2)))

2*atan((x1*x2 - R0*x1 - R0*x2 - 2*(((R0^2 - 2*cos(t)*R0*x1 + x1^2)*(R0^2 - 2*cos(t)*R0*x2 + x2^2))/(cos(t) + 1)^2)^(1/2) + R0^2 + R0^2*tan(t/2)^2 + R0*x1*tan(t/2)^2 + R0*x2*tan(t/2)^2 + x1*x2*tan(t/2)^2)/(2*R0*tan(t/2)*(x1 - x2)))