During flight t, the level of liquid H in the fuel tank changes according to the relation:(one)
Where:–– initial fuel level in the tank; V– fuel rate of change.
With the introduced coordinate system (see figure), the equation for the unsteady motion of a viscous incompressible fluid in the measuring channel will be:(2)
With boundaryand primary
conditions.
where: u (r, t) is the velocity of the fluid in the channel; p is pressure; ρ is the density; time - t; v is the kinematic viscosity; g- acceleration of gravity.
We obtain the ratio for the average speed in the measuring channel:
Multiplying the left and right sides of equation (2) by r, we write the individual terms of the equation of motion:(3)
Where:friction;
wall friction;
dynamic viscosity; R is the radius of the cylindrical channel.
We use equations (3) and write equation (2) in the form (sloped brackets with an average speed are omitted hereinafter):
or(four)
Let us choose in the cylindrical channel the volume of liquid by two cross sections at a distance. We write for the selected volume the balance of pressure and friction:
, we obtain the ratio:
(five)
Using the Darcy-Weisbach equationcombining it with (5) we get:
, hence the ratio for friction of the liquid against the walls of the measuring channel will take the form:
(6)
where λ is the coefficient of hydraulic friction.
Substitute (6) into equation (4) and obtain the following expression:(7)
Calculate the pressure gradient under the following conditions: the pressure decreases linearly from the boost pressure over the free surface of the fuel to the pressure. The pressure gradient with (1) will be equal to:
(eight)
Substituting (8) into the relation (7), we obtain the final differential equation for the level of liquid in the measuring channel:(9)
With initial conditions of Cauchy, like:(ten)
# -*- coding: utf8 -*- import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt R=0.0195 # H=8.2# , g=9.8# /2 L=4.83*10**-2# V=0.039# / def f(y,t): y1,y2=y return [y2,-g+(g*(HV*t)/y1)+((L/(4*R))*y2**2)] t = np.arange(0,10,0.01) y0=[H,0] [y1,y2]=odeint(f,y0,t,full_output=False).T plt.title(' ') plt.ylabel('H,m') plt.xlabel('t,s') plt.plot(t,y1,"b",linewidth=2,label=' ') y=HV*t plt.plot(t,y,"--r",linewidth=2,label=' ') plt.grid(True) plt.legend(loc='best') plt.show()
# -*- coding: utf8 -*- import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt R=0.0195 # H=8.2# , g=9.8# /2 L=4.83*10**-2# V=0.039# / def f(y,t): y1,y2=y return [y2,-g+(g*(HV*t)/y1)+((L/(4*R))*y2**2)] t = np.arange(0,10,0.01) y0=[H,0] [y1,y2]=odeint(f,y0,t,full_output=False).T y1= np.array([np.random.normal(x,0.1) for x in y1])# plt.title(' \n 0.1') plt.ylabel('H,m') plt.xlabel('t,s') plt.plot(t,y1,"b",linewidth=2,label=' ') y=HV*t plt.plot(t,y,"--r",linewidth=2,label=' ') plt.grid(True) plt.legend(loc='best') plt.show()
# -*- coding: utf8 -*- from scipy.integrate import odeint import matplotlib.pyplot as plt from numpy import* from pykalman import KalmanFilter R=0.0195 H=8.2 g=9.8 L=4.83*10**-2 V=0.039 def f(y,t): y1,y2=y return [y2,-g+(g*(HV*t)/y1)+((L/(4*R))*y2**2)] t = arange(0,10,0.01) y0=[H,0] [y1,y2]=odeint(f,y0,t,full_output=False).T y=array(HV*t)# measurements = array([random.normal(x,0.1) for x in y1]) kf = KalmanFilter(transition_matrices=[1] ,# observation_matrices=[1],# initial_state_mean=measurements[0],# initial_state_covariance=1,# observation_covariance=1,# transition_covariance= 0.001) # state_means, state_covariances = kf.filter(measurements)# , state_std = sqrt(state_covariances[:,0]) plt.figure() plt.title(' ') plt.ylabel('H,m') plt.xlabel('t,s') plt.plot(measurements, '-r', label=' ') plt.plot(state_means, '-g', label='kalman- ') plt.plot(y, '-k', label=' ') plt.legend(loc='best') plt.figure() measurement_std = [std(measurements[:i]) for i in arange(1,len(measurements),1)] plt.plot(measurement_std, '-r', label='measurment std') plt.plot(state_std, '-g', label='kalman-filter output std') plt.legend(loc='upper left') plt.show()
Source: https://habr.com/ru/post/354010/
All Articles