Hi all,
trying to solve these equations simultaniously. Tried using fsolve, but didn't get anywhere. Using the solve function I get 4 solutions for each variable. How do I identify the "correct one" since my initial conditions have already been entered.
Any better way to go about this?
%Initial conditions @ time=0
syms A1 A2 phi1 phi2
E1= A1*Mode1vector(1)*sin(phi1) + A2*Mode2vector(1)*sin(phi2) -x0(1) == 0;
E2= A1*Mode1vector(2)*sin(phi1)+ A2*Mode2vector(2)*sin(phi2) == 0;
E3= A1*W(1)*Mode1vector(1)*cos(phi1) + A2*W(2)*Mode2vector(1)*cos(phi2) == 0;
E4= A1*W(1)*Mode1vector(2)*cos(phi1) +A2*W(2)*Mode2vector(2)*cos(phi2) == 0;
[A1,A2,phi1,phi2]=solve(E1,E2,E3,E4,A1,A2,phi1,phi2)
Result:
A1 =
-1/2
1/2
-1/2
1/2
A2 =
-1/2
-1/2
1/2
1/2
phi1 =
-pi/2
pi/2
-pi/2
pi/2
phi2 =
-pi/2
-pi/2
pi/2
pi/2
Best Answer