of 27
7/27/2019 Lec 7 First Order Fluid
1/27
Mathematical Modeling
of Various Systems
Nasir M. Mirza
7/27/2019 Lec 7 First Order Fluid
2/27
Models for Flow of Fluids
First Order Models
7/27/2019 Lec 7 First Order Fluid
3/27
Hydraulic or Fluid Systems
When a system is based on flow of incompressible fluids, we
have a hydraulic system. This appears in chemical processes, automatic control
systems, drive motors and actuators.
A turbine driven by water to generate electricity is anillustration of a system in which hydraulic, mechanical and
electrical sub-systems interact with each other. Variables used to describe a hydraulic system are
flow rate (m3/s),
volume (m3),
height (m) and pressure (N/m2).
These systems have capacitance, resistance to flow andinertia.
Let us consider some simple hydraulic systems throughexamples.
7/27/2019 Lec 7 First Order Fluid
4/27
Example 1: Modeling of Flow of Salt in a Water Tank
A tank contains M (liter)of water
in which are dissolved Q (kg)ofsalt.
About P (liters)of Brine (saltedwater) is dissolved into the tank
per minute . Each liter contains Skg of dissolved salt.
The mixture is kept uniform bystirring and it runs out at thesame rate.
Model this system to find theamount of salt in the water tank.
7/27/2019 Lec 7 First Order Fluid
5/27
Let us define the total amount of salt in the
tank at any time t equal to y(t).
Then the time rate of change of y(t) isequal to inflow of salt minus the out flow.
Let us write down both outflow and in-flows:
The in-flowof salt = P( liters ) S (kg of salt/liter ).
One liter in tank contains y(t)/M of salt, then P liters outgoingwill have = P y(t)/M ;
We know that the tank contains M (liter)of water in whichare dissolved Q (kg)of salt. Then P (liters)of Brian and eachliter containing Skg of dissolved salt runs into the tank perminute. The P litersof water leaves the tank.
Example 1: Modeling of Flow of Salt in a Water Tank
7/27/2019 Lec 7 First Order Fluid
6/27
which may be rearranged as
The initial amount of salt is y( t = 0 ) = Q.
)t(yM
P
SPdt
)t(dy
SP)t(yM
P
dt
)t(dy
The differential equation model for the salt
in the tank is given by following balance offlow rates:
Example 1: Modeling of Flow of Salt in a Water Tank
Rate of Change of salt in tank = in-flow rate out-flow rate
7/27/2019 Lec 7 First Order Fluid
7/27
This is a linear first order ordinary differential equation withnon-homogeneous term.
We can simulate the amount of salt in the tank at any time tusing this model.
The constraints are that the inflow rate and outflow rates arefixed and y( t = 0 )is equal to a given value Q.
The fixed parameters in the system are P, S and Mrespectively.
Let us do the example using some numerical values.
SPtyMP
dttdy )()( Model equation
Example 1: Modeling of Flow of Salt in a Water Tank
7/27/2019 Lec 7 First Order Fluid
8/27
Consider y(t) is the total amount of salt in tank.
Inflow rate = 5 x 2 kg per min = 10 kg/min
The tank shown in Figure contains 200 liter of
water in which an initial amount of 40 kg of saltis dissolved.
Five liters of brine and each liter contain 2 kg of
salt and run into the tank per minute.
Time rate of change of y = Inflow rate
outflow rate
Example 1: Modeling of Flow of Salt in a Water Tank
The mixture is kept uniform by stirring. It runs out at the same rate.
7/27/2019 Lec 7 First Order Fluid
9/27
)(025.00.10 tydt
dy
One liter contains y(t)/200 of salt, then 5
liters outgoing will have
= 5y(t)/200 = 0.025y(t) ;
y(0) = 40, (initial condition)
Salt outflow rate = 0.025y(t)
Inflow rate = 5 x 2 kg per min = 10 kg/min
Time rate of change of y = Inflow rate outflow rate
Mathematical Model
Example 1: Modeling of Flow of Salt in a Water Tank
7/27/2019 Lec 7 First Order Fluid
10/27
Order: 1;
Linearity:It is a linear equation as it has no product term
)(025.00.10 tydt
dy
y(0) = 40,
It is an initial value problem
40)0(;0.10)(025.0 ytydt
dy
Its Standard form is given below:
The model equation is given below:
Example 1: Modeling of Flow of Salt in a Water Tank
7/27/2019 Lec 7 First Order Fluid
11/27
Homogeneity:It is non-homogeneous equation with aforce term (10.0).
Conditions:Initial conditions are given.
Coefficients:There are constant coefficients
Driving term type:It has analytical term as opposed to a
tabular form.
Model Equation Type:It is a single ordinary differentialequation (ODE) based model.
Some Properties of the Model:
40)0(;0.10)(025.0 ytydt
dy
Example 1: Modeling of Flow of Salt in a Water Tank
7/27/2019 Lec 7 First Order Fluid
12/27
Analytical Solution and Interpretation:
0.1040
)(
ty
dt
dy
0.10)(025.0 tydtdy
dty
dy025.0
400
Integrating we get
Cty 025.0|400|ln
)025.0exp(400 tCy
Using initial condition, C = -360 ; and the solution is
y(0) = 40
)025.0exp(360400 ty
Example 1: Modeling of Flow of Salt in a Water Tank
7/27/2019 Lec 7 First Order Fluid
13/27
Model in SIMULINK: a patch or block diagram
40)0(;0.10)(025.0 ytydt
dy
Scope
1/s
Integrator
-0.025
Gain
10
Constant
Add
Example 1: Modeling of Flow of Salt in a Water Tank
7/27/2019 Lec 7 First Order Fluid
14/27
Results from SIMULINK
40)0(;0.10)(025.0 ytydt
dy
0 100 200 300 400 5000
100
200
300
400
500
600
saltcon
centration,y(t)
Time(sec)
y(0) = 40You can see the
equilibrium value is
400 from graph and
from above equation
when dy/dt = 0.
Example 1: Modeling of Flow of Salt in a Water Tank
7/27/2019 Lec 7 First Order Fluid
15/27
This second example has a tank shown in
Figure and it contains 1000 liters of water inwhich an initial amount of 200 kg of salt is
dissolved.
Fiftyliters of brine each contain (1 + cos t) kgof
salt and run into the tank per minute. The
deriving force term has time dependence now.
Time rate of change of y = Inflow rate outflow rate
The mixture is kept uniform by stirring.
It runs out at the same rate.
Model this nonhomogeneous system.
Example 2: First Order fluid Model
7/27/2019 Lec 7 First Order Fluid
16/27
)(05.0)cos1(50 tytdt
dy
Inflow rate = 50 x (1 - cos t) kg per min
Let us say y(t) is the total amount of salt in tank.
Salt outflow rate = 0.05y(t)
y(0) = 200, It is an initial value.Mathematical Model
Example 2: First Order fluid Model
Time rate of change of y = Inflow rate outflow rate
One liter contains y(t)/1000 kg of salt, then 50 liter
outgoing salt will have = 50y(t)/1000;
7/27/2019 Lec 7 First Order Fluid
17/27
Order: first;
Dependent variable = y(t);
independent Variable = t
Linearity: It is a linear equation as it has no product term for y
and its derivatives.
y(0) = 200, let us say.
Standard form
)(05.0)cos1(50 tytdt
dy
)cos1(5005.0 ty
dt
dy
Example 2: First Order fluid Model
7/27/2019 Lec 7 First Order Fluid
18/27
Conditions:Initial conditions are given.
Coefficients:There are constant coefficients
Driving term type: It has analytical term as
opposed to a tabular form.
Model Equation Type: It is a single ordinary
differential equation (ODE) based model.
Some Properties of the Model
Homogeneity:It is non-homogeneous equation
with a time dependent force term.
Example 2: First Order fluid Model
7/27/2019 Lec 7 First Order Fluid
19/27
Solution of the Model and Interpretation:
Using the Integrating factor method we get
Cdttttty )cos1(50)05.0exp()05.0exp()(
Then using initial condition , the solution is
)cos1(5005.0 tydt
dy
)05.0exp(5.802sin88.49cos494.21000)( tttty
y(0) = 200,
Example: First Order non-homogeneous Model
7/27/2019 Lec 7 First Order Fluid
20/27
Model in MATLAB/SIMULINK
)cos1(5005.0 tydtdy y(0) = 200.
cos
TrigonometricFunction
Scope
Ramp
1/s
Integrator
50
Gain1
-0.05
Gain
50
Constant
Add
Example 2: First Order fluid Model
7/27/2019 Lec 7 First Order Fluid
21/27
0 20 40 60 80 100 120 140 160 180 2000
100
200
300
400
500
600700
800
900
1000
1100
saltconcentratio
n,y(t)
Time(sec)
y(0) = 200
Results from simulation
What is differentabout theequilibrium state of
this system?
Example 2: First Order fluid Model
7/27/2019 Lec 7 First Order Fluid
22/27
Example 3: Flow of Water Through a Hole in a Tank
A cylindrical tank 150 cm high stands on its circular base
of diameter 100 cm and it is initially filled with water. Atthe bottom of the tank, there is a hole of diameter onecm, which is opened at some instant, so that the waterstarts draining under the influence of gravity.
GIVEN:
According to the Bernoullis law, waterflows out of the hole with velocityproportional to the square root of theheight at that time. Take proportionalityconstant as 5 for this system.
The velocity increases when heightdecreases.
Assume height of water in the tank at anyinstant of time t is h(t).
Develop the mathematical model.
h
7/27/2019 Lec 7 First Order Fluid
23/27
Example 3: Flow of Water Through a Hole in a Tank
System:A cylindrical tank with maximum waterheight of 150 cm and diameter of 100 cm.
Variable:Water level in the tank at any instant is h(t).
h
Conditions:The initial height of the water
in the tank is 150 cm (i.e. h(t) = 150 cm at
time t= 0). The volume of the tank is fixedand the diameter of the hole does not
change with the passage of time. There is
no internal source.
Fixed Parameters: Acceleration due to gravity g = 980
cm/sec2 , and area of the hole in the tank are fixed
parameters.
7/27/2019 Lec 7 First Order Fluid
24/27
Example 3: Flow of Water Through a Hole in a Tank
Here we must keep in view that final velocity is high ascompared to initial velocity. Then equation reduced tofollowing first order differential equation:
)()(
thkdt
tdh
The negative sign indicates that high
decreases the velocity increases.h
)()(
thdt
tdh
Such a model has analytical solution for given
initial condition.
7/27/2019 Lec 7 First Order Fluid
25/27
Model in MATLAB/SIMULINK :
k = 5; h(0) = 200 m.h
Example 3: Flow of Water Through a Hole in a Tank
)()(
thkdt
tdh
simout
To Workspace
Scope
sqrt
MathFunction
1/s
Integrator
-5
Gain
h(0) = 200
7/27/2019 Lec 7 First Order Fluid
26/27
Results from SIMULINK
You can see the equilibrium
value is 400 from graph and
from above equation when
dy/dt = 0.
Example 3: Modeling of Flow of Salt in a Water Tank
h0 2 4 6 8 10
0
50
100
150
200
Heightofwater(m)
time(min)
using ode45 in matlab k = 5; h(0) = 200 m.
)()(
thkdt
tdh
7/27/2019 Lec 7 First Order Fluid
27/27
End of slides ----