You are on page 1of 33

Applications

by
Dr. Ghulam Murtaza
Example 1

Added information: the rate at which the temperature of


the body changes is proportional to the difference of
current temperature of the body and the temperature of
the surrounding medium.

Let us then define variable name (T). It is instantaneous


temperature of the body in degree C. Let t be the time
variable in minutes.
Then mathematically, we can say
Example 1
• This is a first order ODE model.
• We can solve this at least by separation of variables. So,
Example 1
• Here A is the constant of integration and we can find its value.

When t = 0, T = 100;

• Hence the mathematical model has solution form as

We can go one step further to again find value of k from the data
known to us for the system i.e., when t = 1min, T = 90 degree C.
Example 2: A Model from Biology
• Consider N to be number of organisms present at any time t.
• The after Δt time they will have increased by amount ΔN
• This change ΔN is directly proportional to N and the time interval Δt.

Mathematical model

Where, r is proportionality constant. This will be the


parameter of the system
We can solve this model equation by analytical methods. The
separation of variables is one that we will use here.

Where, r is proportionality constant and t is the time variable.


When time is zero, we say N = N(0);
Then C = N(0).

When time t = 1 hour, the N icreases by 10%. Let us put this in the model.

This value of r is in # per hour.


This is termed as growth constant.

This model is showing very important law of exponential growth.


r = 0.0953 is in # per hour.
Let us consider N(0)=1;

Let us model this law of


exponential growth by MATLAB.
Example 3: Population of Fruit flies
• In a finite world, no population can become infinite.
• There are limiting factors. One factor is food supply.
• So, now consider again the colony of fruit flies reproducing under
conditions of a limited food supply and total absence of any
predators.
• So, population gain is proportional to the population at that time.
• And the population loss due to food limits is proportional to square of
the population at that time.
• Find a mathematical model that will simulate this system.
Example 3: Population of Fruit flies
Population gain rate:
• Consider N to be number of organisms present at any time t.
• The after Δt time they will have increased by amount ΔN
• This change ΔN is directly proportional to N and the time interval Δt.

Where, a is proportionality constant.


Population loss rate:
• It is proportional to the square of populational at that time:

Where, b is proportionality constant.


Example 3: Population of Fruit flies
Balance Equation:
• The net rate of change of population will be equal to gain minus loss rates.

Mathematical model

Where, a and b are proportionality constants.

Let us consider both of them as positive numbers.


Example 3: Population of Fruit flies
When time is zero, let us assume N = N(0) = 100;
Then we can solve analytically the model equation.

Mathematical model

For example, Let us consider

a = 0.095 and b < a

b = 0.01

Then the model equation will be


Example 3: A Model from Biology
a = 0.1 in # per day.
b = 0.0005 in # per day.
N(0)=100;
Modeling Electrical Circuits
In electrical circuits we have

• Source of electrical energy ( a battery);

• A resistor or resistance (R)

• A switch

• An inductor (L)

• A capacitor
Modeling Electrical Circuits
• The voltage drop across a resistor is proportional to
the current flowing through it (Ohm’s law).
• The proportionality constant is R (resistance
measured in ohms)
• The current is measured in amperes
• And Voltage is measured in volts.

Ohm’s law
Modeling Electrical Circuits
• Experiments have shown that the voltage drop
across an inductor is proportional to the
instantaneous time rate of change of current (I).
• The constant of proportionality is called inductance
(L) measured in henry and
• Time is measured in seconds.
• The relationship is

Law for inductance


Modeling Electrical Circuits
• Experiments have shown that the voltage drop
across an capacitor is proportional to the
instantaneous charge Q on the capacitor.
• The constant of proportionality is (1/C). Where C is
capacitance measured in Farad and
• Charge is measured in Coulombs.
• The relationship is

Law for capacitors


Modeling Electrical Circuits
Kirchoff’s voltage law:
• The algebraic sum of all of the voltage drops around any
closed loop is zero.
• Or the voltage applied in a closed loop is equal to the
voltage drops across the rest of the loop.
For example, R and L are in
series with a battery as VR
shown here.
VL
Then
VE = VR + VL
VE
Modeling Electrical Circuits
Example:
Consider an RL series circuit connected to a battary.

The R = 20 ohms and L = 10 henry.

The voltage of battary is constant and have value of 10 volts.

Develop a mathematical model for such an electrical system.

R
VR

VL

VE L
Modeling Electrical Circuits
Using Kirchoff’s voltage law: VE = VL + VR

• This is the model equation.


• We can have the solution as

• When t = 0, I = 0 as initial condition.

Here, R and L are in series with a R


battery and the ratio L/R is VR
inductive time constant (sec).
VL
Its value is 10/20 = 0.5 sec.
VE = 10 volts.
VE L
Example 1: modeling of an RL series circuit
Mathematical model:
• R = 10 ohms; L = 20 H,
VE = 20 volts.
• Initial condition :
I(0) = 0.

R
VR

VL

VE L
Example 1: modeling of an RL series circuit
Mathematical model:
• R = 10 ohms; L = 20 H,
VE = 20 volts.
• Initial condition :
I(0) = 0.
The block diagram in
MATLAB/simulink is

R
VR

VL

VE L
Example 1: modeling of an RL series circuit
The simulation results show that
• the current in the loop increases and
• approaches to a constant value of 2 Amperes when time becomes large.

R
VR

VL

VE L
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 Brine 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

which may be rearranged as

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


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

Model equation

• 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

Mathematical Model

y(0) = 40, (initial condition)


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

The model equation is given below:

y(0) = 40,
It is an initial value problem

Its Standard form is given below:

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

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:

Integrating we get

y(0) = 40

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


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

Results from SIMULINK

You can see the


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

You might also like