Solving sistems of two equations

19 views
Skip to first unread message

SiL588 .

unread,
Dec 4, 2014, 9:08:38 AM12/4/14
to sage-s...@googlegroups.com
Hello,
i have to solve a simple two equations system, where 

eq0=v==V_f*cos(psi_d)
eq1=l*phi==V_f*sin(psi_d)

but when i do

solve ([eq0,eq1],psi_d)

the output is : [ ].
What's wrong?
Thank you very much.
download_worksheets.zip

Emmanuel Charpentier

unread,
Dec 5, 2014, 2:44:07 AM12/5/14
to sage-s...@googlegroups.com

Solving either eq0 or eq1 gives you a solution :

sage: s0=solve(eq0, psi_d) ; s0
[psi_d == arccos(v/V_f)]
sage: s1=solve(eq1, psi_d) ; s1
[psi_d == arcsin(l*phi/V_f)]


Your problem is that you have a hidden condition : apart the obvious ones (abs(v/V_v)<=1 and abs(l*phi/V_f)<=1), the two solutions thus obtained must be compatible :

sage: s0[0].rhs()==s1[0].rhs()
arccos(v/V_f) == arcsin(l*phi/V_f)


which might be betted understood using the well-known equality sin^2x+cos^2x=1 :

sage: map(lambda u,v:u+v, map(lambda t:(cos(t).trig_expand())^2, solve(eq0,psi_d)),
                          map(lambda t:(sin(t).trig_expand())^2, solve(eq1,psi_d)))
[cos(psi_d)^2 + sin(psi_d)^2 == l^2*phi^2/V_f^2 + v^2/V_f^2]


leading you to the condition l^2*phi^2/V_f^2 + v^2/V_f^2==1. Beware : since we squared the previous results, this eqiality might have spurious solutions...

HTH,

--
Emmanuel Charpentier

Emmanuel Charpentier

unread,
Dec 5, 2014, 2:58:24 AM12/5/14
to sage-s...@googlegroups.com
Wups : I forgot to specify that I looked for *real* solutions. If we work in complexes, the "obvious" conditions do not hold...

--
Emmanuel Charpentier

Reply all
Reply to author
Forward
0 new messages