You are on page 1of 10

Mathematical Modeling of Fluid Systems

Fluid: A substance which has definite mass and volume at a specific temperature and
pressure, but no definite shape. Liquids and gases are two classes of fluids. Liquids conform to
shape of the container and may have a bounding surface, whereas gases will expand or contract
to fill the container. Modelling of fluid systems deals with the liquid pressure and flow and
covers the hydraulic systems.
Advantage of fluid system: Large forces can be controlled using much smaller forces.
Constant torque or force at infinitely variable speeds in either direction with smooth reversals is
possible. This following section treats the modelling and analysis of the liquid-level systems with
and without interaction.
The physical relations governing the fluid flow are continuity, force equilibrium and
resistance. The continuity relation is simply a statement of the conservation of matter:
ṁ=w¿ −w out
where m is the fluid mass, w ¿ is the output mass flow rate and w out is the input mass flow rate .

Linearization of resistance and capacitance of fluid systems:

We will try to find the linear model of describing the pipe connecting two tanks in following
figure.

For laminar flow, in terms of H : height of fluid and Q : steady state flow can be written as
Q=KH
where K is a constant term.
Tank resistance is defined for laminar flow as the change of level difference and in the tank
corresponding to a change in flow rete. Thus, the general form of the resistance R is given by
dH H
Rl= =
dQ dQ
which is constant. For turbulence, the flow rate pressure drop relation is nonlinear and the
resistance for turbulent flow depends on the flow rate and pressure drop in the tank:
Q=K √ H
Then, the thank level system resistance can be expressed as
dH
Rt =
dQ
Substituting previous equation into last equation yields the nonlinear equation of the for the
flow rate:
K
dQ= dH
2√H

dH 2 √ H 2 √ H √ H 2 H
= = =
dQ K K K
Finally,
2H
Rt =
Q
Note that, a value of 2 at the numerator of resistance equation indicates that the flow is
proportional to the square root of the pressure differences and therefore will produce a
nonlinear differential equation.

Tank capacitance is defined as the change of fluid volume in the tank corresponding to a
change in fluid. Consider again the given figure above, in which q i , q 0 are the small deviation of
flow rate at the input and output respectively. The general form of the effect of the capacitance
C is given by
C dh=( q i−q 0 ) dt

where
h
q 0=
R
from the definition of the resistance. Substituting this equation into previous time domain
equation yields
dh
RC + h=R q i
dt
Note that, this is a first-order differential equation. If we take the Laplace transform of the last
equation, we obtain the transformed equation of the open-loop level system as
( RC s +1 ) H ( s )=R Qi ( s ) .
In transfer function form the equation is
H (s ) R
=
Qi ( s ) ( RC s+ 1 )
In the output flow control case (we can choose the q 0 as an output), the transfer function of the
system obtained as
Qo ( s ) 1
=
Q i ( s ) ( RC s +1 )

Now consider a liquid-level system with interaction as following figure,.


We can find the differantial equations relating the flow into the first tank to the flow out of the
second tank. The equation of the system given by

h1−h 2
=q1
R1

dh1
C1 =q−q 1
dt

h2
=q
R2 2

dh2
C1 =q 1−q2
dt

If we take the Laplace transform of the above differential equations, we obtain the overall
transfer function of the interconnected level system as
Qo ( s ) 1
= 2
Q s
( ) R1 C1 R 2 C 2 s + ( R1 C1 + R2 C 2+ R2 C1 ) s+1

which is a second-order tansfer function.Finally, the following block diagram illustrates the
interconnection of the two fluid level system.
Modeling Dynamic Liquid Systems Objective: Deriving input-output relations of linear time
invariant (LTI) liquid systems using elemental and structural equations and obtaining transfer
function representation of LTI system.
Assumptions: In this study, only LTI liquid systems will be considered. These systems will have
input-output relations described by linear ordinary differential equations with constant
coefficients.
Fluid System Elements-Incompressible:
Pipe and Valve Resistances

P1∧P2: pressure at fluid entrance and exist


Q : volumetric flow rate,
R : pipe or valve resistance constant,
Δp=RQ
For laminar flow, in terms of heads H i :
R
pi= ρg H i ⟹ ΔH= ( )ρg
Q

For turbulence the flow rate pressure drop relation is nonlinear and The resistance for turbulent
flow depends on the flow rate and pressure drop
Q=K √ Δp : for turbulent flow
Q= K^ √ ΔH : in terms of heads H i
d ( Δp)
R=
dQ
Tank Capacitance

H : height of fluid
Tank capacitance is defined as the change of fluid volume in the tank corresponding to a change
in fluid
ΔV A ( ΔH )
Cf = = =A
ΔH ΔH
Q i∧Q0 : volumetric flow rate in and out of the tank,
Q t : net volumetric flow rate in (or out of) the tank,
p: pressure at the bottom of the tank,
dH dp A
Q t =C f ⟹ p=ρgH ⟹ Q t =C f ;Cf=
dt dt ρg
Fluid Inertance
d Q 1 dQ
F= A ( Δp ) ; F=ma, m=ρAL , a=v̇ =
dt A
=
A dt ( )
1 dQ dQ ρL
⟹ A ( Δp )=( ρAL ) ⟹ Δp=I ⟹ I=
A dt dt A

Example: Obtain the input (Q i)—output Q o relation.

fluid input

fluid output

Write the elemental equations:


dH A dp1
Qt =C f
dt
= t( )
ρg dt
( Δp )valve =RQ

Long pipe will have resistance and inertance:


( Δp ) ' pipe=R p Q0
dQ ρL dQ 0
( Δp ) ' ' pipe =I
dt( )
=
A p dt

Write the continuity and compatibility equations:


Q t =Q i−Q 0 ; ( Δp )valve = p2− p1= p2 −0= p2
Δp= ( Δp ) ' pipe + ( Δp ) ' ' pipe= p1− p 2

Combine elemental and structural equations:


A t dp 1
Tank: Q t −Q 0=( ) ρg dt
;

ρL dQ
Pipe: p −p =
1
( A ) dt + R Q
2
p
0
p 0;

Valve: R Q 0
Eliminate p1 , p2 from these 3 equations to obtain the relation between the input (Q i)—output
Qo
2
At L d Q0 A dQ0
( )( )
Ap g dt ( )
+ ( R+ R p ) t
ρg dt
+Q 0=Q i

which is a second order plant dynamics.

b- Consider a process with the following (forward) transfer function of a unity feedback system:

and the controller:

- If the system is designed to satisfy the damping ratio 0.5, use MATLAB to obtain the
time constants, T, undamped natural frequencies, ω n, damped natural frequencies, ω d,
derivative gains, K d , and proportional gains, K p, for the values of K p/ K d proposed in
Table 1. Show the steps of obtaining the values. Use illustrations as much as you can.
- Fill in the table cells.
- Briefly discuss the effect of K p/ K d (zero location) on the speed of response.

The transfer function of the closed-loop system is given by

GG c
T=
(1+G G c )

where G is plant model, K is the controller. Hence, closed-loop transfer function is obtained as:

K d s+ K p
T= 3 2
s + 6 s + ( 8+ K d ) s+ K p +6

By using final value theorem, the final value of the T is obtained as (where we use s=0):
Kp
T final=
K p +6

In order to minimize the steady state error we can select a high K p value. On the other hand,
we should satisfy the desired damping ratio. It is well known that the overshoot does not
depend on the natural frequency of the system but only on the damping factor. As the damping
factor approaches 1 so the percentage overshoot approaches zero. The following table gives
values of the percentage overshoot for particular damping ratios.

Damping ratio Percentage overshoot

0.2 52.7

0.3 37.2

0.4 25.4

0.5 16.3

We can select the K d , K p values of the system using the following Matlab script

clear all; close all; clc;


s = tf('s');
Kp = 20;% Kp coefficient
Kd = 20;% Kd coefficient
K = Kd*(s+Kp/Kd); % controller
G = (1)/((s+1)*(s+2)*(s+3)); %plant
T = (G*K)/(1+G*K); % closed-loop feedback system
step(T); hold on; % step response of T

As can be seen from following figure, K d =20 , K p=20 gives approximately 16.8% overshoot,
i.e., 0.5 damping ratio.
In Matlab, [wn,zeta] = damp(sys) returns the natural frequencies wn, and damping ratios zeta of
the poles of transfer function.

>> [wn,zeta] = damp(T)

wn =

1.0000

1.0000

2.0000

3.0000

5.0990

5.0990

zeta =

1.0000

1.0000

1.0000

1.0000
0.4903

0.4903

Hence, we obtain underdampedw n=5.09 rad /s .

The system is underdamped because the poles have imaginary component and their real part is
negative (i.e., on the left–hand plane).

Then, damped natural frequencies, ω d=wn √ 1−ξ 2=5.09 √ 1−0.52=4.4159 rad /s

In Matlab again, damp(sys) displays the damping ratio, natural frequency, and time constant of
the poles of the linear model sys.

>> damp(T)
Pole Damping Frequency (rad/seconds) Time Constant (seconds)
-1.00e+00 + 7.81e-08i 1.00e+00 1.00e+00 1.00e+00
-1.00e+00 - 7.81e-08i 1.00e+00 1.00e+00 1.00e+00
-2.00e+00 1.00e+00 2.00e+00 5.00e-01
-3.00e+00 1.00e+00 3.00e+00 3.33e-01
-2.50e+00 + 4.44e+00i 4.90e-01 5.10e+00 4.00e-01
-2.50e+00 - 4.44e+00i 4.90e-01 5.10e+00 4.00e-01
The time constant T is 3.33e-01 seconds (the lowest time constant)
K p/ Kd 0.5 1.5 2.5 3.5
T 0.33 0.33 0.33 3.33
ωn 3.6 6.1 7.65 8.89
ωd 12.49 36.8 58.3 78.6
Kd 10 30 50 70
Kp 20 20 20 20

As can be understood from the above table, when K p / K d value is increased; T is not chance but
ω n , w d increase.
clear all; close all; clc;
s = tf('s');
Kp = 20;% Kp coefficient
Kd = 70;% Kd coefficient
K = Kd*(s+Kp/Kd); % controller
G = (1)/((s+1)*(s+2)*(s+3)); %plant
T = (G*K)/(1+G*K); % closed-loop feedback system
step(T); hold on; % step response of T
[wn,zeta] = damp(T)
damp(T) % Natural frequency and damping ratio
wd= max(wn)*(sqrt(1-max(wn)^2))

Referances:

You might also like