Plot phase portraits of 2D differential equations using
Python's `matplotlib` and `scipy` libraries.
Inspired by Maxima's `plotdf` function.
## Usage
To plot `dx/dt = y`, `dy/dt = -g sin(x) / l - b y/ (m l)`:
````
from math import sin
from plotdf import plotdf
def f(x,g=1,l=1,m=1,b=1):
return np.array([x[1],-g*sin(x[0])/l-b*x[1]/m/l])
plotdf(f, # Function giving the rhs of the diff. eq. system
np.array([-10,2]), # [xmin,xmax]
np.array([-14,14]),# [ymin,ymax]
[(1.05,-9),(0,5)], # list of initial values for trajectories (optional)
# Additional parameters for `f` (optional)
parameters={"g":9.8,"l":0.5,"m":0.3,"b":0.05})
````
For the full list of parameters to `plotdf`, see `help(plotdf.plotdf)`.
## Dependencies
Both Python 2 and 3 are supported. You need `matplotlib`,
`numpy` and `scipy` installed.
## Installation
The package is on PyPI so you can install it with
$ pip install plotdf
Python-plotdf用以绘制2D微分方程相图的Python模块
需积分: 32 105 浏览量
2019-08-10
04:16:49
上传
评论
收藏 16KB ZIP 举报
weixin_39840924
- 粉丝: 492
- 资源: 1万+
最新资源
- [聊天留言]Ajax PHP文本留言本_xingbook.rar
- ASP.NET某店积分更新记录管理(源代码+论文).rar
- 友邻b2b电子商务 v2.3 简体GBK_gbk_电子商务网站开发模板(使用说明+源代码+html).zip
- JSP企业人事管理系统设计(源代码+论文).rar
- VFP现代物流企业管理系统(源代码+论文).rar
- [图片动画]iFoto v1.0_ifoto-1.0.1.rar
- ssm+vue的物资物流系统的设计与实现(有报告) Javaee项目,ssm vue前后端分离项目
- 521yy 网站Whois查询 php版 1.0_whois_工具查询网站开发模板(使用说明+PHP源代码+html).zip
- vb药品库房管理系统设计(源代码+可执行程序+论文+开题报告+外文翻译+答辩ppt).rar
- 按键 12864显示_单片机C语言实例(纯C语言源代码).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈