1.计算目的
1.求解微分方程dy/dx=ky
2.编写程序
from sympy import *
x = Symbol('x')
k = Symbol('k')
y = Function('y')
g = diff(y(x),x) - k*y(x)
print dsolve(g, y(x))
3.运行程序
python dsolve-test.py
4.运行结果
Eq(y(x), C1*exp(k*x)) #即y(x) = C1*exp(k*x)
1.求解微分方程dy/dx=ky
from sympy import *
x = Symbol('x')
k = Symbol('k')
y = Function('y')
g = diff(y(x),x) - k*y(x)
print dsolve(g, y(x))
python dsolve-test.py
Eq(y(x), C1*exp(k*x)) #即y(x) = C1*exp(k*x)