・ Xyz = -234 ・ X + y + z = 20 ・ 5x – y + 2z = 85
(Environment: Ubuntu12.04LTS)
$ sudo apt-get install ipython-notebook
$ sudo apt-get install python-matplotlib python-scipy python-pandas python-sympy python-nose
$ ipython
In the IPython shell, type:
from sympy import *
x, y, z = symbols('x y z')
init_printing()
solve([x * y * z + 234, x + y + z - 20, 5 * x - y + 2 * z - 85], [x, y, z])
For the formula xyz = -234, write x * y * x + 234.
When init_printing () is described (the image is divided into 3 for layout reasons):
If you didn't write init_printing ():
[(-9*17**(1/2)/4 + 39/4, -9*17**(1/2)/4 - 21/4, 31/2 + 9*17**(1/2)/2),
(13, -2, 9), (9*17**(1/2)/4 + 39/4, -21/4 + 9*17**(1/2)/4, -9*17**(1/2)/2 + 31/2)]
Go to the following website. ・ SymPy Live http://live.sympy.org/
You can use Sympy to perform calculations from the console just like iPython.
Recommended Posts