Math366 Lectures Lab3
Math366 Lectures Lab3
Compartmental Analysis
We now learn how to model some physical phonomena through DE.
General steps for modeling (you are encouraged to find your own):
- Fix the variables and decide which variable(s) are dependent and which are independent.
- Determine whether any rate of change is interesting to study the phenomenon.
- Look for any possible relation between the variables, this step may be useful to reduce the number of
variables.
- Look for any relation involving the rates of change of the variables (that is to say their derivatives).
A relation of this kind is a DE.
- Look for initial conditions.
- Solve the IVP.
- Graph the function. Comment on the result.
In this section we study simple systema with only one compartment (or block).
Mixing Problems
Let x t be the amount of substance dissolved in a fluid contained in a tank at time t. We usually
know the initial amount of the dissolved substance x0 .
Let V t be the volume of the fluid in the tank at time t.
Assumption: the solution in the tank is kept well stirred so the concentration of the substance is
uniform. This means that the concentration at time t is given by
x t
V t
Let Rin be the rate at which the substance enters the tank and Rout be the rate at which the substance
exits the tank.
[See picture on the board]
We have the following relation
dx
= Rin KRout
dt
Example: A large tank is filled to capacity with 500 gallons of pure water. Brine containing 2
pounds of salt per gallon is pumped into the tank at a rate of 5 gal/min. The well-mixed solution is
pumped out at the same rate. Find the mass x t of salt in the tank at time t. Do not forget to define a
suitable interval.
Sulution: on the board.
d x t
ode d x t = 10 K
dt 100
d 1
x t = 10 K x t (1.1.1)
dt 100
ics d x 0 = 0
x 0 =0 (1.1.2)
dsolve ode, ics
1
K t
100
x t = 1000 K 1000 e (1.1.3)
1
K t
100
plot 1000 K 1000 e , t = 0 ..1000
1000
800
600
400
200
0
0 200 400 600 800 1000
t
Reading: Examples 1 and 2 on the textbook.
Population Models
Let p t be the population at time t.
Assumption: even if the population is always an integer we assume that p t is a continuous and
differentiable function.
dp
We also assume that the growth rate is proportional to the population present at time t.
dt
So we get the following DE
dp
= kp.
dt
[see the board for general solution]
We get
p t = p0 $ek$t .
This is called the Malthusian model.
Example: The population of a town grows according to the Malthausian model. The initial
population of 500 increases to 575 in 10 years. What will be the population in 30 years? How fast is
the population growing at t = 30 years?
Solution: on the board plus computations on Maple.
A more sophisticated model is the logistic model. We make the assuption that the growth rate is
negatively affected by some constrains which can be taken into account by assuming that there is a
upper bound p1 for the population. More precisely we get an equation of the form
dp
= A$p$ p1 Kp
dt
[General solution on the board]
We get
p1
p t = KA$p $t
1
1 C c$e
p1
In case we have an initial population p0 we get that c = K 1.
p0
Example: Suppose a student carrying a flu virus returns to an isolated college campus of 1000
students. If it is assumed that the rate at which the virus spreads is proportional not only to the
number p of infected students but also to the number of students not infected, determine the number
of infected students after 6 days if it is further observed that after 4 days x 4 = 50.
Solution: on the board.
T1 t
1 1
K t t
3 3
e 12 e CC (2.4)
Let us redefine the function
1 1
K t t
3 3
T1 t d e $ 12 e CC
1 1
K t t
3 3
t/e 12 e C C (2.5)
We need to make sure that the initial condition T 0 = 21 is satisfied so we need to solve:
solve T1 0 = 21, C
9 (2.6)
So the solution to the IVP is
1 1
K t t
3 3
T1 t d e $ 12 e C9
1 1
K t t
3 3
t/e 12 e C9 (2.7)
simplify expand T1 t
1
K t
3
12 C 9 e (2.8)
Remark: exponential term will eventually "die off".
2.4328 (2.10)
+
If the time constant is 3hr, the building reaches 16 C at 2:26pm.
T2 t
1 1
K t t
2 2
e 12 e CC (2.14)
Let us redefine the function
1 1
K t t
2 2
T2 t d e $ 12$e CC
1 1
K t t
2 2
t/e 12 e C C (2.15)
We need to make sure that the initial condition T 0 = 21 is still satisfied so we need to solve:
solve T2 0 = 21, C
9 (2.16)
So the solution to the IVP is
1 1
K t t
2 2
T2 t d e $ 12 e C9
1 1
K t t
2 2
t/e 12 e C9 (2.17)
simplify expand T2 t
1
K t
2
12 C 9 e (2.18)
1.6219 (2.20)
20
19
18
17
16
15
14
13
12
0 1 2 3 4 5
t
T1(t) T2(t) Outside Temperature
Newtonian Mechanics
For simplicity's sake, we consider motions of a point along a linear path with coordinate x. We express
Newton's second law of motion as
dp
= F t, x, v
dt
where
dx
p is the momentum of the point which is m$v (where m is the mass and v = is the velocity)
dt
F represents the net sum of all the forces acting on the point, F may depend on time t, position x, and
velocity v.
Remark 1: we need to be careful in considering all the forces acting on the point.
dp d dv
Remark 2: = m$v = m$ = m$a since the mass m is considered constant.
dt dt dt
Read Examples 1, 2, 3, and 4 Sec. 3.5 on you textbook.
Example: An object of mass 5 kg is given an initial downward velocity of 50 m/sec and then allowed
to fall under the influence of gravity. Assume the force in newtons due to air resistance is K10 v, where
v is the velocity of the object in m/sec. Assume the object is initially 500m above the ground.
a) Write a DE describing the motion.
b) Determine the terminal velocity of the object.
c) Solve the IVP.
d) Determine when the object will strike the ground.
e) Plot the graph of motion from the beginning till the object hits the ground.
Solution: to be done in class.
Electrical Circuits
We consider two simple circuits.
RL-circuits
dI
L$ C R$I = E t
dt
where
E is the voltage (unit: volt, V),
I is the current (unit: ampere, A),
L is the inductance (unit: henry, H)),
R is the resistance (unit: ohm, Ω).
General solution: to be done in class.
RC-circuits
dq q
R$ C =E t
dt C
where
dq
we used the identity I =
dt
q is the charge (unit: coulomb C)
C is the capacitance (unit: farad F)
General solution: to be done in class.