码迷,mamicode.com
首页 > 编程语言 > 详细

Python for Differential Equations

时间:2021-06-28 18:29:07      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:nump   range   nbsp   generate   print   ons   gen   clu   mat   

 

from sympy import *
import numpy as np


c, 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

标签:nump   range   nbsp   generate   print   ons   gen   clu   mat   

原文地址:https://www.cnblogs.com/rose999/p/14933773.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!