You are on page 1of 25

Modeling and

stimulation
COURSE INSTRUCTOR: DR.TARIQ ISMAEEL
Presentation topic
➢ Draining a tank
➢ Predator prey Model
➢ Competition Model
Group members

0507-BH-MATH-19 Iqra Bibi


0508-BH-MATH-19 Anika Tariq
0509-BH-MATH-19 Sana Tahir
0520-BH-MATH-19 Amina Bilal
0523-BH-MATH-19 Seerat Fatima
0533-BH-MATH-19 Manhaba Noor
Torricelli’s law
It states that the speed v of efflux of water though a sharp-edged hole at the bottom of a
tank filled to a depth h is the same as the speed that a body (in this case a drop of water)
would acquire in falling freely from a height h.
1
In case of freely falling change in potential energy 𝑚𝑔ℎ and kinetic energy 2 𝑚𝑣 2 remain
same
1
𝑚𝑔ℎ = 𝑚𝑣 2
2
𝑣= 2𝑔ℎ
where g is the acceleration due to gravity.
Draining a tank
Suppose a tank filled with water is allowed to drain through a hole under the influence of
gravity. We want to find the depth h of water remaining in the tank at time t.
Consider the tank as show in the figure. let the area of the hole is 𝐴ℎ and the speed of the

water leaving the tank 𝑣 = 2𝑔ℎ then

the volume of water leaving the tank = 𝐴ℎ × 2𝑔ℎ


Suppose 𝑉 𝑡 denotes the volume of water in the tank at time t. them
𝑑𝑣
= −𝐴ℎ × 2𝑔ℎ … … … … … . . 1
𝑑𝑡

where the minus sign indicates that V is decreasing.

Now the volume of water in the tank at any time t can be written 𝑉 𝑡 = 𝐴𝑤 ℎ,

where 𝐴𝑤 is the constant


Area of the upper surface of the water, then
𝑑𝑣 𝑑ℎ
= 𝐴𝑤 ……………..2
𝑑𝑡 𝑑𝑡
From eq no 1 and 2
By using Torricelli’s law
𝑑ℎ
𝐴𝑤 = −𝐴ℎ × 2𝑔ℎ
𝑑𝑡
𝑑ℎ 𝐴ℎ
=− 2𝑔ℎ ℎ 0 =𝐻
𝑑𝑡 𝐴𝑤
This is first order equation, so we can solve it by using separation of variable.
𝑑ℎ 𝐴ℎ
=− 𝑑𝑡
2𝑔ℎ 𝐴𝑤

Integrating
1
−2 𝐴
‫ ׬‬2𝑔ℎ 𝑑𝑡 = − 𝐴 ℎ ‫𝑡𝑑 ׬‬
𝑤
2𝑔ℎ 1 𝐴
1 = − 𝐴 ℎ 𝑡 + 𝑐1
2𝑔 𝑤
2

𝐴
2𝑔ℎ = − 𝐴 ℎ 𝑡𝑔 + 𝑐1 𝑔
𝑤
𝐴
2𝑔ℎ = − 𝐴 ℎ 𝑡𝑔 + 𝑐 … … … … … … . . 𝐴
𝑤

Using the initial condition, ℎ 0 = 𝐻


2𝑔𝐻 = 0 + 𝑐

𝑐= 2𝑔𝐻
Put in equation no A
𝐴ℎ
2𝑔ℎ = − 𝑡𝑔 + 2𝑔𝐻
𝐴𝑤

Squaring on both side


2
𝐴
2𝑔ℎ = − 𝐴 ℎ 𝑡𝑔 + 2𝑔𝐻
𝑤

2
1 𝐴
ℎ 𝑡 = − 𝐴 ℎ 𝑡𝑔 + 2𝑔𝐻
2𝑔 𝑤

It tells depth h of water remaining in the tank at any time t


Example
Suppose water is leaking from a tank through a circular hole of area 𝐴ℎ at
its bottom. When water leaks through a hole, friction and contraction of
the stream near the hole reduce the volume of water leaving the tank per

second to 𝑐𝐴ℎ 2𝑔ℎ, where 𝑐 (0 < 𝑐 < 1) is an empirical constant.


Determine a differential equation for the height h of water at time t for
the cubical tank as shown in figure. The radius of the hole is 2 inches, and
𝑔 = 32 𝑓𝑡Τ𝑠 2 .

Solution
Suppose 𝑉 𝑡 = 𝐴𝑤 ℎ denotes the volume of water in the tank at time t.
them
𝑑𝑣
= −𝑐𝐴ℎ 2𝑔ℎ … … … … … . . 1
𝑑𝑡
where the minus sign indicates that V is decreasing.
Now the volume of water in the tank at any time t can be written 𝑉 𝑡 = 𝐴𝑤 ℎ,
where 𝐴𝑤 is the constant
Area of the upper surface of the water, then
𝑑𝑣 𝑑ℎ
= 𝐴𝑤 𝑑𝑡 … … … … … . . 2
𝑑𝑡
From eq no 1 and 2
By using Torricelli’s law
𝑑ℎ
𝐴𝑤 𝑑𝑡 = −𝑐𝐴ℎ 2𝑔ℎ
The differential equation is then
𝒅𝒉 𝒄𝑨𝒉
=− 𝟐𝒈𝒉
𝒅𝒕 𝑨𝒘
2
As given the radius of the hole= 𝑟 = 2 𝑖𝑛𝑐ℎ𝑒𝑠 = 12 𝑓𝑡

2 2 𝜋
So the area of circular hole is 𝐴ℎ = 𝜋𝑟 2 =𝜋 = 36
12

Area of the upper surface of the water is 𝐴𝑤 = 10 2 = 100 𝑎𝑛𝑑 𝑔 = 32 𝑓𝑡Τ𝑠 2

Thus the differential become

𝑑ℎ 𝑐𝜋Τ36
=− 2(32)ℎ
𝑑𝑡 100

𝑑ℎ 𝑐𝜋
=− 8 ℎ
𝑑𝑡 3600

𝒅𝒉 𝒄𝝅
=− 𝒉
𝒅𝒕 𝟒𝟓𝟎
A predator prey model
Suppose that two different species of animals interact within the same environment or ecosystem. Suppose that
the first species (prey) eats only vegetation and the second eats only the first species (prey). In other words, one
species is a predator, and the other is a prey.

let suppose that the predators are foxes and the prey are rabbits. Let x(t) and y(t) denote the fox and rabbit
populations, respectively, at any time t.

To construct the model, we made the following assumption.

1) If there were no rabbits, then the fox population decline at a rate proportional to itself (due to lacking an
adequate food supply).

𝑑𝑥
= −𝑎𝑥, 𝑎 > 0……………..1
𝑑𝑡

𝑤ℎ𝑒𝑟𝑒 "𝑎" 𝑖𝑠 𝑡ℎ𝑒 𝑑𝑒𝑎𝑡ℎ 𝑟𝑎𝑡𝑒 𝑐𝑜𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 𝑜𝑓 𝑓𝑜𝑥𝑒𝑠.


2) The rate at which foxes are born is proportional to no. of rabbit eaten by fox, which by first
assumption is proportion to the rate at which the both species interact.

𝑑𝑥
= 𝑏𝑥𝑦 , 𝑏 > 0 … … … … 2
𝑑𝑡
Adding this last rate to (1) gives a model for the fox population

𝑑𝑥
= −𝑎𝑥 + 𝑏𝑥𝑦 , 𝑎 > 0, 𝑏 > 0 … . . … … . 𝐴
𝑑𝑡

3) In the absence of foxes, then the growth rate of rabbits is proportional to the number of rabbits
present at time t (due to unlimited food supply).

𝑑𝑦
= 𝑑𝑦 , 𝑑 > 0 … … … … 3
𝑑𝑡
𝑤ℎ𝑒𝑟𝑒 "𝑑" 𝑖𝑠 𝑔𝑟𝑜𝑤𝑡ℎ 𝑟𝑎𝑡𝑒 𝑐𝑜𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡
4) The foxes eat rabbits and the rate at which rabbits eaten is proportion to rate at which the foxes and
rabbit interact.
𝑑𝑦
= −𝑐𝑥𝑦 , 𝑐 > 0 … … … … . . 4
𝑑𝑡
negative sign (-) because the rabbits population decrease because the rabbits are eaten during their
interaction with the foxes.
𝑑𝑦
= 𝑑𝑦 − 𝑐𝑥𝑦 , 𝑐 > 0, 𝑑 > 0 … … … … . . 𝐵
𝑑𝑡

Thus, the predator prey model is given as

𝒅𝒙
= −𝒂 + 𝒃𝒚 𝒙
𝒅𝒕
𝒅𝒚
ቑ……………..𝐶
= 𝒅 − 𝒄𝒙 𝒚
𝒅𝒕

where a, b, c, and d are positive constants. This famous system of non- linear differential equations is
known as the Lotka-Volterra predator-prey model.
Example
Solve the following Lotka-Volterra predator prey model define as
𝒅𝒙
= −𝟎. 𝟏𝒙 + 𝟎. 𝟎𝟐𝒙𝒚
𝒅𝒕
𝒅𝒚
= 𝟎. 𝟐𝒚 − 𝟎. 𝟎𝟐𝟓𝒙𝒚
𝒅𝒕
Where 𝐱(𝟎) = 𝟔 , 𝐲(𝟎) = 𝟔

Solution
By using fourth-order Runge-Kutta method where h=0.1
Let
𝑑𝑥
𝑔 𝑡, 𝑥, 𝑦 = = −0.1𝑥 + 0.02𝑥𝑦
𝑑𝑡
𝑑𝑦
𝑓 𝑡, 𝑥, 𝑦 = = 0.2𝑦 − 0.025𝑥𝑦
𝑑𝑡
For n=0 we have
𝑘1 = 𝑔 𝑡0 , 𝑥0 , 𝑦0 = 𝑔 0,6,6 = −0.1 6 + 0.02 6 6 = 0.12
𝑚1 = 𝑓 𝑡0 , 𝑥0 , 𝑦0 = 𝑓 0,6,6 = 0.2 6 − 0.025 6 6 = 0.3
ℎ ℎ𝑘1 ℎ𝑚1
𝑘2 = 𝑔 𝑡0 + 2 , 𝑥0 + , 𝑦0 + = 𝑔 0.05 , 6.006 , 6.015 = −0.1 6.006 + 0.02 6.006 6.015
2 2

𝑘2 = 0.1219218
ℎ ℎ𝑘1 ℎ𝑚1
𝑚2 = 𝑓 𝑡0 + 2 , 𝑥0 + , 𝑦0 + = 𝑓 0.05 , 6.006 , 6.015 = 0.2 6.006 − 0.025 6.006 6.015
2 2

𝑚2 = 0.29984775
ℎ ℎ𝑘2 ℎ𝑚2
𝑘3 = 𝑔 𝑡0 + , 𝑥0 + , 𝑦0 + = 𝑔 0.05 , 6.006096 , 6.01499
2 2 2

𝑘3 = −0.1 6.006096 + 0.02 6.006096 6.01499 = 0.121922


ℎ ℎ𝑘2 ℎ𝑚2
𝑚3 = 𝑓 𝑡0 + 2 , 𝑥0 + , 𝑦0 + = 𝑓 0.05 , 6.006096 , 6.01499
2 2

𝑚3 = 0.2 6.01499 − 0.025 6.006096 6.01499 = 0.2998328


𝑘4 = 𝑔 𝑡0 + ℎ, 𝑥0 + ℎ𝑘3 , 𝑦0 + ℎ𝑚3 = 𝑔 0.1, 6.01219 , 6.029983
𝑘4 = −0.1 6.01219 + 0.02 6.01219 6.029983 = 0.123849
𝑚4 = 𝑓 𝑡0 + ℎ, 𝑥0 + ℎ𝑘3 , 𝑦0 + ℎ𝑚3 = 𝑓 0.1, 6.01219, 6.029983
𝑚4 = 0.2 6.029983 − 0.025 6.01219 6.029983 = 0.2996615

𝑥1 = 𝑥0 + 6 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
0.1
𝑥1 = 6 + 0.12 + 2 0.1219218 + 2 0.121922 + 0.123849 =6.0121922
6


𝑦1 = 𝑦0 + 6 𝑚1 + 2𝑚2 + 2𝑚3 + 𝑚4
0.1
𝑦1 = 6 + 6
0.3 + 2 0.29984775 + 2 0.2998328 + 0.2996615 =6.0299837
𝒕𝒏 𝒙𝒏 𝒚𝒏

0 6 6

0.1 6.012192 6.029984

0.2 6.024770 6.059930

0.3 6.037736 6.089830

0.4 6.051091 6.119676

0.5 6.064838 6.149460

0.6 6.078977 6.179174

0.7 6.093511 6.208809

0.8 6.108441 6.238357

0.9 6.123769 6.267807

1.0 6.139497 6.297153

1.1 6.155625 6.326384

1.2 6.172156 6.355491

1.3 6.189091 6.384465


Approximation solution of x (t)

Approximation solution of y (t)


Competition Model
Now suppose two different species of animals say A and B occupy the same environment, not as predator
and prey but rather as competitors for the same resources (such as food and living space) in the system.
Where x(t) and y(t) respectively be the population of species A and B.
In the absence of the others, the rate of growth of each population is given as

𝑑𝑥
= 𝑎𝑥, 𝑎>0
𝑑𝑡 … … … … .1
𝑑𝑦
= 𝑐𝑦, 𝑐>0
𝑑𝑡
Model 1 is not realistic as it indicates that the population of each species in isolation grows exponentially, (it
means in the absence of one other increase).
So, it is reasonable to exponential model 1 by logistic population model.

𝑑𝑥
= 𝑎1 𝑥 − 𝑏1 𝑥, 𝑎1 , 𝑏1 > 0
𝑑𝑡 … … … … .2
𝑑𝑦
= 𝑎2 𝑦 − 𝑏2 𝑦, 𝑎2 , 𝑏2 > 0
𝑑𝑡
In the case of co-existence

Growth rate of each A and B is reduced by a rate proportional to no. of interactions between them. So, in this case
system 2 written in the form

𝑑𝑥
= 𝑎1 𝑥 − 𝑏1 𝑥 2 − 𝑐1 𝑥𝑦 = 𝑥 𝑎1 − 𝑏1 𝑥 − 𝑐1 𝑦 , 𝑎1 , 𝑏1 , 𝑐1 > 0
𝑑𝑡 … … … … .3
𝑑𝑦
= 𝑎2 𝑦 − 𝑏2 𝑦 2 − 𝑐2 𝑥𝑦 = 𝑦(𝑎2 − 𝑏2 𝑦 − 𝑐2 𝑥) , 𝑎2 , 𝑏2 , 𝑐2 > 0
𝑑𝑡
Model 3 is the competition model for species that compete for same resources.
Example
Solve the following competition model define as
𝒅𝒙
= 𝒙(𝟐 − 𝟎. 𝟒𝒙 − 𝟎. 𝟑𝒚)
𝒅𝒕
𝒅𝒚
= 𝒚(𝟏 − 𝟎. 𝟏𝒚 − 𝟎. 𝟑𝒙)
𝒅𝒕
Where 𝐱 𝟎 = 𝟏, 𝐲(𝟎) = 𝟏

Solution
By using fourth-order Runge-Kutta method where h=0.2
𝑑𝑥
𝑔 𝑡, 𝑥, 𝑦 = = 𝑥(2 − 0.4𝑥 − 0.3𝑦)
𝑑𝑡
𝑑𝑦
𝑓 𝑡, 𝑥, 𝑦 = = 𝑦(1 − 0.1𝑦 − 0.3𝑥)
𝑑𝑡
For n=0 we have

𝑘1 = 𝑔 𝑡0 , 𝑥0 , 𝑦0 = 𝑔 0,1,1 = 1.3
𝑚1 = 𝑓 𝑡0 , 𝑥0 , 𝑦0 = 𝑓 0,6,6 = 0.6
ℎ ℎ𝑘1 ℎ𝑚1
𝑘2 = 𝑔 𝑡0 + 2 , 𝑥0 + 2
, 𝑦0 + 2
= 𝑔 0.1, 1.13, 1.06 = 1.3899

ℎ ℎ𝑘1 ℎ𝑚1
𝑚2 = 𝑓 𝑡0 + 2 , 𝑥0 + , 𝑦0 + = 𝑓 0.1, 1.13, 1.06 = 0.5883
2 2

ℎ ℎ𝑘2 ℎ𝑚2
𝑘3 = 𝑔 𝑡0 + 2 , 𝑥0 + , 𝑦0 + = 𝑔 0.1, 1.13899, 1.05883 = 1.3972617
2 2

ℎ ℎ𝑘2 ℎ𝑚2
𝑚3 = 𝑓 𝑡0 + 2 , 𝑥0 + , 𝑦0 + = 𝑓 0.1, 1.13899, 1.05883 = 0.5849188
2 2

𝑘4 = 𝑔 𝑡0 + ℎ, 𝑥0 + ℎ𝑘3 , 𝑦0 + ℎ𝑚3 = 𝑔 0.2,1.27945,1.11698377 = 1.4753656


𝑚4 = 𝑓 𝑡0 + ℎ, 𝑥0 + ℎ𝑘3 , 𝑦0 + ℎ𝑚3 = 𝑓 0.2,1.27945,1.11698377 = 0.56381

𝑥1 = 𝑥0 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6

0.1
𝑥1 = 1 + 1.3 + 2 1.3899 + 2 1.3972617 + 1.4753656 = 1.2783229
6


𝑦1 = 𝑦0 + 6 𝑚1 + 2𝑚2 + 2𝑚3 + 𝑚4
0.1
𝑦1 = 1 + 0.6 + 2 0.5883 + 2 0.5849188 + 0.56381 = 1.116997
6
𝒕𝒏 𝒙𝒏 𝒚𝒏

0 1 1

0.2 1.278323 1.116997

0.4 1.585445 1.223133

0.6 1.906150 1.311682

0.8 2.223365 1.377722

1.0 2.521908 1.418981

1.2 2.791291 1.435898

1.4 3.026614 1.431002

1.6 3.227780 1.407984


Approximation solution of x (t)

Approximation solution of y (t)

You might also like