我设法解决任务,所以这里是感激之情。谢谢大家的努力。
因此,我需要求解两个相关的微分方程,分别表示流体流量(1)的变化和调压罐内上部水位与水位之间的高度差(2)的及时变化。
此特定示例适用于一个水力发电厂(HPP)。如果关闭阀门,则供水就在末端,并且压力管道启动,供水管道内的水团将开始振荡。因为在供水管道的末端是调压罐,当震荡持续时,调压罐具有吸收内部水团的功能,因此不会有水锤之类的严重后果。
然后,HPP可分为三个部分。第一部分是上部水,第二部分是供水管道(通过大坝与上部水相连),第三部分是调压水箱(与供应管道的上侧相连)。而且,当振荡持续时,水团正从上层水流向缓冲罐,反之亦然。
因此,这里有一些关于此处计算内容的解释...
所有变量均在代码执行时定义了当量直径,当量摩擦力和供应管道的长度,这些都是通过手头计算得出的。如果您愿意,我也可以在代码中为它们写方程式...
该方程式代表:运动方程式(1)和连续性方程式(2)。
Qt = 18 m^3/s
流动的初始条件是:
y = 30 m
而高度是:
0 to 1000 s
和时间更改:从import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
# Variables for calculation:
g = 9.81 # gravity acceleration [m/s**2]
Dt = 2.776 # equivalent diameter of supply pipeline, from upper water to surge tank [m]
Ds = 3 # diameter of surge tank [m]
At = np.pi*Dt**2/4. # equivalent cross section of supply pipeline [m**2]
As = np.pi*Ds**2/4. # cross section of surge tank [m**2]
f_l = 0.011155 # equivalent friction coefficient of supply pipeline [/]
Lt = 9276 # lenght of supply pipeline, from upper water to surge tank [m]
c = (1+f_l*Lt/Dt)/(2*g) # loss coefficient [s**2/m]
# Function si defined as:
def f(Qy, t):
Qt = Qy[0]
yt = Qy[1]
dQdt = (g*At/Lt) * (yt - c*Qt*np.abs(Qt)/At**2)
dydt = -Qt/As
return [dQdt, dydt]
# Where are:
# Qt - volumetric flow of fluid [m**3/s]
# yt - height difference between upper water and water level inside surge tank [m]
# Time interval:
t = np.linspace(0, 1000, 2000)
# Initial condition of volumetric flow, Qt and height difference between upper water and water level inside surge tank, yt:
Qy0 = [18, 30]
# Calling the function for time interval, t:
Q = odeint(f, Qy0, t)
# Graph drawing:
fig = plt.figure()
fig.set_facecolor("w")
plt.title('Oscillations')
plt.axhline(c='gray', lw=0.5)
plt.plot(t, Q[:,0], label='Change of flow in time')
plt.plot(t, Q[:,1], label='Change of height difference in time')
plt.xlabel('Time interval, t')
plt.ylabel('Flow, Qt \nheight difference, y')
legend = plt.legend(loc='lower right', shadow = False, fontsize = 'small')
plt.show()
<div class="form-group">
<label for="Sdate" ><strong style=" color:DarkSlateBlue" > Start date </strong></label>
<input type="date" class="form-control" id="sdate" name="startdate" required>
</div>
<div class="form-group">
<label for="Edate"><strong style=" color:DarkSlateBlue" ;> End date </strong> </label>
<input type="date" class="form-control" id="edate" name="enddate" required>
</div>