I'm trying to write a program to enhance my understanding of a
classical physics class that I am taking. I'm using vpython to create
free body diagrams and to animate kinetic motion from forces that are
described in a class I wrote. I want to turn this into more of a
general purpose solver by using sympy to solve symbolically instead of
relying on the user to enter in the magnitude and angle of each force
vector.
I'm still getting accustomed to using sympy, but I keep running into a
problem. I can solve symbolically for one equation as in:
a = Symbol('a')
v = Symbol('v')
t = Symbol('t')
foo = solve(a*t+v,v) # v in terms of t and a
but I am unable to use that symbolic solution foo in another
equation. For example:
solve(foo/t,a)
gives me the error "unsupported operand type(s) for /: 'list' and
'Symbol'. I think I know enough to understand what the error is
saying, but I don't know enough about sympy to intelligently approach
a solution. Is there an operator that accepts a list, or a simple
workaround I'm overlooking?
Basically, I want to be able to solve a system of equations when I
have an equal number of equations and unknowns. I can do this on
paper no problem, but attempting this in sympy is leaving me
scratching my head. I tried searching, perhaps I didn't use the right
search terms but I can't seem to find anything helpful.
Any help would be greatly appreciated.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.