from sympy import *import numpy as npc, t = symbols('c, t')expr = c*(4 - c)# Solve c(4 - c) = 0:equil = solve(expr, c)print(equil)ys = np.arange(-2, 7) # how to generate an appropriate array includes equil automatically?dys = np.array([expr.subs(c, yi) for yi in ys])print(ys, dys)# Solve the differential equation y' = y(4 - y):y = Function('y')dsols = dsolve(Eq(y(t).diff(t), y(t)*(4 - y(t))), y(t))
总结
以上是内存溢出为你收集整理的Python for Differential Equations全部内容,希望文章能够帮你解决Python for Differential Equations所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)