解线性方程组:
- 安装sympy库,sudo pip install sympy;
源码:
from sympy import *
x = Symbol('x')
y = Symbol('y')
或者写成这个样子 -- x,y = symbols('x y')
print(solve([2*x - y - 3,3 * x + y -7],[x,y]))
即可解得答案。
解积分:
![KTCSW]50BYOR9L16`5T9H}5.png](https://img.haomeiwen.com/i3612808/f81f0856e69c21f5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
from sympy import *
t = Symbol('t')
x = Symbol('x')
m = integrate(sin(t) / (pi - t) , (t , 0 ,x))
n = integrate(m,(x , 0 , pi))
print(n)
解极限:
LFD60KVXNJ9{EA51$K0ELF0.png源码:
from sympy import *
n = Symbol('n')
s = ((n+3)/(n+2)) ** n
print(limit(s,n,oo))
求微分方程:
wm.jpg源码:
from sympy import *
f = Function('f')
x = Symbol('x')
print(dsolve(diff(f(x),x) - 2 * f(x)*x,f(x)))
网友评论