容器漏水微分方程--基于python

容器漏水微分方程--基于python,第1张

目录

解题思路

一:题目

二:思路

开发环境

代码及效果

一:代码

二:效果


解题思路 一:题目

  

二:思路

由于给定了微分方程组的具体表达式和参数,我们使用odeint()得到h(t)积分后的方程,并带入t的数值解,来建立方程图形。

开发环境

vscode python

代码及效果 一:代码

from cmath import e
from matplotlib.pyplot import xlabel, ylabel
import scipy
from scipy.integrate import odeint
import pylab as plt
import numpy as np
t=np.arange(0,1200000,100)#设置t的取值范围
#函数的方程式。
ppt2 =lambda h,t:0.62*np.sqrt(2*980*h)/(-np.pi*(200*h-h**2))
y=odeint(ppt2,100,t)#求数值解。
print(y)
plt.rc('font',size='16')
plt.plot(t,y[:,0])
plt.show()
二:效果

效果

  • 结果:h1m=100cm,t对应100倍t,g对应298,
  • ppt =lambda h,t:np.sqrt(2*980*h)/(-np.pi*(200*h-h**2))
  • [[100.        ],[99859079],[99.99718158] ...[         nan]]

 

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/785976.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-04
下一篇 2022-05-04

发表评论

登录后才能评论

评论列表(0条)

保存