sympy 解方程

来源:互联网 发布:软件开发项目规划 编辑:程序博客网 时间:2024/05/14 12:44

sympy简介

一个可用于解方程的库, anaconda自带.
git上的Quick-examples
sympy.org 官网文档

一元函数

solve the equation 3x2+2x=0. The answer is x1=0,x2=2/3.

from sympy import *x=symbols('x')  # indicate x is an symboleq=Eq(-3*x**2+2*x,0) # type the equationprint(solve(eq,x))  # [0, 2/3]

方程组

原创粉丝点击