You are on page 1of 38

Lecture Notes

BASIC CONTROL THEORY


Module 1 Modelling of Dynamic Systems
(Linear system modelling, ODEs - continuous-time models, Laplace transform)

AUGUST 2005
Prepared by Dr. Hung Nguyen

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......................................................................................................2 3.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 ...........................................................................4 3.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.....................................................................................13 Example 5.............................................................................................................................13 Example 6.............................................................................................................................15 Example 7.............................................................................................................................16 Example 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...........................................................................................................................24 Summary of Module 7...................................................................................................................26 Exercises........................................................................................................................................26 Appendix Numerical Integration Methods .................................................................................30 Sample Program in MATLAB ..................................................................................................31

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 .........................................................................................................................................26 Figure 9 .........................................................................................................................................26 Figure 10........................................................................................................................................27 Figure 11 ........................................................................................................................................27 Figure 12........................................................................................................................................28 Figure 13........................................................................................................................................28 Figure 14........................................................................................................................................28 Figure 15........................................................................................................................................29 Figure A.1 ......................................................................................................................................32

ii

LIST OF TABLES
Table 1 ...........................................................................................................................................2 Table 2 ...........................................................................................................................................9 Table 3 .........................................................................................................................................11

iii

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 International Inc., 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.

iv

AIMS
1.0 Explain principles of modelling linear systems, methods of representing dynamic systems in term 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 mechanical systems, 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.

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 called modelling. 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 many different 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, a first order differential equation is of the following form:

y = f (y, u , t )

(1)

where u, y, and t are input, output and time, respectively. A second order differential equation is of the following general form: y = f (y, y, u , t ) Higher order differential equations can be expressed in the following form: y (n ) = f y (n 1) , y (n 2 ) ,, y (1) , y, u (m ) , u (m1) ,, u (1) , u , t (2a)

(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
a n y ( n ) + a n 1 y (n 1) +  + a 1 y (1) + a 0 y = b m u (m ) + b m1 u (m1) +  + b1u (1) + b 0 u (2c)

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 is based 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 1. State the modelling objectives and the end use of the model. Then determine the required levels 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 partial differential 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 output variables 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. 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. 2

d 2 ( t ) + MgL sin ( t ) = Lx ( t ) dt 2

(3)

where g is the gravity constant and I is the moment of inertia given by I = M(L2).

L x(t)

Mg

Mgsin (t)

Figure 1 Simple pendulum


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 sin ( t ) sin is

approximately equal to ( t ) , the above nonlinear equation can be approximated by the following linear differential equation.
I or L d 2 ( t ) MgL + ( t ) = x ( t ) 2 I I dt (5) d 2 ( t ) + MgL( t ) = Lx( t ) dt 2 (4)

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 system is initially at rest in each case, derive the relationship between the movement of the mass and the independent variable which is the forcing input.

x 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 = dx / dt the equation of motion is P or d 2 x dx P + = dt 2 m dt m
End of Example 2

dx d2x =m 2 dt dt

(6)

(7)

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. qi

h R qo

Cross-sectional area A Figure 3 Liquid level storage system 4

A mass balance yields:


d (V ) = q i q o dt (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 A dh = qi qo dt (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 three important variations of the liquid storage process: 1. The inlet or outlet flow rates might be constant; for example, exit flow rate q might be kept constant 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:

q=

1 h R

(11)

Substituting this into equation (9) give the first-order differential equation: A or A dh 1 + h = qi dt R (13a) dh 1 = qi h R dt (12)

This model shows the relationship between the level (h) and the inlet flow rate (qi).

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 .
P = P Pa

(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.
q=k P Pa (13c)

where k is a constant. The value of k depends on the particular valve and the valve setting (how much it is open). The pressure P at the bottom of the tank is related to liquid level h by a force balance,
P = Pa + g h gc (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. A dh = qi K h dt (13e)

where K = k g / g c . 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

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.

vr R vL L vC C (a) ir =

vr , vr = ir R R

i v

vr R L C vC vL

di di vL = L L , vL = L L dt dt

dv 1 v C = i C dt , i C = C C C dt

(b)

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 their current-to-voltage relationships are shown in Figure 4(a). The active electrical elements can be considered 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): v r + v L + vC v = 0 or iR + L di 1 + idt = v dt C (15) (14)

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 charge accumulating on a capacitor, if it were required to remove the integral from the expression.

End of Example 4

4. Review of Laplace Transform


4.1 Laplace Transform

Differential equations or mathematical models can be produced to represent all or part of a control system. The system response will vary according to the input received and, in order to determine this response, the differential equations must be solved. The form of the solution, since time is often the independent variable, will usually include two terms. These are the steady state and transient solutions. The steady state solution is obtained when all the initial conditions are zero. The transient solution represents the effects of the initial conditions. Both of these parts of the solution must be examined with respect to control systems. Classical mathematical techniques create complex solutions for linear differential equations beyond first-order. Use can be made of the Laplace transform technique to simplify the mathematics and also provide a solution in the two-term form that is required. Transforming, in this situation, involves changing differential equations into an algebraic equation in some new quality. A useful analogy can be made to the use 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 of these computations the number obtained is inverse transformed or antilogged to return to the original system of numbers. It should be noted that the Laplace transform can only be used with constant coefficient linear differential equations. However, only this type of equation will be considered (Taylor, D.A., 1987). The Laplace transform is one of the mathematical tools used for the solution of linear ordinary differential equation. In comparison with the classical method of solving linear differential equations, the Laplace transform method has the following two attractive features below.
Homogeneous equation and the particular integral of the solution are obtained in one operation. The Laplace transform converts the differential equation into an algebraic equation in s. It is then possible to manipulate the algebraic equation by simple algebraic rules to obtain the solution in the s-domain. The final solution is obtained by taking the inverse Laplace transform.

As a result of Laplace transformation, a function of time, f(t), becomes a function of a newdomain, 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 involves multiplying the function, f(t), by the e-st and then integrating the product with respect to time in the interval t = 0 to t = , i.e.
L{f ( t )} = f ( t )e st dt = F(s)
0

(16)

The function f(t) must be real and continuous over the time interval considered, otherwise the Laplace transform cannot be used.

The inverse transform is indicated by the operator L-1 such that f ( t ) = L1{F(s)} (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) Unit impulse, t Unit step, 1 Unit ramp, t nth order ramp, tn Exponential decay, e t Exponential rise, 1 e t Exponential t, te t Sin t Cos t Laplace transform, F(s) 1 1 s 1 s2 n! s n +1 1 s+ s(s + ) 1 (s + ) 2 2 s 2 + 2 s 2 s +

Obtain the Laplace transforms of the functions 1) f(t) = A 3) f(t) = 1 3) f(t) = At 4) f(t) = Ae t assume f(t) = 0 for t < 0 in all cases. 1) f(t) = A, i.e. a step function of magnitude A. L{f ( t )} = Ae st dt =
0

A 1 s e st

|
0

(18)

This step function is undefined at t = 0, but


0+

Ae

st

dt = 0

(19)

Thus, L{f ( t )} = A = F(s) s (20)

3) f(t) = 1, i.e. a unit step function. 1 1 L{f ( t )} = e dt = st s e 0


st

| = s = F(s)
0

(21)

3) f(t) = At, i.e. a ramp function L{f ( t )} = Ate st dt = At


0

e st Ae st A A | s dt = s e st dt = s 2 = F(s) s 0 0 0

(22)

4) f(t) = Ae t , i.e. an exponential decay. L{f ( t )} = Ae t e st dt = A e ( +s ) t dt =


0 0

A = F(s) s+

(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

L{Af ( t )} = AF(s)

(24)

where the sum of two functions is transformed it becomes the sum of the Laplace transforms of the individual functions. Hence

L{f1 ( t ) f 2 ( t )} = F1 (s) F2 (s)


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

(25)

10

df ( t ) L = sF(s) f (0) dt

(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
d 2 f (t ) df (0) L = s 2 F(s) f (0) 2 dt dt

(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

L f ( t )dt =

F(s) f (0) + dt s s

(28)

where f (0)dt 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

lim f ( t ) = lim sF(s)


t 0 s

(29)

Final value theorem. The value of the function f(t), as time t approaches infinity, is given by

lim f ( t ) = lim sF(s)


t s0

(30)

Time shift theorem. The Laplace transform of a time delayed function f ( t ) with respect to the function f(t) is,

L{f ( t )} = e s F(s) where is the value of the time delay in seconds. Table 3 Summary of theorems of the Laplace transforms Multiplication by a constant Sum and difference L[kf (t )] = kF(s ) L[f1 (t ) f 2 (t )] = F1 (s ) F2 (s )

(31)

11

Differentiation

Integration

Shift in time Initial-value theorem Final-value theorem Complex shifting Real convolution

df (t ) L = sF(s ) f (0 ) dt d n f (t ) L n = s n F(s ) s n 1f (0) s n 2f (1) (0 ) ... sf (n 2 ) (0 ) f (n 1) (0 ) dt where d k f (t ) f ( k ) (0 ) = dt k t =0 t F(s ) L f ()d = 0 s t1 t 2 tn F(s ) L ... f ( )ddt1dt 2 ...dt n 1 = n 0 0 s 0 Ts L[f (t T )u s (t T )] = e F(s )

lim f (t ) = lim sF(s )


t 0 s s0 t

lim f (t ) = lim sF(s ) if sF(s ) does not have poles on or to the right of the imaginary axis in the s -plane. L e t f (t ) = F(s )

t F1 (s )F2 (s ) = L f1 ()f 2 (t )d 0 t = L f 2 ()f1 (t )d = L[f1 (t ) * f 2 (t )] 0

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. Control system response functions often appear as a ratio of polynomials, e.g. F(s) = N(s) a m s m + a m1s m1 + ... + a 1s + a 0 = D(s) s n b n + b n 1s n 1 + ... + b1s + b 0 (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 with practical control systems. The partial fraction technique is the most commonly used approach

12

when solving these functions. The denominator polynomial must first be factorized, i.e. the roots must be known. Hence F(s) = N(s) (s + r1 )(s + r2 )...(s + rn ) (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 Laplace transform 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 of linear ODEs.

4.3 Applications of Laplace Transform


Example 5 Determine the inverse Laplace transform of the function F(s), where

F(s) =

s+2 s(s + 1) 2 (s + 3)

(34)

Expanding F(s) into partial fractions: F(s) = A B C D s+2 + + + = 2 s s + 1 (s + 1) s + 3 s(s + 1) 2 (s + 3) (35)

where A, B, C and D are constants. The value of these constants must now be found by algebraic methods. 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

A s+2 B C D (s + 3) = + 2 s s + 1 + (s + 1) 2 + s + 3 s + 3 s(s + 1) (s + 3)

(36)

13

Let s = -3, then 1 1 3+ 2 1 =D= = D = 2 12 12 3(3 + 1) 12 Now (37)

A s+2 B C D (s) = + 2 s s + 1 + (s + 1) 2 + s + 3 s s(s + 1) (s + 3)


Let s = 0, then A= Also, 2 3

(38)

(39)

A s+2 B C D 2 (s + 1) 2 = + 2 s s + 1 + (s + 1) 2 + s + 3 (s + 1) s(s + 1) (s + 3)
Let s = -1, then

(40)

1 1 + 2 1 = = C C = 1(1 + 3) 2 2

(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 F(s) = s+2 A B C D = + + + 2 2 s(s + 1) (s + 3) s s + 1 (s + 1) s+3 (42)

Substitute for A, C, and D, s+2 2 B 1 1 = + + + 2 2 s(s + 1) (s + 3) 3s s + 1 2(s + 1) 12(s + 3) Let s = 1, (43)

3 2 B 1 1 3 B = = + + 16 3 2 8 48 4

(44)

All the constants can now be substituted into the original partial fraction expression such that

14

F(s) =

s+2 2 3 1 1 = + 2 2 s(s + 1) (s + 3) 3s 4(s + 1) 2(s + 1) 12(s + 3)

(45)

Each of the denominators can be readily inverse transformed by reference to a table of transforms, see Table 3. L1{F(s)} = f ( t ) = 2 3 t 1 t 1 3 t e te + e 3 4 2 12 (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 6 Solving Ordinary Differential Equations by Laplace transform

Give the differential equation d 2 y (t ) dy(t ) +3 + 2 y (t ) = 5 u s (t ) 2 dt dt where


(1)

(47) The initial conditions are y(0) = 1 and

y (0 ) = dy(t ) dt t =0 = 2 . To solve the differential equation, the Laplace-transform on both sides of the above equation is first taken s 2 Y(s ) sy(0 ) y (1) (0) + 3sY (s ) 3y(0 ) + 2Y(s ) = 5 s (48)

u s (t ) is

the

unit-step

function.

Substituting the values of the initial conditions into this equation and solving for Y(s ) , the following is obtained

s2 s + 5 s2 s + 5 Y(s ) = 2 = s s + 3s + 2 s(s + 1)(s + 2 )

(49)

Equation (49) can be expanded by partial-fraction expansion to give Y(s ) = 5 5 3 + 2s s + 1 2(s + 2) (50)

Taking the inverse Laplace transform of this equation, the complete solution of the given

15

differential equation is obtained 5 3 y(t ) = 5e t + e 2 t with t 0 2 2


End of Example 6 Example 7 Complex-Conjugate Poles

(51)

Consider the following ordinary differential equation y + 2 y + 5 y = 5u (52)

where y and u are output and input (unit impulse function, U(s) = 1). The initial conditions are y(0) = 0, y(0) = 0. Taking the Laplace-transform on both sides of the above equation, we obtain s 2 Y(s) + 2sY(s) + 5Y(s) = 5 or Y(s) = 5 s + 2s + 5
2

(53)

(54)

This function can be rewritten as Y(s) = 5 (s + 1 2 j)(s + 1 + 2 j) (55)

Y(s) can be expanded as Y(s) = 5 A B = + (s + 1 2 j)(s + 1 + 2 j) s + 1 2 j s + 1 + 2 j (56)

The coefficients in (56) are determined as

A = (s + 1 2 j)Y(s) s=1+ 2 j = B = (s + 1 + 2 j)Y(s) s=12 j

5 4j 5 = 4j

(57) (58)

16

Substituting values of A, B and C into (56), we obtain 5 5 Y (s) = + (4 j)(s + 1 2 j) (4 j)(s + 1 + 2 j) 5 1 1 = (s + 1 2 j) (s + 1 + 2 j) 4j Taking the inverse Laplace on both sides of equation (59) gives ( e jat = cos at + j sin at ): y( t ) = 5 t 2 jt 2 jt 5 t e e e = e [(cos 2t + j sin 2 t ) (cos( 2 t ) + j sin ( 2 t ))] 4j 4j 5 t 5 = e ( j sin 2t ) = e t sin 2t (t 0) 4j 4

(59)

(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, f = 10Hz ( = 2f ), m = 200kg, =100Ns/m, k = 600N/m, y(0) = 0 and y(0) = 0.

k m

Psint

Figure 5 Spring-mass-damper system

Solution The equation of motion for the system is

my + by + ky = P sin t

(61)

Taking Laplace transforms of two sides with initial conditions y(0) = 0 and y(0) = 0 yields

17

(ms
or

+ bs + k Y(s) = P

s + 2
2

(62)

Y(s) =

P 1 2 2 (s + ) ms + bs + k
2

(63)

Since the system is underdamped, Y(s) can be written as follows. Y(s) = P 1 1 2 2 2 m s + s + 2n s + 2 n (64)

where 0 < < 1 , n = k / m , = b / 2 mk . Y(s) can be expanded as Y(s) = P as + c as + d 2 s + 2 + s 2 + 2 s + 2 m n n

(65)

By some calculations, it can be found that a=

2 n
2 n

+ 4 2 2 2 n

, c=

2 2 n
2 n

+ 4 2 2 2 n

and d =

4 2 2 ( 2 2 ) n n
2 n

+ 4 2 2 2 n

(66)

Hence
2n s + 2 2 n s 2 + 2 P 1 Y(s) = m 2 2 2 + 42 2 2 2 n (s + n ) + 2 2 2 2 2 n n n n + s 2 + 2n s + 2 n

(67)

Taking inverse Laplace transform yields


2 2 sin t 2 n cos t + n P + 2 e n t cos 1 2 t y( t ) = n n 2 2 2 2 2 2 m n + 4 n 2 2 2 2 2 n t n n e sin n 1 2 t + n 1 2

[(

(68)

Notes: 1. Substituting the given values into Equation (68) one can draw graphics for y(t) by an M-file. 2. One can solve Equation (61) by one of numerical integration method or a Simulink model.

18

End of Example 8 Example 9 Recalling the equation for mass-damper in Example 2

d 2 y dy P + = dt 2 m dt m

(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 y(0) = 0 .

Solution Taking Laplace transform of two sides with zero initial conditions yields (s 2 + 2 )X(s) = c 1 s
where c = P/m and = / m . Equation (70) can be rewritten as X(s) = c 1 s s + 2

(70)

(71)

Taking inverse Laplace transform yields x ( t ) = c[1 cos(t )]


End of Example 9 Example 10 Recalling the equation for the liquid level storage system in Example 3

(72)

dh 1 + h = qi dt R

(73)

It is assumed that the inlet flow rate qi is constant and the tank starts off empty. Applying Laplace transform find the solution for the liquid level (qi = 0.01m3/s, A = 3m2 and R = 10m2s).

Solution Equation (73) can be rewritten as follows. dh AR + h = Rq i dt Taking Laplace transforms of two sides with zero initial conditions yields (ARs + 1)H(s) = R 1 s

(74)

(75)

19

1 R A = H (s) = 1 s(ARs + 1) s s + AR Taking inverse Laplace transform yields


h(t ) =
t 1 1 e AR A 1

(76)

(77)

End of Example 10 Example 11 Lets 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).

L ei

R i C eo

Figure 6 LRC circuit Generate a differential equation to represent the relationship between the output voltage eo across the 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 0 < < 1 . Applying Laplace transform find the solution.

Solution Applying the Kirchhoffs voltage law to the system, the following equations are obtained,
L di 1 + Ri + idt = e i dt C 1 idt = e 0 C (78) (79)

Equations (78) and (79) can be rearranged into LC d 2eo de + RC o + e o = e i 2 dt dt (80)

20

Taking Laplace transforms of two sides with zero initial condition and ei is a step function, yields

(LCs
or

+ RCs + 1)E o (s) =

Ei s

(81)

E o (s) = E i

1 s(LCs + RCs + 1)
2

(82)

Equation (82) can be rewritten as E o (s) = Ei 1 2 LC s s + 2n s + 2 n

(83)

where n = 1 /(LC) and = 0.5R C / L . Equation (83) can be rearranged as E o (s) = Ei 2 n 2 2 LCn s s + 2n s + 2 n

(84)

Taking inverse Laplace transform of (84) yields

e o (t) =

Ei 1 e n t sin n 1 2 t + 1 2 LCn 1 2

(85)

where = cos 1 (as assumed that the system is underdamped, i.e. 0 < < 1 ).
End of Example 11

Example 12 Ship steering dynamic model

The ship steering dynamic model representing ship motions in horizontal plane can be expressed by the Nomotos first-order model as follows.
T r + r = K =r

(86) (87)

where r is yaw rate (rad/sec), is yaw angle (rad), is rudder angle (rad), and T and K are constants known as ship manoeuvrability indices. Using Laplace transform, find the solution (yaw angle) if T = 7.5seconds, and K = 0.11 and initial conditions (0) = 0, r(0) = 0.

21

Solution Equations (86) and (87) can be rewritten as


T + = K

(88) X

Y Figure 7 Ship steering dynamics Taking Laplace transforms of two sides with zero initial conditions yields and is constant: s(Ts + 1) (s) = or (s) = K s (89)

K s (Ts + 1)
2

(90)

Equation (90) can be rewritten as (s) = K T 1


2

1 s s + T Taking inverse Laplace transform of (91) yields (t ) =


1 1 t t K 1 1 t 1 + e T = ( t ) = KT 1 t 1 + e T T T 1 2 T T

(91)

(92)

End of Example 12

22

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) b s m + b m1s m 1 +  + b1s + b 0 N(s) num = m n = D(s) den a n s + a n 1s n 1 +  + a 1s + a 0

(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, num = [b m b m 1  b 0 ] num = [a n b n 1  a 0 ] 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 r (1) r (2) r (n ) N(s) = + ++ + k (s) s p(1) s p(2 ) s p(n ) D(s) where k(s) is a direct term.
Example 13 Given the following transfer function:

(94)

N(S) 2s 3 + 5s 2 + 3s + 6 = D(s) s 3 + 6s 2 + 11s + 6 Find its partial fraction expansion using MATLAB.
Solution

(95)

The commands:
num = [2 5 3 6]; den = [1 6 11 6]; [r,p,k] = residue(num,den)

23

give the following result is obtained. r= -6.0000 -4.0000 3.0000 p= -3.0000 -2.0000 -1.0000 k= 2 The partial fraction expansion of N(s)/D(s) is as follows. N(S) 2s 3 + 5s 2 + 3s + 6 6 4 3 + +2 + = = 3 2 D(s) s + 6s + 11s + 6 s + 3 s + 2 s + 1 It should be noted that the commands
r = [-6 -4 3]; p = [-3 -2 -1]; k = 2; [num, den] = residue(r,p,k)

(96)

where r, p, k are as given in the previous MATLAB output, converts the partial fraction expansion back to the polynomial ratio N(s)/D(s) as follows: num = 2.0000 5.0000 3.0000 6.0000 den = 1.0000 6.0000 11.0000 6.0000

End of Example 13 Example 14 Expand the following polynomial fraction into partial fraction with MATLAB.

s 2 + 2s + 3 N(S) s 2 + 2s + 3 = 3 = D(s) s + 3s 2 + 3s + 1 (s + 1)3

(97)

24

Solution M-file: num = [1 2 3]; den = [1 3 3 1]; [r, p, k] = residue(num, den)

The result is as follows: r= 1.0000 -0.0000 2.0000 p= -1.0000 -1.0000 -1.0000 k= []

Partial fraction is N(s) 1 0 2 = + + 2 D(s) s + 1 (s + 1) (s + 1)3


End of Example 14

(98)

25

SUMMARY OF MODULE 7
Module 7 is summarized as follows. Modelling of dynamic systems: ordinary differential equation, general principles of modelling, modelling of mechanic systems, liquid level storage system and electrical systems 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 rotational inertia 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. y Mass M Force u Friction force by u

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 surface is 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 the mass and the independent variable which is the forcing input.

m x

Figure 9 Forced mass-damper system

26

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 to zero by fixing that end.) Derive a relationship in each case in Figure 3 between the difference in velocity between the endpoints of the system and forces applied to the system.

P* z y x

P* x y

Figure 10 Forced spring-damper systems 4. Mass-spring-damper system: Many mechanical systems can be represented as a combination of one or more mass, spring and damper configurations. Such a representation may be used for suspension 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).

k x 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

27

proportional to the temperature difference. Write down a differential equation to represent this model (k = proportional constant, Tm = 50oC, Ta = 0oC). What is the temperature at time of 1/k?

Tm

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 storage in 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 the outflowing liquid.

Hot liquid
Heater Mixer

Cold 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.

Pressure in tank (P - po) Gas C R Supply pressure (P - pi) Figure 14 Pneumatic systems Capacity

28

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 effect on both the system behaviour and on the results predicted by an oversimplified model. Such systems may also be subject to minor leakage flows, e.g. within the actuators, which lead to additional model terms which it is often hard to quantity.

y F x

To sump

Supply

To sump Figure 15 Hydraulic press schematic

29

Appendix - Numerical Integration Methods


Given the following differential equation
y = f ( y, u , t )

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: y n +1 = y n + hf ( y n , t n )
Improved Eulers Method

The improved Euler method includes an evaluation y n +1 = y n + hf ( y n , t n ) according to Eulers method. Then an approximation of f (y n +1 , t n +1 ) at the time t n +1 is computed using y n +1 . This value is used to improve the accuracy of the numerical solution yn+1. The method is given by

k 1 = f (y n , t n ) k 2 = f (y n + hk 1 , t n + h ) h y n +1 = y n + (k 1 + k 2 ) 2
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( t + h ), 2 t + h )is used to find the solution. This approximation is computed using Eulers method to find 2 an estimate of y( t + h ). The method is illustrated in Figure 3.4 and is given by 2 k 1 = f (y n , t n ) h h k 2 = f y n + k1 , t n + 2 2 y n +1 = y n + hk 2
Second Order Runge-Kutta Method
The second-order Runge-Kutta method is summarized as follows. k 1 = hf ( y n , t n ) k 2 = hf (y n + k 1 , t n + h )

30

y n +1 = y n +

1 (k 1 + k 2 ) 2

Fourth Order Runge-Kutta Method


The fourth-order Runge-Kutta method is summarized as follows. k 1 = hf ( y n , t n ) k 2 = hf (y n + 1 k 1 , t n + 1 h ) 2 2

k 3 = hf (y n + 1 k 2 , t n + 1 h ) 2 2 k 4 = hf (y n + k 3 , t n + h ) 1 y n +1 = y n + (k 1 + 2k 2 + 2k 3 + k 4 ) 6

Sample program in MATLAB

Problem: Lets consider a tank flow model dh (A.1) + 0.1h = q i dt 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. 3 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: H.Nguyen@mte.amc.edu.au

% Set initial conditions: h1 index step N qi = = = = = 0; 0; 0.1; 200; 0.01; % % % % % initial level index for counting sampling time final value inlet flow rate 0.01m^3/s

% Euler's Simple Method:

31

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 program

Result:

0.1 0.09 0.08 0.07 0.06 Level (m) 0.05 0.04 0.03 0.02 0.01 0 0 20 40 60 80 100 120 Time (second) 140 160 180 200

Figure A.1 Step response

32

You might also like