bct module 01
TRANSCRIPT
-
7/29/2019 BCT Module 01
1/38
Lecture Notes
BASIC CONTROL THEORY
Module 1Modelling of Dynamic Systems
(Linear system modelling, ODEs - continuous-time models, Laplace transform)
AUGUST 2005
Prepared by Dr. Hung Nguyen
-
7/29/2019 BCT Module 01
2/38
i
TABLE OF CONTENTS
Table of Contents..............................................................................................................................i
List of Figures..................................................................................................................................ii
List of Tables ................................................................................................................................. iii
References ......................................................................................................................................iv
Objectives ........................................................................................................................................v
1. Mathematical Modelling of Dynamic Systems ........................................................................... 1
2. Continuous Time Models Ordinary Differential Equations .....................................................1
3. General Modelling Principles......................................................................................................23.1 Mechanical Systems .............................................................................................................2
Example 1 A Simple Pendulum..............................................................................................2
Example 2 A Mass-Damper System.......................................................................................2
3.2 Liquid Level Storage Systems ..............................................................................................4
Example 3 A Liquid Level Storage System ........................................................................... 43.3 Electrical Systems.................................................................................................................7
Example 4 Closed-Loop RLC Circuit....................................................................................7
4. Review of Laplace Transform .....................................................................................................8
4.1 Laplace Transform ................................................................................................................8
4.2 Laplace Transform Theorems .............................................................................................10
4.3 Applications of Laplace Transform.....................................................................................13Example 5.............................................................................................................................13Example 6.............................................................................................................................15
Example 7.............................................................................................................................16Example 8.............................................................................................................................17
Example 9.............................................................................................................................19
Example 10...........................................................................................................................19
Example 11...........................................................................................................................20
Example 12...........................................................................................................................21
4.4 Partial Fraction Expansion with MATLAB ........................................................................23
Example 13...........................................................................................................................23
Example 14...........................................................................................................................24Summary of Module 7...................................................................................................................26
Exercises........................................................................................................................................26
Appendix Numerical Integration Methods.................................................................................30
Sample Program in MATLAB ..................................................................................................31
-
7/29/2019 BCT Module 01
3/38
ii
LIST OF FIGURES
Figure 1 ...........................................................................................................................................3
Figure 2 ...........................................................................................................................................4
Figure 3 ...........................................................................................................................................4
Figure 4 ...........................................................................................................................................7
Figure 5 .........................................................................................................................................17
Figure 6 .........................................................................................................................................20
Figure 7 .........................................................................................................................................22
Figure 8 .........................................................................................................................................26Figure 9 .........................................................................................................................................26
Figure 10........................................................................................................................................27
Figure 11........................................................................................................................................27
Figure 12........................................................................................................................................28
Figure 13........................................................................................................................................28
Figure 14........................................................................................................................................28
Figure 15........................................................................................................................................29
Figure A.1 ...................................................................................................................................... 32
-
7/29/2019 BCT Module 01
4/38
iii
LIST OF TABLES
Table 1 ...........................................................................................................................................2
Table 2 ...........................................................................................................................................9
Table 3 .........................................................................................................................................11
-
7/29/2019 BCT Module 01
5/38
iv
REFERENCES
Kamen, Edward and Heck, Bonnie S. (1997), Fundamentals of Signals and Systems Using
MATLAB, Englewood Cliffs, New Jersey, USA.
Kou, Benjamin C. (1995),Automatic Control Systems, Prentice-Hall International Inc., Upper
Saddle River, New Jersey, USA.
Ogata, Katsuhiko (1997),Modern Control Engineering, 3rd
Edition, Prentice-Hall InternationalInc., Upper Saddle River, New Jersey, USA.
Richards, R.J. (1993), Solving in Control Problems, Longman Group UK Ltd, Harlow, Essex,
UK.
Seborg, Dale E., Edgar, Thomas F. and Mellichamp, Duncan A. (2004), Process Dynamics and
Control, 2nd
Edition, John Wiley & Sons, Inc., Hoboken, New Jersey, USA.
Taylor, D.A. (1987),Marine Control Practice, Anchor-Brendon Ltd, Tiptree, Essex, UK.
-
7/29/2019 BCT Module 01
6/38
v
AIMS
1.0 Explain principles of modelling linear systems, methods of representing dynamic systems interm of mathematics and solving ordinary differential equations.
LEARNING OBJECTIVES
1.1 Explain the way to use ordinary differential equations to model dynamic systems and
principles of modelling.
1.2 Apply physical laws to generate differential equations for certain systems such as mechanicalsystems, liquid tank systems and electrical systems.
1.3 Explain Laplace transform, Laplace transform theorems and inverse Laplace transform.
1.4 Apply Laplace transform for solution of ordinary differential equations.
-
7/29/2019 BCT Module 01
7/38
1
1. Mathematical Modelling of Dynamic Systems
In order to analyse and design a control system knowledge of its behaviour is required. This
behaviour will be considered in a mathematical sense and a system description using
mathematical terms is therefore required. The relationships between the variable quantities in s
system will then form what is called a mathematical model of the system. These mathematical
models are usually derived from applications of the laws of physics, e.g. Newtons laws, laws of
energy and momentum conservation. The way to find a mathematical model of a system is calledmodelling.
In studying control systems a mathematical model of a dynamic system is defined as a set of
equations that represent the dynamics of the system accurately or, at leat, fairy well. Note that
mathematical model is not unique to a giving system. A system may be represented in manydifferent ways and, therefore, may have many mathematical models, depending on ones
perspectives.
The dynamics of many systems, whether they are mechanical, electrical, thermal, pneumatic,hydraulic, and so on, may be described in terms of ordinary differential equations (continuous
time systems) or difference equations (discrete time systems). In the subject, only linear system
modelling is considered.
2. Continuous Time Models - Ordinary Differential Equations
A dynamic system is represented by an ordinary differential equation which is constructed based
on the physical phenomenon related to the process in the system. Behaviour of characteristics of
the system will be analysed based on solutions of the ordinary differential equation. In general, afirst order differential equation is of the following form:
( )t,u,yfy = (1)
where u, y, and t are input, output and time, respectively. A second order differential equation isof the following general form:
( )t,u,y,yfy = (2a)
Higher order differential equations can be expressed in the following form:
( ) ( ) ( ) ( ) ( ) ( ) ( )( )t,u,u,,u,u,y,y,,y,yfy 11mm12n1nn = (2b)
In control engineering, the more convenient form of a general ODE, in which the left-handed side
consists of output(s) and the right-handed side consists of input(s), can be expressed by
( ) ( ) ( ) ( ) ( ) ( ) ububububyayayaya 01
1
1m
1m
m
m0
1
1
1n
1n
n
n ++++=++++
(2c)
-
7/29/2019 BCT Module 01
8/38
2
Solutions of many ordinary differential equations can be found by the classical mathematical
methods. High memory and fast speed computers and high performance programming languages,
however, allow solutions of difficult differential equations to be found by numerical methods.
3. General Modelling Principles
Modelling is very important for analysis and diagnostics of desired control systems. Modelling isbased on physical laws such as Newtons laws, law of conservation of energy, law of
conservation of mass etc. The following table summarizes general modelling principles (D.E
Seborg et al., 2004)
Table 1 A systematic approach for developing dynamic models
Following examples illustrate modelling of linear systems.
3.1 Mechanical Systems
Mechanical systems include a very wide range of everyday items which may frequently be
reduced to a standard first or second order model. In combination with electrical components
mechanical system give rise in turn to electromechanical systems, e.g. motors and generators.
The following examples illustrate mechanical systems.
Example 1 Simple pendulum
By laws of mechanics, the motion of a simple pendulum in Figure 1 can be expressed by the
following second order differential equation.
1. State the modelling objectives and the end use of the model. Then determine the requiredlevels of model detail and model accuracy.
2. Draw schematic diagram of the process and label all process variables.
3. List all of the assumptions involved in developing the model. Try to be parsimonious:the model should be no more complicated than necessary to meet the modelling
objectives.
4. Determine whether spatial variations of process variables are important. If so, a partialdifferential equation model will be required.
5. Write appropriate conservation equations (mass, component, energy, and so forth).
6. Introduce equilibrium relations and other algebraic equations (from thermodynamics,transport phenomena, chemical kinetics, equipment geometry, etc.).
7. Perform a degrees of freedom analysis to ensure that the model equations can be solved.
8. Simplify the model. It is often possible to arrange the equations so that the outputvariables appear on the left side and the input variables appear on the right side. This
model form is convenient for computer simulation and subsequent analysis.
9. Classify inputs as disturbance variables or as manipulated variables.
-
7/29/2019 BCT Module 01
9/38
3
)t(Lx)t(sinMgLdt
)t(dI
2
2
=+
(3)
where g is the gravity constant and I is the moment of inertia given by I = M(L2).
The equation (3) is nonlinear. The linear differential equation for the simple pendulum can be
constructed as follows. If the magnitude )t( of the angle )t( is small, the )t(sin sin is
approximately equal to )t( , the above nonlinear equation can be approximated by the following
linear differential equation.
)t(Lx)t(MgLdt
)t(dI 2
2
=+
(4)
or
)t(xI
L)t(
I
MgL
dt
)t(d2
2
=+
(5)
The representation (4) or (5) is called a small-signal model since it is a good approximation to the
given system if )t( is small. It is possible to derive an explicit expression for the output )t( of
the small-signal model.
End of Example 1
Example 2 Mass-damper systems
Figure 2 shows a simple mass-damper system. A force is applied directly to the mass which is
separated from a fixed rigid surface by a light damper with damping coefficient . If the systemis initially at rest in each case, derive the relationship between the movement of the mass and the
independent variable which is the forcing input.
Figure 1 Simple pendulum
x(t)
Mgsin (t)Mg
L
-
7/29/2019 BCT Module 01
10/38
4
Figure 2 Forced mass-damper system
For the configuration in Figure 2, equating net applied forces to the acceleration force on the
mass, or using the dAlemberts principle, gives the dynamic equation.
For applied external force = P with damping force = dt/dx the equation of motion is
2
2
dt
xdm
dt
dxP = (6)
or
m
P
dt
dx
mdt
xd2
2
=
+ (7)
End of Example 2
3.2 Liquid Level Storage Systems
Example 3 Liquid Level Storage Model
A typical liquid storage process is shown in Figure 3 where qi and qo are volumetric inlet and
outlet flow rates, respectively.
Figure 3 Liquid level storage system
m
P
x
h
qo
qi
V
R
Cross-sectional area A
-
7/29/2019 BCT Module 01
11/38
5
A mass balance yields:
( )oi qqdt
Vd
=
(8)
Assume that liquid density is constant and the tank is cylindrical with cross-sectional area A.
The volume of liquid in the tank can be expressed as V = Ah, where h is the liquid level (or head).
The above equation becomes
oi qqdt
dhA = (9)
This equation appears to be a volume balance. However, in general, volume is not conserved for
fluids. This result occurs in this example due to the constant density consumption. There are threeimportant variations of the liquid storage process:
1. The inlet or outlet flow rates might be constant; for example, exit flow rate q might be keptconstant by a constant-speed, fixed-volume (metering pump). An important consequence of this
configuration is that the exit flow rate is then completely independent of liquid level over a wide
range of conditions. Consequently, q = q , where q is the steady state value. For this situation,
the tank operates essentially as a flow integrator.
2. The tank exit line may function simply as a resistance to flow from the tank (distributed along
the entire line), or it may contain a valve that provides significant resistance to flow at a single
point. In the simplest case, the flow may be assumed to be linearly related to the driving force,the liquid level, i.e.
h = qR (10)
where R is the resistance of the line (m-2s). Rearranging (10) gives the following flow-head
equation:
hR
1q = (11)
Substituting this into equation (9) give the first-order differential equation:
hR
1q
dt
dhA i = (12)
or
iqhR
1
dt
dhA =+ (13a)
This model shows the relationship between the level (h) and the inlet flow rate (qi).
-
7/29/2019 BCT Module 01
12/38
6
3. A more realistic expression for flow rate q can be obtained when a fixed valve has been placed
in the exit line and turbulent flow can be assumed. The driving force for flow through the valve is
the pressure drop P .
aPPP = (13b)
where P is the pressure at the bottom of the tank and Pa is the pressure at the end of the exit line.It is assumed that Pa is the ambient pressure. If the valve is considered to be an orifice, a
mechanical every balance, or Bernoulli equation can be used to derive the following relation.
= a
PPkq (13c)
where k is a constant. The value of k depends on the particular valve and the valve setting (howmuch it is open).
The pressure P at the bottom of the tank is related to liquid level h by a force balance,
hg
gPP
c
a
+= (13d)
where the acceleration of gravity g and conversion factor gc are constants. Substituting (13c) and
(13d) into (9) yield the dynamic model as follows.
hKqdt
dhA i = (13e)
where K = cg/gk . This model is nonlinear due to the square root term.
The liquid storage process discussed above could be operated by controlling the liquid level in
the tank or allowing the level to fluctuate without attempting to control it. For the later case
(operation as a surge tank), it may be of interest to predict whether the tank would over flow or
run dry for particular variations in the inlet and outlet flow rates. Thus, the dynamics of the
process may be important even when automatic control is not utilized.
End of Example 3
-
7/29/2019 BCT Module 01
13/38
7
3.3 Electrical Systems
An electrical circuit or network is another type of physical system. It is comprised of resistors,
capacitors and inductors, and usually one or more energy sources such as a battery or generator.
Figure 4 Electrical systems: (a) passive circuit element relationships, (b) closed-loop electrical
circuit
Example 4 Close-loop electrical circuit
The resistors, inductors and capacitors in a circuit are considered passive elements and theircurrent-to-voltage relationships are shown in Figure 4(a). The active electrical elements can beconsidered to exist as voltage sources or current sources, where the voltage or current is
considered to be constant throughout load changes. In analysing or determining the mathematical
model of an electrical circuit, use is made of Kirchhoffs first law which states that the algebraic
sum of the voltages around a closed loop is zero. Consider the circuit shown in Figure 4(b):
0vvvv CLr =++ (14)
or
vidtC1
dtdiLiR =++ (15)
Depending upon the variable of interest, the above expression may be rearranged in a variety of
forms. Use can be made of the relationship, current i = dq/dt, where q is the electrical chargeaccumulating on a capacitor, if it were required to remove the integral from the expression.
End of Example 4
R
vi rr = , Riv rr =
vr
R
vL
vC
L
C
dt
diLv LL = ,
dt
diLv LL =
dtiC
1v CC = , dt
dvCi CC =
vr
R
vL
vC
L
C
v
i
b
a
-
7/29/2019 BCT Module 01
14/38
8
4. Review of Laplace Transform
4.1 Laplace Transform
Differential equations or mathematical models can be produced to represent all or part of acontrol system. The system response will vary according to the input received and, in order todetermine this response, the differential equations must be solved. The form of the solution, sincetime is often the independent variable, will usually include two terms. These are the steady stateand transient solutions. The steady state solution is obtained when all the initial conditions arezero. The transient solution represents the effects of the initial conditions. Both of these parts ofthe solution must be examined with respect to control systems. Classical mathematical techniquescreate complex solutions for linear differential equations beyond first-order. Use can be made ofthe Laplace transform technique to simplify the mathematics and also provide a solution in thetwo-term form that is required. Transforming, in this situation, involves changing differentialequations into an algebraic equation in some new quality. A useful analogy can be made to theuse of logarithms where numbers are converted to a different form so that multiplication, division,raising, to a power, etc., become addition, substraction or simple multiplication. At the end ofthese computations the number obtained is inverse transformed or antilogged to return to theoriginal system of numbers. It should be noted that the Laplace transform can only be used withconstant coefficient linear differential equations. However, only this type of equation will beconsidered (Taylor, D.A., 1987).
The Laplace transform is one of the mathematical tools used for the solution of linear ordinarydifferential equation. In comparison with the classical method of solving linear differentialequations, the Laplace transform method has the following two attractive features below.
Homogeneous equation and the particular integral of the solution are obtained in oneoperation.
The Laplace transform converts the differential equation into an algebraic equation in s. Itis then possible to manipulate the algebraic equation by simple algebraic rules to obtainthe solution in the s-domain. The final solution is obtained by taking the inverse Laplacetransform.
As a result of Laplace transformation, a function of time, f(t), becomes a function of a new-domain, F(s). Upper case letters are always used for the transformed function. The quantity s is a
complex and takes the form, s = + j where (sigma) and (omega) are real numbers and j= 1 . The operational symbol indicating a transform is L. The actual transformation involvesmultiplying the function, f(t), by the e-st and then integrating the product with respect to time inthe interval t = 0 to t = , i.e.
==0
st )s(Fdte)t(f)}t(f{L (16)
The function f(t) must be real and continuous over the time interval considered, otherwise the
Laplace transform cannot be used.
-
7/29/2019 BCT Module 01
15/38
9
The inverse transform is indicated by the operator L-1
such that
)}s(F{L)t(f 1= (17)
It is usual to employ tables of transform pairs for f(t) and the corresponding F(s). A number of
examples will, however, be provided to indicate the Laplace transform technique (Table 2).
Table 2 Some Laplace transform pairs
Time function f(t) Laplace transform, F(s)
Unit impulse, t 1
Unit step, 1
s
1
Unit ramp, t2s
1
nth order ramp, tn1ns
!n+
Exponential decay, te
+s
1
Exponential rise, te1 )s(s +
Exponential t, tte 2)s(
1
+
Sin t 22
2
s +
Cos t +2s
s
Obtain the Laplace transforms of the functions
1) f(t) = A
3) f(t) = 13) f(t) = At
4) f(t) = tAe
assume f(t) = 0 for t < 0 in all cases.
1) f(t) = A, i.e. a step function of magnitude A.
|0
st
0
st
e
1
s
AdtAe)}t(f{L
== (18)
-
7/29/2019 BCT Module 01
16/38
10
This step function is undefined at t = 0, but
0dtAe
0
0
st =
+
(19)
Thus,
)s(Fs
A)}t(f{L == (20)
3) f(t) = 1, i.e. a unit step function.
)s(Fs
1
e
1
s
1dte)}t(f{L |
0
st
0
st
====
(21)
3) f(t) = At, i.e. a ramp function
)s(Fs
Adte
s
Adt
s
Ae
s
eAtdtAte)}t(f{L
2
0
st
0
st
0
st
0
st | ===
==
(22)
4) f(t) = tAe , i.e. an exponential decay.
)s(Fs
AdteAdteAe)}t(f{L0
t)s(
0
stt =+
===
+
(23)
4.2 Laplace Transform Theorems
A number of theorems relating to Laplace transforms are used when solving differential
equations.
Linearity theorem. Where a function is multiplied by a constant, the Laplace transform of the
product is the constant multiplied by the function transform. Hence
)s(AF)}t(Af{L = (24)
where the sum of two functions is transformed it becomes the sum of the Laplace transforms ofthe individual functions. Hence
)s(F)s(F)}t(f)t(f{L 2121 = (25)
This is sometimes referred to as the principle of superposition.
Differential theorem. The Laplace transform of the first derivative of a function f(t) is
-
7/29/2019 BCT Module 01
17/38
11
)0(f)s(sF
dt
)t(dfL =
-
(26)
where f(0) is the value of the function f(t) evaluated at time t = 0. The Laplace transform of the
second derivative of f(t) is
dt
)0(df)0(f)s(Fs
dt
)t(fdL 2
2
2
=
-
(27)
where df(0)/dt is the value of the first derivative of the function at time t = 0.
Integration theorem. The Laplace transform of the integral of a function f(t) is
{ } dts
)0(f
s
)s(Fdt)t(fL
+= (28)
where dt)0(f is the value of the integral of the function evaluated at time, t = 0.
Initial value theorem. The value of the function f(t), as time t approaches zero, is given by
)s(sFlim)t(flims0t
= (29)
Final value theorem. The value of the function f(t), as time t approaches infinity, is given by
)s(sFlim)t(flim0st
= (30)
Time shift theorem. The Laplace transform of a time delayed function )t(f with respect to
the function f(t) is,
)s(Fe)}t(f{L s= (31)
where is the value of the time delay in seconds.
Table 3 Summary of theorems of the Laplace transforms
Multiplication by a constant ( )[ ] ( )skFtkfL =
Sum and difference ( ) ( )[ ] ( ) ( )sFsFtftfL 2121 =
-
7/29/2019 BCT Module 01
18/38
12
Differentiation
( )( ) ( )0fssF
dt
tdfL =
( ) ( ) ( ) ( )( ) ( )( ) ( )( )0f0sf...0fs0fssFsdt
tfdL 1n2n12n1nnn
n =
where
( ) ( )( )
0
0=
=t
k
k
k
dt
tfdf
Integration
( )( )s
sFdfL
t
0=
( )( )n1n21
t
0
t
0
t
0 s
sFdt...dtdtdf...L
1 2 n
=
Shift in time ( ) ( )[ ] ( )sFeTtuTtfLTs
s
= Initial-value theorem ( ) ( )ssFlimtflim
s0t =
Final-value theorem( ) ( )ssFlimtflim
0st = if ( )ssF does not have poles on or to the right
of the imaginary axis in the s -plane.
Complex shifting ( )[ ] ( )= sFtfeL t
Real convolution
( ) ( ) ( ) ( )
=
t
02121 dtffLsFsF
( ) ( ) ( ) ( )[ ]tf*tfLdtffL 21t
012
=
=
Where a control system is represented by an ordinary differential equation and time is the
independent variable it can be solved using Laplace transforms. The first step is to transform the
equation term by term, taking due account of any initial conditions. The transformed equations in
s can then be solved for the variable of interest. The equation in s must then be inversely
transformed to obtain the variable as function of time. Simultaneous equations can be handled in
a similar way where the solving for variable takes place in terms of s and the values obtained are
inversely transformed.
The inverse transform L-1 is usually obtained by reference to a set of transform tables. Where this
is not immediately possible the function in s must be rearranged into a suitable form. Controlsystem response functions often appear as a ratio of polynomials, e.g.
01
1n
1nn
n
01
1m
1m
m
m
bsb...sbbs
asa...sasa
)s(D
)s(N)s(F
++++
++++==
(32)
where m and n are real positive integers and all as and bs are real constants. The highest power
of s in the denominator must be greater that that in the numerator, which is usually the case withpractical control systems. The partial fraction technique is the most commonly used approach
-
7/29/2019 BCT Module 01
19/38
13
when solving these functions. The denominator polynomial must first be factorized, i.e. the roots
must be known. Hence
)rs)...(rs)(rs(
)s(N)s(F
n21+++
= (33)
where r1, r3, , rn are the roots of D(s) which may exist as real or complex numbers. The
factors of the denominator, e.g. (s + r1), should be recognizable as denominators in the table of
transforms, see Table 3.
Linear ordinary differential equations can be solved by the Laplace transform method with the
aid of the theorems on Laplace transform given in Table 3. The procedure is outlined as follows:
1. Transform the differential equation to the s-domain by Laplace transform using the Laplacetransform table.
2. Manipulate the transformed algebraic equation and solve for the output variable.
3. Perform partial-fraction expansion to the transformed algebraic equation.
4. Obtain the inverse Laplace transform from the Laplace transform table.
Following examples illustrate how to apply the Laplace transform method to the solution oflinear ODEs.
4.3 Applications of Laplace Transform
Example 5 Determine the inverse Laplace transform of the function F(s), where
)3s()1s(s
2s)s(F
2 ++
+= (34)
Expanding F(s) into partial fractions:
)3s()1s(s
2s
3s
D
)1s(
C
1s
B
s
A)s(F
22 ++
+=
++
++
++= (35)
where A, B, C and D are constants. The value of these constants must now be found by algebraicmethods. The evaluation of residues or the cover-up rule will be used.
If s is made equal to the value of any of the roots, i.e. 0, -1, or 3, then F(s) becomes infinite.
However, if both sides of the equation are multiplied by a factor (s + r) where r is the root, then a
function of s will be left which has a value at s = -r, or the value of F(s) if the factor (s + r) were
covered up. Hence
3s3s
D
)1s(
C
1s
B
s
A)3s(
)3s()1s(s
2s22
+
++
++
++=+
++
+(36)
-
7/29/2019 BCT Module 01
20/38
14
Let s = -3, then
12
1
12
1D
)13(3
232
=
==
+
+
12
1D = (37)
Now
s3s
D
)1s(
C
1s
B
s
A)s(
)3s()1s(s
2s22
++
++
++=
++
+(38)
Let s = 0, then
3
2A = (39)
Also,
2
2
2
2)1s(
3s
D
)1s(
C
1s
B
s
A)1s(
)3s()1s(s
2s+
++
++
++=+
++
+(40)
Let s = -1, then
C21
)31(121 ==++
21C = (41)
It is know necessary to substitute the values of A, C, and D and evaluate the equation at some
convenient value, e.g. s = 1, in order to obtain B. Thus
3s
D
)1s(
C
1s
B
s
A
)3s()1s(s
2s)s(F
22 ++
++
++=
++
+= (42)
Substitute for A, C, and D,
)3s(12
1
)1s(2
1
1s
B
s3
2
)3s()1s(s
2s22 ++
++
++=
++
+(43)
Let s = 1,
48
1
8
1
2
B
3
2
16
3++=
4
3B
= (44)
All the constants can now be substituted into the original partial fraction expression such that
-
7/29/2019 BCT Module 01
21/38
15
)3s(12
1
)1s(2
1
)1s(4
3
s3
2
)3s()1s(s
2s)s(F
22 ++
+
+=
++
+= (45)
Each of the denominators can be readily inverse
transformed by reference to a table of transforms, see Table 3.
t3tt1 e12
1te
2
1e
4
3
3
2)t(f)}s(F{L
+== (46)
The form of the solution can be seen to be made up of a steady state term, i.e. 3/3 and transient
terms, i.e. the exponentials, which will all die away as the time increases towards infinity.
End of Example 5
Example 6Solving Ordinary Differential Equations by Laplace transform
Give the differential equation
( ) ( )( ) ( )tu5ty2
dt
tdy3
dt
tyds2
2
=++ (47)
where ( )tu s is the unit-step function. The initial conditions are ( ) 10y = and( ) ( ) ( ) 2dttdy0y
0t
1 ===
. To solve the differential equation, the Laplace-transform on both sides
of the above equation is first taken
( ) ( ) ( ) ( ) ( ) ( ) ( )s
5sY20y3ssY30y0sysYs 12 =++ (48)
Substituting the values of the initial conditions into this equation and solving for ( )sY , thefollowing is obtained
( )( ) ( )( )2s1ss
5ss
2s3ss
5sssY
2
2
2
++
+=
++
+= (49)
Equation (49) can be expanded by partial-fraction expansion to give
( )( )2s2
3
1s
5
s2
5sY
++
+= (50)
Taking the inverse Laplace transform of this equation, the complete solution of the given
-
7/29/2019 BCT Module 01
22/38
16
differential equation is obtained
( ) t2t e2
3e5
2
5ty
+= with 0t (51)
End of Example 6
Example 7Complex-Conjugate Poles
Consider the following ordinary differential equation
u5y5y2y =++ (52)
where y and u are output and input (unit impulse function, U(s) = 1). The initial conditions are
y(0) = 0, )0(y
= 0.
Taking the Laplace-transform on both sides of the above equation, we obtain
5)s(Y5)s(sY2)s(Ys2 =++ (53)
or
5s2s
5)s(Y
2 ++= (54)
This function can be rewritten as
)j21s)(j21s(
5)s(Y
+++= (55)
Y(s) can be expanded as
j21s
B
j21s
A
)j21s)(j21s(
5)s(Y
+++
+=
+++= (56)
The coefficients in (56) are determined as
A = ( )j4
5)s(Yj21s
j21s=+
+=(57)
B = ( )j4
5)s(Yj21s
j21s =++
=(58)
-
7/29/2019 BCT Module 01
23/38
17
Substituting values of A, B and C into (56), we obtain
)s(Y =( ) ( )j21s)j4(
5
j21s)j4(
5
+++
+
=( ) ( )
++
+ j21s
1
j21s
1
j4
5(59)
Taking the inverse Laplace on both sides of equation (59) gives ( atsinjatcosejat += ):
)t(y = ( )jt2jt2t eeej4
5 = ( ) ( ) ( )( )[ ]t2sinjt2cost2sinjt2cosej4
5 t ++
= ( ) t2sine4
5t2sinje
j4
5 tt = (t 0) (60)
End of Example 7
Example 8
A mechanical shown in the following figure is at rest before excitation force Psint is given,
derive the complete solution y(t) (using Laplace transform). The displacement y is measured
from the equilibrium position. Assume that the system is under-damped. Use values of P = 20N,
Hz10f= ( f2= ), m = 200kg, =100Ns/m, k = 600N/m, y(0) = 0 and )0(y = 0.
Figure 5 Spring-mass-damper system
Solution
The equation of motion for the system is
tsinPkyybym =++ (61)
Taking Laplace transforms of two sides with initial conditions y(0) = 0 and )0(y = 0 yields
m
Psint
yb
k
-
7/29/2019 BCT Module 01
24/38
18
( )22
2
sP)s(Ykbsms
+
=++ (62)
or
( )
+++
=
kbsms
1
s
P)s(Y
222(63)
Since the system is underdamped, Y(s) can be written as follows.
2
nn
222 s2s
1
s
1
m
P)s(Y
+++
= (64)
where 10
-
7/29/2019 BCT Module 01
25/38
19
End of Example 8
Example 9 Recalling the equation for mass-damper in Example 2
m
P
dt
dy
mdt
yd2
2
=
+ (69)
The constant force P = 20N, m = 200kg, = 100Ns/m. Applying Laplace transform find solution
for equation (69) with initial conditions y(0) = 0 and 0)0(y = .
Solution
Taking Laplace transform of two sides with zero initial conditions yields
( )s
1c)s(Xs 22 =+ (70)
where c = P/m and m/= .
Equation (70) can be rewritten as
( )22ss1
c)s(X+
= (71)
Taking inverse Laplace transform yields
( )[ ]tcos1c)t(x = (72)
End of Example 9
Example 10
Recalling the equation for the liquid level storage system in Example 3
iqhR
1
dt
dhA =+ (73)
It is assumed that the inlet flow rate qi is constant and the tank starts off empty. Applying Laplacetransform find the solution for the liquid level (qi = 0.01m
3/s, A = 3m2 and R = 10m2s).
SolutionEquation (73) can be rewritten as follows.
iRqhdt
dhAR =+ (74)
Taking Laplace transforms of two sides with zero initial conditions yields
( )s
1R)s(H1ARs =+ (75)
-
7/29/2019 BCT Module 01
26/38
20
)s(H =
( )1ARss
R
+
=
+ AR
1ss
A
1
(76)
Taking inverse Laplace transform yields
=)t(h
tAR
1
e1A
1(77)
End of Example 10
Example 11Lets consider the LRC circuit shown in Figure 6. The circuit consists of an inductance L (henry),
a resistance R (ohm) and a capacitance C (farad).
Figure 6 LRC circuit
Generate a differential equation to represent the relationship between the output voltage eo acrossthe capacitor and the supply voltage ei. It is assumed that the initial conditions are zero and the
system is under-damped, i.e. the damping ratio satisfies 10
-
7/29/2019 BCT Module 01
27/38
21
Taking Laplace transforms of two sides with zero initial condition and ei is a step function, yields
( ) sE
)s(E1RCsLCsi
o
2
=++ (81)
or
( )1RCsLCss1
E)s(E2io ++
= (82)
Equation (82) can be rewritten as
( )2nn
2
io
s2ss
1
LC
E)s(E
++= (83)
where )LC/(1n = and L/CR5.0= .
Equation (83) can be rearranged as
( )2nn2
2
n
2
n
io
s2ssLC
E)s(E
++
= (84)
Taking inverse Laplace transform of (84) yields
( )
+
= t1sine
1
11
LC
E)t(e 2n
t
22
n
io
n (85)
where = 1cos (as assumed that the system is underdamped, i.e. 10
-
7/29/2019 BCT Module 01
28/38
22
Solution
Equations (86) and (87) can be rewritten as
=+ KT (88)
Figure 7 Ship steering dynamics
Taking Laplace transforms of two sides with zero initial conditions yields and is constant:
( ) sK
)s(1Tss
=+ (89)
or
( )1TssK
)s(2 +
= (90)
Equation (90) can be rewritten as
+
=
T
1ss
1
T
K)s(
2
(91)
Taking inverse Laplace transform of (91) yields
+
=
tT
1
2e1t
T
1
T
1
1
T
K)t( =
+=
tT
1
e1tT
1TK)t( (92)
End of Example 12
r
Y
X
-
7/29/2019 BCT Module 01
29/38
23
4.4 Partial Fraction Expansion with MATLAB
MATLAB has a command to obtain the partial-expansion of N(s)/D(s). Consider the transfer
function (see in Module 8)
den
num
)s(D
)s(N= =
01
1n
1n
n
n
01
1m
1m
m
m
asasasa
bsbsbsb
++++
++++
(93)
Where some of ai and bj may be zero, except an and bm. In MATLAB row vectors num and den
specify the coefficients of the numerator and denominator of the transfer function. That is,
[ ]01mm bbbnum =
[ ]01nn abanum =
The command
[r, p, k] = residue(num,den)
finds the residues, poles and direct terms of a partial fraction expansion of the ratio of two
polynomials N(s) and D(s). The partial fraction expansion of N(s)/D(s) is given by
)s(D
)s(N=
( )
( )
( )
( )
( )
( )
)s(k
nps
nr
2ps
2r
1ps
1r+
++
+
(94)
where k(s) is a direct term.
Example 13
Given the following transfer function:
6s11s6s
6s3s5s2
)s(D
)S(N23
23
+++
+++= (95)
Find its partial fraction expansion using MATLAB.
Solution
The commands:
num = [2 5 3 6];den = [1 6 11 6];
[r,p,k] = residue(num,den)
-
7/29/2019 BCT Module 01
30/38
24
give the following result is obtained.
The partial fraction expansion of N(s)/D(s) is as follows.
21s
3
2s
4
3s
6
6s11s6s
6s3s5s2
)s(D
)S(N23
23
++
++
+
+
=
+++
+++= (96)
It should be noted that the commands
r = [-6 -4 3];p = [-3 -2 -1];k = 2;
[num, den] = residue(r,p,k)
where r, p, k are as given in the previous MATLAB output, converts the partial fractionexpansion back to the polynomial ratio N(s)/D(s) as follows:
End of Example 13
Example 14
Expand the following polynomial fraction into partial fraction with MATLAB.
( )3
2
1s
3s2s
)s(D
)S(N
+
++= =
1s3s3s
3s2s23
2
+++
++(97)
r =
-6.0000-4.0000
3.0000
p =
-3.0000
-2.0000
-1.0000
k =
2
num =2.0000 5.0000 3.0000 6.0000
den =
1.0000 6.0000 11.0000 6.0000
-
7/29/2019 BCT Module 01
31/38
25
Solution
M-file:
num = [1 2 3];den = [1 3 3 1];[r, p, k] = residue(num, den)
The result is as follows:
Partial fraction is
( ) ( )32 1s2
1s
0
1s
1
)s(D
)s(N
++
++
+= (98)
End of Example 14
r =
1.0000
-0.0000
2.0000
p =
-1.0000
-1.0000
-1.0000k =
[]
-
7/29/2019 BCT Module 01
32/38
26
SUMMARY OF MODULE 7
Module 7 is summarized as follows.
Modelling of dynamic systems: ordinary differential equation, general principles ofmodelling, modelling of mechanic systems, liquid level storage system and electricalsystems
Laplace transforms: definition, Laplace transforms and inverse Laplace transform Application of Laplace transforms to solve ordinary differential equations.
Exercises
1. Cart on surface: We have a cart as shown in the following figure. Assuming that the rotationalinertia of the wheels is negligible and that there is friction retarding the motion of the cart,
friction is proportional to the carts speed. Write a differential equation representing the
relationship between the force (u) and the motion (y) of the cart.
Figure 8 Cart on surface
2. The following figure shows two alternative applications of force or simple mass-damper
system. In the first case force is applied directly to the mass which is separated from a fixed rigid
surface by a light damper with damping coefficient . In the second case the restraining surfaceis absent and the force P is now applied to this end of the damper system. In this latter case the
force is not now the independent variable but the velocity of movement of this part of the damper.
If the system is initially at rest in each case, derive the relationship between the movement of themass and the independent variable which is the forcing input.
Figure 9 Forced mass-damper system
mF
y x
Mass MForce u
M u
y
Friction
force yb
-
7/29/2019 BCT Module 01
33/38
27
3. Spring-damper system: A light spring-damper coupling may be composed of parallel or
serially connected components. Although one end of the system may be fixed or connected to an
inertial mass, the modelling and movement may be initially investigated when there is movement
at each end of the system and no mass in the system. (One of the velocity terms may be set tozero by fixing that end.) Derive a relationship in each case in Figure 3 between the difference invelocity between the endpoints of the system and forces applied to the system.
Figure 10 Forced spring-damper systems
4. Mass-spring-damper system: Many mechanical systems can be represented as a combination ofone or more mass, spring and damper configurations. Such a representation may be used forsuspension systems, machine tool vibrations, linkage of vehicles, etc. One such arrangement is
shown in Figure 4. Relate the movement of the mass to the applied force P, forming an overall
transfer function between this and the mass displacement. How does this system respond to a step
force of 20N? (Use values of m = 200kg, =100Ns/m, k = 600N/m).
Figure 11 Mass-spring-damper system
5. Newtons Cooling Law: A hot block with temperature Tm is put in a room with a constant
ambient temperature Ta. Newtons law of cooling states that the rate of heat loss from the block is
P*
x
P*PP
z
y
y
x
mP
x
k
-
7/29/2019 BCT Module 01
34/38
28
proportional to the temperature difference. Write down a differential equation to represent this
model (k = proportional constant, Tm = 50oC, Ta = 0
oC). What is the temperature at time of 1/k?
Figure 12 Newtons cooling law
6. Thermal system: Consider the system shown in Figure 11. It is assumed that the tank is
insulated to eliminate heat loss to the surrounding air. It is also assumed that there is heat storagein the insulation and the liquid in the tank is perfectly mixed so that it is at a uniform temperature.
Thus, a single temperature is used to describe the temperature of the liquid in the tank and theoutflowing liquid.
Figure 13 Thermal system
7. Pneumatic systems have been developed into low pressure pneumatic controllers for industrial
control systems and they have been used extensively in industrial processes.
Figure 14 Pneumatic systems
Tm
Hot liquid
Cold liquid
Mixer
Heater
C
R
Gas
Supply pressure (P - pi)
Pressure in tank (P - po)
Capacity
-
7/29/2019 BCT Module 01
35/38
29
8. Hydraulic systems have a complexity of model which depends on the degree to which
properties such as fluid compressibility are taken into account. However, if these terms are
omitted then these systems give rise to model equations of standard form. This is also true of
pneumatic systems, although in this case the properties of the fluid will have more marked effecton both the system behaviour and on the results predicted by an oversimplified model. Suchsystems may also be subject to minor leakage flows, e.g. within the actuators, which lead toadditional model terms which it is often hard to quantity.
Figure 15 Hydraulic press schematic
My
x
F
k
To sump Supply To sump
-
7/29/2019 BCT Module 01
36/38
30
Appendix - Numerical Integration Methods
Given the following differential equation
)t,u,y(fy =
Eulers methods for the solution of this ordinary differential equation are summarized as follows:
Simple Eulers Method
A simple but important numerical integration scheme is Eulers method, where the numerical
solution is computed from:
)t,y(hfyy nnn1n +=+
Improved Eulers Method
The improved Euler method includes an evaluation )t,y(hfyynnn1n
+=+ according to Eulers
method. Then an approximation of ( )1n1n t,yf ++ at the time 1nt + is computed using 1ny + . Thisvalue is used to improve the accuracy of the numerical solution yn+1. The method is given by
( )nn1 t,yfk = ( )ht,hkyfk n1n2 ++=
( )21n1n kk2hyy ++=+
Modified Eulers Method
The modified Euler method, also called the explicit midpoint rule, is derived in a similar way as
the improved Euler method. In the modified Euler method an approximation of f at (y(2ht + ),
2ht + )is used to find the solution. This approximation is computed using Eulers method to find
an estimate of y(2ht + ). The method is illustrated in Figure 3.4 and is given by
( )nn1 t,yfk =
++=
2ht,k
2hyfk n1n2
2n1n hkyy +=+
Second Order Runge-Kutta Method
The second-order Runge-Kutta method is summarized as follows.
)t,y(hfk nn1 =
( )ht,kyhfk n1n2 ++=
-
7/29/2019 BCT Module 01
37/38
31
( )21n1n kk2
1yy ++=+
Fourth Order Runge-Kutta Method
The fourth-order Runge-Kutta method is summarized as follows.
)t,y(hfk nn1 =
( )ht,kyhfk21
n121
n2++=
( )ht,kyhfk21
n221
n3++=
( )ht,kyhfk n3n4 ++=
( )4321n1n kk2k2k6
1yy ++++=+
Sample program in MATLAB
Problem: Lets consider a tank flow model
iqh1.0dt
dh3 =+ (A.1)
If the input flow qi is maintained constant at a constant flow rate of 0.01m3/s into the tank, which
starts empty, plot the change in level of the liquid h in the tank with time.
Sample M-file:
% Filename: TankFlowModel.m
% This M-file illustrates Euler's Methods
%
% Ordinary Differential Equation
% 3*hdot + 0.1*h = qi
% where h = level, qi = inlet flow rate (0.01m^3/s)
% Initial conditions: h(0) = 0
%
% Created by Hung Nguyen in June 2005
% Last modified in June 2005
% Copyright (C) 2005 Hung Nguyen% Email: [email protected]
%
% Set initial conditions:
h1 = 0; % initial level
index = 0; % index for counting
step = 0.1; % sampling time
N = 200; % final value
qi = 0.01; % inlet flow rate 0.01m^3/s
% Euler's Simple Method:
-
7/29/2019 BCT Module 01
38/38
for ii = 0.0:step:N
index = index + 1;
h1_dot = (qi - 0.1*h1)/3;
h1 = h1 + step*h1_dot;
data(index,1) = ii; % time (sec)
data(index,2) = qi; % inlet flow rate (m^3/s)
data(index,3) = h1; % level (m)
end
% Plot
plot(data(:,1),data(:,3));grid
xlabel('Time (second)');ylabel('Level (m)')
% End of programResult:
0 20 40 60 80 100 120 140 160 180 2000
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
Time (second)
Level(m)
Figure A.1 Step response