4 Unknowns in 4 trig equations.
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!