Chapter 2 - Mathematical Modelling
Chapter 2 - Mathematical Modelling
MATHEMATICAL MODELLING
INTRODUCTION
• Differential equations are obtained by utilizing the physical laws of the dynamic system
modelling (1 - 3).
• This approach applies equally well to:
o Mechanical.
o Electrical.
o Fluid.
o Thermodynamic systems.
• The physical laws lead to mathematical models that describe the relationship between
the input and output of dynamic system.
1. Kirchhoff’s voltage law
2. Kirchhoff’s current law
3. Newton’s law
1
LAPLACE TRANSFORM
Where:
ℒ = Laplace transform operator
f(t) = function in time domain
F(s) = function on complex frequency domain 𝑠 = 𝜎 + 𝑗𝜔
• Linearity
ℒ{𝑎 𝑓(𝑡) + 𝑏 𝑔(𝑡)} = 𝑎 ℒ{𝑓(𝑡)} + 𝑏 ℒ{𝑔(𝑡)}
• Differentiation
𝑑𝑓(𝑡)
ℒ{ } 𝑠𝐹(𝑠) − 𝑓(0)
𝑑𝑡
𝑑 2 𝑓(𝑡) 2
ℒ{ ̇
} 𝑠 𝐹(𝑠) − 𝑠𝑓(0) − 𝑓(0)
𝑑𝑡 2
2
Laplace Transform Table
f(t) F(s)
1 𝜕(𝑡) 1 Impulse function
2 1 Step function
𝑢(𝑡)
s
3 1 Ramp function
𝑡 𝑢(𝑡)
s2
4 n!
𝑡 𝑛 𝑢(𝑡)
s n +1
5 1 Exponential
𝑒 −𝑎𝑡 𝑢(𝑡)
s+a
6 Sine
sin 𝜔𝑡 𝑢(𝑡)
s +2
2
7 s Cosine
cos 𝜔𝑡 𝑢(𝑡)
s +2
2
3
Inverse Laplace Transform
1 𝜎+𝑗𝜔
𝑓(𝑡) = ∫ 𝐹(𝑠)𝑒 +𝑠𝑡 𝑑𝑠
2𝜋𝑗 𝜎−𝑗𝜔
Partial fraction expansion is used to find the inverse Laplace Transform of a complicated
function. We can convert the function to a sum of simpler terms for which we know the inverse
N ( s)
Laplace Transform. If F ( s ) = , where the order of N(s) is less than D(s), then a partial
D( s)
fraction expansion can be made.
1. The numerator must be of lower degree than the denominator. If it is not, then we
first divide out.
2. Factorize the denominator into its prime factors. These determine the shapes of the
partial fractions.
𝐴
3. A linear factor (𝑠 + 𝑎) gives a partial fraction 𝑠+𝑎 where 𝐴 is a constant to be
determined.
𝐴 𝐵
4. A repeated factor (𝑠 + 𝑎)2 gives (𝑠+𝑎) + (𝑠+𝑎)2
Example 1
𝑠 3 + 2𝑠2 + 6𝑠 + 7
𝐹1 (𝑠) =
𝑠2 + 𝑠 + 5
N(s) must be divided by D(s) successively until the result has a remainder whose numerator is
of order less than its denominator. Taking the inverse Laplace transform, we obtain:
2
𝐹1 (𝑠) = 𝑠 + 1 +
𝑠2 + 𝑠 + 5
𝑑 𝜕𝑡 2
𝑓1 (𝑡) = + 𝜕𝑡 + ℒ −1 [ 2 ]
𝑑𝑡 𝑠 +𝑠 +5
We will consider two cases and show that F(s) can be expanded into partial fraction:
Case 1:
Roots of denominator F(s) are real and distinct.
4
Case 2:
Roots of denominator F(s) are real and repeated.
Case 3:
Roots of denominator F(s) are complex conjugate.
2
𝐹(𝑠) =
(𝑠 + 1)(𝑠 + 2)
Solution: We write partial fraction expansion as a sum of terms where each factor of the
original denominator forms the denominator of each term, and constants, called residues form
the numerators.
𝐴 𝐵
𝐹(𝑠) = +
𝑠+1 𝑠+2
2 𝐵
𝐹 (𝑠 ) = =𝐴+ (−1 + 1)
(−1 + 2) (−1 + 2)
2
𝐹 (𝑠 ) = =𝐴+ 0
1
∴𝐴=2
Find B with the similar approach, letting 𝑠 + 2 = 0 and s = -2, we get B = -2.
Thus,
2 𝐴 𝐵
𝐹 (𝑠 ) = (𝑠 + 2) = (𝑠 + 2) + (𝑠 + 2)
(𝑠 + 1)(𝑠 + 2) (𝑠 + 1) (𝑠 + 2)
2 𝐴
𝐹 (𝑠 ) = = (−2 + 2) + 𝐵
(−2 + 1) (−2 + 1)
2
𝐹(𝑠) = = 0+𝐵
−1
∴ 𝐵 = −2
5
Taking inverse Laplace transform, we get
2 2
𝐹(𝑠) = −
𝑠+1 𝑠+2
2
𝐹1 (𝑠) =
(𝑠 + 1)(𝑠 + 2)2
2 𝐴 𝐵 𝐶
𝐹1 (𝑠) = = + +
(𝑠 + 1)(𝑠 + 2)2 (𝑠 + 1) (𝑠 + 2) 2 (𝑠 + 2)
2 𝐴 𝐵 𝐶
𝐹1 (𝑠) = (𝑠 + 1) = (𝑠 + 1) + (𝑠 + 1) + (𝑠 + 1)
(𝑠 + 1)(𝑠 + 2)2 (𝑠 + 1) (𝑠 + 2) 2 (𝑠 + 2)
∴𝐴=2
2 𝐴 𝐵 𝐶
𝐹1 (𝑠) = (𝑠 + 2)2 = (𝑠 + 2)2 + (𝑠 + 2)2 + (𝑠 + 2)2
(𝑠 + 1)(𝑠 + 2)2 (𝑠 + 1) (𝑠 + 2) 2 (𝑠 + 2)
2 (𝑠 + 2)2 𝐴
𝐹1 (𝑠) = = + 𝐵 + (𝑠 + 2)𝐶
(𝑠 + 1) (𝑠 + 1)
(1.1)
2 (𝑠 + 2)2 𝐴
= + 𝐵 + (𝑠 + 2)𝐶
(𝑠 + 1) (𝑠 + 1)
−2 (𝑠 + 2)𝑠𝐴
2 = +𝐶
(𝑠 + 1) (𝑠 + 1)2
6
2 2 2 2
𝐹1 (𝑠) = = − −
(𝑠 + 1)(𝑠 + 2)2 (𝑠 + 1) (𝑠 + 2)2 (𝑠 + 2)
3
𝐹1 (𝑠) =
𝑠(𝑠2 + 2𝑠 + 5)
3
Using the previous way, 𝐴 = 5 can be found. Multiply Eq (1.2) by the lowest common
denominator,
3 6
0 = (𝐵 + ) 𝑠 2 + (𝐶 + ) 𝑠
5 5
Balancing coefficients,
3 6
𝐵=− , 𝐶= −
5 5
3 3 −𝑡 1
𝑓 (𝑡 ) = − 𝑒 (cos 2𝑡 + sin 2𝑡)
5 5 2
DIFFERENTIAL EQUATIONS
The differential equations are transformed into algebraic equations, which are easier to solve.
The Laplace transformation for a function of time, f(t) is
∞
𝐹 (𝑠) = ∫ 𝑓 (𝑡)𝑒 −𝑠𝑡 𝑑𝑡 = ℒ{𝑓(𝑡)}
0
𝑑𝑦
If 𝑓 (𝑡) = , then ℒ {𝑓(𝑡)}, then
𝑑𝑡
𝑑𝑦
ℒ{𝑓(𝑡)} = ℒ { } = 𝑠ℒ{𝑦(𝑡)} − 𝑦(0)
𝑑𝑡
7
𝑑2 𝑦(𝑡) 𝑑𝑦(0)
Similarly, ℒ { } = 𝑠ℒ{𝑦(𝑡)} −
𝑑𝑡 2 𝑑𝑡
𝑑2 𝑦(𝑡) 𝑑𝑦(0)
Thus, ℒ { } = 𝑠 2 ℒ{𝑦(𝑡)} − 𝑠𝑦(0) −
𝑑𝑡 2 𝑑𝑡
𝑑2𝑥
𝑎 2 + 𝑏𝑥 = 𝑟(𝑡)
𝑑𝑡
𝑑2𝑥
ℒ [𝑎 2 ] = 𝑎[𝑠 2 𝑋(𝑠)]
𝑑𝑡
𝑑𝑥
ℒ [𝑏 ] = 𝑏𝑋(𝑠)
𝑑𝑡
ℒ 𝑟(𝑡)] = 𝑅(𝑠)
[
𝑅(𝑠)
∴ 𝑋 (𝑠 ) =
𝑎𝑠 2 + 𝑏
𝑅(𝑠)
𝑥 (𝑡) = ℒ −1 [ ]
𝑎𝑠 2 + 𝑏
8
EXAMPLE 2.1
Given the following differential equation, solve for y(t) if all initial conditions are zero. Use
the Laplace transform.
𝑑2𝑦 𝑑𝑦
+ 12 + 32𝑦 = 32 𝑢(𝑡)
𝑑𝑡 2 𝑑𝑡
Solution:
32
𝑠 2 𝑌 (𝑠) + 12𝑠 𝑌 (𝑠) + 32 𝑌 (𝑠) =
𝑠
32
(𝑠 2 + 12𝑠 + 32)𝑌 (𝑠) =
𝑠
32
𝑌 (𝑠 ) =
𝑠 (𝑠 2
+ 12𝑠 + 32)
32
𝑌 (𝑠 ) =
𝑠(𝑠 + 4)(𝑠 + 8)
32
𝐴= | =1
(𝑠 + 4)(𝑠 + 8) 𝑠 →0
32
𝐵= | = −2
𝑠(𝑠 + 8) 𝑠 →−4
32
𝐶= | = −1
𝑠(𝑠 + 4) 𝑠 →−8
1 2 1
𝑌 (𝑠 ) = − +
𝑠 (𝑠 + 4) (𝑠 + 8)
9
TRANSFER FUNCTION
A mathematical function called transfer function is inside each block. So, we can develop the
mathematical model to do the analysis and design.
In general, a physical system that can be represented by a linear, time invariant differential
equation can be modeled as a transfer function. Transfer function can be used to represent
electrical networks, translational mechanical systems, rotational mechanical systems, and
electromechanical systems.
Begin with,
𝑎𝑛 𝑠 𝑛 𝐶 (𝑠) + 𝑎𝑛−1 𝑠 𝑛−1 𝐶 (𝑠) + ⋯ + 𝑎0 𝐶 (𝑠) = 𝑏𝑚 𝑠 𝑚 𝑅(𝑠) + 𝑏𝑚−1 𝑠 𝑚−1 𝑅(𝑠) + ⋯ + 𝑏0 𝑅(𝑠)
Form the ratio of output transform, C(s) over input transform, R(s)
𝐶(𝑠) 𝑏𝑚 𝑠 𝑚 + 𝑏𝑚−1 𝑠 𝑚−1 + ⋯ + 𝑏0
(
=𝐺 𝑠 =)
𝑅(𝑠) 𝑎𝑛 𝑠 𝑛 + 𝑎𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑎0
10
Example 2.2
𝑑𝑐(𝑡)
+ 2𝑐 (𝑡) = 𝑟(𝑡)
𝑑𝑡
Solution:
Then, find the response, 𝑐(𝑡), to an input, 𝑟(𝑡) = 𝑢(𝑡), a unit step, assuming zero initial
condition.
1
Since 𝑟(𝑡) = 𝑢(𝑡), 𝑅(𝑠) = 𝑠 .
1
𝐶 (𝑠 ) = 𝑅 (𝑠 )𝐺 (𝑠 ) =
𝑠(𝑠 + 2)
Using partial fraction expansion,
1/2 1/2
𝐶 (𝑠 ) = −
𝑠 𝑠+2
Taking inverse Laplace,
1 1
𝑐(𝑡) = − 𝑒 −2𝑡
2 2
We will be applying transfer function to the mathematical modelling of electric circuit. The
circuit consists of passive linear components (resistor, capacitor, inductor).
Guiding principles: Kirchhoff’s Law
i. analyse on KCL/KVL.
ii. from analysis, write the differential equations.
iii. take Laplace transform & solve the transfer function.
11
Table 2.2 : Electrical Properties
Simple RC Network
Example 2.3
𝑉𝑐 (𝑠)
Obtain the transfer function, for the following RC network.
𝑉(𝑠)
+
v(t) i(t) C vc(t)
-
Solution:
Using mesh analysis,
𝑑𝑞
𝑖 (𝑡 ) = , q(t) = 𝐶𝑉𝑐 (𝑡)
𝑑𝑡
1
R(i(t) + ∫ 𝑖 (𝑡)𝑑𝑡 = 𝑉(𝑡)
𝐶
𝑑𝑞 1
𝑅 + 𝑞(𝑡) + 𝑉(𝑡)
𝑑𝑡 𝐶
𝑑𝑉𝑐 1
𝑅𝐶 + (𝐶𝑉𝑐 ) = 𝑉(𝑡)
𝑑𝑡 𝐶
𝑑𝑉𝑐
𝑅𝐶 + 𝑉𝑐 = 𝑉(𝑡)
𝑑𝑡
12
Convert into s domain,
𝑠𝑅𝐶𝑉𝑐 + 𝑉𝑐 = 𝑉(𝑠)
𝑉𝑐 [𝑠𝑅𝐶 + 1] = 𝑉 (𝑠)
𝑉𝑐 (𝑠) 1
∴ =
𝑉(𝑠) 𝑠𝑅𝐶 + 1
Example 2.4
𝑉𝑐 (𝑠)
Obtain the transfer function, for the following RC network.
𝑉(𝑠)
L
R
+
v(t) i(t) C vc(t)
-
Solution:
i) Simple Circuits via Mesh Analysis in time domain
Summing the voltages around the loop, assuming zero initial conditions;
𝑑𝑖(𝑡) 1 𝑡
𝐿 + 𝑅𝑖 𝑡 + ∫ 𝑖 (𝜏)𝑑𝜏 − 𝑣(𝑡) = 0
( )
𝑑𝑡 𝐶 0
𝑑𝑞(𝑡)
𝑖 (𝑡 ) =
𝑑𝑡
𝑑 2 𝑞(𝑡) 𝑑𝑞(𝑡) 1
𝐿 +𝑅 + 𝑞(𝑡) = 𝑣(𝑡)
𝑑𝑡 2 𝑑𝑡 𝐶
13
Taking Laplace,
(𝑠 2 𝐿𝐶 + 𝑠𝑅𝐶 + 1)𝑉𝑐 (𝑠) = 𝑉(𝑠)
𝑉𝑐 (𝑠) 1/𝐿𝐶
=
𝑉(𝑠) 𝑠 2 + 𝑅 𝑠 + 1
𝐿 𝐿𝐶
1
For capacitor, 𝑉 (𝑠) = 𝑠𝐶 𝐼 (𝑠)
For resistor, 𝑉(𝑠) = 𝑅𝐼(𝑠)
For inductor, 𝑉 (𝑠) = 𝑠𝐿𝐼(𝑠)
Thus,
𝑉𝑐 (𝑠) 1
=
𝑉(𝑠) 𝑠𝐶(𝑠𝐿 + 𝑅 + 1 )
𝑠𝐶
𝑉𝑐 (𝑠) 1
=
𝑉(𝑠) 𝐿𝐶(𝑠 2 + 𝑅 𝑠 + 1 )
𝐿 𝐿𝐶
Transfer function using current law and summing currents flowing from nodes.
Assume that currents leaving the node are positive, and currents entering the node
are negative.
𝑉(𝑠) − 𝑉𝑐 𝑉𝑐
− =0
𝑠𝐿 + 𝑅 1
𝑠𝐶
𝑉(𝑠) − 𝑉𝑐 𝑉𝑐
− =0
𝑠𝐿 + 𝑅 1
𝑠𝐶
𝑉 (𝑠) − 𝑉𝑐
− 𝑠𝐶𝑉𝑐 = 0
𝑠𝐿 + 𝑅
𝑉 (𝑠) = (1 + 𝑠 2 𝐶𝐿 + 𝑠𝑅𝐶)𝑉𝑐
𝑉𝑐 1
∴ = 2
𝑉(𝑠) 1 + 𝑠 𝐶𝐿 + 𝑠𝑅𝐶
Rearrange,
𝑉𝑐 1
∴ = 2
𝑉(𝑠) 𝑠 𝐶𝐿 + 𝑠𝑅𝐶 + 1
1
𝑉𝑐 𝐿𝐶
=
𝑉(𝑠) 𝑠 2 + 𝑠 𝑅 + 1
𝐿 𝐿𝐶
15
iv) Simple Circuits via Voltage Division
In summary 4 different methods can be used to obtain the transfer function of simple circuits
1) Differential equation derivation using KVL
2) Using mesh analysis with Laplace transform (without writing differential equation)
3) Nodal analysis
4) Voltage divider/division
16
EXERCISE
1 2 1
i. F(s) = − s vi. F(s) = − 𝑠2 + 𝑠+1
1 6
ii. F(s) = s−5 vii. F(s) = (s−3)4
3 10 4
iii. F(s) = s+2 viii. F(s) = 𝑠2+25 + s−3
3
iv. F(s) = − 4s
s+1
v. F(s) = 𝑠2 +4
s+7 3s+9
1. 6.
s2 −7s+10 s2 +8s+12
8s−28 3s3 −s2−13s−13
2. 7.
s2 −6s+8 s2 −s−6
10s+37 2s +3s2−54s+50
3
3. 2
s +3s−28 8. s2 +2s−24
2s2 +18s+31 10
4. 9.
s2 +5s+6 s(s+2)(s+3)2
2s2 +6s−35
5. s2 −s−12
Q4 Find the response, y(t) corresponding to the differential equation with r(t) is a unit step.
𝑑2𝑦 𝑑𝑦
2
+4 + 3𝑦 = 2𝑟(𝑡)
𝑑𝑡 𝑑𝑡
2𝑠 + 1
𝐺 (𝑠 ) =
𝑠 2 + 6𝑠 + 2
17
Q6 Find the ramp response for a system whose transfer function is:
𝑠
𝐺 (𝑠 ) =
(𝑠 + 4)(𝑠 + 8)
Q7 Find the transfer function, G(s) = C(s)/R(s) corresponding to the differential equation.
Find the expression for the transfer function of the system, Y(s) / X(s).
𝐶(𝑠)
Q9 Find the transfer function, 𝐺 (𝑠) = 𝑅(𝑠), corresponding to the differential equation,
Q11 Write the differential equation for the system shown in Figure 2.7.
Figure 2.7
Q12 A system is represented by the following differential equation with r(t) as the input, and
x(t) as the output. Assume zero initial condition.
𝑑𝑥
+ 2𝑥(𝑡) = 𝑟(𝑡)
𝑑𝑡
18
(b) Find output x(t) if the input R(s) is given by;
10
𝑅(𝑠) =
𝑠−9
Q13 A system is represented by the following differential equation with r(t) as the input, and
x(t) as the output.
𝑑2𝑥 𝑑𝑥
+ 5 + 6𝑥 = 𝑟(𝑡)
𝑑𝑡 2 𝑑𝑡
4
𝑅(𝑠) =
𝑠
Q14 A system is represented by the following transfer function with r(t) as the input, and x(t)
as the output.
4(𝑠 + 50)
𝐺(𝑠) =
𝑠2 + 30𝑠 + 200
1
𝑅(𝑠) =
𝑠
Q15 A system is represented by the following differential equation with r(t) as the input, and
x(t) as the output.
𝑑2𝑦 𝑑𝑦
2
+6 + 8𝑦(𝑡) = 𝑓(𝑡)
𝑑𝑡 𝑑𝑡
1
𝐹(𝑠) =
𝑠
19