Académique Documents
Professionnel Documents
Culture Documents
Topic 02 : ODEs
Lectures 1012 : Introduction to Ordinary Differential Equations (ODEs)
Dr Kieran Murphy
Department of Computing and Mathematics,
Waterford Institute of Technology.
(kmurphy@wit.ie)
Credits:
This module and these
notes were developed
by Dr Pardaig Kirwan
with only minor modifications on my part.
Outline
Types of ODEs
Solution of ODEs using integration
Application to electrical circuits
1 of 1
Lecture 10
2 of 1
Lecture 10
2 of 1
Lecture 10
2 of 1
Lecture 10
2 of 1
Lecture 10
2 of 1
Lecture 10
Lecture 10
Ts
.
t
3 of 1
Lecture 10
After an initially rapid decrease the temperature changes progressively less rapidly
and eventually the curve appears to flatten out.
4 of 1
Lecture 10
After an initially rapid decrease the temperature changes progressively less rapidly
and eventually the curve appears to flatten out.
4 of 1
Lecture 10
After an initially rapid decrease the temperature changes progressively less rapidly
and eventually the curve appears to flatten out.
4 of 1
Lecture 10
After an initially rapid decrease the temperature changes progressively less rapidly
and eventually the curve appears to flatten out.
Example
Write down the mathematical equation which is equivalent to Newtons law of
cooling and state the accompanying condition.
4 of 1
Lecture 10
In the above example we call t the independent variable and T the dependent
variable.
Since the condition is given at t = 0 we refer to it as an initial condition.
The solution of the above differential equation which satisfies the initial
condition is T = Ts + (T0 Ts )ekt
Definition
A differential equation is a relationship between the value of a function y(t) and
the values of its derivatives, which is true for all valid values of t. y(t) is called a
solution of the differential equation.
5 of 1
Lecture 10
In the above example we call t the independent variable and T the dependent
variable.
Since the condition is given at t = 0 we refer to it as an initial condition.
The solution of the above differential equation which satisfies the initial
condition is T = Ts + (T0 Ts )ekt
Definition
A differential equation is a relationship between the value of a function y(t) and
the values of its derivatives, which is true for all valid values of t. y(t) is called a
solution of the differential equation.
Example
Show that y = Ae2t satisfies the differential equation
dy
= 2t
dt
5 of 1
Lecture 10
Example
Show that y = (A + Bt)e2t is a solution of the differential equation
d2 y
dy
+ 4 + 4y = 0
dt2
dt
Example
Show that y = A sin(3t) + B cos(3t) is a solution of the differential equation
d2 y
+ 9y = 0
dt2
6 of 1
Lecture 10
Example
Show that y = (A + Bt)e2t is a solution of the differential equation
d2 y
dy
+ 4 + 4y = 0
dt2
dt
Example
Show that y = A sin(3t) + B cos(3t) is a solution of the differential equation
d2 y
+ 9y = 0
dt2
Example
Determine a differential equation satisfied by
6 of 1
Lecture 10
We have seen that an expression including one arbitrary constant required one
differentiation to obtain a differential equation which eliminated the arbitrary
constant.
7 of 1
Lecture 10
We have seen that an expression including one arbitrary constant required one
differentiation to obtain a differential equation which eliminated the arbitrary
constant.
Where two constants were present, two differentiations were required.
7 of 1
Lecture 10
We have seen that an expression including one arbitrary constant required one
differentiation to obtain a differential equation which eliminated the arbitrary
constant.
Where two constants were present, two differentiations were required.
Is the converse true? For example,
7 of 1
Lecture 10
We have seen that an expression including one arbitrary constant required one
differentiation to obtain a differential equation which eliminated the arbitrary
constant.
Where two constants were present, two differentiations were required.
Is the converse true? For example,
would a differential equation involving dy
as the only derivative have a general
dt
solution with one arbitrary constant and
7 of 1
Lecture 10
We have seen that an expression including one arbitrary constant required one
differentiation to obtain a differential equation which eliminated the arbitrary
constant.
Where two constants were present, two differentiations were required.
Is the converse true? For example,
would a differential equation involving dy
as the only derivative have a general
dt
solution with one arbitrary constant and
2
would a differential equation which had ddt2y as the highest derivative produce a
general solution with two arbitrary constants?
7 of 1
Lecture 10
We have seen that an expression including one arbitrary constant required one
differentiation to obtain a differential equation which eliminated the arbitrary
constant.
Where two constants were present, two differentiations were required.
Is the converse true? For example,
would a differential equation involving dy
as the only derivative have a general
dt
solution with one arbitrary constant and
2
would a differential equation which had ddt2y as the highest derivative produce a
general solution with two arbitrary constants?
Lecture 10
Example
Integrate twice the differential equation
d2 y
= 8(6t t2 )
dt2
8 of 1
Lecture 10
Example
Integrate twice the differential equation
d2 y
= 8(6t t2 )
dt2
8 of 1
Lecture 10
Example
Integrate twice the differential equation
d2 y
= 8(6t t2 )
dt2
Example
Determine the unique solution of the differential equation
dy
= 4t3
dt
which satisfies the condition y(1) = 12.
8 of 1
Lecture 10
It is worth noting that different additional conditions give rise to different solutions
to a given differential equation.
9 of 1
Lecture 10
It is worth noting that different additional conditions give rise to different solutions
to a given differential equation.
Example
Solve the differential equation
d2 y
= 4t subject to the conditions
dt2
9 of 1
Lecture 10
10 of 1
Lecture 10
10 of 1
Lecture 10
10 of 1
Lecture 10
10 of 1
Lecture 10
Lecture 10
Example
Classify the differential equations, specifying the order and type (linear/non-linear).
(a)
(b)
(c)
(d)
(e)
d2 y dy
= t2
dt2
dt
3
d2 y
dy
+ 3t
=
dt2
dt
dx
t = x2
dt
dy
+ cos(y) = 0
dt
dy
+ y2 = 4
dt
11 of 1
Lecture 10
12 of 1
Lecture 10
12 of 1
Lecture 10
12 of 1
Lecture 10
12 of 1
Lecture 10
Ohms Law
The voltage across the resistor is iR where i is the current flowing in the circuit and
R is the (constant) resistance.
12 of 1
Lecture 10
Ohms Law
The voltage across the resistor is iR where i is the current flowing in the circuit and
R is the (constant) resistance.
Lecture 10
q
C
Definition
Current is the rate of change of charge. If q(t) represents the charge on a capacitor
then
dq
i(t) =
dt
13 of 1
Lecture 10
q
C
Definition
Current is the rate of change of charge. If q(t) represents the charge on a capacitor
then
dq
i(t) =
dt
Note
We shall assume that the resistance, capacitance and inductance shall remain
constant for each problem. This means that our differential equations will only have
constant coefficients of the objective function and its derivatives.
13 of 1
Lecture 10
Example
In this RL circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
E
.
Write down a differential equation for the current i and state the initial condition.
14 of 1
Lecture 10
Example
In this RC circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
E
.
Write down a differential equation for the current i and state the initial condition.
15 of 1
Lecture 10
Example
In this LC circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
E
.
Write down a differential equation for the current i and state the initial condition.
16 of 1
Lecture 10
Example
In this LCR circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
E
.
Write down a differential equation for the current i and state the initial condition.
17 of 1
Lecture 11
18 of 1
Lecture 11
18 of 1
Lecture 11
18 of 1
Lecture 11
18 of 1
Lecture 11
Example
Show that y = 3e4t satisfies the differential equation
dy
+ 4y = 0
dt
Example
Show that y = 2 + 4e2t satisfies the differential equation
dy
2y = 4
dt
18 of 1
Lecture 11
19 of 1
Lecture 11
19 of 1
Lecture 11
19 of 1
Lecture 11
19 of 1
Lecture 11
Example
Solve the following differential equation by inspection
2
dx(t)
+ 5x(t) = 0 where x(0) = 6
dt
20 of 1
Lecture 11
Example
Solve the following differential equation by inspection
2
dx(t)
+ 5x(t) = 0 where x(0) = 6
dt
homogeneous
20 of 1
Lecture 11
Example
Solve
dy
(a)
+ 7y = 14
dt
dy
(b) 2 + 5y = 15
dt
21 of 1
Lecture 11
Example
Solve
dy
(a)
+ 7y = 14
dt
dy
(b) 2 + 5y = 15
dt
21 of 1
Lecture 11
Suppose that we have a non-zero constant, A, on the right side of the equation then
we have an example of the type
dy
+ ky = A
dt
Example
Solve
dy
(a)
+ 7y = 14
dt
dy
(b) 2 + 5y = 15
dt
21 of 1
Lecture 11
Suppose that we have a non-zero constant, A, on the right side of the equation then
we have an example of the type
dy
+ ky = A
dt
non-homogeneous
Example
Solve
dy
(a)
+ 7y = 14
dt
dy
(b) 2 + 5y = 15
dt
21 of 1
Lecture 11
Suppose that we have a non-zero constant, A, on the right side of the equation then
we have an example of the type
dy
+ ky = A
dt
non-homogeneous
A
k
Example
Solve
dy
(a)
+ 7y = 14
dt
dy
(b) 2 + 5y = 15
dt
21 of 1
Lecture 11
y(t) = Ae 2 + 3
is called a general solution of the differential equation as all possible solutions
to the equation are of this type.
22 of 1
Lecture 11
y(t) = Ae 2 + 3
is called a general solution of the differential equation as all possible solutions
to the equation are of this type.
To uniquely determine a value for A we need more information such as the
value of y(t) or dy
dt for a given value of t.
22 of 1
Lecture 11
y(t) = Ae 2 + 3
is called a general solution of the differential equation as all possible solutions
to the equation are of this type.
To uniquely determine a value for A we need more information such as the
value of y(t) or dy
dt for a given value of t.
This gives us an initial value problem.
22 of 1
Lecture 11
y(t) = Ae 2 + 3
is called a general solution of the differential equation as all possible solutions
to the equation are of this type.
To uniquely determine a value for A we need more information such as the
value of y(t) or dy
dt for a given value of t.
This gives us an initial value problem.
Example
Solve the initial value problems
dx
(a)
+ 34x = 0
x(0) = 2
dt
dx
(b)
+ 3x = 12
x(0) = 2
dt
22 of 1
Lecture 11
Example
Sketch the graph of
v(t) = 3 + 4et
23 of 1
Lecture 11
Example
Sketch the graph of
v(t) = 3 + 4et
Determine a differential equation which has v(t) as a solution by analysing the
dv
and v(t).
relationship between
dt
23 of 1
Lecture 11
Example
Sketch the graph of
v(t) = 3 + 4et
Determine a differential equation which has v(t) as a solution by analysing the
dv
and v(t).
relationship between
dt
23 of 1
Lecture 11
Example
Sketch the graph of
v(t) = 3 + 4et
Determine a differential equation which has v(t) as a solution by analysing the
dv
and v(t).
relationship between
dt
23 of 1
Lecture 11
Example
Sketch the graph of
v(t) = 3 + 4et
Determine a differential equation which has v(t) as a solution by analysing the
dv
and v(t).
relationship between
dt
23 of 1
Lecture 11
Example
Sketch the graphs of each of the following:
(a) e7t U(t)
(b) 4e7t U(t)
(c) 4e7t U(t)
24 of 1
Lecture 11
Example
In this RL circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
E
.
Determine an expression for the current i if the inductance is L = 0.5 henry and the
resistance is 10, given that
(a) E = 0 volts.
(b) E = 12 volts.
Assume that there is no initial current in the circuit.
25 of 1
Lecture 11
Example
In this RC circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
E
.
Determine an expression for the current i if the capacitance is C = 0.01 Farad and
the resistance is 100, given that
(a) E = 0 volts.
(b) E = 12 volts.
Assume that there is no initial charge on the capacitor.
26 of 1
Lecture 12
dy
d2 y
+ b + cy = f (t)
2
dt
dt
Lecture 12
Recall that differentiating cosh(kt) and sinh(kt) twice is the same as multiplication
by k2 . Thus x(t) = Acosh(kt) + Bsinh(kt) is the general solution of the differential
equation
d2 x(t)
k2 x(t) = 0
dt2
Example
Solve the differential equations
d2 x(t)
1
49x(t) = 0
dt2
d2 x(t)
2
4x(t) = 16 - a non-homogeneous problem
dt2
Note
Problems of this type do not arise in LC circuits. Otherwise we would have a
negative value for the inductance or the capacitance.
28 of 1
Lecture 12
Recall that differentiating cosh(kt) and sinh(kt) twice is the same as multiplication
by k2 . Thus x(t) = Acosh(kt) + Bsinh(kt) is the general solution of the differential
equation
d2 x(t)
k2 x(t) = 0
dt2
Example
Solve the differential equations
d2 x(t)
1
49x(t) = 0
dt2
d2 x(t)
2
4x(t) = 16 - a non-homogeneous problem
dt2
Note
Problems of this type do not arise in LC circuits. Otherwise we would have a
negative value for the inductance or the capacitance.
28 of 1
Lecture 12
Recall that differentiating cos(t) and sin(t) twice is the same as multiplication
by 2 . Thus
x(t) = A cos(t) + B sin(t)
is the general solution of the second order, linear, homogeneous differential
equation
d2 x(t)
+ 2 x(t) = 0
dt2
29 of 1
Lecture 12
Recall that differentiating cos(t) and sin(t) twice is the same as multiplication
by 2 . Thus
x(t) = A cos(t) + B sin(t)
is the general solution of the second order, linear, homogeneous differential
equation
d2 x(t)
+ 2 x(t) = 0
dt2
Example
Solve the differential equations
d2 x(t)
1
+ 16 2 x(t) = 0
dt2
d2 x(t)
2
+ 8x(t) = 16 - a non-homogeneous problem
dt2
29 of 1
Lecture 12
Example
In this LC circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
E
.
Determine an expression for the current i if the capacitance is C = 0.02 Farad and
the inductance is 0.1 henry, given that
(a) E = 0 volts.
(b) E = 12 volts.
Assume that there is no initial charge on the capacitor and no initial current.
30 of 1
Lecture 12
Example
Determine, by inspection, the function x(t) which is the general solution of the
differential equation
d2 x(t)
m
+ kx(t) = 0
dt2
if m = 2 and k = 2 104 . Hence determine the particular solution that satisfies the
initial conditions x(0) = 0 and x0 (0) = 1.
31 of 1
Lecture 12
General LCR circuits with no forcing function (external voltage supply) can be
modelled by second-order linear homogeneous differential equations such as
a
d2 y
dy
+ b + cy = 0
2
dt
dt
32 of 1
Lecture 12
General LCR circuits with no forcing function (external voltage supply) can be
modelled by second-order linear homogeneous differential equations such as
a
d2 y
dy
+ b + cy = 0
2
dt
dt
Note
If y1 (t) and y2 (t) are two solutions of a second-order linear homogeneous
differential equation, such that y1 (t) is not a multiple of y2 (t), then the general
solution of the differential equation is
y(t) = Ay1 (t) + By2 (t)
where A, B are constants.
32 of 1
Lecture 12
Example
Show that y1 = e3t and y2 = e2t both satisfy the second-order linear homogeneous
differential equation:
d2 y dy
6y = 0
dt2
dt
Write down the general solution of this equation.
33 of 1
Lecture 12
Example
Show that y1 = e3t and y2 = e2t both satisfy the second-order linear homogeneous
differential equation:
d2 y dy
6y = 0
dt2
dt
Write down the general solution of this equation.
Example
Determine values of k such that y = ekt is a solution of
d2 y
dy
+ 3 + 2y = 0
2
dt
dt
Hence state the general solution.
33 of 1
Lecture 12
34 of 1
Lecture 12
Definition
The auxiliary equation of the second-order linear homogeneous differential
equation
d2 y
dy
a 2 + b + cy = 0
dt
dt
is
ak2 + bk + c = 0
where y = ekt .
34 of 1
Lecture 12
Example
Determine the auxiliary equations of the following:
d2 y dy
(a)
+y=0
+
dt2
dt
d2 y
(b) 4 2 + 7y = 0
dt
d2 y
dy
(c) 2 2 + 7 3y = 0
dt
dt
d2 y dy
(d)
+
=0
dt2
dt
35 of 1
Lecture 12
36 of 1
Lecture 12
36 of 1
Lecture 12
b b2 4ac
k=
2a
36 of 1
Lecture 12
b b2 4ac
k=
2a
We will deal with the solutions of the quadratic equation based on the value of
the discriminant in three cases:
36 of 1
Lecture 12
b b2 4ac
k=
2a
We will deal with the solutions of the quadratic equation based on the value of
the discriminant in three cases:
Case 1: b2 > 4ac
36 of 1
Lecture 12
b b2 4ac
k=
2a
We will deal with the solutions of the quadratic equation based on the value of
the discriminant in three cases:
Case 1: b2 > 4ac
Case 2: b2 = 4ac
36 of 1
Lecture 12
b b2 4ac
k=
2a
We will deal with the solutions of the quadratic equation based on the value of
the discriminant in three cases:
Case 1: b2 > 4ac
Case 2: b2 = 4ac
Case 3: b2 < 4ac
36 of 1
Lecture 12
37 of 1
Lecture 12
Example
Determine the general solution of
d2 y
dy
7 + 12y = 0
2
dt
dt
37 of 1
Lecture 12
Example
In this LCR circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
R
E
.
Determine an expression for the current i if the inductance is L = 0.1 henry, the
resistance is 14 and C = 0.25 farad, given that E = 0 volts. Assume that the
initial charge on the capacitor is 0.4 coloumb and that there is no initial current.
Sketch the graphs of q(t) and i(t).
38 of 1
Lecture 12
Example
In this LCR circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
R
E
.
Determine an expression for the current i if the inductance is L = 0.1 henry, the
resistance is 14 and C = 0.25 farad, given that E = 0 volts. Assume that the
initial charge on the capacitor is 0.4 coloumb and that there is no initial current.
Sketch the graphs of q(t) and i(t).
Over-damping
If R2 >
4L
then we say that the system is over-damped.
C
38 of 1
Lecture 12
Case 2: b2 = 4ac
If b2 = 4ac then the quadratic formula will yield a unique real value for k. The
value of k thus obtained will allow us to write down two independent solutions:
y1 (t) = ekt and y2 (t) = tekt
and so the general solution of the differential equation will be:
y(t) = Aekt + Btekt
39 of 1
Lecture 12
Case 2: b2 = 4ac
If b2 = 4ac then the quadratic formula will yield a unique real value for k. The
value of k thus obtained will allow us to write down two independent solutions:
y1 (t) = ekt and y2 (t) = tekt
and so the general solution of the differential equation will be:
y(t) = Aekt + Btekt
Example
Determine the auxiliary equation of the differential equation
d2 x
dx
+ 8 + 16x = 0
dt2
dt
(a) Show that e4t is a solution.
(b) Show that te4t is another solution.
(c) Determine the particular solution if
39 of 1
Lecture 12
Example
In this LCR circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
E
.
Determine an expression for the current i if the inductance is L = 0.1 henry, the
1
resistance is 8 and C = 160
farad, given that E = 0 volts. Assume that the initial
charge on the capacitor is 0.2 coloumb and that there is no initial current. Sketch
the graphs of q(t) and i(t).
40 of 1
Lecture 12
Example
In this LCR circuit the switch is closed at t = 0 and a constant voltage E is applied.
.
E
.
Determine an expression for the current i if the inductance is L = 0.1 henry, the
1
resistance is 8 and C = 160
farad, given that E = 0 volts. Assume that the initial
charge on the capacitor is 0.2 coloumb and that there is no initial current. Sketch
the graphs of q(t) and i(t).
Critical-damping
If R2 =
4L
then we say that the system is critically-damped.
C
40 of 1
Lecture 12
In the final case we will encounter the square root of negative numbers. This brings
us into the realm of complex numbers. Consequently we need to recall some
important facts.
Definition
A complex number is an ordered pair of real numbers. We usually denote it as
z = (x, y)
and describe x as the real part of z and y as the imaginary part of z. This is made
explicit as follows:
x = Re(z)
y = Im(z)
We usually denote the set of complex numbers as C and the set of real numbers as
R. We have that
RC
since every real number x can be identified with the complex number (x, 0).
41 of 1
Lecture 12
Definition
We define
j = (0, 1)
This has the property that
j2 = 1
In some scientific texts we have that i is written instead of j, so that i2 = 1.
42 of 1
Lecture 12
Definition
We define
j = (0, 1)
This has the property that
j2 = 1
In some scientific texts we have that i is written instead of j, so that i2 = 1.
Consequently, every complex number can be written as
z = x + jy
42 of 1
Lecture 12
Definition
We define
j = (0, 1)
This has the property that
j2 = 1
In some scientific texts we have that i is written instead of j, so that i2 = 1.
Consequently, every complex number can be written as
z = x + jy
Eulers Formula
ei = cos() + j sin()
42 of 1
Lecture 12
43 of 1
Lecture 12
Example
Show that the general solution of the differential equation in this case will be:
y(t) = eat (A cos(bt) + B sin(bt))
43 of 1
Lecture 12
Example
Determine the general solution of the differential equation
d2 y
+ 16y = 0
dt2
44 of 1
Lecture 12
Example
Determine the general solution of the differential equation
d2 y
+ 16y = 0
dt2
Example
Determine the general solution of the differential equation
d2 y
dy
+ 2 + 4y = 0
dt2
dt
44 of 1
Lecture 12
Example
. E is applied.
In this LCR circuit the switch is closed at t = 0 and a constant voltage
R
E
.
Determine an expression for the current i if the inductance is L = 1 henry, the
resistance is 0.2 and C = 0.05 farad, given that E = 0 volts. Assume that the
initial charge on the capacitor is 0.4 coloumb and that there is no initial current.
Sketch the graphs of q(t) and i(t).
45 of 1
Lecture 12
Example
. E is applied.
In this LCR circuit the switch is closed at t = 0 and a constant voltage
R
E
.
Determine an expression for the current i if the inductance is L = 1 henry, the
resistance is 0.2 and C = 0.05 farad, given that E = 0 volts. Assume that the
initial charge on the capacitor is 0.4 coloumb and that there is no initial current.
Sketch the graphs of q(t) and i(t).
Over-damping
If R2 < 4L
C then we say that the system is under-damped. If R = 0 then we say that
the system is undamped. The motion that ensues is called simple harmonic
motion.
45 of 1