using solve, 4eqs 4unkns

I'm trying to understand why the output of the following is giving me a 4x1 matrix for the desired solutions. There should only be one discrete value for a1, a2, p1, p2.
t=0;
syms a1 a2 p1 p2
x1=(-1/3)+a1*(1/3)*sin(sqrt(2)*t+p1)-a2*(1/3)*sin(2*t+p2);
x2=-1+a1*sin(sqrt(2)*t+p1)+a2*sin(2*t+p2);
v1=a1*(1/3)*sqrt(2)*cos(sqrt(2)*t+p1)-a2*(1/3)*2*cos(2*t+p2);
v2=a1*sqrt(2)*cos(sqrt(2)*t+p1)+a2*2*cos(2*t+p2);
soln=solve(x1,x2,v1,v2);
soln.a1
soln.a2
soln.p1
soln.p2
I have found the solutions by other means which are a1=1, a2=0, p1=pi/2, p2=pi/2. The answers matlab is returning is:
ans =
-1
1
-1
1
ans =
0
0
0
0
ans =
-pi/2
pi/2
-pi/2
pi/2
ans =
pi
pi
0
0
Any help would be appreciated.
TY

回答(1 个)

Alan Stevens
Alan Stevens 2020-10-1

0 个投票

There are, in fact, an infinite number of possible solutions. When t = 0 the equations can be written and manipulated as follows:
Matlab clearly just provides four simple possibilities!

类别

帮助中心File Exchange 中查找有关 Mathematics 的更多信息

产品

版本

R2020a

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by