Professional Documents
Culture Documents
ODE's
Outcome
Solve a mathematical model governed by a linear first-order ODE.
The theory
dy
STANDARD FORM: + P( x) y = Q( x)
dx
Calculations
Example 1
Solve for 𝑦 = 𝑦(𝑡) if 𝑦 ′ + 5𝑦 = 0. Homogeneous because RHS = 0
SOLUTION
We may classify ODE as linear or separable.
Method 1: Linear
P = 5; Q = 0
R = e
5 dt
= e5t No integration constant
Method 2: Separable
Example 2
Solve y '+ ty = 5t .
SOLUTION
P = t ; Q = 5t
R = e
tdt
= et
2
/2
The solution: 𝑑 𝑡 2 /2 2𝑡
2 2
(𝑒 ) = 𝑒 𝑡 /2 ( ) = 𝑡𝑒 𝑡 /2
𝑑𝑡 2
e 2 y = e 2 (5t )dt
t2 t2
2 /2 2 /2
t2
∴ ∫ 5𝑡 𝑒 𝑡 𝑑𝑡 = 5𝑒 𝑡 +𝑐
= 5e 2
+c
y = 5 + ce
− t2
2
✔
Example 3
Solve y 'cos x + y sin x = 1 if − 2 x 2 and y (0) = 3 . Non-homogeneous because RHS ≠ 0
SOLUTION
Divide by cos 𝑥 to obtain the standard form:
y '+ y tan x = sec x
sin 𝑥 1
= tan 𝑥 ; = sec 𝑥
P = tan x; Q = sec x cos 𝑥 cos 𝑥
Integration factor:
R = e
tan xdx
= eln sec x
Log law: 𝑒 ln 𝑎 = 𝑎
= sec x
Mathematical models
See a summary of a few of mathematical models governed by linear first-order ODE's in Addendum
A.
Example 4
A resistor of resistance R and an inductor of inductance L is connected in series with a constant
applied voltage E.
a) Use Kirchhoff's law to set up a differential equation for the current 𝑖 = 𝑖(𝑡).
b) Given 𝑖(0) = 0, solve the DE.
di
E = iR + L
dt
or, in standard form,
di R E
+ i=
dt L L This ODE may also be solved using separation of
variables. See if you can get the same answer.
b) This is a linear first-order ODE.
IF = e L = e
R dt
Rt
L
Let's use 𝐼𝐹 for the integration factor
to not confuse it with the resistance R
E Rt L
e Li =
Rt
e dt
L
E L Rt
= e L +c
LR
E − Rt
i = + ce L
R
Calculate c using the given initial condition:
E
0= +c
R
E
c = −
R
Thus,
E E − Rt L
i = − e
R R
which may be written as
i =
E
R
( − Rt
1− e L )
c) When 𝑡 → ∞, 𝑒 −𝑅𝑡/𝐿 → 0. Thus,
𝐸
𝑖→ .
𝑅
d) The graph
Example 5
A tank contains 200 litres of water in which 40 kilograms of salt are dissolved. Five litres of brine,
each containing 2 kg of dissolved salt, run into the tank every minute. The mixture, kept uniform by
stirring, runs out at the same rate.
(a) Determine the amount of salt, A(t), in the tank at time t.
(b) How much salt is in the tank after a long time?
The volume of the mixture in the tank: Since the mixture leaves the tank at the same rate as
that at which the brine enters, the volume of the mixture in the tank remains constant at 200
litres.
An expression for Rin: Every litre of brine contains 2 kg of salt, that is, 2 kg/litre. Every
minute five litres of brine enter the tank, that is, brine enters at 5 litres/minute. Combining
these two facts,
2 kg 5 litres
Rin = = 10 kg/min.
litre minute
An expression for Rout: The amount of salt in the tank at time t is A(t), dissolved in 200 litres.
The mixture leaves the tank at a rate of 5 litres/min. Thus,
A kg 5 litres 5 A
Rout = = = 0.025 A kg/min.
200 litres minute 200
dA
= 10 − 0.025 A ,
dt
a linear differential equation which can be solved using an integration factor. The equation in
standard form is
dA
+ 0.025 A = 10 .
dt
The integration factor is
IF = e
0.025 dt
= e0.025t
so that
e0.025t A = 10e0.025 A dt = 10
0.025 e 0.025t + c = 400e 0.025t + c
which simplifies to
A = 400 + ce −0.025t .
Substitution of the initial condition yields
40 = 400 + c c = −360 .
200
100
0
0 100 200 300 400
Time (minutes)
Notes
• The maximum amount of salt in the tank is 400 = 200 2 kg.
• Note how the graph reflects the initial condition and the maximum value of A.
• Also take note of the labels and ticks in the graph – this is what graphs should look
like in the assignments!
Example 6
Assume the mixture in Example 4 is pumped out at a slower rate of 3 litres per minute. Derive an
expression for the amount of salt in the tank as a function of time.
SOLUTION
The volume of the mixture in the tank: Since the mixture leaves the tank at a slower rate,
the volume of the mixture will increase by 5 − 3 = 2 litres every minute. The following table
leads to an expression for the changing volume:
0 200
1 200+2=202=200+2(1)
2 202+2=204=200+2(2)
3 204+2=206=200+2(3)
4 206+2=208=200+2(4)
t 200+2(t)
2 kg 5 litres
Rin = = 10 kg/min.
litre miniute
An expression for Rout: The amount of salt in the tank at time t is A(t), dissolved in
(200 + 2t ) litres. The mixture leaves the tank at a rate of 3 litres/min. Thus,
A kg 3 litres 3A
Rout = = kg/min.
(200 + 2t ) litres minute 200 + 2t
Hence
dA 3A 3 1
= 10 − = 10 − A
dt 200 + 2t 2 100 + t
or, in standard form,
dA 3 1
+ A = 10 .
dt 2 100 + t
The integration factor is
IF = e 2 100+t = e 2 = (100 + t )
3 1 dt 3 ln(100 + t ) 3/ 2
.
which simplifies to
Notes
The graph of the solution in Example 5 depicts an unlimited increase in the amount of salt in the tank.
Is this correct? NO! At some stage, when the tank is full, the tank will overflow and the governing
equation will no longer be valid.
2500
1250
0
0 125 250 375 500
Time (minutes)
Notes
What will happen if the rate of outflow is greater than the rate of inflow, say, 7 litres per minute? The
volume of the mixture in the tank will then decrease at a rate of 2 litres per minute and the linear ODE
to solve will be
dA 7 1
+ A = 10 .
dt 2 100 − t
The tank will slowly drain. Initially the amount of salt will increase, as shown below, but after about
50 minutes the amount of salt will decrease until there is no more salt in the tank – assuming it is
possible for all of the mixture to leave the tank.
100
Amount of salt in tank (kg)
75
50
25
0
0 25 50 75 100
Time (minutes)
Next …
Solve Bernoulli's equation by reducing it to linear form using a suitable substitution.
Electrical circuits
The differential equations governing L-R and R-C circuits are based on Kirchhoff's second law
(Singh, p. 616): The sum of all voltages in a series circuit equals the impressed voltage, E(t), on
the circuit.
Let i(t) represent the current in the circuit at time t, while q(t) represents the charge. Recall that
dq
i (t ) = and q = idt .
dt
di d 2q dq
L + Ri = E (t ) or L 2 + R = E (t )
dt dt dt
and for an R-C circuit,
dq 1 1
R + q = E (t ) or Ri + idt = E (t ) .
dt C C
Mixing problems
Consider the tank in Figure 1. Initially an amount of salt, A(t), is dissolved in the liquid in the tank. A
solution of some kind is pumped into the tank at a rate Rin, measured as the amount of salt per time
unit (mass/time) The contents of the tank is stirred continuously and pumped out at a rate of Rout, also
measured as mass/time
Amount of salt = A
Rout
Figure 1 The tank in a typical mixing problem
Since more salt enters the tank and some leave the tank, the amount of salt in the tank is not constant.
The rate at which the amount of salt in the tank changes equals the difference between the rate at
which salt enters and the rate at which it flows out, that is,
dA
= Rin − Rout . (6)
dt
Notes
• The unit of the quantity on the left-hand side of Equation (6) is mass/time. The unit of
Rin, and Rout should thus also be mass/time. Thus, both Rin and Rout are calculated as:
• Concentration flow rate = mass/volume volume/time.
• A solution of ordinary salt, NaCl, in water is often called "brine".
• A(t) represents the amount of salt in the tank at time t.
y '+ Py = Q . (1.1)
SP = S ' . (1.3)
Substitute (1.3) in (1.2):
d
Sy '+ S ' y = ( Sy ) . (1.5)
dx
Substitute (1.5) in (1.4):
d
( Sy ) = SQ . (1.6)
dx
Integrate both sides of (1.6) with respect to x:
Sy = SQdx + c1 . (1.7)
Solve for y:
y=
SQdx + c 1
. (1.8)
S
(1.8) is a general solution of (1.1) with S some unknown function. To determine an expression for S
change the subject of (1.3) to P:
S'
P= . (1.9)
S
Recall from the differentiation rules that
d S'
( ln S ) = . (1.10)
dx S
Combining (1.10) and (1.9),
d
P= ( ln S ) . (1.11)
dx
ln S = Pdx + c2
S = e = ec2 e = c3e
Pdx + c2 Pdx Pdx
. (1.12)
Pdx Q + c
y=
c e 3 1
(1.13)
c3e
Pdx
which simplifies to
Pdx Q + c
y=
e (1.14)
e
Pdx
e y = e
Pdx Pdx
Q+c . (1.15)
Let R = R ( x) = e
Pdx
, then (1.15) becomes
Ry = RQdx + c . (1.16)
When we perform the integration on the right we'll get another constant of integration and we thus
omit the "+c" in (1.16).
y '+ Py = Q
Ry = RQdx
where
R = e
Pdx
,