using solve, 4eqs 4unkns

3 次查看(过去 30 天)
Corey Tucker
Corey Tucker 2020-9-30
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
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!

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by