Solving LSE in terms of specific variables

22 views
Skip to first unread message

ymer...@gmail.com

unread,
Apr 10, 2014, 10:07:07 AM4/10/14
to sy...@googlegroups.com
Hi there

I have the following LSE:

Vm,Vp,Vinm,Vinp,Io,Ref,R1,R3,R4,R2a,R2b,Vo= symbols("V_- V_+ V_in- V_in+ I_out Ref R_1 R_3 R_4 R_2a R_2b V_out")

System = [(Vm-Vinm)/R3 - (Vo-Vm)/R4,\
         
(Vp-Vinp)/R1 - (Vo-Io*R2b-Vp)/R2a,\
         
Vm-Vp,\
         
]

which I want to solve for Io. So i do:

solve(System, Io)

...this returns an expression for Io which is a rewrite of eq (2).

(
-R_1*V_+ + R_1*V_out - R_2a*V_+ + R_2a*V_in+)/(R_1*R_2b)

Know I'd like to have Io expressed in therms of all variables BUT Vo, which means that the therm Vo of equation (2) needs to be substituted by eq (1).

So I tried

solve(System, Io, exclude=[Vo])

But this returns exactly the same result as above.

How can I tell sympy to resolve this LSE against Io with substituting Vo ?

Aaron Meurer

unread,
Apr 10, 2014, 7:36:35 PM4/10/14
to sy...@googlegroups.com
If I am understanding correctly, you are asking for an elminiate behavior https://github.com/sympy/sympy/issues/2720. The answer to the stackoverflow question linked to in that issue might give you some hints. I think you just need to solve separately for Vo and substitute it into the solution for Io.

Aaron Meurer


--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/da88c35a-fb9a-49c8-ad0e-e2e84fa5d0b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ymer...@gmail.com

unread,
Apr 14, 2014, 4:59:48 AM4/14/14
to sy...@googlegroups.com
Thank you very much for your answer. Yes you're right, I was looking for something similar to the eliminate function. I'll do it manually with subs  as you suggested.
Reply all
Reply to author
Forward
0 new messages