Sei sulla pagina 1di 27

Mathematical Modeling of Various Systems

Nasir M. Mirza

Models for Flow of Fluids


First Order Models

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 an illustration 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 and inertia. Let us consider some simple hydraulic systems through examples.

Example 1: Modeling of Flow of Salt in a Water Tank A tank contains M (liter) of water in which are dissolved Q (kg) of salt. About P (liters) of Brine (salted water) is dissolved into the tank per minute . Each liter contains S kg of dissolved salt. The mixture is kept uniform by stirring and it runs out at the same rate. Model this system to find the amount of salt in the water tank.

Example 1: Modeling of Flow of Salt in a Water Tank


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) is equal to inflow of salt minus the out flow.
We know that the tank contains M (liter) of water in which are dissolved Q (kg) of salt. Then P (liters) of Brian and each liter containing S kg of dissolved salt runs into the tank per minute. The P liters of water leaves the tank. Let us write down both outflow and in-flows:

The in-flow of salt = P( liters ) S (kg of salt/liter ).


One liter in tank contains y(t)/M of salt, then P liters outgoing will have = P y(t)/M ;

Example 1: Modeling of Flow of Salt in a Water Tank


The differential equation model for the salt in the tank is given by following balance of flow rates: Rate of Change of salt in tank = in-flow rate out-flow rate

dy( t ) PS dt

P y( t ) M

which may be rearranged as


dy( t ) P y( t ) P S dt M

The initial amount of salt is y( t = 0 ) = Q.

Example 1: Modeling of Flow of Salt in a Water Tank


dy(t ) P y(t ) P S Model equation dt M

This is a linear first order ordinary differential equation with non-homogeneous term. We can simulate the amount of salt in the tank at any time t using this model. The constraints are that the inflow rate and outflow rates are fixed and y( t = 0 ) is equal to a given value Q. The fixed parameters in the system are P, S and M respectively. Let us do the example using some numerical values.

Example 1: Modeling of Flow of Salt in a Water Tank


The tank shown in Figure contains 200 liter of water in which an initial amount of 40 kg of salt is dissolved. Five liters of brine and each liter contain 2 kg of salt and run into the tank per minute.
The mixture is kept uniform by stirring. It runs out at the same rate.

Consider y(t) is the total amount of salt in tank.

Time rate of change of y = Inflow rate outflow rate


Inflow rate = 5 x 2 kg per min = 10 kg/min

Example 1: Modeling of Flow of Salt in a Water Tank Inflow rate = 5 x 2 kg per min = 10 kg/min One liter contains y(t)/200 of salt, then 5 liters outgoing will have = 5y(t)/200 = 0.025y(t) ;

Salt outflow rate = 0.025y(t)


Time rate of change of y = Inflow rate outflow rate

dy 10.0 0.025 y (t ) Mathematical Model dt


y(0) = 40, (initial condition)

Example 1: Modeling of Flow of Salt in a Water Tank


The model equation is given below:

dy 10.0 0.025 y (t ) dt
y(0) = 40, It is an initial value problem Its Standard form is given below:

dy 0.025 y (t ) 10.0; dt

y (0) 40

Order: 1; Linearity: It is a linear equation as it has no product term

Example 1: Modeling of Flow of Salt in a Water Tank

dy 0.025 y(t ) 10.0; y(0) 40 dt


Some Properties of the Model:
Homogeneity: It is non-homogeneous equation with a force 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 differential equation (ODE) based model.

Example 1: Modeling of Flow of Salt in a Water Tank


Analytical Solution and Interpretation:

dy 0.025 y (t ) 10.0 dt dy y (t ) 10.0 dt 40


Integrating we get

dy 0.025 dt y 400

ln | y 400 | 0.025t C

y 400 C exp(0.025t )

y(0) = 40

Using initial condition, C = -360 ; and the solution is

y 400 360 exp(0.025t )

Example 1: Modeling of Flow of Salt in a Water Tank


Model in SIMULINK: a patch or block diagram

dy 0.025 y (t ) 10.0; dt

y (0) 40

10 Constant Scope 1/s Integrator Gain -0.025 Add

Example 1: Modeling of Flow of Salt in a Water Tank


Results from SIMULINK
dy 0.025 y (t ) 10.0; dt y (0) 40
600

salt concentration, y(t)

You can see the equilibrium value is 400 from graph and from above equation when dy/dt = 0.

500 400 300 200 100 0

y(0) = 40

100

200

300

400

500

Time(sec)

Example 2: First Order fluid Model


This second example has a tank shown in Figure and it contains 1000 liters of water in which an initial amount of 200 kg of salt is dissolved. Fifty liters of brine each contain (1 + cos t) kg of salt and run into the tank per minute. The deriving force term has time dependence now.

The mixture is kept uniform by stirring.


It runs out at the same rate. Model this nonhomogeneous system.
Time rate of change of y = Inflow rate outflow rate

Example 2: First Order fluid Model


Let us say y(t) is the total amount of salt in tank. Inflow rate = 50 x (1 - cos t) kg per min

One liter contains y(t)/1000 kg of salt, then 50 liter outgoing salt will have = 50y(t)/1000;

Salt outflow rate = 0.05y(t) Time rate of change of y = Inflow rate outflow rate

dy 50(1 cost ) 0.05 y (t ) dt

Mathematical Model

y(0) = 200, It is an initial value.

Example 2: First Order fluid Model


dy 50(1 cost ) 0.05 y (t ) dt
y(0) = 200, let us say.

dy 0.05 y 50(1 cost ) dt


Order: first;

Standard form

Dependent variable = y(t);


independent Variable = t Linearity: It is a linear equation as it has no product term for y and its derivatives.

Example 2: First Order fluid Model


Some Properties of the Model Homogeneity: It is non-homogeneous equation

with a time dependent force term.


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.

Example: First Order non-homogeneous Model


Solution of the Model and Interpretation:

dy 0.05 y 50(1 cost ) dt

y(0) = 200,

Using the Integrating factor method we get

y(t ) exp(0.05t )

exp(0.05t )50(1 cost )dt C

Then using initial condition , the solution is

y(t ) 1000 2.494 cost 49.88 sin t 802.5 exp(0.05t )

Example 2: First Order fluid Model


Model in MATLAB/SIMULINK

dy 0.05 y 50(1 cost ) y(0) = 200. dt

cos Ramp Trigonometric Function

50 Gain1 50 Constant

Scope 1/s Integrator Gain -0.05 Add

Example 2: First Order fluid Model


Results from simulation

1100 1000 900

salt concentration, y(t)

800 700 600 500 400 300 200 100 0

y(0) = 200

What is different about the equilibrium state of this system?


0 20 40 60 80 100 120 140 160 180 200
Time(sec)

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. At the bottom of the tank, there is a hole of diameter one cm, which is opened at some instant, so that the water starts draining under the influence of gravity. GIVEN: According to the Bernoullis law, water flows out of the hole with velocity proportional to the square root of the height at that time. Take proportionality constant as 5 for this system. The velocity increases when height decreases. Assume height of water in the tank at any instant of time t is h(t). Develop the mathematical model.

Example 3:

Flow of Water Through a Hole in a Tank

System: A cylindrical tank with maximum water height of 150 cm and diameter of 100 cm. Fixed Parameters: Acceleration due to gravity g = 980 cm/sec2 , and area of the hole in the tank are fixed parameters. Variable: Water level in the tank at any instant is h(t). 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 fixed and the diameter of the hole does not change with the passage of time. There is no internal source.

Example 3:
dh(t ) dt

Flow of Water Through a Hole in a Tank

h(t )

Here we must keep in view that final velocity is high as compared to initial velocity. Then equation reduced to following first order differential equation:

dh(t ) dt

k h(t )

The negative sign indicates that high decreases the velocity increases.
h

Such a model has analytical solution for given initial condition.

Example 3:

Flow of Water Through a Hole in a Tank

Model in MATLAB/SIMULINK :

dh(t ) dt

k h(t )
h

k = 5; h(0) = 200 m.
h(0) = 200
Scope 1/s Integrator sqrt Math Function simout To Workspace -5 Gain

Example 3: Modeling of Flow of Salt in a Water Tank


Results from SIMULINK

dh(t ) dt

k h(t )

200

using ode45 in matlab

k = 5; h(0) = 200 m. You can see the equilibrium value is 400 from graph and from above equation when dy/dt = 0.

Height of water (m)

150

100

50

0 0 2 4 6 8 10

time(min)

End of slides ----

Potrebbero piacerti anche