Python solutions for unknown variable

is there any way where I can solve the equation for its unknown value (without transposition) in python. are there any libraries that perform such calculations. for example: W = mg w = 60, g = 9.81 m =?

thank

+3
source share
3 answers

Try SymPy

In [1]: from sympy import *

In [2]: m = Symbol('m')

In [3]: g = 9.81

In [4]: w = m*g

In [5]: solve(w - 60, m)
Out[5]: [6.11620795107034]
+2
source

The scipy optimize module provides reliable implementations of the most commonly used algorithms for numerically solving equations. For more information about the various types, as well as how to use them, check out this page:

http://docs.scipy.org/doc/scipy-0.10.1/reference/tutorial/optimize.html

0
source

:

:

SymPy is an open source Python library for symbolic math. It aims to become a full-featured computer algebra system (CAS), while keeping the code as simple as possible, to be understandable and easily extensible. SymPy is completely written in Python and does not require any external libraries.

http://code.google.com/p/sympy/

0
source

All Articles