Sie sind auf Seite 1von 83

P1: OSO

JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59


APPENDI X B
MODELING AND SIMULATION OF
DYNAMIC SYSTEMS
B.1 MODELING OF DYNAMIC SYSTEMS
A model of a system can be physical or mathematical. The model accuracy needed (close-
ness to the actual system) depends on the purpose. Generally, a simplied model is needed
to study the main characteristics of the system. A detailed model is needed for accurate
simulation and prediction studies. In this book, modeling refers to the mathematical model
of a system. The mathematical model of a dynamic system is generally in the form of
differential equations. Therefore, for our purposes, modeling means obtaining the differ-
ential equations of a dynamic system. First we will study the physical laws and the use of
these laws in modeling various dynamic systems. Once we have a model of a system, we
are interested in studying the behavior of it. The behavior of a dynamic system in time is
described by the solution of its differential equations.
There are two different purposes for modeling a physical system (Fig. B.1).
r
Develop a mathematical model in order to predict the dynamic behavior of the system
as accurately as possible, using numerical solution methods. Such a model serves as
a tool for extensive evaluation of system behavior without actually using or building
the actual system.
r
Develop models to gain insight into the behavior of dynamic system qualitatively in-
stead of exact response prediction, i.e., knowledge of stability margins, controllability
and observability of states, and sensitivity of response to parameter changes. Such
models need not contain all the detail of an actual system, but only the most essential
features so as to provide good insight from an engineering standpoint.
Therefore, we may develop simplied linear models for controller design and analysis
purposes, and use more detailed, possibly nonlinear, models in testing and predicting the
dynamic system response as accurately as possible. For instance, consider the robotic ma-
nipulator model shown in Fig. B.1. The dynamic model is a set of diffential equations which
describes the relationship between the applied torques at the joints and motion of the joint
angles in time. The set of nonlinear diffential equations can be used to predict the behavior
of the robotic manipulator under various initial conditions and joint torque inputs.
Quite often, the dynamic models of physical systems are nonlinear. Most control sys-
temdesign methods and analytical methods are applicable only to linear systems. Therefore,
for the sake of being able to analyze various controller alternatives, we need to obtain ap-
proximate linearized models from the nonlinear models.
In the following sections, we will discuss the basic complex variables and Laplace
transforms which are the fundamental mathematical methods used in modeling and analysis
547
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
548 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
Actual system
q
1 = f1
q
2 = f2
q
1
q
3 q
2 q
4
Mathematical modeling
based on
physical relations
Initial conditions
Inputs
Outputs
Mathematical model
FIGURE B.1: Mathematical model and
dynamic response prediction of a physical
system.
of linear dynamic systems. Then we discuss ordinary differential equations which are used to
represent the behavior of most dynamic systems we consider. Finally, we discuss analytical
and well as numerical solutions of differential equations. Using Laplace transforms, we
also establish the concept of transfer functions. Readers who are not familiar with Matlab
and Simulink software should read the short review in the appendix.
B.2 COMPLEX VARIABLES
The analysis and design of computer-controlled electromechanical systems rely to a great
extent on the application of the theory of complex variables. A complex variable can be
thought of as a point in two-dimensional space connected to the origin by a vector. The
x-coordinate of the vector is called the real part, and the y-coordinate is called the imaginary
part (Fig. B.2). Let s be a complex variable dened as
s = x +jy (B.1)
where j is the imaginary number

1. The complex variable s can also be dened in terms


of its magnitude and direction, such that
s = |s|e
j
(B.2)
= (x
2
+ y
2
)
1
2
e
jtan
1
(
y
x
)
(B.3)
Im(s)
Re(s)
s = s e
j

= x+jy

FIGURE B.2: Complex s-plane and a complex


variable on the complex plane.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.2 COMPLEX VARIABLES 549
with its complex conjugate dened as
s = x jy (B.4)
The following exponential relations and series expansions are useful in the study of
control theory:
sin =
e
j
e
j
2 j
(B.5)
cos =
e
j
+e
j
2
(B.6)
cos = 1

2
2!
+

4
4!


6
6!
+ (B.7)
sin =

3
3!
+

5
5!


7
7!
+ (B.8)
e

= 1 + +

2
2!
+

3
2!
+

4
4!
+ (B.9)
cos +jsin = 1 +( j )

2
2!
+(j )

3
3!
+ (B.10)
= 1 + j +
( j )
2
2!
+
( j )
3
3!
+ (B.11)
= e
j
(B.12)
where
e
j
= cos +jsin (B.13)
is known as Eulers theorem.
In the remainder of this section, we will discuss the basic algebraic operations on
complex variables (addition, subtraction, multiplication, division). Let s
1
and s
2
be two
complex variables dened as
s
1
= x
1
+ j y
1
(B.14)
s
2
= x
2
+ j y
2
(B.15)
The algebraic operations ( +, , , / ) on complex variables can be dened as follows: The
addition and subtraction of two complex variables are performed by adding or subtracting
the real parts and imaginary parts of each variable. In multiplication and division operations,
we need to keep in mind that j =

1, j
2
= 1, j
3
= j , j
4
= 1, j
5
= j , and so on.
s
1
s
2
= (x
1
x
2
) + j (y
1
y
2
) (B.16)
/ s
1
s
2
= (x
1
x
2
y
1
y
2
) + j (x
1
y
2
+ y
1
x
2
) (B.17)
The multiplication of two complex variables may also be accomplished using the magnitude
and phase representation,
s
1
s
2
= |s
1
|e
j
1
|s
2
|e
j
2
(B.18)
= |s
1
| |s
2
| e
j (
1
+
2
)
(B.19)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
550 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
s
1
s
1
Im(s)
Re(s)

FIGURE B.3: Graphical description of complex


conjugate, s
1
, of a complex number s
1
.
Similarly, division of two complex variables can be achieved using the real and imaginary
part representation or magnitude and phase representation. Note that multiplying a complex
number by its complex conjugate always results in a real number.
s
1
s
2
=
x
1
+ j y
1
x
2
+ j y
2
(B.20)
=
(x
1
+ j y
1
)(x
2
j y
2
)
(x
2
+ j y
2
)(x
2
j y
2
)
(B.21)
=
(x
1
+ j y
1
)(x
2
j y
2
)
x
2
2
+ y
2
2
=
s
1
s
2
|s
2
|
2
(B.22)
If the two complex numbers are expressed in magnitude and phase form, the division is
accomplished as follows:
s
1
s
2
=
|s
1
|e
j
1
|s
2
|e
j
2
(B.23)
=
|s
1
|
|s
2
|
e
j (
1

2
)
(B.24)
Note that the complex conjugate of s
1
is s
1
and s
2
is s
2
and are dened as (Fig. B.3)
s
1
= |s
1
|e
j
1
s
1
= |s
1
|e
j
1
(B.25)
s
2
= |s
2
|e
j
2
s
2
= |s
2
|e
j
2
(B.26)
Finally, the nth power of a complex variable can be obtained as
s
1
n
= |s
1
|
n
e
j n
(B.27)
B.3 LAPLACE TRANSFORMS
B.3.1 Denition of Laplace Transform
The Laplace transform is a mathematical tool which allows us to represent a function f (t )
as a continuous sumof generalized exponential functions with complex frequencies. Let the
Laplace transform of a function f (t ) be F(s), and the inverse Laplace transform of F(s) be
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.3 LAPLACE TRANSFORMS 551
f (t ). The denitions of the Laplace transform and the inverse Laplace transform are given
as follows:
L{ f (t )} = F(s) =
_

0
f (t )e
st
dt (B.28)
L
1
{F(s)} = f (t ) =
1
2j
_
+j
j
F(s)e
st
ds (B.29)
where s is a complex variable, dened as s = + j and is a real constant greater than
the real part of any singularity of F(s). A singularity of a function is a point in the s-plane
at which the function value goes to innity. The condition for the Laplace transform to exist
is given by
_

| f (t )|e
t
dt < (B.30)
where is a constant, real number with the property that | f (t )|e
t
remains bounded
as t . Another way to state this is that there are constants , M, and T such that
| f (t )|e
T
< M for all t > T.
Consider the function e
at
u(t ), where u(t ) is the unit step function, such that u(t ) = 0,
for t < 0, and 1 for t > 0
F(s) =
_

0
e
at
u(t )e
st
dt (B.31)
=
1
(s +a)
e
(s+a)t
|

0
(B.32)
=
1
s +a
(B.33)
for all ( +a) > 0 (B.34)
Note that if ( +a) < 0, the value of the above integral goes to innity and the
transform does not exist. Hence, the region of convergence is given by Re(s) > a.
Although the Laplace transform denition is used often in taking the Laplace trans-
formof a function, the inverse Laplace transformequation is usually a difcult mathematical
operation and is not normally used in engineering applications. An easier way to obtain
the inverse Laplace transform is to use partial fraction expansions, which will be discussed
later in this chapter.
Existence Condition A function f (t ) must be dened for all t > 0, except at a
nite set of points noted as discontinuities, in order for its Laplace transform to exist. Every
such f (t ), which is piecewise continuous and of exponential order, has a unique Laplace
transform.
In summary, for a function f (t ) to have Laplace transform, it is sufcient (but not
necessary) for the function to be:
r
Piecewise continuous.
r
Exponential order, that is
_

0
e
t
| f (t )|dt < ; there exists a nite or equivalently
| f (t )| < Me
t
t > T.
For instance, e
2t
is an exponential order function, but e
(t )
2
is not an exponential order
function.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
552 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
t
t
f
1
(t)
f
2
(t)
f
*
(t)
t
FIGURE B.4: Laplace transforms of functions that
differ only at point discontinuities are the same. Inverse
Laplace transformation gives a function which takes on
the arithmetic average value at discontinuities.
If a function is exponential order, the derivative of it is not necessarily exponential
order. Consider the following example:
f (t ) = sin (e
t
2
) (B.35)
d
dt
f (t ) = (2te
t
2
)cos (e
t
2
) (B.36)
where f (t ) is exponential order, but not the rst derivative of it.
If f
1
(t ), f
2
(t ) differ only at point discontinuities, never over a nite region, then they
have the same Laplace transform. Laplace transform, F(s), of a function, f (t ), is such
that F(s) 0, s F(s) Finite, as s . Inverse Laplace transform of F(s) gives
a function f

(t ) which takes on the average value at discontinuities (Fig. B.4).


B.3.2 Properties of the Laplace Transform
We have dened the Laplace transforms and the sufcient conditions for their existence.
Nowwe will discuss some of the properties of the Laplace transform. Keeping the properties
of the Laplace transform in mind is very helpful in the analysis of control systems.
Property 1 Linearity (also called the Superposition Property): Let the functions
f
1
(t ) and f
2
(t ) be piecewise continuous and exponential order, and let c
1
and c
2
be constant
scalars. The Laplace transform of the linear combination of two functions is equal to the
linear combination of the Laplace transforms of each of the individual functions. This
property is shown as follows:
L[c
1
f
1
(t ) +c
2
f
2
(t )] = c
1
L[ f
1
(t )] +c
2
L[ f
2
(t )]
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.3 LAPLACE TRANSFORMS 553
It is rather straightforward to show that this property is true by direct application of the
Laplace transform denition,
_

0
[c
1
f
1
(t ) +c
2
f
2
(t )]e
st
dt = c
1
_

0
f
1
(t )e
st
dt +c
2
_

0
f
2
(t )e
st
dt (B.37)
= c
1
F
1
(s) +c
2
F
2
(s) (B.38)
There is an analogy between differentiation and integration in the time domain, and
multiplication and division by s in the s-domain. Taking the derivative of a function in time
domain is equivalent to multiplying its Laplace transform by s in the s-domain. Similarly,
taking the integral of a function in time domain is equivalent to dividing the Laplace
transform of the function by s in the s-domain. There are also initial conditions given as
f (0) involved in the relationships, which are given below as properties 2 and 3.
Property 2 Let us assume that f (t ) is continuous and exponential order, and its
rst derivative f

(t ) is also piecewise continuous and exponential order. Then


L[ f

(t )] = sL[ f (t )] f (0); (B.39)


L[ f
(n)
(t )] = s
n
L[ f (t )] s
n1
f (0) s
n2
f

(0) . . . f
(n1)
(0) (B.40)
where f, f

, . . . , f
n1
are higher-order derivatives and are assumed continuous and expo-
nential order. Thus f
(n)
is piecewise continuous and of exponential order.
Let us prove the above relations for the rst derivative case.
L[ f

(t )] =
_

o
d
dt
( f (t ))e
st
dt (B.41)
Notice that
d
dt
( f (t )e
st
) =
d
dt
( f (t ))e
st
f (t )se
st
(B.42)
Then, rearranging
d
dt
( f (t ))e
st
=
d
dt
( f (t )e
st
) +s f (t )e
st
(B.43)
If we substitute this relationship in the above denition of the Laplace transform for f

(t ),
and take the integration term by term, we will nd that
L[ f

(t )] = sL[ f (t )] f (0) (B.44)


Property 3 Let both f (t ) and
_
t
0
f (t )dt be piecewise continuous and exponential
order; then it can be shown that
L
__
t
a
f (t )dt
_
=
1
s
L[ f (t )] (B.45)
Property 4 Initial Value theorem: It can be shown that the initial value of a signal
as t 0 and its behavior as s are related to each other as follows (Fig. B.5):
lim
t 0
+
f (t ) = f (0
+
) = lim
s
sF(s) (B.46)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
554 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
f(t)
f (t)
t 0
+
t
-1
t
Im(F(s))
Re(F(s))
sF(s)
s
S
0
+
FIGURE B.5: Initial Value theorem
describing the relation between time
domain function and its Laplace
transformation as time goes to zero.
Property 5 Final Value theorem: The nal value of a signal as t in the time
domain (in steady state) is related to the value of the Laplace transform of the function as
s 0 (Fig. B.6).
lim
t
f (t ) = lim
s0
sF(s) (B.47)
For the Final Value theorem to be applicable and meaningful, the function must have
a steady-state value as time goes to innity, such that
| f

(t )| < Me

0
t
;
0
< 0 (B.48)
where M is a positive nite value. This means that the function f (t ) is stable and converges
to a steady-state constant value. The equivalent condition in the s-domain requires that the
Laplace transform F(s) at most can have one pole at s = 0; everything else must be on
the left half of the s-plane. A pole is the value of s which makes the denominator of F(s)
zero (a singularity). The Final Value theorem is a very useful term in control theory, as
it is used to determine the nal value of a time function by examining the behavior of its
Laplace transform as s tends to zero. However, the Final Value theorem is not valid if the
denominator of s F(s) contains any pole whose real part is zero or positive.
In other words, for F(s) to be the Laplace transform of a signal which is stable and
converges to a constant value as time goes to innity it must have poles with negative real
parts and at most can have one pole at s = 0.
The basic analogies between the time domain and s-domain operations can be stated
as
s
d
dt
(B.49)
1
s

_
t
0
. . . dt (B.50)
Property 6 Multiplying a time domain function by an exponential function is equiv-
alent to the shifting of the Laplace transform of the function is s-domain by the exponential
power. An analogous relationship exists between shifting a function in time domain and its
f(t)
f (t)
t
t 0
+
-1
t
Im(F(s))
Re(F(s))
sF(s)
s
FIGURE B.6: Final Value theorem
describing the relation between time
domain function and its Laplace
transformation as time goes to innity.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.3 LAPLACE TRANSFORMS 555
t
2 .
1(t)
(t-a)
2 .
1(t-a)
t
2
1(t) 1(t-a)
(t-a)
2
FIGURE B.7: Shifted functions in time domain.
corresponding effect in s-domain.
L[e
at
f (t )] = L[ f (t )]
s s+a
= F(s +a) (B.51)
The following examples illustrate this property:
L[e
at
cos(bt )] =
(s +a)
(s +a)
2
+b
2
(B.52)
L[e
at
sin(bt )] =
b
(s +a)
2
+b
2
(B.53)
L[e
at
t
n
] =
n!
(s +a)
n+1
; n is positive integer (B.54)
Property 7 Multiplying a function in s-domain by an exponential function, i.e, e
as
,
has the effect of shifting the original function in time domain by a units (Fig. B.7).
L[ f (t a)u(t a)] = e
as
L[ f (t )] (B.55)
L
1
[e
as
F(s)] = f (t a)u(t a) (B.56)
Note that in some cases we may need to take the Laplace transform of a function in
the following form:
L[ f (t )u(t a)]
where u(t a) is the unit step function shifted in time from t = 0 to t = a. In order to take
the Laplace transform using the above relations, we must make sure the arguments of the
function and the shifted unit step function are the same.
f [(t +a) a]u(t a) = g(t a)u(t a) (B.57)
L[g(t a)u(t a)] = e
as
L[g(t )] (B.58)
= e
as
L[ f (t +a)] (B.59)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
556 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
Therefore,
L[ f (t )u(t a)] = e
as
L[ f (t +a)], a 0 (B.60)
Property 8 The analog of properties 2 and 3that is, multiplying and dividing a
function in time domain by t , is related to differentiation, and integration of the function is
the s-domain.
L[ f (t )] = F(s) (B.61)
L[t f (t )] = F

(s) (B.62)
L
_
f (t )
t
_
=
_

s
F(s)d(s) (B.63)
Property 9 Convolution theorem: Let us consider two functions f (t ) and g(t ),
which are both piecewise continuous and exponential order, then
L[ f (t )] L[g(t )] = L
__
t
0
f (t )g()d()
_
which states that the product of the Laplace transforms of two functions is equal to the
Laplace transform of the convolution of the two functions.
Proof:
L
__
t
0
f (t )g()d
_
=
_

0
__
t
0
f (t )g()d
_
e
st
dt (B.64)
=
_

0
_

0
f (t )g()u(t )e
st
ddt (B.65)
=
_

0
g()
__

0
f (t )u(t )e
st
dt
_
d (B.66)
=
_

0
g()
__

0
f ()e
s
d
_
e
s
d (B.67)
=
_

0
g()e
s
d
_

0
f ()e
s
d (B.68)
= G(s)F(s) (B.69)
Note that the following changes of variables and relations are used in the above deriva-
tion,
u(t ) =
_
1 < t
0 > t
t = (B.70)
dt = d (B.71)
and integral limits on eqn. B.64 from [0, t ] is extended in eqn. B.65 to [0, ] since for
> t , the [t, ] range would be zero due to the denition of u(t ).
B.3.3 Laplace Transforms of Some
Common Functions
The Laplace transforms of a number of functions often encountered in control systems
are studied below. The transforms are obtained by direct application of the denition and
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.3 LAPLACE TRANSFORMS 557
e
b(t-a)
1(t-a)
..
2
b

e
at
e
at
1
1
-1
-1
1
1
1
sb
1
e
b(ta)
1(ta) = e
as

s+a
1
e
at
=
s
2
+b
2
s
cos bt =
s
2
+b
2
b
sin bt =
(t) = 1
s
1
1(t) =
FIGURE B.8: Laplace transform of some
common signals.
properties dened in this chapter. More complicated functions can be expressed as a linear
summation of the elementary functions. Then the Laplace transformof the linear summation
can be taken by application of the superposition (linearity) property (Figs. B.8 and B.9).
1. Unit Pulse: Consider the following unit pulse such that
u
1
(t ) =
_
lim
0
f (t ); t = 0
0; t = 0
(B.72)
The Laplace transform of the unit pulse is
L[u
1
(t )] =
_

0
u
1
(t )e
st
dt =
_
0
+
0

e
st
dt = 1 (B.73)
2. Unit Step: Consider the following unit step function such that
u
2
(t ) =
_
1; t 0
0; t 0
(B.74)
where the Laplace transform is given by
F(s) = L[u
2
(t )] =
_

0
u
2
(t )e
st
dt =
1
s
[e
st
]

0
=
1
s
(B.75)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
558 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS

1/
a
a
1(t-a)
t
n .
1(t)
e
at
s
n+1
n!
t
n
= ; n z
+
b
(s+a)
2
+b
2
e
at
Sin bt =
(s+a)
(s+a)
2
+b
2
e
at
cos bt =
s
1
1(ta) = e
as
s
2
1
(ta)1(ta) = e
as
(ta) = e
as
1
FIGURE B.9: Laplace transform of some
common signals.
3. Exponential function: Consider the following function:
u
3
(t ) = e
at
(B.76)
The Laplace transform follows as
F(s) = L [u
3
(t )] =
_

0
e
at
e
st
dt (B.77)
=
_
e
(s+a)t
s +a
_
|

0
(B.78)
=
1
s +a
(B.79)
for Re(s) > a. Therefore, the Laplace transform of f (t ) = e
at
exists in the region
to the right of the line Re(s) = a in the s-plane.
4. Sinusoid: Consider the function
u
4
(t ) = cos(t ) (B.80)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.3 LAPLACE TRANSFORMS 559
a b
1
FIGURE B.10: Example signal.
With Laplace transform,
F(s) = L[cos(t )] =
_

0
cos(t )e
st
dt (B.81)
=
1
2
_

0
(e
j t
+e
j t
)e
st
dt (B.82)
0 =
1
2
L[e
j t
] +
1
2
L[e
j t
] (B.83)
=
1
2
_
1
s j
+
1
s + j
_
(B.84)
L[cos t ] =
s
s
2
+
2
(B.85)
It is not necessary to derive the Laplace transform of f (t ) each time. Laplace transform
tables can conveniently be used to nd the transformof a given function. Figures B.8 and B.9
show Laplace transforms of time functions that frequently appear in linear system analysis.
Example Find the Laplace transform of the following function (Fig. B.10):
f (t ) = u(t a) u(t b)
This signal is comprised of a unit step function shifted in time by b subtracted from a unit
step function shifted in time by a (Fig. B.11).
L[ f (t )] = L[u(t a)] L[u(t b)] (B.86)
= e
as
1
s
e
bs
1
s
(B.87)
= (e
as
e
bs
)
1
s
(B.88)
a
b
1
1
FIGURE B.11: Decomposition of the signal.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
560 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
B.3.4 Inverse Laplace Transform: Using Partial
Fraction Expansions
We can use Laplace transforms to convert a linear constant coefcient differential equation
to an algebraic equation. The algebraic equation is a function of the complex variable s and
can be expressed as the ratio of the Laplace transformof the output to the input. This function
is called the transfer function. The Laplace transformof the response of a dynamic systemis
equal to the algebraic multiplication of the transfer function and the Laplace transformof the
input function. In order to nd the response in the time domain, we need to take the inverse
Laplace transform of the response to return to the time domain. In practice, the difculty of
applying the inverse Laplace transform denition makes it impractical in most engineering
applications. Instead, the method of partial fraction expansion (PFE) is commonly used in
obtaining the inverse Laplace transform. The idea is to expand the rational function F(s) into
a summation of simpler components for which the inverse Laplace transforms are known.
Let us restate the denition of the Laplace and the inverse Laplace transforms
L f (t ) = F(s) =
_

0
f (t )e
st
dt (B.89)
L
1
[F(t )] = f (t ) =
1
2j
_
+j
j
F(s)e
st
dt (B.90)
Consider a general rational function F(s) of complex variable s, such that
F(s) =
n(s)
d(s)
(B.91)
= F
1
(s) + F
2
(s) + + F
n
(s) (B.92)
where we assume that the function F(s) can be expressed as a sum of simpler functions
F
i
(s)s, and their corresponding inverse Laplace transforms f
i
(t ) are known. Then the
inverse Laplace transform can be obtained by the superposition (linearity) property,
f (t ) = f
1
(t ) + f
2
(t ) + + f
n
(t ) (B.93)
The mathematical derivation of the PFE is based on the Taylor and Laurent series
expansions [56]. Let F(s) be a rational polynomial of a complex variable s, and it has poles
s
1
, s
2
, . . . ., s
m
withmultiplicityn
1
, n
2
, . . . ., n
m
. Alsonote that for most engineeringsystems
the degree of the numerator is less thanthe degree of the denominator, deg(n(s)) deg(d(s)).
Then, F(s) can be expanded into its partial fractions expansion as follows:
F(s) =
B(s)
A(s)
(B.94)
= F
1
(s) + + F
m
(s) +a
0
(B.95)
=
a
1,1
(s s
1
)
n
1
+ +
a
1,n
1
s s
1
(B.96)
+
a
2,1
(s s
2
)
n
2
+ +
a
2,n
2
(s s
2
)
(B.97)
.
.
.
+
a
m,1
(s s
m
)
n
m
+ +
a
m,n
m
s s
m
(B.98)
+ a
0
(B.99)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.3 LAPLACE TRANSFORMS 561
Given a rational function F(s), we need to nd the roots of its denominator and the mul-
tiplicity of each root. Then we can write out the PFE in the form of equation B.99 where
only the constants of the numerators are unknown. Examining both sides of the expansion,
it is easy to see that a
1,1
can be calculated as follows:
a
1,1
= lim
ss
1
_
(s s
1
)
n
1
F(s)
_
(B.100)
Noting that roots of the expanded PFE in terms of the coefcients a
1,n
i
are repeated, a
1,2
can be found by taking the derivative of the expansion as calculated for a
1,1
, such that
a
1,2
= lim
ss
1
d
ds
_
(s s
1
)
n
1
F(s)
_
(B.101)
This relationship can be generalized such that any of the coefcients of the expansion can
be determined as
a
i, j
= lim
ss
i
1
( j 1)!
d
j 1
ds
j 1
_
(s s
i
)
n
i
F(s)
_
(B.102)
Let us consider examples which illustrate applications of the PFE in obtaining inverse
Laplace transforms. The constant term a
0
is obtained by direct division of the numerator
by the denominator if deg(n(s)) = deg(d(s)). If deg(n(s)) < deg(d(s)), then a
0
is zero.
Example Consider the following rational function of a complex variable, and let us
take the inverse Laplace transform of it using PFE.
G(s) =
s +2
(s 1)
2
(s +1)
(B.103)
=
a
1,1
(s 1)
2
+
a
1,2
(s 1)
+
a
2,1
(s +1)
(B.104)
The coefcients can be obtained using the formula given in equation B.102.
a
1,1
= lim
s1
[(s 1)
2
G(s)] =
3
2
(B.105)
a
1,2
= lim
s1
d
ds
[(s 1)
2
G(s)] =
1
4
(B.106)
a
2,1
= lim
s1
[(s +1)G(s)] =
1
4
(B.107)
Now we can take the inverse Laplace transform of each component.
G(s) =
3
2
(s 1)
2
+

1
4
s 1
+
1
4
s +1
(B.108)
g(t ) =
3
2
t e
t

1
4
e
t
+
1
4
e
t
(B.109)
g(t ) =
_
3
2
t
1
4
_
e
t
+
1
4
e
t
(B.110)
Example Consider the following complex function and its inverse Laplace transform
using the PFE method:
Y(s) =
1
(s +1)(s +2)(s +3)
(B.111)
=
a
1,1
s +1
+
a
2,1
s +2
+
a
2,1
s +3
(B.112)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
562 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
m = 1
k = 5 c = 2
u(t)
y(t)
1
FIGURE B.12: A second-order linear system model:
Mass, damper, and spring with external force.
The coefcients of PFE are found using equation B.102,
a
1,1
= lim
s1
[(s +1)Y(s)] =
1
2
(B.113)
a
2,1
= lim
s2
[(s +2)Y(s)] = 1 (B.114)
a
3,1
= lim
s3
[(s +3)Y(s)] =
1
2
(B.115)
Hence, the inverse Laplace transform is easily found as follows:
Y(s) =
1
2
s +1
+
1
s +2
+
1
2
s +3
(B.116)
y(t ) =
1
2
e
t
e
2t
+
1
2
e
3t
(B.117)
Example Consider a linear dynamic system with transfer function, G(s), input u(t ),
and output y(t ). Let the Laplace transform of u(t ) be U(s), and that of y(t ) be Y(s). By
application of the Convolution theorem, valid for linear time invariant systems, the Laplace
transform of the response (Fig. B.12), Y(s), is equal to the transfer function multiplied by
the Laplace transform of the input, U(s),<?TeX
Y(s) = G(s) U(s) (B.118)
By application of Newtons second law, the forceacceleration relationship of the
mass at a displacement y(t ) and speed y(t ) is
m y(t ) = u
net
(t ) (B.119)
= u(t ) c y(t ) k y(t ) (B.120)
m y(t ) +c y(t ) +k y(t ) = u(t ) (B.121)
1.0 y(t ) +2.0 y(t ) +5.0 y(t ) = u(t ) (B.122)
If we take the Laplace transform of the differential equation, and assume zero initial con-
ditions, that is y(t
o
) = y(t
0
) = 0, then
1.0 s
2
Y(s) +2.0 sY(s) +5.0 Y(s) = U(s) (B.123)
Y(s)
U(s)
= G(s) (B.124)
G(s) =
1
s
2
+2s +5
(B.125)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.3 LAPLACE TRANSFORMS 563
In general, the transfer function between force (input) and displacement (output) of such a
system has the following form:
Y(s)
U(s)
= G(s) =
1
ms
2
+cs +k
(B.126)
and when there is no damper or spring (c = k = 0), the transfer function reduces to
Y(s)
U(s)
= G(s) =
1
ms
2
(B.127)
The same transfer function relationship describes the dynamics of a rotary inertia-torque
system. The analogy between the variables are as follows: displacement and angular dis-
placement, force and torque, translational spring/damper and rotational spring/damper.
In particular, the input force function u(t ) is a step function with unit magnitude.
Then we can detemine the response of the system to this particular input using the transfer
function and inverse Laplace transform method. The Laplace transform of the step function
is
U(s) =
1
s
(B.128)
The response in the s-domain and its partial fraction expansion (PFE) can be expressed as
Y(s) =
1
s
2
+2s +5

1
s
(B.129)
=
1
s(s +1 2 j )(s +1 +2 j )
(B.130)
=
a
1,1
s
+
a
2,1
(s +1 2 j )
+
a
3,1
(s +1 +2 j )
(B.131)
a
1,1
= lim
s0
[sY(s)] = 1/5 (B.132)
a
2,1
= lim
s1+2 j
[(s +1 2 j )Y(s)] = 0.1 +0.04 j (B.133)
a
3,1
= = 0.1 0.04 j (B.134)
Note that a
3,1
= a

2,1
because s
2
= s

2
. This is always true. The residues of complexconjugate
poles are complex conjugate of each other. Here we carried out the calculations in detail to
illustrate the properties by example.
The time domain response can be obtained by taking the inverse Laplace transform
of the PFE form of Y(s)
y(t ) = L
1
_
1
5
s
+
0.1 +0.04 j
s +1 2 j
+
0.1 0.04 j
s +1 +2 j
_
= (1/5)u(t ) +(0.1 +0.04 j )e
t
e
2jt
(0.1 +0.04 j )e
t
e
2jt
= (1/5)u(t ) +e
t
[0.1(e
2jt
+e
2jt
) +0.04 j (e
2jt
e
2jt
)]
= (1/5)u(t ) e
t
(0.2cos(2t ) +0.08sin(2t ))u(t )
= (1/5)u(t ) (0.2cos(2t ) +0.08sin(2t ))e
t
u(t )
= (1/5)u(t ) D sin(2t +)e
t
u(t ) (B.135)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
564 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
Step
+
-
-
1
2
5
Mass Integrator
Integrator1
1
s
1
s
Damping
Spring
Scope
FIGURE B.13: Model and simulation of a mass, damper, and spring with an external force
system using Simulink.
where
D =
_
0.2
2
+0.08
2
(B.136)
= +tan
1
_
0.2
0.08
_
(B.137)
Note that the following relations were used in the above example:
A cost + B sint = C sin(t +) (B.138)
A = C sin (B.139)
B = C cos (B.140)
C = (A
2
+ B
2
)
1
2
(B.141)
= tan
1
_
A
B
_
(B.142)
Notice that the response of the systemcan also be determined numerically by using a Matlab
or Simulink environment. Figure B.13 shows the Simulink model and simulation result.
B.4 FOURIER SERIES, FOURIER TRANSFORMS, AND
FREQUENCY RESPONSE
Every signal can be viewed in terms of its frequency content. Fouries series is a mathematical
expression of the fact that any periodic function can be expressed as a series sumof sine and
cosine functions which have frequencies that are integer multiples of the frequency of the
periodic function. Then, a periodic function can be viewed as having frequency content that
includes its main frequency and the integer multiples of that frequency. Fourier transforms
can be dened as the limiting case of Fourier series for nonperiodic functions where a
nonperiodic function is viewed as a periodic function with innite period. When the period
is innite, the fundamental frequency of the function is innitesimally small. As a result,
the series summation of Fourier series becomes an integral operation in Fourier transforms.
Let us consider a periodic function, f (t ), and its Fourier series expression and Fourier
transform,
f (t ) = f (t + T) (B.143)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.4 FOURIER SERIES, FOURIER TRANSFORMS, AND FREQUENCY RESPONSE 565
where T > 0 is the period of the function. If T is nite, we can express the function as a
Fourier series. Fourier series can be viewed as a frequency domain representation of the
periodic function where only integer multiples of the fundamental frequency are involved
in the function. We call fundamental frequency w
1
= 1/T [Hz] or w
1
= 2/T [rad]. If T is
innite (the function is not periodic), we can express the function in frequency domain as
continuous function of frequency, which is referred to as its Fourier transform.
The following conditions are sufcient but not necessary for the existence of the
Fourier series and transforms (rst two conditions are for Fourier series, and all three
conditions are for Fourier transforms):
1. Function must be piecewise continuous.
2. Function can have nite discontinuities, but the maximum and minimum values of
the function are within a nite range.
3.
_
+

| f (t )| dt < M; M nite.
Any periodic function which satises the above two requirements can be experessed
as an innite series sum as follows:
f (t ) =
1
2
a
o
+

n=1

a
n
cos
_
2n
T
t
_
+b
n
sin
_
2n
T
t
_
(B.144)
=

n=

c
n
e
j
2n
T
t
(B.145)
The second series expression is called the complex form, and it can be shown that it is
equivalent to the rst form. It can be shown that the coefcients in the above series are as
follows (derivation is skipped here and can be found in any advanced mathematics book):
a
o
=
1
T/2
_
t
0
t
o
+T
f (t ) dt (B.146)
a
n
=
1
T/2
_
t
0
t
o
+T
f (t ) cos
_
2n
T
t
_
dt (B.147)
b
n
=
1
T/2
_
t
0
t
o
+T
f (t ) sin
_
2n
T
t
_
dt (B.148)
c
n
=
1
T
_
t
0
t
o
+T
f (t ) e
j (
2n
T
t )
dt (B.149)
In the above integrations for coefcients, the t
0
is arbitrary. The important thing is that
the integration should be taken over a complete period, T. Therefore, t
0
= 0 is often a
convenient choice. It can be shown that a
n
, b
n
, and c
n
coefcients are related. In addition,
c
n
coefcients appear in complex conjugate pairs. As a result, the complex form of the
series expression still leads to a real function.
If we have a function that is nonperiodic, then we can view it as a limiting case
of a periodic function where T goes to innity. In this case, the fundamental frequency,
w
1
= 2/T, is innitesimally small, and integer multiples of it, w
n
= (2/T)n, are almost
a continuous frequency spectrum. Figure B.14 shows a periodic function, its Fourier series
frequency content, as the period of the function is extended to innity, and its frequency
content.
Fourier transform is a limiting case of Fourier series where the period of the original
function is innite, and the fundamental frequency of the function is very small. Hence,
the integer multiples of the fundamental frequency actually form a continuous frequency
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
566 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
f(t)
1
-3 -2 -1
T = 4
1 2 3
t (sec)
(a)
1/2*a
0
1/2
-2 -1
-2 -1 1 2
(cost)*a
1
2
(cos 3t)*a
3
2
(sin 3t)*b
3
2
(sin t)*b
2
2 1
(cos t)*a
2
2
2
1
1
-1 -2
-2 -1
(b)
-2 -1 1 2
-2 -1 1 2
2 1 -1 -2
(sin t)*b
1
2
FIGURE B.14: Fourier series of a periodic function. (a) a periodic signal, and (b) its Fourier
series components (cos(
2n
T
t, sin(
2n
T
t , n = 1, 2, . . .) and magnitude of each components
contribution (a
i
, b
i
) at integer multiples of the fundamental frequency.
f (t) = f (t + T) =
1
2
a
o
+

n=1

(a
n
cos (
2n
T
t) +b
n
sin(
2n
T
t).
spectrum. The series summation of discrete frequency contents becomes integral of con-
tinuous frequency content. Let f (t ) be the periodic function with period T and its Fourier
series experession be
f (t ) =

n=

c
n
e
j
2n
T
t
(B.150)
where
c
n
=
1
T
_
0
T
f (t ) e
j (
2n
T
t )
dt (B.151)
Substitute the c
n
denition into the above series, and let w
n
=
2
T
n = w n,
f (t ) =

n=
1
2
e
j w
n
t
__
T
0
f ()e
j w
n

d
_
w (B.152)
=

n=

e
j w
n
t
F( j w
n
) w (B.153)
If we let T , then w dw, w
n
w, and the summation can be replaced by
integration,
f (t ) =
_

1
2
e
jwt
__

f ()e
j w
d
_
dw (B.154)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.4 FOURIER SERIES, FOURIER TRANSFORMS, AND FREQUENCY RESPONSE 567
where
F( jw) =
_

f (t ) e
jwt
dt Fourier transform (B.155)
f (t ) =
1
2
_

F( jw) e
jwt
dt Inverse Fourier transform (B.156)
It should be noted that the constant (1/2) in the Fourier transformand inverse Fourier trans-
form expression can be divided between the two expressions in any way desired depending
on the convention used, as long as the multiplication of them equals 1/2.
Fourier transform is a linear operator and has the same properties as Laplace trans-
forms, such as linearity, shift, convolution. Notice that Fourier transform is applied to func-
tions that run fromto in the independent variable which is generally time in our case.
Laplace transform is applied to functions that run from a nite time (i.e., zero time) to in-
nite. If we have the Laplace transformof a function, its Fourier transformcan be obtained by
F( jw) = F(s)|
s=j w
(B.157)
Example Consider the square function shown in Fig. B.14 with unit magnitude and
period T[sec]. We will consider two cases of this function as follows:
1. Let T = 4.0sec, andwe are todetermine the Fourier series descriptionof it (Fig. B.14).
2. Let T = sec, and we are to determine the Fourier transform of it (Fig. B.15).
(a)
(b)
-2 -1 1 2
b
n
b
0
b
1
b
3
2
b
2
b
1
b
0
b
3
b
2
a
1
a
n
a
0
a
0
a
3
a
2
a
1
a
3
a
2
T
4
T
6
T
2
T
4
T
6
T

-1 1
T
FIGURE B.15: Fourier transform of a nonperiodic function: (a) a nonperiodic signal as a
limiting case of a periodic signal where the period T , and (b) its Fourier transform
function which can be interpreted as a limiting case of Fourier series. Fourier series represents
the frequency content of a periodic signal with a function of discrete frequencies. Fourier
transform represents the frequency content of a nonperiodic signal with a function of
continuous frequency.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
568 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
The fundamental frequency of the periodic function is
w
1
=
2
T
=
2
4
=

2
[rad/sec] (B.158)
=
1
T
[Hz] = 0.25[Hz] (B.159)
The frequency components of cosine and sine functions [cos(w
n
t ), sin(w
n
t )] contributing to
the Fourier series description of the function are simply integer multiples of that fundamental
frequency w
1
,
w
n
= n w
1
= n

2
; n = 1, 2, 3, . . . (B.160)
=

2
, ,
3
2
,
4
2
,
5
2
, . . . . (B.161)
The contribution of each sinusoidal function is determined by the coefcients a
o
, a
n
, b
n
,
n = 1, 2, . . . which can be determined by
a
o
=
1
2
_
2
2
f (t ) dt =
1
2
_
1
1 dt =
1
2
(t )|
1
1
= 1 (B.162)
a
n
=
1
2
_
2
2
f (t ) cos
_

2
nt
_
dt ; n = 1, 2, 3, . . . (B.163)
=
1
2
_
1
1
1.0 cos
_

2
nt
_
dt (B.164)
=
1
2

2
n
sin
_

2
nt
_

1
1
(B.165)
=
1
n
(1 +1) (B.166)
=
2
n
(B.167)
b
n
=
1
2
_
2
2
f (t ) sin
_

2
nt
_
dt ; n = 1, 2, 3, . . . (B.168)
=
1
2
_
1
1
1.0 sin
_

2
nt
_
dt (B.169)
=
1
2

2
n
cos
_

2
nt
_

1
1
(B.170)
=
1
2

2
n
(0 0) (B.171)
= 0 (B.172)
If we think of the Fourier series as a summation of sinusioidal functions, it is clear that the
periodic functions have discrete frequency content.
f (t ) =
1
2
+
1

n=1
1
n
cos
_

2
nt
_
; n = 1, 2, 3, . . . (B.173)
Notice that since this function is an even function, b
n
coefcients are all zero. For even
functions, this is always the case. If the function were an odd periodic function instead, then
a
0
, a
1
, a
2
, . . . . would be zero. This is a property of Fourier series.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.4 FOURIER SERIES, FOURIER TRANSFORMS, AND FREQUENCY RESPONSE 569
Let us now consider the nonperiodic function, which is only a pulse. The Fourier
transform of the function can be obtained by evaluating the integral,
F( jw) =
_

f (t ) e
jwt
dt (B.174)
=
_
1
1
1.0 e
jwt
dt (B.175)
=
1
j w
e
jwt
|
1
1
(B.176)
=
1
j w
_
e
jw
e
jw
_
(B.177)
=
1
j w
_
e
jw
+e
jw
_
(B.178)
=
2
w
sin(w) (B.179)
which indicates that the Fourier transformof a single-pulse function, which is a nonperiodic
function, is a continuous function of frequency.
B.4.1 Basics of Frequency Response: Meaning
of Frequency Response
Consider a linear time invariant stable (LTI) dynamic system shown in Fig. B.16. If such a
system is excited by a sinusoidal input signal, the response of the system in steady state is
also sinusoidal with the same frequency. The only difference would be in the magnitude and
phase of the steady-state response in relation to the input signal. Furthermore, the output-
to-input magnitude ratio and the phase shift are functions of excitation frequency. This is a
property of the LTI stable dynamic systems. For the input signal
u(t ) = A sin (wt) (B.180)
the steady-state response of the LTI system is
y(t ) = B sin (wt +) (B.181)
1

0
+
L. T. I.
H(s) =
u(t) y(t)
y(s)
u(s)
FIGURE B.16: For a linear time
invariant dynamic system, Laplace
transform of the impulse response
is equal to the transfer function.
Similarly, Fourier transform of the
impulse response is equal to the
frequency response relationship
between input and output.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
570 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
For nonlinear or time-varying systems, this relationship does not hold. For LTI sys-
tems, output-to-input magnitude ratio and the phase as functions of frequency completely
characterize a specic LTI system steady-state response,
B/A = B/A(w) (B.182)
= (w) (B.183)
B.4.2 The Relationship Between the Frequency
Response and Transfer Function
The magnitude ratio and phase difference in the steady-state response of an LTI system to
a sinusoidal input, {B/ A(w), (w)}, are related to the transfer function of the LTI system.
Let us derive this relationship. Let the transfer function of the LTI stable system be
G(s) = n(s)/d(s) (B.184)
and note that because the dynamic system is assumed to be stable, all the roots of d(s) have
negative real parts. Hence, consider a transfer function
G(s) = n(s)/((s + p
1
)(s + p
2
) . . . (s + p
n
)) (B.185)
where Re( p
i
) < 0for i = 1, . . . , n. Let us calculate the response of the systemtoa sinusoidal
input Asin(wt) using partial fraction expansions and inverse Laplace transform,
y(t ) = L
1
{G(s)u(s)} (B.186)
= L
1
{n(s)/((s + p
1
)(s + p
2
) . . . (s + p
n
)). Aw/(s
2
+w
2
)} (B.187)
If we take the partial fraction expansion of the terms inside the bracket,
y(t ) = L
1
_
k
1
s + j w
+

k
1
s j w
+
c
1
s + p
1
+
c
2
s + p
2
+ +
c
n
s + p
n
_
(B.188)
= k
1
e
jwt
+

k
1
e
jwt
+
p

i =1
c
i
e
p
i
t
(B.189)
lim
t
y(t ) = k
1
e
jwt
+

k
1
e
jwt
(B.190)
The summation terms associated with transient response go to zero because the LTI is stable
and, therefore, has poles with negative real parts. It can be shown that the residues k
1
and
the complex conjugate of it,

k
1
, are
k
1
= lim
sj w
{(s + j w)G(s)u(s)} =
A
2 j
G(j w) (B.191)

k
1
= lim
sj w
{(s j w)G(s)u(s)} =
A
2 j
G( jw) (B.192)
Let us note the following relations:
G( jw) = |G( jw)|e
j
(B.193)
G(j w) = |G(j w)|e
j
= |G( jw)|e
j
(B.194)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.4 FOURIER SERIES, FOURIER TRANSFORMS, AND FREQUENCY RESPONSE 571
where = tan

1
_
Im(G( jw))
Re(G( jw))
_
. The steady-state response is
y
ss
(t ) =
A
2 j
G(j w)e
jwt
+
A
2 j
G( jw)e
jwt
(B.195)
= A|G( jw)|
_

1
2 j
e
jwt
e
j
+
1
2 j
e
jwt
e
j
_
(B.196)
= A|G( jw)|sin (wt +) (B.197)
= Bsin (wt +) (B.198)
From the above equation, the relationship between transfer function magnitude and its
phase evaluated along s = j w axis and the steady-state response to sinusoidal input which
is characterized by the output-to-input magnitude ratio and phase shift between output and
input,
B/ A(w) = |G( jw)| (B.199)
(w) = tan
1
_
Im(G( jw))
Re(G( jw))
_
(B.200)
Therefore, the steady-state response of an LTI stable dynamic system to a sinusiodal input
at various frequencies conveys the same information as the transfer function of the system
evaluated along the imaginary axis. The transfer function evaluated along the imaginary
axis conveys all the information conveyed by the transfer function over the s-plane, and it
is called the frequency response of the LTI dynamic system.
B.4.3 s-domain Interpretation
of Frequency Response
We can think of the frequency response as either the magnitude ratio and phase shift of a
linear system in steady-state response to a sinusoidal stimulus or as the transfer function
evaluated along the s = jw axis on the complex s-plane. If the G(s) is a stable transfer
function, the G( jw) completely describes the same information described by G(s).
G(s)
|s=j w
= G( jw) = |B/ A(w)|e
j (w)
(B.201)
Magnitude ratio at a frequency is equal to gain multiplied by the magnitude of product of
the phasors from zeros divided by the the magnitude of product of the phasors from poles.
G( jw) = K
1
(s + z
i
)
(s + p
i
)

s=jw
(B.202)
= K
1
| jw + z
i
|
| jw + p
i
|

s=jw
e
j (

z
i

p
i
)
(B.203)
= |G( jw)|e
j (w)
(B.204)
Therefore, the following relations are obvious from the above:
|G( jw)| = K
1
| jw + z
i
|
| jw + p
i
|
(B.205)
(w) =
_

z
i

p
i
_
(B.206)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
572 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
B.4.4 Experimental Determination
of Frequency Response
Consider the dynamics system shown in Fig. B.16. It is excited by an input signal in the
range such that the dynamic system behaves as a LTI system. Let us assume that we can
set the magnitude and phase of the input signal, and that we can measure the response
magnitude and phase.
The experimantal procedure to determine the frequency response is:
1. Select A, and w = w
0
(i.e., w
0
= 0.001).
2. Apply input signal: u(t ) = Asin (wt).
3. Wait long enough so that the output reaches the steady-state response and so that
transients die out.
4. Measure B and of the response in y(t ) = B sin (wt +).
5. Record w, B/ A, .
6. Repeat until w = w
max
where w
max
is the maximum frequency of interest, by incre-
menting w = w +w. w is the increment of frequency as the experiment sweeps
the freqeuncy range from w
0
to w
max
.
7. Plot B/ A, versus w.
8. Curve t to B/ A and as function of w and obtain a mathematical expression for the
frequency response as a rational function.
B.4.5 Graphical Representation
of Frequency Response
The frequency response of a dynamic systemis conveniently represented by a complex func-
tion of frequency. The complex function can be graphically represented in many different
ways. In control system studies, three most commonly known representations are:
1. Bode plots: plot 20log
10
|G( jw)| v.s. log
10
(w) and Phase(G( jw)) v.s. log
10
(w).
2. Nyquist plots (polar plots): plot Re(G( jw)) v.s. Im(G( jw)) on the complex G( jw)
plane where w-frequency is parameterized along the curve.
3. Log magnitude versus phase plot: plot the 20log
10
(G( jw)) (y-axis) vs. phase(G( jw))
(x-axis) and w-frequency is parameterized along the curve.
One can choose to graphically plot the complex frequency response function in many other
ways. The above three representations are the most common ones. With the aid of CAD-
tools, it is very simple to plot a given frequency response in any one of the above forms.
However, the ability to plot basic building blocks of transfer functions by hand sketches
still remains a powerful tool in design.
B.5 TRANSFER FUNCTION AND IMPULSE
RESPONSE RELATION
The equation that relates the Laplace transforms of input and output is called the transfer
function, or inputoutput description of a linear time invariant system. The transfer function
does not take the initial condition effects into account. One can dene the relationship
between the initial conditions and output as another transfer function which describes the
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.5 TRANSFER FUNCTION AND IMPULSE RESPONSE RELATION 573
way the initial conditions inuence the output. Generally, the term transfer function alone
refers to the transfer function from input to output.
We can take the Laplace transform of any linear constant coefcient ordinary differ-
ential equation and nd out the transfer function between inputoutput as well as between
initial condition and output. Consider the following LTI system model:
y +3 y +2y = 2 u +u (B.207)
and assume that initial conditions, y
0
= y
0
, y(0) = y
0
, u(0) = u
0
, are given. The response
of the system, y(t ), to any input, u(t ), plus the given initial conditions can be studied using
Laplace transforms.
Note that
L{y(t )} = y(s) (B.208)
L{u(t )} = u(s) (B.209)
L{ y(t )} = sy(s) y(0) (B.210)
L{ u(t )} = su(s) u(0) (B.211)
L{ y(t )} = s
2
y(s) y(0) sy(0) (B.212)
Using the above properties of Laplace transforms, we can take the Laplace transform of the
o.d.e.,
(s
2
y(s) y(0) sy(0)) +3(sy(s) y(0)) +2y(s) = 2(su(s) u(0)) +u(s) (B.213)
(s
2
+3s +2)y(s) = (2s +1)u(s) 2u(0) + y(0) +(s +3)y(0) (B.214)
and the Laplace transform of the response as a result of the input and the initial conditions
can be found as
y(s) =
2s +1
s
2
+3s +2
u(s)
2
s
2
+3s +2
u
0
+
1
s
2
+3s +2
y
0
+
s +3
s
2
+3s +2
y
0
(B.215)
The y(s) can be obtained for any input and initial conditions, then by taking inverse
Laplace transform (i.e., using partial fraction expansion), y(t ) can be obtained. Note that if
the initial conditions are zero, the response will be only due to the input
y(s) =
2s +1
s
2
+3s +2
u(s) (B.216)
and in general, the relationship between u(s) and y(s) is described by a rational polynomial
of s called the transfer function,
G(s) =
y(s)
u(s)
(B.217)
y(s) = G(s)u(s) (B.218)
which describes the output due to input.
Special Case If u(t ) = (t ) unit impulse function, the Laplace transformof it is u(s) =
1.0, then y(s) = G(s), which means that the transfer function of an LTI systemis the Laplace
transform of its unit impulse response.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
574 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
The transfer function and unit impulse response are related to each other as follows:
G(s) = L{h(t )} (B.219)
h(t ) = L
1
{H(s)} (B.220)
Similarly, the Fourier transform of the impulse response is equal to the frequency response
of the system,
G( jw) = F{h(t )} (B.221)
= G(s)|
s=j w
(B.222)
h(t ) = F
1
{G( jw)} (B.223)
The transfer function of a LTI dynamic system consists of poles, zeros, and gain
(constant),
{A transfer function } = { { poles }, { zeros }, { constant (gain) } }
G(s) = K

(s + z
i
)

(s + p
i
)
(B.224)
= K
dc

(s/z
i
+1)

(s/p
i
+1)
(B.225)
where it is clear that the DC gain K
dc
of the transfer function and the gain K are related as
K
dc
= G(0) = K

z
i

p
i
(B.226)
For instance, consider the following transfer function:
G(s) =
b(s)
a(s)
=
2s +1
s
2
+3s +2
(B.227)
The zeros are these s values for which G(s) is zero, which means b(s) is zero,
{s | G(s) = 0 : b(s) = 0} 2s +1 = 0 s =
1
2
(zeros) (B.228)
The poles are these s values for which G(s) goes to , which means a(s) is zero,
{s | G(s) : a(s) = 0} s
2
+3s +2 = 0 s = 1, 2 (poles) (B.229)
Another convenient way of expressing G(s) is poles, zeros, and DC gain. The DC gain is
dened as the value of G(s) at s = 0. Consider the same transfer function,
G(s) =
2s +1
s
2
+3s +2
(B.230)
=
2
_
s +
1
2
_
(s +1)(s +2)
(B.231)
=
_
s
1
2
+1
_
2
_
s
1
+1
_ _
s
2
+1
_ (B.232)
=
1
2
_
_
_
s
1
2
+1
_
_
s
1
+1
_ _
s
2
+1
_
_
_
(B.233)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.5 TRANSFER FUNCTION AND IMPULSE RESPONSE RELATION 575
In general, a transfer function can be expressed as
G(s) = G(0)

m
i =1
_
s
z
i
+1
_

n
i =1
_
s
p
i
+1
_ (B.234)
The unit magnitude impulse response of the systemdescribed by the above transfer function
can be found:
h(t ) = L
1
_
2s +1
s
2
+3s +2
_
=
2(s +1/2)
(s +2)(s +1)
(B.235)
= L
1
_
1
s +1
+
3
s +2
_
(B.236)
= L
1
_
2 (s +1/2)
(s +1)(s +2)
(B.237)
h(t ) = e
t
+3e
2t
(B.238)
Notice that the contribution of each pole to the impulse response is determined by the
residue associated with that pole when we expand the transfer function to its partial fraction
expansion (p.f.e.). The graphical illustration of of the residue associated with each pole is
shown in Fig. B.17. The residue associated with a particular pole is the ratio of vectors from
zeros and poles to that pole location multiplied by the gain (in this example the gain is 2,
not the d.c. gain which is 1/2) of the transfer function. Let us show the effect of poles and
zeros on the response of an LTI system with an example.
-1 -1/2 -2
s-plane
Im(S)
Re(s)
1 -1/2
-1
-1
1
/2
FIGURE B.17: Illustration of residue in the inverse
Laplace transform and the effect of zeros on residue
values.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
576 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
Example Consider the response of an LTI dynamic system due to a nonzero initial
condition,
y(s) =
s +3
s
2
+3s +2
y(0
+
) (B.239)
y(0
+
) = 1 (B.240)
We can obtain the time domain response by taking the inverse Laplace transform using the
PFE method. The roots of the denominator are 1 and 2; hence, the PFE of y(s) is
y(s) =
k
1
(s +1)
+
k
2
(s +2)
(B.241)
where
k
1
= lim
s1
(s +1)y(s) =
s +3
s +2

s=1
= 2 (B.242)
k
2
= lim
s2
(s +2)y(s) =
s +3
s +1

s=2
= 1 (B.243)
Substituting the k
1
, k
2
coefcients in the PFE,
y(s) =
2
s +1

1
s +2
(B.244)
Taking the inverse Laplace transform,
y(t ) = 2e
t
e
2t
(B.245)
Note that if a zero is too close to a pole, the residue (k
i
) associated with that pole is
very small; hence, the contribution of that pole to the response is small (Fig. B.18).
-1
-1
-1
-2
-2
-2
s-plane
Im(S)
Re(s)
-3
-3
-3
FIGURE B.18: Illustration of residue in the inverse
Laplace transform.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.6 CONVOLUTION 577
1

L. T. I.
u(t)
y(t)
y(t)
y(t) = h(t)
h(t) G(s) =
t
t
t
A
0
(t)
A
1
(tt)
A
2
(t2t)
A
0
h(t)
A
1
h(tt)
A
2
h(t2t)
Sum of impulse responses
shown below as a result of
the superposition principle for
linear systems
FIGURE B.19: Illustration of the
convolution theorem for linear
time invariant systems.
B.6 CONVOLUTION
A linear system has superposition property. If the response of a linear system to an input
u
1
(t ) is y
1
(t ), and to an input u
2
(t ) is y
2
(t ), then the response of the system to an input
c
1
u
1
(t ) +c
2
u
2
(t ) is c
1
y
1
(t ) +c
2
y
2
(t ). The response of an LTI system to a unit impulse is
called its impulse response and generally denoted as h(t ). The Laplace transformof impulse
response is the transfer function of the system.
Any general input function (piecewise continuous, and exponential order) can be
expressed as a sum of discrete impulses. Therefore, the response of the LTI system can be
obtained as the sumof the responses to impulses (Fig. B.19). Let us describe a general input
u(t ) as a sum of a series of impulses
u(t ) =

i =0
A
i
(t i.t ) (B.246)
The response is calculated by using the above superposition argument,
y(t ) =

i =0
A
i
h(t i t ) (B.247)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
578 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
Im(s)
Re(s)
2j
-2j
-0.5 -1
FIGURE B.20: Poles and zeros of the transfer
function H(s) =
2s+1
s
2
+2s+5
.
In limit, as t converges to zero, we can replace the summation with integration as follows:
y(t ) =
_
t
0
h(t )u()d (B.248)
Notice that this is the same convolution property discussed in the study of Laplace trans-
forms. If we take the Laplace transform of the above equation in both sides, we obtain
(following the property number 9, Convolution theorem, of Laplace transforms)
y(s) = G(s)u(s) (B.249)
Example Consider the following transfer function (Fig. B.20):
G(s) =
2s +1
s
2
+2s +5
(B.250)
The zeros of the transfer function are
1
2
. The poles are 1 2 j . Therefore, the partial
fraction expansion form of G(s) can be expressed as
G(s) =
k
1
s +1 2 j
+
k

1
s +1 +2 j
(B.251)
where k
1
= lim
s1+2 j
[s (1 +2 j )]
k
1
=
1 +4 j
4 j
=
_
1 +0.25
2
e
jtan
1
(0.25)
(B.252)
Note:
z = x +yj =
_
x
2
+ y
2
e
jtan
1
(
y
x
)
(B.253)
k

1
=
_
1 +0.25
2
e
jtan
1
(0.25)
(B.254)
The unit impulse response of the linear time invariant (LTI) system is given by
h(t ) = L
1
{H(s)} (B.255)
=
_
1 +0.25
2
(e
jtan
1
(0.25)
e
t
e
2tj
+e
jtan
1
(0.25)
e
t
e
2tj
) (B.256)
=
_
1 +0.25
2
e
t
cos (2t +) (B.257)
=
_
1 +0.25
2
e
t
cos (2t +14.03
o
); = tan
1
(0.25) = 14.03
o
(B.258)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.7 REVIEW OF DIFFERENTIAL EQUATIONS 579
B.7 REVIEW OF DIFFERENTIAL EQUATIONS
B.7.1 Denitions
Continuous time dynamic systems are described by differential equations. A differential
equation is an equation involving derivatives of a dependent variable with respect to an
independent variable, such as
dy(t )
dt
+ay(t ) = 0 (B.259)
where y is a dependent and t is an independent variable. If there is only one independent
variable, then the differential equation is called an ordinary differential equation (O.D.E.). If
there are more than one independent variables, then it is called a partial differential equation
(P.D.E.). If the dependent variables and their derivatives appear in nonlinear functions in the
equations, then the differential equation (D.E.) is nonlinear; otherwise it is linear. Consider
the following two O.D.E.s:
d
2
y(t )
dt
2
+
_
dy(t )
dt
_
2
+ay(t ) = 0 (B.260)
This differential equation is nonlinear due to
_
dy(t)
dt
_
2
term.
d
2
y(t )
dt
2
+2
_
dy(t )
dt
_
+ay(t ) = 0 (B.261)
This is a linear differential equationbecause y, dy/dy, d
2
y/dt
2
appear linearlyinthe equation.
The highest derivative in the equation is the order of the d.e. Solution of an nth-order
d.e. contains n-arbitrary constants. These constants would be determined by n-conditions
on dependent variables (i.e., the initial conditions).
B.7.2 System of First-Order O.D.E.s
Any nth-order O.D.E. can be expressed as n set of rst-order O.D.E. There are innitely
many different equivalent ways of doing that. Especially in numerical and state space
analysis, expressing differential equations as a set of rst-order O.D.E. is very useful.
Consider an nth-order nonlinear O.D.E.,
d
n
x(t )
dt
n
= g(t, x(t ), x(t )
(1)
, x(t )
(2)
, . . . , x(t )
(n1)
) (B.262)
Lets dene n new variables x
1
, x
2
, . . . ., x
n
as follows:
x(t )
1
= x(t ) (B.263)
x(t )
2
= x(t )
(1)
=
dx(t )
dt
(B.264)
x
3
= x
(2)
=
d
2
x
dt
2
(B.265)
.
.
.
x
n
= x
(n1)
=
dx
n1
dt
n1
(B.266)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
580 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
Then
x
1
= x
2
(B.267)
x
2
= x
3
(B.268)
.
.
.
x
n1
= x
n
(B.269)
x
n
= g(t, x, x
(1)
, x
(2)
, . . . ., x
(n1)
) (B.270)
Hence the nth-order O.D.E. can be expressed as an n set of rst-order O.D.E.s in vector
form as
x = f (t, x)
where
x = [x
1
, x
2
, . . . ., x
n1
, x
n
]
T
(B.271)
f = [x
2
, x
3
, . . . ., x
n
, g(t, x)]
T
(B.272)
where superscript T represents transpose of the vector.
Clearly, innitely many other possible ways exist to obtain an equivalent n set of
rst-order O.D.E.s, because any T transformation (x

= T x, x = T
1
x

) describes a new
equivalent rst-order O.D.E. set.
Consider the following special case of an n-order O.D.E which is linear,
a
0
(t )
d
n
x
dt
n
+a
1
(t )
d
n1
x
dt
n1
+ +a
n1
(t )
dx
dt
+a
n
(t )x(t ) = r(t )
Using the same approach, this O.D.E. can be expressed as an n-set of rst-order O.D.E.s
and it would have the following form,
x(t ) = [A(t )]x(t ) + B(t )r(t )
where
A(t ) =
_
_
_
_
_
_
0 1 0 . . . .0
0 0 1 ..0
. . . ..
a
n
(t ) a
n1
(t ) ... a
1
(t )
_

_
(B.273)
B(t ) =
_
_
_
_
_
_
_
_
0
0
..
..
1/a
0
(t )
_

_
(B.274)
B.7.3 Existence and Uniqueness of the
Solution of O.D.E.s
Nonlinear O.D.E.s Consider a general nonlinear O.D.E,
dx
dt
= f (x, t ); x(t
0
) = x
0
given (B.275)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.8 LINEARIZATION 581
If f (x, t ) continuous and has continuous partial derivative with respect to x at each point
of region |t t
0
| <
1
, |x x
0
| <
2
, there exists one unique solution in the region which
passes through (t
0
, x
0
). This theorem can be generalized to the nth order O.D.E.s, since nth
order O.D.E. can be expressed as n set of rst order O.D.E. Therefore, the above statements
are also valid for vector f function and vector x states.
Linear O.D.E.s Consider an nth-order, linear, variable coefcient O.D.E.
a
0
(t )
d
n
x
dt
n
+a
1
(t )
d
n1
x
dt
n1
+ +a
n1
(t )
dx
dt
+a
n
(t )x = r(t ) (B.276)
a
i
(t ), r(t ) continuous in region |t t
0
| < and a
0
(t ) = 0. Then there exists a unique solu-
tion which satises n initial conditions x(t
0
), x

(t
0
), . . . , x
(n1)
(t
0
).
B.8 LINEARIZATION
We study the linearizarion in increasing order of complexity. First we study the linearization
of nonlinear functions, then that of rst-order nonlinear differential equations, and nally
that of a set of rst-order nonlinear differential equations.
B.8.1 Linearization of Nonlinear Functions
Consider the function y = ax or y = ax +b which are both linear in x (Fig. B.21). If
the linear function does not pass through the origin, it may be convenient to dene a new
variable so that the inputoutput relationship of the static function passes through the origin,
y

= y b (B.277)
= ax (B.278)
If the function between independent variable and dependent variable (or input and
output) is nonlinear,
y = y(x) (B.279)
it can be approximated by a linear function about a nominal point, (x
o
, y
o
). This approxima-
tion is accomplished by expanding the function to its Taylor series about the nominal point,
and neglecting the second-order and higher-order terms. Let us dene the total values of
1
1
a
a
y
y
y
x
y
0
+ y = a(x
0
+ x)
2
= ax
0
2
+ 2ax
0
x + ax
2
y = (2ax
0
)x
x
0
y
0
y = a
.
x
2
y
x
x
x
0
b
FIGURE B.21: Linearization of
functions.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
582 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
the independent and dependent variables as nominal values plus the small variations about
that point,
x = x
o
+x (B.280)
y(x) = y(x
o
) +y(x
o
+x) (B.281)
The Taylor series expansion of y(x) about the nominal point (x
o
, y
o
) is
y(x) = y(x
o
) +
dy(x)
dx

x
o
(x x
o
) +
d
2
y(x)
dx
2

x
o
(x x
o
)
2
2!
+ (B.282)
If we neglect the second- and higher-order terms, assuming that the approximation will be
used in the close vicinity of the nominal point (x
o
, y
o
),
y(x) = y(x
o
) + y

(x
o
)(x x
o
) (B.283)
The small variations around the (x
o
, y
o
) nominal point have the following relation:
y(x) y(x
o
) = y

(x
o
)(x x
o
) (B.284)
y(x) = m x (B.285)
where m = y

(x
o
).
Clearly, the closer the actual evaluation point to the nominal point, the more accurate
the approximation. As the evaluation point gets farther away from the nominal point, the
approximation gets poorer (Fig. B.21).
We can apply the same idea to the linearization of nonlinear differential equations.
Every nonlinear function in the o.d.e. can be approximated by its rst-order Taylor series
expansion about the nominal point.
Notice that linearizing a nonlinear algebraic function about a nominal operating con-
dition involves taking the rst derivative of the nonlinear function and evaluating it at the
nominal values of the independent variable. For multivariable, nonlinear functions, the
same operation would be performed using the rst-order partial derivatives of the nonlinear
function with respect to each individual independent variable. Let y = f (x) be a nonlinear
albegraic function of single variable x, and z = h(x
1
, x
2
, x
3
) be a nonlinear algebraic mul-
tivariable function of variables x
1
, x
2
, x
3
. Let us consider the linearized approximation of
these functions about the nominal conditions of x
0
, (x
10
, x
20
, x
30
),
y =
df(x)
dx

x
0
x (B.286)
which is a linearized approximation to y = f (x) about nominal point (x
o
, y
o
).
z =
h(x
1
, x
2
, x
3
)
x
1

(x
10
,x
20
,x
30
)
x
1
+
h(x
1
, x
2
, x
3
)
x
2

(x
10
,x
20
,x
30
)
x
2
(B.287)
+
h(x
1
, x
2
, x
3
)
x
3

(x
10
,x
20
,x
30
)
x
3
which is a linearized approximation to z = h(x
1
, x
2
, x
3
) about the nominal point z
o
=
h(x
10
, x
20
, x
30
).
Example Let us study the linearization of a set of nonlinear differential equations by an
example. The key idea is that the systemis operating about a nominal condition (state or time
varying trajectory), and the variations about that nominal condition are small such that the
second-order and higher terms are negligible when all the nonlinearities are approximated
by a Taylor series expansion about the nominal condition.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.8 LINEARIZATION 583
g
m
1

FIGURE B.22: Pendulum model.


Consider the dynamic model of a pendulum (Fig. B.22),
ml
2

+mgl sin = 0 (B.288)

+
_
g
l
_
sin = 0 (B.289)
The differential equation is nonlinear due to the presence of the nonlinear function sin()
of the dependent variable .
Let us consider the linearization of the nonlinear dynamic model of the pendulum
about a nominal angle at rest. It is assumed that (1) The angular motion of the pendulum
is small, and it stays in the neighborhood of the nominal angular position; and (2) position,
speed, and acceleration changes are so small that the second-order terms are negligible.
=
0
+ (B.290)

0
+

(B.291)

0
+

(B.292)
sin = sin (
0
+)|

0
(B.293)
= sin
0
+(cos
0
) (B.294)
Let us consider the nominal angular position
0
= 0 and,

0
= 0 ,

0
= 0:
sin |

0
=0
= 0, cos |

0
=0
= 1 (B.295)
Finally, the linearized dynamic model is

+
_
g
l
_
= 0 (B.296)
Note that the linearization of cos and sin about the nominal angle
0
for small
variations of angle around that nominal value,
cos = cos
0
+(sin
0
) + (B.297)
cos = 1; when
0
= 0 (B.298)
sin = sin(
0
+)|

0
(B.299)
= sin
0
+(cos
0
) (B.300)
= ; when
0
= 0 (B.301)
B.8.2 Linearization of Nonlinear First-Order
Differential Equations
Consider the following generic form of a nonlinear rst-order o.d.e:
x = f (x, u) (B.302)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
584 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
We want to linearize about a nominal condition of state and inputs. If the state and input
nominal conditions dene a constant state, we call this linearization about a nominal state.
If the nominal state and input is function of time, we call this linearization about a nominal
trajectory. Clearly, linerization about a nominal state is a special case of linearization about
a nominal trajectory.
1. If the nominal state and its derivative are specied (x
0
(t ), x
0
(t )), we can determine
the necessary nominal input, u
0
(t ),
x
0
(t ), x
0
(t ) specied; x
0
(t ) = f (x
0
(t ), u
0
(t )), solve for u
0
(t ).
2. If the nominal state and nominal input are specied x
0
(t ), u
0
(t ), then we can calculate
the corresponding nominal rst derivative of the state,
x
0
(t ) = f (x
0
(t ), u
0
(t )), solve for x
0
(t )
Either way, the nominal state and nominal input condition (x
0
(t ), u
0
(t ), x
0
(t )) satisfy
the nonlinear dynamic model. Otherwise, it could not be called a nominal state at which this
particular dynamic system can be. Let us dene the total state and input values as nominal
values plus the small variations about the nominal state,
x = x
0
+x x = x
0
+ x (B.303)
u = u
0
+u (B.304)
The O.D.E. can be linearized about a nominal operating point or trajectory by substitution
of the above relations and expanding the nonlinear function to its Taylor series up to the
rst-order terms,
x(t ) = f (x, u) (B.305)
x
o
(t ) + x(t ) = f (x
o
(t ), u
o
(t )) +
f
x

[x
o
(t ),u
o
(t )]
x +
f
u

[x
o
(t ),u
o
(t )]
(B.306)
Because the nominal values would cancel out each other,
x(t ) =
f
x

[x
o
(t ),u
o
(t )]
x +
f
u

[x
o
(t ),u
o
(t )]
u (B.307)
= a(t )x(t ) +b(t )u(t ) (B.308)
It must be emphasized that this linearized equation is an approximation to the original
nonlinear equation. It is accurate only within the close vicinity of the nominal conditions.
As the operating conditions get farther away fromthe nominal conditions, the approximation
gets poorer.
The same idea can be directly extended to the vector case which represents multi-
dimensional dynamic systems.
B.8.3 Linearization of Multidimensional Nonlinear
Differential Equations
Consider the following n-set of rst-order nonlinear differential equations (note that any
nth-order differential equation can be re-expressed as an n set of rst-order differential
equations),
x = f (x, u) (B.309)
x
T
= [x
1
, x
2
, . . . ., x
n
] (B.310)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.8 LINEARIZATION 585
u
T
= [u
1
, u
2
, . . . ., u
m
] (B.311)
f
T
= [ f
1
, . . . ., f
n
] (B.312)
x + x = f (x
0
, u
0
) +
f
x

x
0
,u
0
x +
f
x

x
0
,u
0
u +
x =
f
x

x
0
,u
0
x +
f
u

x
0
,u
0
u (B.313)
x = [A]x +[B]u (B.314)
where the elements of matrices are given by
_
A
ij
_
=
f
i
x
j

x
0
,u
0
(B.315)
_
B
ij
_
=
f
i
u
j

x
0
,u
0
(B.316)
Linearizationis validfor operatingconditions for whichneglectingsecond- andhigher-order
terms are valid and accurate enough. Notice that if the nominal condition is an equilibrium
point, which means (x
o
, u
o
) are constant, the A and B matrices are constant. Dynamic
systems represented by linear matrix differential equations where matrices A and B are
constant are called linear time invariant (LTI) linear systems. If the nominal conditions
dene a nominal trajectory in time, not an equilibrium condition, then (x
o
, (t ), u
o
(t )) are
functions of time; hence, the A and B matrices will be function of time, A(t ) and B(t ). Such
systems are called the linear time varying (LTV) type.
% linear0.m
%
% Numerical linearizarion example using Matlab.
%
x0 = [ pi/2 0.0 ] ;
u0 = [ 0.0 ] ;
[A,B] = linear1(pendulum, x0, u0) ;
%
%
function [A,B] = linear1(Fname, x0, u0)
%
% Given: nonlinear function f(x,u)
% nominal condition x0, u0
%
% Calculate linearized equation matrices A, B
%
n = size(x0) ;
m = size(u0) ;
delta = 0.0001 ;
x = x0 ;
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
586 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
u = u0 ;
for j=1:n
x(j) = x(j) + delta;
A(:,j) = (feval(Fname,x,u)-feval(Fname,x0,u0))/delta;
x(j) = x(j) - delta ;
end
for j=1:m
u(j) = u(j) + delta;
B(:,j) = (feval(Fname,x,u)-feval(Fname,x0,u0))/delta;
u(j) = u(j) - delta ;
end
%
%
function xdot=pendulum(x,u)
%
% Pendulum dynamic model: nonlinear model.
%
g = 9.81 ;
l = 1.0 ;
xdot = [ x(2)
- (g/l)*sin(x(1)) + u] ;
}
B.9 NUMERICAL SOLUTION OF O.D.E.s AND
SIMULATION OF DYNAMIC SYSTEMS
Analytical solution methods are available for only linear, constant coefcient differential
equations (i.e., variationof parameters, Laplace transforms). Onlya fewspecial cases of rst-
or second-order nonlinear differential equations can be solved by analytical methods. For
all practical purposes, the only viable engineering solution method for nonlinear differential
equations is the numerical methods.
The behavior of a dynamic system in time can be predicted by the solution of its
mathematical model which typically is a set of ordinary differential equations. Analytical
solution of O.D.E.s is available for only linear O.D.E.s and very simple nonlinear O.D.E.s.
Therefore, time domain response of any dynamic systemmodel with reasonable complexity
must be solved using numerical methods. The primary tool is the numerical integration of
O.D.E.s in time. Numerical integration is performed by discretizing O.D.E.s using various
approximations to differentiation (i.e., Eulers approximation, trapezoidal approximation,
RungaKutta approximation). First we will study various numerical integration methods
for a general nonlinear O.D.E. set of the form,
x = f (x, u, t ) (B.317)
x(t
0
) = x
0
, u(t ) given (B.318)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.9 NUMERICAL SOLUTION OF O.D.E.s AND SIMULATION OF DYNAMIC SYSTEMS 587
Then we will study the time domain simulation of a dynamic system that involves a digital
controller in the determination of u(t ).
B.9.1 Numerical Methods for Solving O.D.E.s
The problem is that given a nonlinear set of rst-order O.D.E.s, with a specied initial
condition and input, nd the solution of the O.D.E. system.
x = f (x, u; t ) (B.319)
x(t
0
) = x
0
, initial condition (B.320)
u(t ) is given (B.321)
Numerical integration provides an approximate solution method for the differential equa-
tions. Although the solution is approximate, the error in the approximation can be controlled
to the point of being negligible. The essential approximation is that the derivatives of the
dependent variables are approximated by nite differences. Here we will consider various
nite difference approximations.
B.9.2 Numerical Solution of O.D.E.s
Eulers Method The Eulers approximation is the simplest among others. In the fol-
lowing discussion, we drop the underline symbol fromthe x, f , and u variables for simplicity
in notation. The variables x, f, u are still considered to be vector quantities. The derivative
of the dependent variable at a given time is approximated by the difference between the val-
ues of the dependent variable at two consecutive samples divided by the sampling interval
(Fig. B.23).
x =
dx
dt
lim
t 0
+
x(t +t ) x(t )
t
(B.322)
x(t +t ) = x(t ) + xt (B.323)
x(t +t ) = x(t ) + f (x, u; t )t (B.324)
where t is the sampling interval. We can use this approach to solve any nonlinear O.D.E.
(although it may not be the most efcient or accurate method) as follows: Starting with
u(t)
x(t)
t
0
t
0
x
0
x(t
0
+ t) = x(t
0
) + f(x
0
, u
0
; t
0
) t
t
t
t
1
f
FIGURE B.23: Eulers method for solution
of O.D.E.s.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
588 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
the initial condition, we know x(t
0
), u(t ), then we can evaluate f (x
0
, u; t
0
), and calculate
x(t
0
+t ) as
x(t
0
+t ) = x(t
0
) + f (x
0
, u
0
, t
0
)t (B.325)
Similarly, using the newfound values of x(t
0
+t ), we can nd the x(t
0
+2t ) as
x(t
0
+2t ) = x(t
0
+t ) + f (x, u, t )t (B.326)
where f (x, u, t ) is evaluated for those values at (t
0
+t ). This iteration can be continued
until the desired solution time period is covered.
RungaKutta Method: 4th Order RungaKuttas fourth-order numerical inte-
gration method may be the best compromise between the complexity and accuracy. The
difference compared to Eulers method is that it uses a more accurate approximation for
the differentiation. If the sampling period is taken very small, the difference between
the two methods would be insignicant in terms of accuracy. Given the same o.d.e so-
lution problem, RungaKuttas fourth-order approximation to the solution is given by
(Fig. B.24).
x(t
i
+t ) = x(t
i
) +
1
6
(k
1
+2k
2
+2k
3
+k
4
) (B.327)
where
k
1
= t f (t
i
; x(t
i
), u(t
i
)) (B.328)
k
2
= t f
_
t
i
+
t
2
; x(t
i
) +
1
2
k
1
, u
_
t
i
+
t
2
__
(B.329)
k
3
= t f
_
t
i
+
t
2
; x(t
i
) +
1
2
k
2
, u
_
t
i
+
t
2
__
(B.330)
k
4
= t f (t
i
+t ; x(t
i
) +k
3
, u (t
i
+t )) (B.331)
u(t)
x(t)
(k
3
)
(k
4
)
(k
2
)
(k
1
)
t
0
x
0
t
0
t
t
t
2
t
x(t + t) = x(t) + t x
ave
= x(t) + t f
ave
f
ave
; average of derivatives at t, t +
t
, t + t.
2
FIGURE B.24: Fourth-order RungaKutta nite
difference approximation.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.9 NUMERICAL SOLUTION OF O.D.E.s AND SIMULATION OF DYNAMIC SYSTEMS 589
y
d
(t)
e(t) u(t) y(t)
Command
generator
Controller Process
Analog controller
FIGURE B.25: A continuous time feedback control systemcontroller and process are both
analog.
B.9.3 Time Domain Simulation of Dynamic Systems
We will consider the program structure for digital computer simulation of dynamic systems
which has (a) analog controller (Fig. B.25), and (b) digital controller with a given control
sampling period (Fig. B.26).
(a) Dynamic system with analog controller (Fig. B.25): The signals in such a system
are all continuous in time, and no sampling is involved in reality. The numerical
simulation will work on the samples of the signals in the system. For accuracy both
the controller and process signals should be sampled at the same rate. Some numerical
o.d.e. solution algorithms have automatic step size control in order to enssure local
error in each integration step is smaller than a given value. In such a case, in order to
enssure that the controller signals are sampled at the same rate as the process, thus
simulate an analog control, the controller function should be called from the process
dynamics. Hence, every time integration routine calls the process dynamic model, the
controller routine will also be called.
(b) Dynamic system with digital controller (Fig. B.26): In this case there are two sam-
pling periodsone is decided on by the numerical integration accuracy requirements
for the purpose of accurate simulation of an actually continuous time process (T
int
).
The other is the sampling period of the digital controller which physically exists in
real-time implementation, T
control
. Almost all digital controllers are interfaced to a
zero-order-hold (Z.O.H.) type D/A converter. Hence, between each sampling period,
control action stays constant. In order to simulate the real-world behavior accurately,
the controller function should be called to get an updated control signal only every,
T
control
, time period. The control signal value should be kept constant between the
sampling instants to simulate a zero-order-hold D/A converter behavior. During that
time period, the process dynamics may be called one or more time depending on the
numerical accuracy requirements. Generally the integration step is integer multiples
smaller than the control sampling period {T
control
= n T
i nt
; n = 1, 2, . . .}.
r(kT)
y
d
(kT)
u(kT) u(t) y(t)
Command
generator
Control
algorithm
D/A
D/A
Process
Digital controller
FIGURE B.26: A digital control system: Process is analog, controller is digital.
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
590 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
r
Simulation program
Initialize modules
If simulating a digital controller: run control sample loop every T
control
period call
controller and get u
* Simulation loop: T
int
call o.d.e. solver
* next
next (if simulating digital controller)
r
Controller
desired response (command signal)
sensor dynamics: y = g(x)
calculate u = . . . ..
r
O.D.E. solver
in : t, x, u, t, process dynamics
If simulating analog controller, call analog controller function here.
call process dynamics, get x
out : x(t +h)
r
Process dynamics
x = f (x, u; t )
The structure of the simulation program is given below in more details.
r
Initialize system parameters
t
0
, t
f
- initial & nal simulation time
x
0
- initial states
t
sample
, t
int
- control loop update time (sampling time period), integration step size
r
Initialize controller
controller parameters - i.e., gains, nonlinear compensation functions
controller initial condition - i.e., observer initial states.
r
Loop for each control sampling period (assuming digital controller implementation)
begin simulation loop: t
0
, t
0
+t
sampling
, . . . ., t
f
control calculations: u
begin loop to simulate dynamic system during the control sampling period:
o.d.e. solver
loop end
loop end
r
loop end
r
output results
Simulation of a Dynamic System Using Matlab
/* Implementation of dynamic system simulation program
using MATLAB */
% mass_s.m
%
% simulates a continuous time dynamic system using
% 4 th order Runga-Kutta integration algorithm.
%
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.9 NUMERICAL SOLUTION OF O.D.E.s AND SIMULATION OF DYNAMIC SYSTEMS 591
% dynamic system: mass-force system
% controller : PD control algorithm
%
% Initialize simulation...
%.....Dynamic system .....
t0 = 0.0 ;
tf = 4.0 ;
t_sample = 0.01 ;
t_int = 0.005 ;
x = [ 0.0 0.0 ] ;
x_out = x ;
u_out = 0 ;
%.....initialize controller parameters....
k_p = 16.0 ;
k_v = 4.0 ;
% Start the simulation loop...
for (t = t0 : t_sample : tf )
mass_ct1 ;
for (t1 = t : t_int : t+t_sample )
x = rk4(mass_dyn,t1,t1+t_int, x, u) ;
end
x_out=[x_out ; x ] ;
u_out=[u_out ; u ] ;
end
% ..Plot results....
t_out=t0:t_sample:tf ;
t_out = [t_out ; tf+t_sample ] ;
clg ;
subplot(221)
plot(t_out,x_out(:,1)) ;
title(position vs time) ;
subplot(222)
plot(t_out,x_out(:,2)) ;
title(velocity vs time );
subplot(223)
plot(t_out,u_out) ;
title(control vs time );
pause
% ... end......
% mass_ct1.m
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
592 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
%
% Implements a PD controller for a second order system...
% get sensor measurements ....
% in simulation this is readily available,
% in hardware implementation that will require a
call to sensor
% device drivers i.e. A/D converters....
% x(1) - measured position,
% x(2) - measured velocity.
% desired motion ...
xd = [ 1.0
0.0 ] ;
% PD control algorithm.............
u = k_p * (xd(1)-x(1)) + k_v * (xd(2) - x(2)) ;
% Output to D/A converter in hardware
implementation....
% In simulation, the u is returned to the calling
function...
% ..end....
function xdot=mass_dyn(t,x,u)
%
% describes the dynamic model: o.d.es
% returns xdot vector.
% xdot = [ x(2)
u(1) ];
function x1=rk4(FuncName,t0,tf,x,u)
%
% implements Runga-Kutta 4th order ingetration algorithm
on
% o.d.es.
%
h = tf - t0 ;
h2= h/2 ;
h6= h/6 ;
th=t0+h2 ;
xdot = feval(FuncName,t0,x,u) ;
xt = x + h2 * xdot ;
dxt = feval(FuncName,th,xt,u) ;
xt = x + h2 * dxt ;
dxm = feval(FuncName,th,xt,u) ;
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.9 NUMERICAL SOLUTION OF O.D.E.s AND SIMULATION OF DYNAMIC SYSTEMS 593
xt = x + h * dxm ;
dxm = dxm + dxt ;
dxt = feval(FuncName,tf,xt,u) ;
x1 = x + h6 * (xdot + dxt + 2.0*dxm) ;
% .... End.....
Modeling and Simulation of a Dynamic System Using Simulink
Simulink is a numerical modeling and time domain simulation software with a graphi-
cal user interface. It allows us to mix linear, nonlinear, analog, and digital systems in the
model using interconnected blocks. In Simulink, the dynamic model and control algorithm
are modeled using interconnected blocks. In order to simulate the system response for a
given input conditions, inputs are connected to various source blocks (i.e., function genera-
tor block, step input block). The response is recorded by connecting various output signals
to sink blocks (i.e., scope block). The simulation start time, stop time, sampling time, and
integration method are selected in the Simulink set-up window. The same example (mass-
force system and a PD controller) given earlier is simulated in Simulink as shown below.
The Simulink model simulates an analog PD controller for the mass-force system. The
controller is sampled at the same rate as the integration algorithm uses for the solution of
the mass-force model. In Simulink models, the inputoutput relationships are described
by interconnected blocks. The individual blocks may represent linear or nonlinear func-
tions between its input and output, transfer functions in Laplace transform form for analog
systems, and z-transforms form for digital systems. Input functions for the simulated case
are represented in time domain form. The response of the system are also time domain
functions.
Example Consider the liquid level in a tank and its control system shown in (Fig. 1.4).
Let us further consider a computer-controlled version of the system: The mechanical levers
are replaced by a level sensor, a digital controller, and a valve that is actuated by a solenoid.
In-ow rate to the tank is controlled by the valve. The valve is controlled by a solenoid. The
input to the solenoid is the current signal from the controller, and output of the solenoid is
proportional force. The force generated by the solenoid is balanced by a centering spring.
Hence, the valve position or opening of the orice is proportional to the current signal. The
ow rate through the valve is proportional to the valve opening. Assuming simplied linear
relationships, the inputoutput relationship for the valve can be expressed as
F
valve
(t ) = K
1
i (t ) (B.332)
= K
spring
x
valve
(t ) (B.333)
Q
i n
(t ) = K
ow
x
valve
(t ) (B.334)
= K
ow

1
K
spring
K
1
i (t ) (B.335)
= K
valve
i (t ) (B.336)
where K
valve
= K
ow
K
1
/K
spring
, which is the valve gain between current input and ow
rate through the valve.
The liquid level in the tank is a function of the rate of in-ow, rate of out-ow, and
the cross-sectional area of the tank. The time rate of change in the volume of the liquid in
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
594 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
the tank is equal to the difference between in-ow rate and out-ow rate,
d(volume in tank)
dt
= (in-ow rate) (out-ow rate) (B.337)
d(A y(t ))
dt
= Q
in
(t ) Q
out
(t ) (B.338)
A
dy(t )
dt
= Q
in
(t ) Q
out
(t ) (B.339)
The Q
i n
is controlled by the valve to be between zero and maximumowthat can go through
the valve, [0, Q
max
]. The Q
out
is function of the liquid level and the orice geometry at
the outlet. Let us approximate the relationship as a linear one; that is, the higher the liquid
height, the larger the out-ow rate,
Q
out
(t ) =
1
R
y(t ) (B.340)
where R represents the orice restriction as the resistance to ow. Then the tank dynamic
model can be expressed as
A
dy(t )
dt
+
1
R
y(t ) = Q
i n
(t ) (B.341)
Let us consider a practical ON/OFF type controller with hysteresis. The controller either
fully turns ON or turns OFF the valve depending on the error between the actual and
measured liquid level. In order to make sure the controller does not switch the valve ON/OFF
at high frequency due to small changes in the liquid level, a small amount of hysteresis is
added in the control function. This type of controller is called relay with hysteresis and is
commonly used in many automatic control systems such as home temperature control and
liquid level control. In Simulink, the controller function is implemented with a hysteresis
block. In mathematical terms, the controller function is
e(t ) = y
d
(t ) y(t ) (B.342)
i (t ) = Relay
hysteresis
(e) (B.343)
The relay control function with hysteresis where the hysteresis band is [e
max
, e
max
] range.
Flow rate can vary linearly between zero and maximum ow rate as function of current
signal. Because current signal is either zero or maximum value, ow rate will be either zero
or maximum ow.
Q
in
(t ) = K
valve
i (t ) (B.344)
= Q
max
; when i (t ) = i
max
(B.345)
= 0; when i (t ) = 0 (B.346)
Let us simulate the liquid level control system for the following conditions. The sys-
tem parameters are e
max
= 0.05, i
max
= 1.0 A, Q
max
= 1200 liter/min = 20 liter/sec =
0.02 m
3
/sec, A = 0.01 m
2
, and R = 500 [m]/[m
3
/sec]. Consider the case that the desired
liquid height is y
d
(t ) = 1.0 m which is commanded as step function, and the initial height
of the liquid is zero (empty tank). Figure B.27 shows the simulink model and simulation
results.
Example Consider the room or furnace temperature control system (Fig. 1.7). We need
to consider room temperature, outside temperature (cold), and a heater. The heater is con-
trolled by a relay type controller with hysteresis. The room temperature is initially at the
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.9 NUMERICAL SOLUTION OF O.D.E.s AND SIMULATION OF DYNAMIC SYSTEMS 595
Step
(command signal)
Relay
controller
Saturation
(valve)
1/A
1/R
Gain
Integrator
Gain1
1
Level sensor
Scope
1
S
+
-
+
-
FIGURE B.27: Model and simulation of a liquid level control system.
same temperature as the outside temperature. The controller is set to increase the room
temperature to a higher level. The heater is controlled to regulate the room temperature. As
the room temperature increases and becomes larger than the outside temperature, there is a
heat loss fromroomto outside. The net added heat rate to the roomis the difference between
the heat generated by the heater and the heat loss to the outside because outside temperature
is colder. The temperature raise in the room is a function of this difference and the size of
the room. The heat loss is linear function of the inside and outside room temperatures.
(net heat rate added to room) = (heat-in rate) (heat-out rate) (B.347)
Q
net
= Q
in
Q
out
(B.348)
mc
dT
dt
= Q
in

1
R
(T T
o
) (B.349)
where mc is the heat capacitance of the room which is function of the room size and R
is the resistance of the heat transfer from walls due to the temperature difference. The
effective resistance (R) to heat transfer is a function of the type of dominant mode of heat
transfer (conduction, convection, radiation) as well as the size and insulation type of walls.
T and T
o
are inside and outside temperatures, respectively.
Let us simulate the room temperature control system for the following conditions:
T
d
= 72

F, T
o
= 42

F, e
max
= 0.5

F, Q
max
= 100 , R = 100, mc = 1.0. Initially the room
is assumed to be at the same temperature as the outside temperature. After entering the
room, 1 sec later, the temperature is commanded to be T
d
= 72

F. The relay controller is


active if the temperature difference is beyond 2% of the commanded temperature. Figure
B.28 shows the Simulink implementation of the model and simulation results.
Example Consider the web tension control system shown in Fig. 1.6. The wind-off
roll is driven by another part of the machinery where the speed v
1
(t ) is dictated by other
considerations. The wind-up roll is driven by an electric motor. This motor is required to
run in such a way that the tension in the web (F) is maintained constant and equal to a
desired value (F
d
). So, if the wind-off roll speeds up, the wind-up roll is supposed to speed
up. Similarly, if the wind-off roll slows down, the wind-up roll is suppose to slow down
quickly. The wind-off roll speed is given as an external input and not under our control. The
wind-up speed is our controlled variable. Our objective is to minimize the tension error,
e(t ) = F
d
(t ) F(t ).
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
596 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
Desired temperature
setting
Temperature
sensor
Relay
controller
Heater: Q_in
+
-
+
-
+
-
1/mc
Gain
1/R
x
0
1
s
Room
temperature
Scope
To
Outside
temperature
Heat loss:
Q_out = (1/R)* (T-To)
1
FIGURE B.28: Model and simulation of furnace or room temperature control system.
The tension in the web will be determined by the difference between the integral of
v
1
(t ) and v
2
(t ),
y(t ) = y(t
0
) +
_
t
t
o
(v
2
(t ) v
1
(t )) dt (B.350)
F(t ) = F
o
+k y(t ) (B.351)
If initially the web tension is adjusted so that when y = y
0
, the tension F = F
0
= 0 by
proper calibration, then we can express the tension as a function of change in y(t ),
y(t ) = y(t ) y(t
0
) (B.352)
=
_
t
t
o
(v
2
(t ) v
1
(t )) dt (B.353)
Y(s) =
1
s
(V
2
(s) V
1
(s)) (B.354)
F(t ) = k y(t ) (B.355)
F(s) =
k
s
(V
2
(s) V
1
(s)) (B.356)
The control system that controls the v
2
(t ) is a closed-loop control system and implemented
using an analog controller [op-amp in the Fig. 5.31 (a)]. Let us consider the dynamics
of the amplier and motor as a rst-order lter, that is, the transfer function between the
commanded speed w
2,cmd
to actual speed w
2
,
w
2
(s)
w
2,cmd
(s)
=
1

m
s +1
(B.357)
where
m
is the rst-order lter time constant for the amplier and motor. The corresponding
linear speeds are
v
2,cmd
(t ) = r
2
w
2,cmd
(t ) (B.358)
v
2
(t ) = r
2
w
2
(t ) (B.359)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.9 NUMERICAL SOLUTION OF O.D.E.s AND SIMULATION OF DYNAMIC SYSTEMS 597
Wind-off roll
speed: magnitude is 2.5
Wind-off speed:
magnitude is 10.0
Desired tension
setting: 50
F_d(t)
Wind-off speed:
V1(t)
Kp
Controller
gain
Transfer Fcn1:
motor and amp
k
Tension sensor
Web tension control system model
w2(t)
V1(t)
V2(t)
-
+
1
s
r2
Roll radius
y(t)
Integrator:
speed difference
to change in length
k
F(t)
Gain:
tension/displacement
Scope1
Scope
+
+
+
-
10
1
tau_m.s+1
FIGURE B.29: Model and simulation of web tension control system. Top gure is the Simulink
model of the tension control system. The left plot shows the commanded tension on the top
and actual tension at the bottom. Right plot shows the wind-off and wind-up speeds.
Let us consider a proportional controller,
w
2,cmd
(t ) = K
p
(F
d
(t ) F(t )) (B.360)
Figure B.29 shows the model and simulation conditions in Simulink. The parameters of the
system used in the simulation are
k = 10000 [N/m] (B.361)
K
p
= 10 [m/s/m] (B.362)

m
= 0.01 [sec] (B.363)
r
2
= 0.5 [m] (B.364)
We will simulate a condition where v
1
(t ) has a step change from its nominal value for a
period of time,
v
1
(t ) = 10.0 +2.5 f
1
(t ) (B.365)
F
d
(t ) = 50 step(t 1.0); step function starts at 1.0 sec (B.366)
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
598 APPENDIX B MODELING AND SIMULATION OF DYNAMIC SYSTEMS
where f
1
(t ) represents a square pulse function with a period of T = 30 sec. Interested
reader can easily experiment with different control algorithms as well as different process
parameters, i.e., different roll diameter values r
2
.
B.10 PROBLEMS
1. Consider the following complex number. Determine its magnitude and phase angle in complex
plane and express it in magnitude times the exponential phase angle:
s = 2 + j 4 (B.367)
2. Consider the function shown in Fig. B.10. Let a = 2.0 sec, b = 12.0 sec.
(a) Determine the Laplace transform of the function.
(b) Determine the Fourier transform of the signal.
3. Consider that a rst-order linear dynamic system is excited with the signal given in problem
2. Calculate the time domain response of the system using Laplace and inverse Laplace transform
methods. The transfer function of the rst-order system is
G(s) =
10
0.5 s +1
(B.368)
4. Consider a nonlinear dynamic system. Write a Matlab programthat linearizes the dynamic model
about any given nominal operating condition ( y(t
0
), y(t
0
), u(t
0
)) and obtains the result in rst-order
set of linear differential equations. Do the same analytically. The nonlinear dynamic system model is
y(t ) = ( y(t ))
3
+sin(y(t )) +u(t )
2
(B.369)
Compare your Matlab results with your analytically obtained linearization results.
5. Consider the dynamics of a pendulum. Assume that the torque input is decided by an analog
controller using the following relationship:
u(t ) = 10.0 (
d
(t ) (t )) (B.370)
and the dynamics of the pendulum is given by
m l
2

(t ) +m g l sin((t )) = u(t ) (B.371)


where m = 1.0 kg, l = 1.0 m, g = 10 m/s
2
. Let the
d
(t ) = /6 [rad]. Simulate the response of the
pendulum position under such a controller using Matlab or Simulink. Notice that the controller is an
analog controller.
6. Repeat the problem 5 assignment for a digital controller. The same control algorithm is applied.
u(kT) = 10.0 (
d
(kT) (kT)) (B.372)
where T is the sampling period of the controller and k is the sampling period number (k = 0, 1, 2, . . .).
Simulate the digital controller for two different sampling rates: (1) T = 0.001 sec (1 msec) and (2)
T = 1.0 sec.
7. Consider the liquid level control system example given earlier in the chapter. Simulate the
same system for two different digital controllers, each with 1.0-msec sampling period (1) u(kT) =
1.0 e(kT) and (2) u(kT) = 1.0 e(kT) +0.5 e(kT).
8. Consider the temperature control system example given earlier in the chapter. Experiment with
the effect of changing the relay hysteresis band on the control system. What are the effects of making
the hysteresis band larger and smaller?
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
B.10 PROBLEMS 599
9. Consider the web tension control systemshown in the example earlier in the chapter. Simulate the
same conditions under two different radius values of the rewind roll: (1) r
2
= 0.5 mand (2) r
2
= 5.0 m.
In particular, focus on the transient response around the sudden change in the speed of the unwind
roll and magnify the response plot in that region in order to see the effect of the large changes in roll
radius. What can be done in order to maintain the same dynamic response under the changing roll
diameter conditions? Consider the dynamic bandwidth of the tension sensor. Assume that the sensor
can be represented by a rst-order lter. What is the effect of sensor dynamics on the overall system
response if the time constant is
s
= 0.001 sec and
s
= 0.1 sec?
P1: OSO
JWDD005-12 JWDD005-Cetinkunt-v10 October 28, 2005 11:59
600
344
Fig3-43.eps
Figure 119: Step responses of the closed loop system under dierent controller approxima-
tions and smapling periods.
UPDATES for Appendix B:
Insert page 574, End of Section B.4.5.
Therefore, we will discuss the manual plotting of various transfer functions next. Let us
consider a general transfer function which has
1. DC gain,
2. zeros and poles at the origin,
3. rst order zeros and poles,
4. second order zeros and poles.
G(s) = K
0
(s/z
i
+ 1)((s/w
zi
)
2
+ 2
zi
(s/w
zi
) + 1)
s
N
(s/p
i
+ 1)((s/w
pi
)
2
+ 2
pi
(s/w
pi
) + 1)
(1014)
The rest of the graphical plotting discussions will consider this general form of the transfer
function.
Bode Plots
Given a frequency response data either in explicit mathematical form as G(jw) or as a
raw experimental data as magnitude and phase information B/A = |G(jw)| and (w), one
possible graphical represenation is as two plots:
Plot 1, y-axis: 20Log
10
|G(jw)| , x-axis: Log
10
w,
Plot 2, y-axis: Phase(G(jw)), x-axis: Log
10
w.
Such graphical representation is called the Bode plots. The Bode plot is the most commonly
used graphical representation of frequency response information. Let us consider
G(s)|
s=jw
= G(jw) = |G(jw)|e
j(w)
(1015)
The most general form of a transfer function and its frequency domain representation,
0.10. GPS: GLOBAL POSITIONING SYSTEM 345
G(s) = K
0
(s/z
i
+ 1) [(s/w
zi
)
2
+ 2
zi
(s/w
zi
) + 1]
s
N
(s/p
i
+ 1) [(s/w
pi
)
2
+ 2
pi
(s/w
pi
) + 1]
(1016)
G(jw) = K
0
(jw/z
i
+ 1) [(jw/w
zi
)
2
+ 2
zi
(jw/w
zi
) + 1[
jw
N
(jw/p
i
+ 1) [(jw/w
pi
)
2
+ 2
pi
(jw/w
pi
) + 1]
(1017)
= K
0
[1 + (w/z
i
)
2
]
1/2
e
jtan
1
(w/zi)
[(1 w
2
/w
2
zi
)
2
+ (2
zi
w/w
zi
)
2
]
1/2
e
jtan
1
(
(2
zi
w/w
zi
)
(1w
2
/w
2
zi
))
w
N
e
jN90
[1 + (w/p
i
)
2
]
1/2
e
jtan
1
(w/pi)
[(1 w
2
/w
2
pi
)
2
+ (2
pi
w/w
pi
)
2
]
1/2
e
jtan
1
(
(2
pi
w/w
pi
)
(1w
2
/w
2
pi
)
= |G(jw)|e
j(w)
(1018)
Now, let us express the magnitude and phase information separately, and take the
logarithm of the magnitude information. Further, let us multiply the logarithm of the
magnitude with 20 in order to express the magnitude information in dB (decibel) units.
20log
10
|G(jw)| = 20log
10
K
0
+

20log
10
[1 + (w/z
i
)
2
]
1/2
(1019)
+

20log
10
[(1 w
2
/w
2
zi
)
2
+ (2
zi
w/w
zi
)
2
]
1/2
(1020)
20 (N)Log
10
w

log
10
[1 + (w/p
i
)
2
]
1/2
(1021)

log
10
[(1 w
2
/w
2
pi
)
2
+ (2
pi
w/w
pi
)
2
]
1/2
(1022)
(w) =

G(jw) =

tan
1
(w/z
i
) +

tan
1
(2
zi
w/w
zi
)
(1 w
2
/w
2
zi
)
(1023)

N90

tan
1
(w/p
i
)

tan
1
(2
pi
w/w
pi
)
(1 w
2
/w
2
pi
)
(1024)
Bode plot of the frequency response G(jw) is the two plots of the above two equations
versus the Log
10
w.
The implication of taking the logarithm of the magnitude information is that the con-
tribution of gain, zeros, and poles to the overall gain plot becomes additive. The phase
information is already additive. When designing compensators, the additive nature of fre-
quency response in Bode plots is very helpful. As we try dierent controllers, we do not
have to replot the open loop system frequency response. Logarithmic scale in frequency
allows us to capture the behavior of the system at very low frequencies as well as very high
frequencies while using a resonable size for the x-axis.
Bode plot of any frequency response which can be expressed as a rational polynomial can
be drawn as linear summation of magnitude and phase contribution of i) gain, ii) zero/pole
at origin, iii) rst order zero/pole, iv) second order zero/pole. Quite often, the asymptotic
sketches of the contribution of each of these dynamic components are more useful than their
exact plots due to the fact that the asymptotic approximate sketches can be ploted rather
quickly by hand.
346
Bode Plots of Standard Elements of a Transfer Function
1. Constant Gain, K
0
: A constant gain will have a constant logarithmic magnitude as a
function of frequency, and zero phase. If the sign of the gain is negative, the phase will be
180 degrees,
20Log
10
|.| = 20Log
10
K
0
(1025)

(.) = tan
1
Im(K
0
)
Re(K
0
)
= tan
1
0
Re(K
0
)
= 0 (1026)
= tan
1
Im(K
0
)
Re(K
0
)
= tan
1
0
Re(K
0
)
= 180
o
; for K
0
< 0 (1027)
2. Pole/zero at the origin: Pole at the origin
1
s
N
|
s=jw
=
1
(jw)
N
=
1
w
N
e
jN90
=
1
w
N
e
jN90
(1028)
The magnitude and phase in Bode plots is given by
20Log
10
|
1
(jw)
N
| = 20Log
10
1
w
N
= 20 N Log
10
w (1029)

(
1
(jw)
N
) = N 90
o
(1030)
Similiarly, for zero(s) at the origin, the Bode plot is
s
N
|
s=jw
= (jw)
N
= w
N
e
jN90
= w
N
e
jN90
(1031)
and
20Log
10
|(jw)
N
| = 20Log
10
w
N
= 20 N Log
10
w (1032)

(jw)
N
= N 90
o
(1033)
The Bode plots of gain, pole(s) and zero(s) at the origin are shown in Fig. 120.
3. First order pole and zero: Let us consider a pole on real axis,
0.10. GPS: GLOBAL POSITIONING SYSTEM 347
1
(s/p
i
+ 1)
|
s=jw
=
1
(jw/p
i
+ 1)
(1034)
=
1
[1 + (w/p
i
)
2
]
1/2
e
jtan
1
(w/p
i
)
(1035)
=
1
[1 + (w/p
i
)
2
]
1/2
e
jtan
1
(w/p
i
)
(1036)
The magnitude and phase as function of frequency are given by
20Log
10
|
1
jw/p
i
+ 1
| = 20Log
1
[1 + (w/p
i
)
2
]
1/2
= 20Log[1 + (w/p
i
)
2
]
1/2
(1037)
20Log1 = 0 ; for w/p
i
1 (1038)
20Log(w/p
i
) ; for w/p
i
1 (1039)

1
(jw/p
i
+ 1)
= tan
1
(w/p
i
) (1040)
Similiar algebraic calculations can be carried out for a zero on the real axis and the Bode
plots are as follows,
(s/z
i
+ 1)|
s=jw
= (jw/z
i
+ 1) = [1 + (w/z
i
)
2
]
1/2
e
jtan
1
(w/z
i
)
(1041)
20Log|jw/z
i
+ 1| = 20Log[1 + (w/z
i
)
2
]
1/2
= 20Log[1 + (w/z
i
)
2
]
1/2
(1042)
= 20Log1 = 0 ; for w/z
i
1 (1043)
= 20Log(w/z
i
) ; for w/z
i
1 (1044)

(jw/z
i
+ 1) = tan
1
(w/z
i
) (1045)
The Bode plots of rst order (real) pole and zeros are also shown in Fig. 120.
4. Second order (complex conjugate) poles and zeros: Consider a complex conjugate pole
pair, and its frequency response
1
(s/w
i
)
2
+ 2(s/w
i
) + 1
|
s=jw
=
1
[(1 w
2
/w
2
i
)
2
+ (2w/w
i
)
2
]
1/2
e
jtan
1
2w/w
i
1(w
2
/w
2
i
)
(1046)
348
The magnitude and phase as function of frequency are given by
20Log|.| = 20Log[(1 w
2
/w
2
i
)
2
+ (2w/w
i
)
2
]
1/2
(1047)
0 ; w/w
i
1 (1048)
40Log(w/w
i
) ; w/w
i
1 (1049)

() = tan
1
(
2(w/w
i
)
(1 w
2
/w
2
i
)
) (1050)
Similarly, the Bode plot of a complex conjugate zero and its asymptotic plot can be found
as (Fig. 120).
(s/w
i
)
2
+ 2(s/w
i
) + 1|
s=jw
= [(1 (w
2
/w
2
i
))
2
+ (2w/w
i
)
2
]
1/2
e
jtan
1
2w/w
i
1(w
2
/w
2
i
)
(1051)
20Log|.| = 20Log[(1 (w
2
/w
2
i
))
2
+ (2w/w
i
)
2
]
1/2
(1052)
0 ; w/w
i
1 (1053)
40Log(w/w
i
) ; w/w
i
1 (1054)

(.) = tan
1
(
2(w/w
i
)
1 (w
2
/w
2
i
)
) (1055)
Nyquist (Polar) Plots of Standard Elements of a Transfer Function
The Nyquist plots (also called the polar plots) are the graphical representation of the
frequency response data on a complex plane where y-axis is the imaginary part, and x-
axis is the real part of the frequency response. The frequency is parameterized along the
curve.
G(jw) = G(s)|
s=jw
= Re(G(jw)) +jIm(G(jw)) = X(w) +jY (w) (1056)
For every point along the imaginary axis of the s-plane, s = jw, there is a point on the
curve plotted on the (G(jw)) plane. Nyquist plot of various standard elements are shown
in the gure 121.
0.10. GPS: GLOBAL POSITIONING SYSTEM 349
Log Magnitude versus Phase Plots of Standard Elements of a Transfer Function
Frequency response is conveniently represented by a complex function. Graphical represen-
tation of a complex function must convey the real and imaginary part or magnitude and
phase information. Another possible way of plotting the frequency response data is to plot
the 20Log
10
|G(jw)| as y-axis versus

(G(jw)) as x-axis, where w is parameterized along
the plot. A frequency response can be expressed as
G(jw) = |G(jw)|

(G(jw)) (1057)
Log magnitude (20Log
10
|G(jw)| )versus phase angle (

(G(jw))) plots of various elements


are shown in Fig.122. A Matlab program to generate the plot for gures 120 - 122 is shown
below.
K0 = 10.0 ;
z1 = 1.0 ;
p1 = 1.0 ;
z2 = 1.0 ;
p2 = 10.0 ;
z3 = 1.0 ;
p3 = 0.1 ;
num1 = [K0] ; den1 = [1] ; sys1=tf(num1,den1) ; % Ko
num2 = [1] ; den2 = [1 0] ; sys2=tf(num2,den2) ; % 1/s
num3 = [1 0 ] ; den3 = [1 ] ; sys3=tf(num3,den3) ; % s
num4= [1] ; den4 = [1/p1 1]; sys4=tf(num4,den4) ; % 1/(s/p1+1)
num5= [1/z1 1] ; den5 = [1] ; sys5=tf(num5,den5) ; % (s/z1+1)
num12=[1/z2 1] ; den12 = [1/p2 1]; sys12=tf(num12,den12) ; % (s/z2+1)/(s/p2+1)
num13=[1/z3 1] ; den13 = [1/p3 1]; sys13=tf(num13,den13) ; % (s/z3+1)/(s/p3+1)
psi = 0.25; w_n = 1.0 ;
num6=[w_n^2] ; den6=[1 2*psi*w_n w_n^2]; sys6=tf(num6,den6) ;
psi = 0.5; w_n = 1.0 ;
num7=[w_n^2] ; den7=[1 2*psi*w_n w_n^2]; sys7=tf(num7,den7) ;
psi = 0.75; w_n = 1.0 ;
num8=[w_n^2] ; den8=[1 2*psi*w_n w_n^2]; sys8=tf(num8,den8) ;
psi = 0.25; w_n = 1.0 ;
num9=[1 2*psi*w_n w_n^2]; den9=[w_n^2] ; sys9=tf(num9,den9) ;
psi = 0.5; w_n = 1.0 ;
num10=[1 2*psi*w_n w_n^2]; den10=[w_n^2] ; sys10=tf(num10,den10) ;
psi = 0.75; w_n = 1.0 ;
num11=[1 2*psi*w_n w_n^2]; den11=[w_n^2] ; sys11=tf(num11,den11) ;
figure(1) ; grid on; % Bode Plots
subplot(3,3,1) ; bode(sys1); grid on;
350
subplot(3,3,2) ; bode(sys2); grid on;
subplot(3,3,3) ; bode(sys3); grid on;
subplot(3,3,4) ; bode(sys4); grid on;
subplot(3,3,5) ; bode(sys5); grid on;
subplot(3,3,6) ; bode(sys12); grid on;
subplot(3,3,9) ; bode(sys13); grid on;
subplot(3,3,7) ; bode(sys6); hold on; bode(sys7); hold on;
bode(sys8); hold on;grid on;
subplot(3,3,8) ; bode(sys9); hold on; bode(sys10); hold on;
bode(sys11); hold on;grid on;
figure(2) ; grid off; % Nyquist (Polar) plots
subplot(3,3,1) ; nyquist(sys1); grid off;
subplot(3,3,2) ; nyquist(sys2); grid off;
subplot(3,3,3) ; nyquist(sys3); grid off;
subplot(3,3,4) ; nyquist(sys4); grid off;
subplot(3,3,5) ; nyquist(sys5); grid off;
subplot(3,3,6) ; nyquist(sys12); grid off;
subplot(3,3,9) ; nyquist(sys13); grid off;
subplot(3,3,7) ; nyquist(sys6); hold on; nyquist(sys7); hold on;
nyquist(sys8); hold on; grid off;
subplot(3,3,8) ; nyquist(sys9); hold on; nyquist(sys10); hold on;
nyquist(sys11); hold on; grid off;
figure(3) ; grid off; % Log Magnitude versus Phase plots
subplot(3,3,1) ; nichols(sys1); grid off;
subplot(3,3,2) ; nichols(sys2); grid off;
subplot(3,3,3) ; nichols(sys3); grid off;
subplot(3,3,4) ; nichols(sys4); grid off;
subplot(3,3,5) ; nichols(sys5); grid off;
subplot(3,3,6) ; nichols(sys12); grid off;
subplot(3,3,9) ; nichols(sys13); grid off;
subplot(3,3,7) ; nichols(sys6); hold on; nichols(sys7); hold on;
nichols(sys8); hold on; grid off;
subplot(3,3,8) ; nichols(sys9); hold on; nichols(sys10); hold on;
nichols(sys11); hold on; grid off;
Stability Analysis in Frequency Domain: Nyquist Stability Criteria
Frequency domain methods are probably the most commonly used control system design
methods in practice. Therefore, it is important to be able to evaluate the stability of a
dynamic system in frequency domain. Stabiliy of a linear time invariant dynamic system can
be determined in frequency domain using Nyquist stability criteria. Furthermore, relative
stability can be quantied (if stable, how far is the system from being unstable, or if unstable
how far is the system from being stable) using the gain margin and phase margin measures.
0.10. GPS: GLOBAL POSITIONING SYSTEM 351
Consider the feedback control system shown in the Fig. 2.17. If there is sensor dynamics,
it is usually included in the loop transfer function since the output is the quantity we can
physically measure. The question is how can we determine if the CLS is stable using
frequency domain methods.
CLS poles : 1 +G(s)H(s) = 0 (1058)
Is there any roots of this equation on the right-half s-plane ? The Nyquist stability criteria
answers that question by using the frequency response data of the loop transfer function,
G(s)H(s) or G(s) if the sensor dynamics is included in the loop transfer function. In s-
domain, we can nd the roots of this equation. If any roots are on the right-half s-plane,
than the CLS is unstable. However, we would like to determine if the CLS has poles on the
RHP using frequency domain methods without explicitly solving for the roots of the closed
loop characteristic equation.
Nyquist stability criteria is derived as a special case of the mapping theorem of complex
variables. Consider the mapping shown in Fig. 123. A contour C
1
from the s-plane is
mapped to F(s) plane by the function F(s). The closed contour C
1
will be mapped to
another closed contour C
1
on the F(s) plane. The important point to note in this mapping
is the number of poles and zeros of the mapping function F(s) inside the C
1
contour and its
relationship to the number of encirclement of the origin in F(s) plane by the C
1
contour.
Notice that as a phasor from a zero inside C
1
traverses clock-wise (CW) over the C
1
, the
C
1
will encircle the origin in the CW direction (Fig. 123.a). Similarly, as a phasor from
a pole inside C
1
traverses clock-wise (CW) over the C
1
, the C
1
willl encircle the origin in
the counter clock-wise (CCW) direction (Fig. 123.b). If there is no poles or zeros of F(s)
inside the contour C
1
, then the mapped contour C
1
does not encircle the origin in the F(s)
plane.
In summary, as the mapping F(s) traverses for s variable values over the C
1
contour in
CW direction, the corresponding contour in F(s) plane, C
1
, will encircle the origin in the
CW direction based on the following relationship:
N = Z P (1059)
where,
N is the number of CW encirclement of the origin by C
1
,
Z is the number of zeros of F(s) inside C
1
,
P is the number of poles of F(s) inside C
1
.
Notice that encirclements of origin in CW direction are counted as positive, and the encir-
clements of the origin in the CCW direction are counted as negative (Fig. 123.a-c).
Nyquist stability criteria is an application of the mapping theorem to determine the
stability of a closed loop LTI dynamic system. Let us consider that the C
1
contour is a
352
contour containing the RHP in s-plane, and that F(s) = 1 +G(s)H(s) (Fig. 123.d). Then,
the number of CW encirclement of the origin in (1 + GH(s)) plane by the C
1
contour is
equal to the number of zeros of (1 + GH(s)) in the RHP (which is the number of unstable
closed loop poles) minus the number of poles of (1 + GH(s)) in the RHP (which is the
number of unstable open loop poles). Finally, instead of the (1 + GH(s)) mapping, we
can consider the GH(s) mappping alone, and revise the above conclusion for (1, 0) point
encirclement instead of the origin (0, 0).
Nyquist Stability Criteria: The number of unstable closed loop poles (Z) of system
shown in Fig. 123, is equal to the number of CW encirclement of the (1, 0) point plus the
number of unstable poles of the open loop system,
Z = N + P (1060)
Notice that if the open loop system is stable, P = 0, then Z = N.
In most engineering systems, the transfer function has more poles than zeros. Therefore,
as we map the C
1
contour with G(s)H(s),
the half circle arc (as s goes to innity) will map to zero magnitude for deg(d(s)) >
deg(n(s)) or a nite value is deg(d(s)) = deg(n(s)) (Fig. 123.d, e).
The mapping of the lower half of the imaginary axis will be symmetric to the mapping
of the upper half of the imaginary axis (Fig. 123.d, e).
Hence, the Nyquist plot can be determined only from the mapping of the positive jw axis.
If there are poles or zeros on the imaginary axis, the contour C
1
should either include
them or exclude them from being inside the C
1
contour. Either approach would give the
same nal conclusion regarding closed loop stability. It is customary to exclude the poles
and zeros on the imaginary axis from the C
1
contours inside (Fig. 123.f).
Relative Stability
The Nyquist stability criteria can be extented to answer relative stability questions as well.
For instance, if we want to know whether there are any poles with less than certain amount
of damping ratio, the C
1
contour can be dened as shown in Fig. 123.g. The mapping
of G(s)H(s) and encirlcement of (1, 0) tells us the number of CLS poles inside the C
1
contour. Similiarly, we can determine the number of CLS poles inside any contour as shown
in Fig. 123.
The more direct and commonly used method of evaluating the relative stability of a
CLS is to use the distance of the Nyquist plot from the (1, 0) point as an indication of
relative stability. That is how far is the CLS from the stability boundary.
There are two quantities dened for relative stability: gain margin (GM) and phase
margin (PM). Gain margin is the inverse of the maginitude of the loop transfer function
when the phase is 180
0
. It indicates how much the loop gain can be increased before the
0.11. CORRELATION BETWEENTIME DOMAIN ANDFREQUENCYDOMAIN INFORMATION353
system reaches the stability boundary. The phase margin is the phase angle dierence
between the loop transfer function and 180
0
when the magnitude of the loop transfer
function is one. PM indicates the amount of phase lag that can be introduced into the loop
transfer function before it reaches the stability boundary. The measurement of GM and
PM on Bode, Nyquist and Log Mag-Phase plots are shown in Fig. 124.
0.11 Correlation Between Time Domain and Frequency Do-
main Information
Three major groups of events which are not under our control and aect the system per-
formance are:
1. variations in the process parameters and dynamics,
2. disturbances,
3. sensor noise.
A desired performance specication for any CLS includes specications regarding
1. stability,
2. response quality
3. robustness of stability and response quality despite the real-world imperfections i.e.
variations in the process dynamics, disturbances, sensor noise.
The stability of CLS requires that all of the CLS poles be in the left half s-plane (LHP).
If a certain degree of relative stabilty is required, then we can further impose conditions
that CLS poles must have a real part smaller than a negative real value
Re(p
i
) < 0 or a (1061)
or in frequency domain it can be specied in terms of gain and phase margins,
GM > GM
min
, PM > PM
min
(1062)
The response quality is generally divided into two groups: transient response and stead-
state response. The transient response is generally specied as the step response. The step
response is quantied using percent overshoot, settling time, and rise time specications:
(P.O.%, t
s
, t
r
). For a second order closed loop system , the P.O.% and t
s
uniquely determine
the closed loop system poles with damping ratio ( ) and natural frequency (w
n
): p
1,2
=
354
w
n
j

1
2
w
n
. In frequency domain, cross-over frequency (w
cr
) of the loop transfer
function and bandwidth (w
bw
) of the closed loop transfer function, along with the phase
margin of the loop transfer function correlates well with the transient response. Cross-over
frequency is dened for the loop transfer function where the magnitude of the loop transfer
function is 1 (or 0dB). Bandwidth frequency is dened for the closed loop transfer function
where the magnitude is 0.707 or (3dB). Bandwidth closely relates to the speed of response
(t
s
), and phase margin (PM) is closely related to the damping ratio. For a second order
closed loop system as shown in gure 125, it can be shown [15] that
PM = tan
1
2

1 + 4
2
2
2
(1063)
100 for 0.6 (1064)
w
cr
=

2
2
+

4
2
+ 1 w
n
; w = w
cr
at |G(jw)| = 1.0 (1065)
; (20Log
10
|G(jw)| = 0.0 dB) (1066)
w
bw
= w
n

(1 2
2
) +

(2
2
1)
2
+ 1 (1067)
; w = w
bw
at |G(jw)/(1 +G(jw))| = 0.707 (1068)
; (20Log
10
|G(jw)/(1 + G(jw))| = 3dB) (1069)
w
p
= w
n

1 2
2
; where |G(jw)/(1 + G(jw))| is maximum (1070)
; w = w
p
at
d
dw
(|G(jw)/(1 + G(jw))|) = 0.0 (1071)
; for 0 0.707 (1072)
M
p
= max|G(jw)/(1 + G(jw))| (1073)
=
1
2

1
2
; for 0 0.707 (1074)
t
s
=
4.0
w
n
; (1075)
P.O. = e
/

1
2
; for 0 < 1.0 (1076)
(1077)
where setting time t
s
is dened as the time it takes for the step response to settle within
2% of the commanded signal, P.O. is the maximum percent overshoot of the step response.
Bode plot of the loop transfer function and closed loop transfer function can be generated
for specic values of the parameters and w
n
is shown below (Fig. 125),
psi = 0.25 ;
wn = 10.0 ;
s=tf(s) ;
0.11. CORRELATION BETWEENTIME DOMAIN ANDFREQUENCYDOMAIN INFORMATION355
G1 = wn^2/(s^2+2*psi*wn*s) ; % Loop tranfer function
G2 = G1/(1+G1) ; % Closed loop transfer function
figure(1) ; grid on ;
subplot(1,2,1) ; bode(G1,r) ; grid on ;
subplot(1,2,2) ; bode(G2,r) ; grid on ;
Typical desired gain margin and phase margins are; GM 6dB and PM around 30
0
to 60
0
. In general, it can be shown that w
cr
w
p
2 w
cr
. For any stable minimum
phase system, G(s), (a dynamic sytem whose zeros and poles are on the LHP), the phase
of G(jw) is uniquely related to the magnitude of G(jw). Approximate phase is the slope of
the magnitude curve (n, slope of magnitude curve) times 90
0
at a any frequency,

G(jw) n 90
0
(1078)
Therefore, around cross-over frequency, w w
cr
, |G(jw)| 1, if n = 1 , that is the slope
of the magnitude curve is 20dB/decade, then

G(jw
cr
) 90
0
, and hence the PM 90
0
.
If n = 2,

G(jw
cr
) 180
0
and the PM 0. Therefore, the slope of the magnitude curve
on Bode plot should have about 20dB/decade slope around the cross-over frequency so
that the the system has about 90
0
phase margin.
The steady-state response is specied in terms of the steady-state error of the CLS in
response to three standard test command signals: step, ramp, and parabolic signals. It can
be shown that the steady state error in response to step, ramp, and parabolic command
signals are dened as
e
step
() =
1
1 +K
p
(1079)
e
ramp
() =
1
K
v
(1080)
e
parabolic
() =
1
K
a
(1081)
where K
p
, K
v
, K
a
are dened as
K
p
= lim
s0
D(s)G(s) (1082)
K
v
= lim
s0
sD(s)G(s) (1083)
K
a
= lim
s0
s
2
D(s)G(s) (1084)
356
The error constants K
p
, K
v
, K
a
can be directly determined from the asymptotic behavior
of the frequency response plots using Bode or Nyquist plots (Fig. 126). Let us consider a
frequency response equation in the following form
G(jw) = K
(1 + jw/z
1
)(1 + jw/z
2
)...
(jw)
N
(1 + jw/p
1
)(1 + jw/p
2
)...
(1085)
Clearly, if we would like to estimate the low frequency gain in order to get the error con-
stants, let w 0 and the frequency response can be approximated as
G(jw)
K
(jw)
N
(1086)
If N = 0, then K
p
= K.
If N = 1, then K/|jw| = 1 or K
v
= w
1
where 20log|G(jw)|
w=w
1
= 0dB.
Similarly, If N = 2, then K
a
= w
2
2
where w
2
is such that 20Log|G(jw)|
w=w
2
= 0.
The type of the loop transfer function can also be immediately determined from the slope
of the magnitude curve as frequency goes to zero or from the phase plot at low frequencies.
The robustness specication deals with the sensitivity of the system. The most impor-
tant advantage of feedback control over open loop control is that the feedback improves
the robustness of the system performance against the variations in process dynamics, and
disturbances. The closed loop system should not only be stable and have good response
quality for the nominal parameters of the operating conditions, but also should stay stable
and have good response quality despite the real-world imperfections.
In summary, the correlation between the time-domain specications and frequency do-
main behavior is as follows
good stability means large gain margin and phase margin. In order to have a rea-
sonably good P.M., the slope of the magnitude curve should be about 20dB/decade
around the cross-over frequency.
larger loop gain at low frequencies will result in lower stead-state errors, and good
disturbance rejection against low frequency disturbances
low loop gain and a fast decaying rate at high frequency region will able to increase
the ability to reject the eect of high frequency noise.
Overall, the stability, steady state error and robustness characteristics of a CLS is well
represented in frequency response of the loop transfer function, whereas the transient re-
sponse is not represented with the same accuracy. The s-domain pole-zero representation
0.11. CORRELATION BETWEENTIME DOMAIN ANDFREQUENCYDOMAIN INFORMATION357
of a CLS correlate to the transient response behavior well, but does not give information
about disturbance and sensor noise rejection ability. Therefore, frequency response (i.e.
Bode plots) and s-domain methods (i.e. root locus method) complement each other in the
graphical information they display regarding the control system charateristics (i.e. transient
and steady state response).
358
1
9
.
4
1
9
.
6
M a g n i t u d e ( d B )
1
0
0
.
7
1
0
0
.
8
1
0
0
.
9

1 0 1
P h a s e ( d e g )
K
o

=

1
0
F
r
e
q
u
e
n
c
y


(
r
a
d
/
s
e
c
)

2
0 0
2
0
M a g n i t u d e ( d B )
1
0
0
1
0
1

9
1

9
0

8
9
P h a s e ( d e g )
1
/
s
F
r
e
q
u
e
n
c
y


(
r
a
d
/
s
e
c
)

2
0 0
2
0
M a g n i t u d e ( d B )
1
0
0
1
0
1
8
9
9
0
9
1
P h a s e ( d e g )
s
F
r
e
q
u
e
n
c
y


(
r
a
d
/
s
e
c
)

4
0

2
0 0
M a g n i t u d e ( d B )
1
0

2
1
0
0
1
0
2

9
0

4
5 0
P h a s e ( d e g )
1
/
(
s
/
p
1
+
1
)
,

p
1

=

1
.
0
F
r
e
q
u
e
n
c
y


(
r
a
d
/
s
e
c
)
0
2
0
4
0
M a g n i t u d e ( d B )
1
0

2
1
0
0
1
0
2
0
4
5
9
0
P h a s e ( d e g )
(
s
/
z
1
+
1
)
,

z
=
1
.
0
F
r
e
q
u
e
n
c
y


(
r
a
d
/
s
e
c
)
0
1
0
2
0
M a g n i t u d e ( d B )
1
0

2
1
0
0
1
0
2
0
4
5
9
0
P h a s e ( d e g )
(
s
/
z
2
+
1
)
/
(
s
/
p
2
+
1
)
;

z
2
=
1
.
0
,

p
2
=
1
0
.
0
F
r
e
q
u
e
n
c
y


(
r
a
d
/
s
e
c
)

2
0

1
0 0
M a g n i t u d e ( d B )
1
0

2
1
0
0
1
0
2

9
0

4
5 0
P h a s e ( d e g )
(
s
/
z
3
+
1
)
/
(
s
+
p
3
+
1
)
;

z
3
=
1
.
0
,

p
3

=

0
.
1
F
r
e
q
u
e
n
c
y


(
r
a
d
/
s
e
c
)

1
0
0 0
1
0
0
M a g n i t u d e ( d B )
1
0

2
1
0
0
1
0
2

1
8
0

9
0 0
P h a s e ( d e g )
w
n
2
/
(
s
2
+
2

p
s
i

w
n

s

+

w
n
2
)
;

w
n
=
1
,

p
s
i
=
0
.
2
5
,


0
.
5
,

0
.
7
5
F
r
e
q
u
e
n
c
y


(
r
a
d
/
s
e
c
)

1
0
0 0
1
0
0
M a g n i t u d e ( d B )
1
0

2
1
0
0
1
0
2
0
9
0
1
8
0
P h a s e ( d e g ) (
s
2
+
2

p
s
i

w
n

s

+

w
n
2
)
/
w
n
2

;

w
n
=
1
,

p
s
i
=
0
.
2
5
,


0
.
5
,

0
.
7
5
F
r
e
q
u
e
n
c
y


(
r
a
d
/
s
e
c
)
F
i
g
u
r
e
1
2
0
:
B
o
d
e
p
l
o
t
s
o
f
b
a
s
i
c
t
r
a
n
s
f
e
r
f
u
n
c
t
i
o
n
s
:
g
a
i
n
,
p
o
l
e
/
z
e
r
o
a
t
t
h
e
o
r
i
g
i
n
,

r
s
t
o
r
d
e
r
p
o
l
e
/
z
e
r
o
,
s
e
c
o
n
d
o
r
d
e
r
p
o
l
e
/
z
e
r
o
(
f
o
r
d
i

e
r
e
n
t
d
a
m
p
i
n
g
c
o
e

c
i
e
n
t
s
)
,
p
h
a
s
e
-
l
e
a
d
a
n
d
p
h
a
s
e
-
l
a
g

l
t
e
r
s
.
0.11. CORRELATION BETWEENTIME DOMAIN ANDFREQUENCYDOMAIN INFORMATION359

1
0

5
0
5
1
0

0
.
5 0
0
.
5 1
N
y
q
u
i
s
t

D
i
a
g
r
a
m
:

K
o

=

1
0
R
e
a
l

A
x
i
s
I m a g i n a r y A x i s

0
.
5
0
0
.
5

1
0

5 0 5
1
0
N
y
q
u
i
s
t

D
i
a
g
r
a
m
:

1
/
s
R
e
a
l

A
x
i
s
I m a g i n a r y A x i s

0
.
5
0
0
.
5

1
0

5 0 5
1
0
N
y
q
u
i
s
t

D
i
a
g
r
a
m
:

s
R
e
a
l

A
x
i
s
I m a g i n a r y A x i s

0
.
5
0
0
.
5
1

0
.
5 0
0
.
5
N
y
q
u
i
s
t

D
i
a
g
r
a
m
:

1
/
(
s
/
p
1
+
1
)
;

p
1
=

1
.
0
R
e
a
l

A
x
i
s
I m a g i n a r y A x i s

1
0
1
2

2
0

1
0 0
1
0
2
0
N
y
q
u
i
s
t

D
i
a
g
r
a
m
:

(
s
/
z
1
+
1
)
;

z
1
=
1
.
0
R
e
a
l

A
x
i
s
I m a g i n a r y A x i s

5
0
5
1
0

5 0 5
(
s
/
z
2
+
1
)
/
(
s
/
p
2
+
1
)
;

z
2
=
1
.
0
,

p
2
=
1
0
.
0
R
e
a
l

A
x
i
s
I m a g i n a r y A x i s

0
.
5
0
0
.
5
1

0
.
5 0
0
.
5
(
s
/
z
3
+
1
)
/
(
s
/
p
3
+
1
)

;

z
3
=
1
.
0
;

p
3
=
0
.
1
R
e
a
l

A
x
i
s
I m a g i n a r y A x i s

1
0
1
2

5 0 5
w
n
2
/
(
s
2
+
2

p
s
i

w
n

s

+

w
n
2
)
;

w
n
=
1
.
0
;


p
s
i
=
0
.
2
5
,

0
.
5
,

0
.
7
5
R
e
a
l

A
x
i
s
I m a g i n a r y A x i s

5
0
0
0
5
0
0

5
0 0
5
0
(
s
2
+
2

p
s
i

w
n

s

+

w
n
2
)
/
w
n
2
;

w
n
=
1
.
0
;


p
s
i
=
0
.
2
5
,

0
.
5
,

0
.
7
5
R
e
a
l

A
x
i
s
I m a g i n a r y A x i s
F
i
g
u
r
e
1
2
1
:
N
y
q
u
i
s
t
(
p
o
l
a
r
)
p
l
o
t
s
o
f
b
a
s
i
c
t
r
a
n
s
f
e
r
f
u
n
c
t
i
o
n
s
:
g
a
i
n
,
p
o
l
e
/
z
e
r
o
a
t
t
h
e
o
r
i
g
i
n
,

r
s
t
o
r
d
e
r
p
o
l
e
/
z
e
r
o
,
s
e
c
o
n
d
o
r
d
e
r
p
o
l
e
/
z
e
r
o
(
f
o
r
d
i

e
r
e
n
t
d
a
m
p
i
n
g
c
o
e

c
i
e
n
t
s
)
,
,
p
h
a
s
e
-
l
e
a
d
a
n
d
p
h
a
s
e
-
l
a
g

l
t
e
r
s
.
360

1
0
1
1
9
1
9
.
5
2
0
2
0
.
5
2
1
N
i
c
h
o
l
s

C
h
a
r
t
:

K
o

=

1
0
O
p
e
n

L
o
o
p

P
h
a
s
e

(
d
e
g
)
O p e n L o o p G a i n ( d B )

9
1

9
0

8
9

5
0 0
5
0
N
i
c
h
o
l
s

C
h
a
r
t
:

1
/
s
O
p
e
n

L
o
o
p

P
h
a
s
e

(
d
e
g
)
O p e n L o o p G a i n ( d B )
8
9
9
0
9
1

5
0 0
5
0
N
i
c
h
o
l
s

C
h
a
r
t
:

s
O
p
e
n

L
o
o
p

P
h
a
s
e

(
d
e
g
)
O p e n L o o p G a i n ( d B )

9
0

4
5
0

4
0

3
0

2
0

1
0 0
N
i
c
h
o
l
s

C
h
a
r
t
:

1
/
(
s
/
p
1
+
1
)
;

p
1
=

1
.
0
O
p
e
n

L
o
o
p

P
h
a
s
e

(
d
e
g
)
O p e n L o o p G a i n ( d B )
0
4
5
9
0
0
1
0
2
0
3
0
4
0
N
i
c
h
o
l
s

C
h
a
r
t
:


(
s
/
z
1
+
1
)
;

z
1
=

1
.
0
O
p
e
n

L
o
o
p

P
h
a
s
e

(
d
e
g
)
O p e n L o o p G a i n ( d B )
0
3
0
6
0
0 5
1
0
1
5
2
0
N
i
c
h
o
l
s

C
h
a
r
t
:

(
s
/
z
2
+
1
)
/
(
s
/
p
2
+
1
)
;

z
2
=
1
.
0
,

p
2
=
1
0
.
0
O
p
e
n

L
o
o
p

P
h
a
s
e

(
d
e
g
)
O p e n L o o p G a i n ( d B )

6
0

3
0
0

2
0

1
5

1
0

5 0
N
i
c
h
o
l
s

C
h
a
r
t
:

(
s
/
z
3
+
1
)
/
(
s
/
p
3
+
1
)
;

z
3
=
1
.
0
,

p
3
=
0
.
1
O
p
e
n

L
o
o
p

P
h
a
s
e

(
d
e
g
)
O p e n L o o p G a i n ( d B )

1
8
0

9
0
0

1
0
0

5
0 0
5
0
1
0
0
w
n
2
/
(
s
2
+
2

p
s
i

w
n

s

+

w
n
2
)
;

w
n
=
1
.
0
;


p
s
i
=
0
.
2
5
,

0
.
5
,

0
.
7
5
O
p
e
n

L
o
o
p

P
h
a
s
e

(
d
e
g
)
O p e n L o o p G a i n ( d B )
0
9
0
1
8
0

1
0
0

5
0 0
5
0
1
0
0
(
s
2
+
2

p
s
i

w
n

s

+

w
n
2
)
/
w
n
2
;

w
n
=
1
.
0
;


p
s
i
=
0
.
2
5
,

0
.
5
,

0
.
7
5
O
p
e
n

L
o
o
p

P
h
a
s
e

(
d
e
g
)
O p e n L o o p G a i n ( d B )
F
i
g
u
r
e
1
2
2
:
L
o
g
m
a
g
n
i
t
u
d
e
v
e
r
s
u
s
p
h
a
s
e
p
l
o
t
s
o
f
b
a
s
i
c
t
r
a
n
s
f
e
r
f
u
n
c
t
i
o
n
s
:
g
a
i
n
,
p
o
l
e
/
z
e
r
o
a
t
t
h
e
o
r
i
g
i
n
,

r
s
t
o
r
d
e
r
p
o
l
e
/
z
e
r
o
,
s
e
c
o
n
d
o
r
d
e
r
p
o
l
e
/
z
e
r
o
(
f
o
r
d
i

e
r
e
n
t
d
a
m
p
i
n
g
c
o
e

c
i
e
n
t
s
)
,
p
h
a
s
e
-
l
e
a
d
a
n
d
p
h
a
s
e
-
l
a
g

l
t
e
r
s
.
N
o
t
i
c
e
t
h
a
t
t
h
e
p
l
o
t
f
o
r
c
o
n
s
t
a
n
t
g
a
i
n
K
0
i
s
o
n
l
y
a
p
o
i
n
t
i
n
t
h
i
s
c
a
s
e
s
i
n
c
e
i
t
h
a
s
o
n
e
m
a
g
n
i
t
u
d
e
v
a
l
u
e
a
n
d
z
e
r
o
p
h
a
s
e
(
a
p
o
i
n
t
o
n
t
h
i
s
p
l
o
t
)
f
o
r
a
l
l
f
r
e
q
u
e
n
c
i
e
s
.
0.11. CORRELATION BETWEENTIME DOMAIN ANDFREQUENCYDOMAIN INFORMATION361
I
m
(
s
)
R
e
(
s
)
F
(
s
)
(
a
)
(
b
)
I
m
(
F
(
s
)
)
R
e
(
F
(
s
)
)
I
m
(
s
)
R
e
(
s
)
I
m
(
F
(
s
)
)
R
e
(
F
(
s
)
)
I
m
(
s
)
R
e
(
s
)
C
1
C
1
C
1
C
1
C
1
C
1
C
1

C
1

C
1

C
1

C
1

(
c
)
I
m
(
F
(
s
)
)
R
e
(
F
(
s
)
)
I
m
(
s
)
R
e
(
s
)
(
d
)
I
m
(
G
H
(
s
)
)
R
e
(
G
H
(
s
)
)
I
m
(
s
)
R
e
(
s
)
(
e
)
I
m
(
G
H
(
s
)
)
R
e
(
G
H
(
s
)
)
I
m
(
s
)
R
e
(
s
)
(
f
)
I
m
(
G
H
(
s
)
)
R
e
(
G
H
(
s
)
)
I
m
(
s
)
R
e
(
s
)
(
-
1
,
0
)
(
-
1
,
0
)
F
(
s
)
F
(
s
)
G
H
(
s
)
G
H
(
s
)
G
H
(
s
)
G
H
(
s
)
x
x
x
C
1
I
m
(
G
H
(
s
)
)
R
e
(
G
H
(
s
)
)
F
i
g
u
r
e
1
2
3
:
S
t
a
b
i
l
i
t
y
a
n
a
l
y
s
i
s
i
n
f
r
e
q
u
e
n
c
y
d
o
m
a
i
n
u
s
i
n
g
N
y
q
u
i
s
t
S
t
a
b
i
l
i
t
y
c
r
i
t
e
r
i
a
:
a
)
m
a
p
p
i
n
g
o
f
a
c
l
o
s
e
d
c
o
n
t
o
u
r
C
1
f
r
o
m
s
-
p
l
a
n
e
t
o
F
(
s
)
p
l
a
n
e
,
w
h
e
r
e
F
(
s
)
h
a
s
a
z
e
r
o
i
n
s
i
d
e
t
h
e
c
o
n
t
o
u
r
C
1
i
n
t
h
e
s
-
p
l
a
n
e
,
b
)
s
a
m
e
a
s
(
a
)
e
x
c
e
p
t
F
(
s
)
h
a
s
a
p
o
l
e
i
n
s
i
d
e
C
1
,
c
)
s
a
m
e
a
s
(
a
)
e
x
c
e
p
t
F
(
s
)
d
o
e
s
n
o
t
h
a
v
e
a
n
y
p
o
l
e
s
o
r
z
e
r
o
s
i
n
s
i
d
e
t
h
e
C
1
c
o
n
t
o
u
r
,
d
)
m
a
p
p
i
n
g
o
f
r
i
g
h
t
h
a
n
d
s
-
p
l
a
n
e
a
s
a
s
p
e
c
i
a
l
c
h
o
i
c
e
o
f
C
1
c
o
n
t
o
u
r
i
n
s
-
p
l
a
n
e
a
n
d
F
(
s
)
=
1
+
G
H
(
s
)
,
e
)
t
y
p
i
c
a
l
s
e
l
e
c
t
i
o
n
o
f
C
1
c
o
n
t
o
u
r
t
o
e
x
c
l
u
d
e
p
o
l
e
s
a
n
d
z
e
r
o
s
o
n
j
w
a
x
i
s
.
I
f
C
1
i
s
c
h
o
s
e
n
t
o
i
n
c
l
u
d
e
t
h
e
m
,
N
y
q
u
i
s
t
s
t
a
b
i
l
i
t
y
c
r
i
t
e
r
i
a
w
o
u
l
d
s
t
i
l
l
g
i
v
e
u
s
c
o
r
r
e
c
t
a
n
s
w
e
r
a
b
o
u
t
t
h
e
n
u
m
b
e
r
o
f
u
n
s
t
a
b
l
e
p
o
l
e
s
,
f
)
N
y
q
u
i
s
t
s
t
a
b
i
l
i
t
y
c
r
i
t
e
r
i
a
a
n
d
N
y
q
u
i
s
t
(
p
o
l
a
r
)
p
l
o
t
w
h
e
r
e
o
n
l
y
s
=
j
w
f
o
r
w
=
0

i
s
m
a
p
p
e
d
,
g
)
u
s
e
o
f
N
y
q
u
i
s
t
s
t
a
b
i
l
i
t
y
c
r
i
t
e
r
i
a
t
o
d
e
t
e
r
m
i
n
e
r
e
l
a
t
i
v
e
s
t
a
b
i
l
i
t
y
:
d
o
e
s
t
h
e
c
l
o
s
e
d
l
o
o
p
s
y
s
t
e
m
h
a
v
e
p
o
l
e
s
i
n
s
i
d
e
t
h
i
s
c
o
n
t
o
u
r
C
1
,
i
f
s
o
,
h
o
w
m
a
n
y
?
362
0.11. CORRELATION BETWEENTIME DOMAIN ANDFREQUENCYDOMAIN INFORMATION363
Positive
GM
Positive
GM
Positive
GM
Positive
PM
Positive
PM
Positive
PM
0
2
0

L
o
g
1
0
|
G
(
j
w
)
|
2
0

L
o
g
1
0
|
G
(
j
w
)
|
G
G
Stable system
Stable system
Stable system
Negative
GM
Negative
GM
Negative
GM
Negative
PM
Negative
PM
Negative
PM
0
2
0

L
o
g
1
0
|
G
(
j
w
)
|
Unstable system
(a)
(b)
1
G(jw)
R
e
(G(jw))
I
m
(G(jw))
G(jw)
Unstable system
1
R
e
(G(jw))
I
m
(G(jw))
1
Kg
1
Kg
-1 -1
0
-270 -180 -90
2
0

L
o
g
1
0
|
G
(
j
w
)
|
G
Unstable system
0
-270 -180 -90
G
Figure 124: Gain margin and phase margin measures in Bode plot, Nyquist (polar) plot,
and Log-magniude versus phase plots.
364
w
n
2
y(t) r(t)
r(s) y(s)
-
wbw
PM
wcr
-3
wbw
Mp
Bode plots for loop transfer function Bode plots for closed loop transfer function
Figure 125: Correlation between the time domain transient response and frequency response
(loop transfer function and closed loop transfer function) for a second order system.
0.11.1 Closed Loop Frequency Response
Control system design and analysis using frequency domain based methods, i.e. Bode plots,
use only the loop transfer function to design and analyze the behaivor for a closed loop
system. Once the controller is designed, it is of interest to evaluate the frequency response
of the closed loop system in frequency domain. To this end, let us consider the general
closed loop control system shown in Fig. ??, where we denote controller transfer function
as part of the G(s) = D(s)G
1
(s). For unity feedback systems, simply let H(s) = 1.0.
The closed loop transfer function and its frequency reponse is
y(s)
r(s
) =
G(s)
1 +G(s)H(s)
(1087)
y(jw)
r(jw
) =
G(jw)
1 +G(jw)H(jw)
(1088)
Given, G(s) = D(s)G
1
(s), controller and process transfer functions, and the sensor transfer
function H(s), computationally it is straight forward to calculate the closed loop transfer
function and it frequency response. It is simply a matter of evaluating the above equation
0.11. CORRELATION BETWEENTIME DOMAIN ANDFREQUENCYDOMAIN INFORMATION365
dB
Low Frequency
Range
High Frequency
Range
N=2
N=2
N=3
N=1
n-m = 1
n-m = 2
n-m = 3
-90
-180
-270
N=0
N=0
(n-m) x 20 db/decade
G(s) = num (s) / den (s)
n = deg (den (s))
m = deg (num(s))
N=1
n-m = 4
-360
N=4
(deg)
Figure 126: Correlation between the time domain steady state response and frequency
response (Bode plot) characteristics
.
for w : 0 w
max
and determine the complex value (magnitude and phase, or real and
imaginary part) of the closed loop transfer function.
There are two classic graphical methods to represent the CLS frequency response:
1. M & N circles, and
2. Nichols Charts.
M & N Circles for Closed Loop Frequency Response
Let us consider the unity feedback case, H(s) = 1.0. Let
G(jw) = X + jY (1089)
366
G(jw)
1 + G(jw)
= M e
j
=
X + jY
1 + X + jY
(1090)
M = |
X + jY
1 + X + jY
| (1091)
= tan
1
(
Y
X
) tan
1
(
Y
1 + X
) (1092)
Now, let us further manipulate the above equations to obtain the so called M and N circles.
For the M equation, the following derivation can be made,
M = |
X +jY
1 +X +jY
| (1093)
M
2
=
X
2
+ Y
2
(1 +X)
2
+ Y
2
=
X
2
+ Y
2
(1 + 2X + X
2
+Y
2
(1094)
X
2
+ Y
2
= M
2
+ 2XM
2
+X
2
M
2
+M
2
Y
2
(1095)
0 = X
2
(1 M
2
) 2M
2
X M
2
+ (1 M
2
)Y
2
(1096)
For M = 1 X =
1
2
(1097)
For M = 1 (1098)
0 = X
2
+
2M
2
M
2
1
X +
M
2
M
2
1
+Y
2
(1099)
add
M
2
(M
2
1)
2
to both sides (1100)
(X +
M
2
M
2
1
)
2
+ Y
2
=
M
2
(M
2
1)
(1101)
The above equation denes equations for circles, where M is the parameter of the circle,
and X and Y the cartisian coordinates of the circle (Fig. ??). For any given value of M,
there is a constant circle on the X and Y plane. The intersection points of the constant
M circles and the G(jw) are the CLS frequency response magnitude at that frequency. Let
N = tan(), then
N = tan(tan
1
(
Y
X
) tan
1
(
Y
1 +X
)) (1102)
tan(A B) =
tan(A) tan(B)
1 +tan(A)tan(B)
(1103)
N =
Y
X

Y
1+X
1 +
Y
X
Y
1+X
=
Y
X
2
+ X +Y
2
(1104)
0 = X
2
+ X +Y
2

1
N
Y (1105)
(1106)
0.11. CORRELATION BETWEENTIME DOMAIN ANDFREQUENCYDOMAIN INFORMATION367
and add
1
4
+
1
2N
2
to both sides of the last equation, the resulting equation can be expressed
as
(X +
1
2
)
2
+ (Y
1
2N
)
2
=
1
4
+ (
1
2N
)
2
(1107)
(1108)
where N is the CLS phase angle and a specic constant value of it represents a contour of
constant CLS phase angle (Fig. ??). Intersection of between the N contors and G(jw) for a
particular frequency gives the phase angle of the CLS frequency response at that frequency.
Notice that for various parameterized values of M and N, these two equations result in
standard plots that serve as a template. Then for a specic G(jw) loop transfer function,
we can plot its magnitude on the M circles plot, and phase angle on the M circles plot
(like an overlay). Then, determine the closed loop frequency response magnitude and phase
angle from the intersections of the |G(jw)| plot on M circles, and

G(jw) plot on the N
circles.
Nichols Charts for Closed Loop Frequency Response
Nichols chart plots are equivalent to thee M and N circles, expect that the same information
is plotted on the magnitude versus phase plane, 20Log
10
|G(jw)| is the y-axis,

G(jw) is the
x-axis (Fig.??). Nichols chart is symmetric about the phase angle 180
0
line. Chart center
is (0dB, 180
0
). In order to obtain the CLS frequency response magnitude and phase,
simply plot the loop transer function over the Nichols chart (in magnitude versus phase
angle respresentation), and then for each value of w, determine the intections between M
and N contours and the G(jw) plot. Then plot the CLS frequency response magnitude and
phase as function of frequency.
Example:
Let us illustrate the use of M&N circles and Nichols Chart in closed loop system frequency
response plots (Fig. 129 and 130).
368
Figure 127: Closed loop frequency response plots: M and N circles.
0.11. CORRELATION BETWEENTIME DOMAIN ANDFREQUENCYDOMAIN INFORMATION369
Figure 128: Closed loop frequency response plots: Nichols Chart.
370
Figure 129: Closed loop frequency response plots: a) G(jw) plot superimposed on the M
circles, b) G(jw) plot superimposed on the N circles, c) closed loop frequency response
obtained from the intersection of G(jw) plot and M and N circles.
0.11. CORRELATION BETWEENTIME DOMAIN ANDFREQUENCYDOMAIN INFORMATION371
Figure 130: Closed loop frequency response plots: a) G(jw) plot superimposed on the
Nichols chart, b) closed loop frequency response obtained from the intersection of G(jw)
plot and Nichols chart.
372

Das könnte Ihnen auch gefallen