You are on page 1of 227

ME 132, Dynamic Systems and Feedback

Class Notes
Andrew Packard, Roberto Horowitz, Kameshwar Poolla, Francesco Borrelli
Fall 2012
Instructor:
Prof. F. Borrelli
Department of Mechanical Engineering
University of California
Berkeley CA, 94720-1740
copyright 1995-2010 A. Packard, Horowitz, Poolla, Borrelli
ME 132, Fall 2012, UC Berkeley, F. Borrelli i
Contents
1 Introduction 1
1 The Power of Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 The Idea of a Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 1
3 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4 The Structure of Control Systems . . . . . . . . . . . . . . . . . . . . . . . . 3
5 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
6 The Ingredients of Control System Design . . . . . . . . . . . . . . . . . . . 6
7 A General Architecture for Control Systems . . . . . . . . . . . . . . . . . . 8
8 Example: A simple Cruise Control System for a Car . . . . . . . . . . . . . 8
2 Modeling 15
1 The Uses of Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2 Modeling Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3 Models for Use in Control System Design . . . . . . . . . . . . . . . . . . . . 15
4 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5 First Order Linear Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.1 Example: Moving Mass . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.2 Example: RC Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6 Second Order Linear Systems . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.1 Example: Spring-Mass-Damper . . . . . . . . . . . . . . . . . . . . . 18
6.2 Example: RLC Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . 20
7 n-th Order Linear Dynamical Systems . . . . . . . . . . . . . . . . . . . . . 21
7.1 SLODE Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.2 State-Space Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
ME 132, Fall 2012, UC Berkeley, F. Borrelli ii
7.3 SLODE to State-Space Models and Viceversa . . . . . . . . . . . . . 22
7.4 The Concept of State . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8 Nonlinear Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.1 Example: Magnetically Suspended Ball . . . . . . . . . . . . . . . . . 23
8.2 Example: Water Tank . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.3 Example: Pendulum . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9 Nonlinear Dynamical Systems in State Space Form . . . . . . . . . . . . . . 26
10 Properties of Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
11 Models in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
11.1 Composing integrators . . . . . . . . . . . . . . . . . . . . . . . . . . 28
11.2 State Space Linear Models . . . . . . . . . . . . . . . . . . . . . . . . 29
12 Additional Example: DC motor . . . . . . . . . . . . . . . . . . . . . . . . . 30
3 First Order, Linear, Time-Invariant (LTI) ODE 34
1 The Big Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2 Solution of a First Order LTI ODE . . . . . . . . . . . . . . . . . . . . . . . 35
3 The Free Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4 The Step Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.1 Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5 The Sinusoidal Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6 The Frequency Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4 Review of SLODEs 53
1 Linear, Time-Invariant Dierential Equations . . . . . . . . . . . . . . . . . 53
2 Importance of Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
ME 132, Fall 2012, UC Berkeley, F. Borrelli iii
3 Solving Homogeneous Equation . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.1 Interpretation of complex roots to ODEs with real-coecients . . . . 56
4 General Solution Technique . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5 Behavior of Homogeneous Solutions as t . . . . . . . . . . . . . . . . . 58
6 Response of stable system to constant input (Steady-State Gain) . . . . . 60
7 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8 Stability Conditions for 2nd order dierential equation . . . . . . . . . . . . 62
9 Important 2nd order example . . . . . . . . . . . . . . . . . . . . . . . . . . 64
10 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1 Main Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
2 General Solution Technique . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3 Behavior of Homogeneous Solutions as t . . . . . . . . . . . . . . . . . 78
4 Stability of Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5 2nd order dierential equation . . . . . . . . . . . . . . . . . . . . . . . . . . 79
6 Solutions of 2nd order dierential equation . . . . . . . . . . . . . . . . . . . 79
5 Derivatives on the inputs: Eect on the forced response 81
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
2 Other Particular Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
3 Limits approaching steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
4 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
6 Distributions 87
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
2 Procedure to get step response . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
ME 132, Fall 2012, UC Berkeley, F. Borrelli iv
7 Frequency Responses of Linear Systems 97
1 Complex and Real Particular Solutions . . . . . . . . . . . . . . . . . . . . . 98
2 Response due to real sinusoidal inputs . . . . . . . . . . . . . . . . . . . . . 99
3 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
8 Bode Plots 103
1 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
9 Transfer functions 106
1 Linear Dierential Operators (LDOs) . . . . . . . . . . . . . . . . . . . . . . 106
2 Algebra of Linear dierential operations . . . . . . . . . . . . . . . . . . . . 108
3 Feedback Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
4 More General Feedback Connection . . . . . . . . . . . . . . . . . . . . . . . 110
5 Cascade (or Series) Connection . . . . . . . . . . . . . . . . . . . . . . . . . 112
6 Parallel Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
7 General Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
8 Systems with multiple inputs . . . . . . . . . . . . . . . . . . . . . . . . . . 116
9 Poles and Zeros of Transfer Functions . . . . . . . . . . . . . . . . . . . . . . 116
10 Remarks/Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
11 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
10 Simple Cruise-Control 124
1 Dynamic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
2 Control of the First Order Car Model . . . . . . . . . . . . . . . . . . . . . . 125
2.1 Open-Loop Control System . . . . . . . . . . . . . . . . . . . . . . . 126
2.2 Closed-Loop Control System . . . . . . . . . . . . . . . . . . . . . . . 126
ME 132, Fall 2012, UC Berkeley, F. Borrelli v
2.3 Open/Closed Loop Comparison . . . . . . . . . . . . . . . . . . . . . 127
3 Integral Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
3.1 Cruise Control with Integral Action and Velocity Feedback . . . . . . 132
4 Understanding the Integral Controller By Using Second Order SLODE . . . 134
5 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
A Arithmetic of Feedback Loops 149
1 Tradeos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
2 Signal-to-Noise ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
3 Whats missing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
4 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
B Saturation and Antiwindup Strategies 160
1 Saturation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
2 Anti-Windup PI control action . . . . . . . . . . . . . . . . . . . . . . . . . . 163
3 Alternate architecture for AntiWindup Logic . . . . . . . . . . . . . . . . . . 166
4 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
C Robustness Margins 169
1 Gain Margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
2 Time-Delay Margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
3 Percentage Variation Margin . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
3.1 The Small-Gain Theorem . . . . . . . . . . . . . . . . . . . . . . . . 177
3.2 Necessary and Sucient Version . . . . . . . . . . . . . . . . . . . . . 179
3.3 Application to Percentage Variation Margin . . . . . . . . . . . . . . 181
4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
ME 132, Fall 2012, UC Berkeley, F. Borrelli vi
5 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
5.1 Generic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
5.2 Missile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
5.3 Application to percentage variation margin . . . . . . . . . . . . . . . 188
6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
D Nonlinear Systems 197
1 Input-output Dierential Equation Models . . . . . . . . . . . . . . . . . . . 198
2 State-space Realizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
3 Example: Magnetically Suspended Ball . . . . . . . . . . . . . . . . . . . . . 199
4 Equilibrium Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
5 Jacobians and the Taylor Theorem . . . . . . . . . . . . . . . . . . . . . . . 202
6 Linearization about Equilibrium Points . . . . . . . . . . . . . . . . . . . . . 203
7 Control using Jacobian Linearized Plant Models . . . . . . . . . . . . . . . . 205
8 Gain Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
9 Feedback Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
E Complex Arithmetic 210
1 Basic Stu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
2 Magnitude and Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
3 Functions of a Complex Variable . . . . . . . . . . . . . . . . . . . . . . . . 210
4 Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
5 Subsets of the complex-plane . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
F Linear Algebra 213
1 Matrices and Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
ME 132, Fall 2012, UC Berkeley, F. Borrelli vii
2 Linear Simultaneous Equations . . . . . . . . . . . . . . . . . . . . . . . . . 214
3 Transposes and Adjoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
4 Determinants and Inverses . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
5 Eigenvalues and Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . 216
6 Simple-case of the Jordan form . . . . . . . . . . . . . . . . . . . . . . . . . 217
7 Matrix Exponentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
ME 132, Fall 2012, UC Berkeley, F. Borrelli 1
1 Introduction
1 The Power of Feedback
Every morning I wake up and have a shower. I live in North Berkeley, where the housing
is somewhat run-down, but I suspect the situation is the same everywhere. My shower is
very basic. It has hot and cold water taps that are not calibrated. So I cant set the shower
temperature I like, and then step in. Instead, I am forced to use feedback control. I stick
my hand in the shower to measure the temperature. In my brain, I have an idea of what
shower temperature I would like. I then adjust the hot and cold water taps based on the
discrepancy between what I measure and what I want. In fact, it is possible to set the shower
temperature to within 0.5

F this way using this feedback control. Moreover, using feedback,


I can compensate for all sorts of changes: environmental changes, toilets ushing, etc.
This is the power of feedback: it allows us to make a precision device out of a crude one
that works well even in changing environments.
2 The Idea of a Block Diagram
We will, in this course, consider complex interconnections of physical systems. Each of
these physical systems may themselves have complicated dynamics, often represented by
dierential equations. These interconnections form the core of our study of control systems.
We therefore need a convenient means of handling and representing complex interconnections
of physical systems. The basic unit for doing this is a block diagram.
Oven
u
y
y
y
u
1
2
1
2
3
Figure 1: Block diagram of an
oven.
Oven
Figure 2: Complex interconnected system.
Consider for example an oven with two electrical heating coils, and three thermometers to
measure temperature. The recorded temperatures y
1
, y
2
, y
3
at each of the three thermometers
is a function of the past history of the voltages u
1
, u
2
applied to the heating coils. Indeed,
this dependence of y
i
on u
j
is very complicated: it involves partial dierential equations
to model conduction eects, and radiative and convective losses. Instead of carrying these
equations along with us, we simply represent the oven as a block as shown in Figure 1. This
ME 132, Fall 2012, UC Berkeley, F. Borrelli 2
block has two inputs (the applied voltages y
i
) and three outputs (the temperatures y
j
). We
may now connect various inputs and outputs of this oven to other devices, each of which may
have complicated dynamics, but is represented conveniently as a block, as shown in Figure
2. This simple idea makes possible the study of complex interconnections.
It is very important to remember that the inputs and outputs in a block diagram are not
numbers but signals, i.e. they are functions of time. Also, the value y(t) of the output y at
time t can depend on the entire past history of the applied input signals u(t).
3 Terminology
We need to agree on a common vocabulary before we embark on our study of control systems.
We will explain terms we introduce in the context of the shower temperature control system
discussed earlier.
The physical system to be controlled is called the plant. This term has its origins in chemical
engineering where the control of chemical plants or factories is of concern. In the shower
example, the plant consists of the hot and cold water tanks, the heating elements, connecting
pipes, plumbing connecting to the city water supply and to other showers and toilets all across
town.
A sensor is a device that measures a physical quantity like pressure, acceleration, humidity,
or chemical concentration. Very often, sensors produce an electrical signal whose voltage
is proportional to the physical quantity being measured. This is very convenient, because
these signals can be readily processed with electronics, or can be stored on a computer for
analysis or for real-time processing. In the context of our shower example, the sensor is our
hand. The water temperature is measured and converted to electrical signals that propagate
along neuro-sensory pathways to the brain.
An actuator is a device that has the capacity to aect the behavior of the plant. An electrical
signal is applied to the actuator, which results in some mechanical motion such as the opening
of a valve, or the motion of a motor, which in turn induces changes in the plant dynamics.
Sometimes, as for example electrical heating coils in a furnace, the applied voltage directly
aects the plant behavior without mechanical motion being involved. In the shower example,
the actuator is our hand which can open or close hot and cold water taps in response to
electrical signals sent along neuro-muscular pathways from the brain.
The controlled variables are the physical quantities we are interested in controlling. In the
shower example, this is simply the water temperature of the shower.
The reference or command is an electrical signal that represents what we would like the
regulated variable to behave like. In the context of the shower example, this is the desired
shower temperature.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 3
Disturbances are phenomena that aect the behavior of the plant being controlled. In our
shower example, disturbances include the outside temperature (which aects the character-
istics of the water heater and the heat loss through the plumbing), and other user of the
water supply (ushing an adjacent toilet can decrease the cold water pressure head resulting
in scalding of the unfortunate person taking a shower). Disturbances are often induced by
environmental changes such as temperature and humidity.
The controller is a device that processes the measured signals from the sensors and the ref-
erence signals and generates the actuated signals which in turn, aects the behavior of the
plant. In the shower example, our brain serves as the controller. Based on the dierence
between the reference or desired shower temperature and the electrical signals that repre-
sent the measured shower temperature, our brain sends out electrical signals along neural
pathways that cause our hand muscles (the actuators) to adjust the hot and cold water
taps. Controllers are essential an algorithm that prescribes how to process sensed signals
and reference signals to generate the actuator inputs.
Finally, noises are present at various points in the overall system. We will have some amount
of measurement noise (which captures the inaccuracies of sensor readings), actuator noise
(due for example to the power electronics that drives the actuators), and even noise aecting
the controller itself (due to quantization errors in a digital implementation of the control
algorithm).
Throughout these notes, we will consistently use the following symbols:
P plant K controller
u input y output
d disturbance n noise
r reference
4 The Structure of Control Systems
Based on our discussion above, we can draw the block diagram of Figure 3 that reveals the
structure of many control systems. Again, the essential idea is that the controller processes
measurements together with the reference signal to produce the actuator input u(t). In this
way, the plant dynamics are continually adjusted so as to meet the objective of having the
plant outputs y(t) track the reference signal r(t).
5 Discussion
A. Commands or Reference Signals
ME 132, Fall 2012, UC Berkeley, F. Borrelli 4
Controller
Sensors Plant Actuators
Disturbances
Commands
Measurement noise
Controller noise
Actuator noise
Figure 3: Basic structure of a control system.
These are often piecewise constant signals or ramps as shown in Figure 4. For example,
in the temperature control system of an oven, we may set a desired temperature value
as the command, and later select a dierent temperature value. In most applications,
the reference signal does not change very rapidly. An exception is target tracking.
Here, we might have a missile that is tracking a moving target. The control objective
is to have the position vector of the missile track the position vector of the missile.
Eventually, when the tracking error is small enough, we might declare the missile to
be successful. Notice in this example that the reference signal (the position vector
of the target) changes quickly, as the target is bound to attempt evasive maneuvers.
In the common situation where the reference signal is a constant, such as cruise-control
in a car, the value of the reference is called the set-point.
Who generates the reference signal? It many applications it is a human operator. For
example, a pilot may issue a command to bank his/her aircraft starboard by 12 degrees
by manually turning the steering column. This mechanical motion is converted into
an electrical reference signal which drives the banking control system of the aircraft.
In other applications, the command is generated by a higher level control system, or
by other physical systems. For example, we might have an automated steering system
for a car. Here, we could have a vision system consisting of a camera and related
electronics that watches the center-line of the roadway. The system generates steering
commands that instruct the car to turn appropriately based on the curvature of the
upcoming road. These commands drive the car steering control system.
B. The Controller
Observe that the controller processes voltage signals (the command and the sensor
outputs) and produces voltage signals (applied to the actuators). This is desirable
because it is very convenient to process voltage signals. This can be done with analog
or digital electronics, or with software. The controller is then a mapping or algorithm
that processes the signals y(t) and r(t) and generates the signals u(t). This algorithm
can be very complicated. It may contain logical elements (if .. then .. else
ME 132, Fall 2012, UC Berkeley, F. Borrelli 5
0 2 4 6 8 10
2
1
0
1
2
Time (secs)
R
e
f
e
r
e
n
c
e

(
v
o
l
t
s
)
Figure 4: Typical reference signal.
statements), or dierential equations. Software implementations of the control algo-
rithm are more exible than hardware implementations, and are natural candidates
for development or prototyping. However, control algorithms are realized in hardware
for production units because these can be much more cost-eective.
C. Robustness
As we shall discover soon, the design of a control system begins with a model of
the plant dynamics. The controller is designed to deliver the requisite performance
assuming the plant behaves as predicted by the model.
The controller should also work well even if the actual plant behaves slightly dierently
than the plant model. Equivalently, the controller should be designed deliver satisfac-
tory performance for modest perturbations of the plant model. This very important
design requirement is often stated as insisting that the controller or the feedback system
be robust to modeling errors.
There are several reasons why the actual plant dynamics may be dierent than the
plant model.
First, we may have made many simplifying assumptions in modeling the plant. For
example, we often choose to neglect friction terms or aerodynamic eects.
Second, in many situations, the plant dynamics may change during operation. For
example, in chemical reactors, there is often a build-up of slag at the base of the reactor
which changes the heat-transfer characteristic of the reactor. This in turn causes the
dynamics of the reactor to change, and over time, this change can be signicant.
The third reason is that we may have changed the physical plant itself. For example,
in a manufacturing situation, we produce many copies of the same car design, each of
which behaves slightly dierently. But we dont custom design a controller for each car
rolling o the assembly line: its too expensive. We design one controller that works,
say for all Ford Mustangs, keeping in mind the variations in the car dynamics that
occur in the manufacturing cycle.
D. The Notion of Performance
ME 132, Fall 2012, UC Berkeley, F. Borrelli 6
There is no universal measure to assist us in deciding whether one controller is better
than another. This decision is often problem specic.
Consider for example the step responses shown in Figure 5. In the context of position
control of an elevator, the response in panel (b) is unacceptable. The response exhibits
undershoot and signicant oscillations. Both of these features would cause great con-
sternation to elevator passengers. Undershoot means the elevator travels momentarily
in the wrong direction, while the under-damped behavior corresponds to the elevator
oscillating with signicant amplitudes before settling to the correct oor level.
0 2 4 6 8
0.5
0
0.5
1
1.5
2
time
s
t
e
p

r
e
s
p
o
n
s
e
0 2 4 6 8
0.5
0
0.5
1
1.5
2
time
s
t
e
p

r
e
s
p
o
n
s
e
Figure 5: Illustrating the notion of performance: (a) overdamped and (b) lightly damped
responses.
Conversely, consider the position control problem of the end-eector of a robot arm
in a high-precision manufacturing facility. Assuming the robot workspace is free of
obstacles, the response in panel (b) is preferable to that in panel (b). This is because
the step response of panel (b) has a much smaller settling time. In this application, it
is imperative for the robot arm to be in place quickly so that subsequent machining
can be done. The intermediate trajectory of the robot arm is of little consequence.
The response of panel (a) takes 6 seconds to settle to within 2 % of the nal value.
This will cause a signicant reduction in the processing throughput, or the number of
parts per hour that the robot can service.
There are some aspects of performance that are universal. For example, we would
always want our control system to result in closed-loop dynamics that are insensitive
to disturbances. This is called disturbance rejection. Also, as pointed out previously,
we would want the controller to be robust to plant modeling errors.
6 The Ingredients of Control System Design
In designing a complete feedback control system, we are faced with several dicult choices.
Let us discuss these choices in the context of a realistic example.
Our example is drawn from semiconductor manufacturing. One of the critical processing
steps in processing silicon wafers in plasma etching, illustrated in Figure 6. Here, ions are
ME 132, Fall 2012, UC Berkeley, F. Borrelli 7
accelerated towards a silicon wafer by means of an external voltage. The wafer is selectively
protected from this ion bombardment by a photo-resist mask. The unprotected regions of
the wafer are etched by the plasma bombardment, creating a ne pattern on the silicon
wafer. Our objective is to engineer a feedback control system for plasma etching that allows
for removal of material at a carefully controlled rate that is uniform across the wafer.
wafer
etch chamber
ground plate
ions
3 concentric
electrodes
Figure 6: Illustration of the plasma etch process.
The rst decision we are confronted with is to select what physical variables we wish to
control or regulate. This decision is based on considerations specic to the process being
controlled. In the plasma etch example, we wish to control etch rate uniformity.
The next step is to select appropriate sensors and actuators. The simplest situation is if
we can directly measure the regulated variables. This results in the most straightforward
control problem. However, in many situations (particularly in process control), we can only
indirectly measure the regulated variables. In other words, we get to measure some other
physical variables that are aected by
Then, we have to construct a model for the plant, based on which we design a control system.
This can be done from rst principles or using empirical methods based on experimental data.
For the purposes of control, we usually require a simple, approximate model. A rule of thumb
is that the controller is as complex as the model that was used to design it.
We can then design and test the controller. There are many choices of design methods
distinguished by the type of plant model we have, and the measure of performance we
demand from the closed-loop system. Testing the controller can be rst done in simulations,
using a very detailed plant model. Then a prototype controller can be built (usually in
a software implementation) and tested with the real plant. Finally, we can design and
manufacture production versions of the controller. These will have user-friendly software
interfaces.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 8
7 A General Architecture for Control Systems
A general control system architecture is shown in Figure 7. This general architecture pro-
vides a universal framework in which to address apparently dierent control system design
problems.
inputs u
controlled
exogenous
measured
outputs y
regulated
variables z inputs w
controller
generalized
plant
Figure 7: General control system architecture.
In the diagram above, we have the generalized plant which includes the physical plant to be
controller, the sensors, and the actuators.
There are two sets of input signals to the generalized plant. The controlled inputs u are the
inputs that we may adjust in the course of controlling the plant. These are just the actuator
inputs. The exogenous inputs are signals that aect the generalized plant over which we
have no authority. These include the commands r, the external disturbances d, and noises
n that aect various components of the generalized plant.
There are two sets of outputs from the generalized plant. The measures outputs y are all
signals available to the control system. These typically include the sensor outputs y
s
and
the commands r. The regulated outputs are a collection of signals which we would like to
keep small. These typically include tracking errors (r y
r
), and the actuator inputs u.
As an example, we can redraw a standard tracking feedback system to resemble the general
conguration of Figure 7. This is illustrated in Figure 8.
8 Example: A simple Cruise Control System for a Car
We will now go through a simple control system design example. The plant consists of a
car, and the regulated variable is the speed v of the car. We have available a speedometer
that is our sensor, and an electric motor that opens the fuel throttle serves as our actuator.
The driver of the car issues a command r for the desired car speed. The dynamics of the
car is aected by various disturbances, most prominent of these being d, the incline of the
roadway. We do not have any sensor that measures the roadway incline (if we did, then d
would a measured output and not a disturbance).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 9
r
u
e
K
p
P
-
+
+
+
+
+
d
u
y
r
P
Kp
o
K +
K
o
+
d
+
+ +
-
e
Figure 8: Standard tracking control system, redrawn in the general architecture.
A. The model
We begin by oering a very simple model of the car. Common experience reveals
that for a xed fuel throttle position the car achieves a certain steady speed. With
the throttle being held xed, if the roadway is inclined uphill, this steady speed is
diminished. We therefore suggest a model of the form
y = Gu Hd
Experiments conrm that this model is reasonable, and for the particular car under
consideration, nominal values of the constants G and H are
G
o
= 20, H
o
= 5
It is these nominal values that will be used to design our controllers. However, the
behavior of the actual plant may be better represented by other values of G and H
that are close to, but not exactly equal, to these nominal values. Indeed, we may
better describe the plant by a more complex model. Many important dynamics have
been ignored in our extremely simplied plant model. In fact, our model suggests that
changes in the throttle immediately aect the speed, which we know from common
experience to be unrealistic.
B. Control design
Next we will design a control system to regulate the speed of the car. Our rst objective
will be to achieve reference tracking (y(t) r(t)) for the nominal model (G = G
o
) and
in absence of disturbances (d = 0). Then, we will analyze the behavior of the controlled
system in the presence of disturbances (d = 0) and model mismatch (G = G
o
). We
will study the dierence between open-loop control and closed-loop control.
1. Open-loop Control System
ME 132, Fall 2012, UC Berkeley, F. Borrelli 10
To begin with lets design an open-loop control system to regulate the speed of
the car. The conguration is shown in Figure 9 below. The controller gain K
ol
is
to be designed. Notice that there is no feedback of measured information to the
actuator. Analyzing Figure 9 gives us the relationships y = Gu Hd, u = K
ol
r,
which can be combined to yield
y = GK
ol
r Hd
As a rst cut, we should demand that the cruise control system work perfectly
for the nominal plant (i.e. G = G
o
, H = H
o
), and in the absence of disturbances
(i.e. d = 0). Thus, we insist that
r = G
o
K
ol
r, or G
o
K
ol
= 1, which forces the design K
ol
=
1
G
o
= 0.05
This results in the open-loop control system behavior
y =
G
G
o
r Hd (1.1)
which is
y =
G
20
r Hd
-
+
Car Model
d
r
H
G
u
y
K
ol
Figure 9: Open-loop cruise control sys-
tem.
Figure 10: Closed-loop cruise control system.
2. Closed-loop Control System
Now lets design a closed-loop or feedback control system. The conguration is
shown in Figure 10. The controller gains K

and K
fb
are to be designed. Analysis
of Figure 10 yields the relationships
y = Gu Hd, u = K

r K
fb
y
These can be combined as
y = GK

r GK
fb
y Hd, or (1 +GK
fb
)y = GK

r Hd
ME 132, Fall 2012, UC Berkeley, F. Borrelli 11
We therefore have the closed-loop control system behavior
y =
GK

1 +GK
fb
r
H
1 +GK
fb
d (1.2)
Again, for the nominal plant model with no disturbances, we demand perfect
tracking. As a result,
r =
G
o
K

1 +G
o
K
fb
r
which gives us the design rule
G
o
K

1 +G
o
K
fb
= 1 (1.3)
One way to achieve this is through high-gain feedback. This means that if we
select |G
o
K
fb
| >> 1 and K

= K
fb
then
G
o
K

1 +G
o
K
fb
1 (1.4)
For instance if we choose G
o
K
fb
= 2000, then K
fb
= 100 and K

= 100. This
results in the closed-loop control system behavior
y =
100G
1 + 100G
r
H
1 + 100G
d
C. Robustness
So far we have designed K
ol
or K

and K
fb
in order to obtain y r under no model
mismatch and d = 0. Two important questions need to be answered:
What is the eect of the road incline d on the vehicle speed? (Disturbance Re-
jection)
How sensitive is the controller performance (y r) to (small) inaccuracies in
model parameters and model simplication. (Sensitivity Analysis)
A good control design should provide minimal variation of the vehicle speed in both
cases.
1. Disturbance Rejection
We analyze the nominal model case: G = G
o
, H = H
o
, and focus only on the
disturbance eect on the output: r = 0 and d = 0.
(a) Open-loop Disturbance Rejection
From equation (1.1) we have
y = H
o
d
ME 132, Fall 2012, UC Berkeley, F. Borrelli 12
Therefore we notice that the open-loop control has no power to reduce the
eect of the disturbance d on the output y. For instance since H
0
= 5 a slope
of 1degree provides a speed reduction of 5m/s ( 11 miles per hours) which
is denitely not acceptable and cannot be changed by any choice of K
ol
.
(b) Closed-loop Disturbance Rejection
From equation (1.5) we have
y =
H
o
1 +G
o
K
fb
d
Clearly, if we use a high-gain feedback controller we obtain
H
o
1+G
o
K
fb
0
and therefore we are able to almost cancel the eect of the disturbance on
the output.
For our choice of controller parameters we have
y =
5
1 + 20 100
d = 0.002d
which says that a slope of 1degree provides a speed reduction of 0.002m/s
( 0.004 miles per hours).
2. Sensitivity Analysis
If we have a nominal model G = G
o
and H = H
o
and d = 0, then we have
a nominal output y = y
o
. The question we are trying to answer is: what is the
variation of the output y around the nominal output y
o
when there is a variation
of the plant G around the nominal plant G
o
.
To this aim are going to use the quantity
S =
y
y
G
G

G=G
o
, y=y
o
=
y
G

G=G
o
, y=y
o
G
o
y
o
The number S will represent the controlled system sensitivity to plant variation.
A small S implies that y is small with respect to G and thus the controlled
system behavior does not drastically change if we have some model mismatch.
(a) Open-loop Sensitivity
Let us now calculate the sensitivity of the output y with respect to G at the
nominal value G
o
in the absence of disturbances (d = 0). Using the open-loop
control system behavior (1.1), we obtain
S =
y
G
G
y
=
r
G
o
G
Gr/G
o
= 1
This means that a 1 percent deviation of the plant from its nominal value G
o
will result in a 1 percent deviation in the output y.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 13
(b) Closed-loop Sensitivity
Let us repeat the sensitivity calculation for the closed-loop control scheme.
The closed-loop system behavior in the absence of disturbances is
y =
GK

1 +GK
fb
r
We can then compute
S =
y
G
G
y
=
K

(1 +GK
fb
)r K
fb
GK

r
(1 +GK
fb
)
2
1 +GK
fb
K

r
=
1
1 +GK
fb

G=G
o
In conclusion
S =
1
1 +G
o
K
fb
We can again conclude that a high-gain feedback controller allow us to have
a small sensitivity to uncertain parameters and plant/model mismatch.
Lets evaluate S for the controller chosen in the past sections
S =
1
1 +G
o
K
fb
=
1
2001
In this case, we see that a 1 percent deviation of the plant from its nominal
value G
o
will result in an insignicant 1/2001 .0005 percent deviation in
the output y. Thus, the behavior of the closed-loop control scheme is far less
sensitive to modeling errors in G.
D. Noise attenuation
So far we have seen that a high-gain feedback controller solves all our problems:
reference tracking, robustness to disturbances and small sensitivity to model mismatch.
Here is one reason why feedback control design is not so trivial... and high-gain
feedback has to be carefully used.
Assume now that we have a noisy sensor and thus the information fed back to the
controller is
y
m
= y +n
where n is the sensor noise. The control input will be
u = K

r K
fb
y
m
which yields the closed loop behavior
y = GK

r GK
fb
y GK
fb
n Hd
or
y =
GK

1 +GK
fb
r
H
1 +GK
fb
d
GK
fb
1 +GK
fb
n (1.5)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 14
The term
GK
fb
1+GK
fb
n characterizes the eect of the sensor noise on the plant output.
A good controller should make sure that any noise injected at the sensor output should
be signicantly attenuated at the process output y . This requires

GK
fb
1 +GK
fb

<< 1
This is equivalent to requiring
|GK
fb
| << 1
This is clearly in direct conict with the high-gain feedback control design.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 15
2 Modeling
1 The Uses of Models
Modeling of physical systems is a vital component of modern engineering. A model often
consists of complex coupled dierential equations. The solution of these dierential equations
describe the evolution of the physical system being considered.
Models may be developed for a variety of purposes including
simulation & prediction
design
control
2 Modeling Errors
It is extremely important to be aware that models of physical systems are always inaccurate.
They involve varying degrees of approximation. For example in modeling a car, we may
choose to ignore rolling resistance, aero-dynamic eects, road-tire interactions, etc.
3 Models for Use in Control System Design
As we have discussed earlier, models are a key ingredient in the design of control systems.
Models used for this purpose need not be extremely accurate. The general rule of thumb is
that the complexity of the control system is approximately the same as the complexity of the
model used to design the controller
1
. If we use an exceedingly detailed model, the resulting
controller may be so complex as to render implementation unreliable, or even worse, we may
not be able to implement the control algorithm in real time. On the other hand, if we use
a too simple model to design control systems, the resulting controller may not function as
anticipated when used with the real physical plant.
4 Notation
Let x(t) be a function of time. We will use the following notation:
x(t) =
dx(t)
dt
x(t) =
d
2
x(t)
dt
2
1
We will make this assertion precise in a very specic context when we develop state-space controller
design methods.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 16
Often we will also remove the time dependence and only write x for x(t) and x for x(t).
5 First Order Linear Systems
5.1 Example: Moving Mass
Consider the moving mass in Figure 11. Assume we can measure the mass speed v(t).
Figure 11: Moving Mass.
We also have an actuator that applies a force u(t) to the mass. The goal is to derive a
model describing the behavior of v(t) under any input u(t). The mass is also aected by a
viscous braking force F
b
(t). We assume that F
b
is proportional to the speed of the mass:
F
b
(t) = bv(t), where b is the friction coecient.
Using Newtons laws we can easily write the equations of motion as
m v(t) = u(t) F
b
(t) = u(t) bv(t) (2.1)
Use the notation y(t) = v(t) and rewrite (2.1) with one being the coecient of y
y +
b
m
y =
1
m
u(t) (2.2)
Equation 2.2 is a single linear ordinary dierential equation (SLODE).
It is an Ordinary Dierential Equation since it involves only ONE independent variable (the
time t). In case the dierential equations involve two or more independent variables they
are called partial dierential equations. In this class we will study only ODEs. Equation 2.2
is a rst order SLODE since the highest derivative that appears in the dierential equation
is the rst.
In order to compute the speed of the mass at a time T, we need to specify the speed v(t)
at time 0 (the initial condition) AND the input u(t) from 0 till T. If we denote the initial
speed with the symbol v
0
, the initial condition will have the form
v(0) = v
0
ME 132, Fall 2012, UC Berkeley, F. Borrelli 17
Therefore the complete SLODE model is
y +
b
m
y =
1
m
u(t) (2.3)
y(0) = v
0
(2.4)
An alternative modeling formalism is obtained as follows. Use the notation x(t) = v(t) and
rewrite (2.1) with only the highest derivative on the left hand side of the equality:
x =
b
m
x +
1
m
u (2.5)
x(0) = v
0
(2.6)
Equation 2.5 is the state-space model of the system and x(t) is the system state at time t.
Equation 2.6 is the initial condition. Note that in order to compute the state at time T we
just need the state x(0) at time 0 and the input from 0 till T.
5.2 Example: RC Circuit
Consider the electric circuit in Figure 12 consisting of a capacitor C and a resistor R in series
with a voltage source u(t) which represents the input to the system.
Figure 12: RC Circuit.
If u(t) = 0 then the capacitor would discharge its energy into the resistor. We are interested
in deriving a model describing the behavior of the voltage across the capacitor v
C
(t) under
any input u(t).
Recall the fundamental equations linking the current i(t) through the resistor and the the
voltage across the resistor
v
R
(t) = Ri(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 18
and the fundamental equations linking the current i(t) through the capacitor and the the
voltage across the capacitor (in an ideal capacitor wholly characterized by a constant capac-
itance C)
i(t) = C
dv
C
(t)
dt
The circuit equation can be easily derived by using the Kirchhos voltage law (the algebraic
sum of the electrical potential dierences around any closed circuit must be zero):
u(t) v
R
(t) v
C
(t) = 0
which becomes
u(t) RC v
C
(t) v
C
(t) = 0
The SLODE model with y(t) = v
C
(t) is
y +
1
RC
y =
1
RC
u(t) (2.7)
y(0) = v
c,0
(2.8)
where v
c,0
is the initial condition, i.e., the voltage across the capacitor at time 0.
The state space model with x(t) = v
C
(t) is
x =
1
RC
x +
1
RC
u (2.9)
x(0) = v
c,0
(2.10)
6 Second Order Linear Systems
6.1 Example: Spring-Mass-Damper
Consider the spring-mass-damper arrangement of Figure 13
The position of the mass S(t) is measured relative to the un-stretched position of the spring.
2
We assume that
we have an actuator that applies a force u(t) to the mass.
3
2
There are many schemes available to inexpensively measure S(t). For example, an optical sensor sends
a light pulse out which reects o the mass, and its position S(t) can be deduced from the elapsed travel
time of the light pulse.
3
Note that the actuator accepts a voltage input and converts it to a force. We presume that this conversion
is has a unit gain, i.e., 1 volt produces 1 Newton of force.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 19
Figure 13: Spring-Mass-Damper System.
the spring element has mass zero and it generates a braking force F
K
(t) proportional
to the mass position S(t):
F
K
(t) = KS(t)
where K is the spring constant.
the position of the mass is also aected by a viscous damper, which supplies a braking
force F
b
= b y proportional to, and opposing the velocity of the mass. b is the friction
coecient.
Using Newtons laws we can easily write the equations of motion as
m

S(t) = KS(t) b

S(t) +u(t)
The SLODE model with y(t) = S(t) is
y +
b
m
y +
K
m
y =
1
m
u(t) (2.11)
y(0) = s
0
, y(0) = v
0
(2.12)
where s
0
and v
0
are the initial conditions, i.e., the position and speed of the mass at time 0.
The state space model consists of 2 coupled rst order dierential equations. Dene the two
states as x
1
(t) = S(t) and x
2
(t) =

S(t), then
x
1
=

S = x
2
x
2
=

S =
b
m
x
2

K
m
x
1
+
1
m
u(t)
These equations can be written in matrix form as
_
x
1
x
2
_
=
_
0 1

K
m

b
m
_ _
x
1
x
2
_
+
_
0
1
m
_
u
ME 132, Fall 2012, UC Berkeley, F. Borrelli 20
The initial conditions are x
1
(0) = s
0
and x
2
(0) = v
0
. Also we have two states but we have
only one sensor (the mass position). For this reason we introduce the output equation:
y = [ 1 0 ]
_
x
1
x
2
_
to emphasize the fact that we measure only y(t) = x
1
(t) = S(t). The nal model is
_
x(t) = Ax(t) +Bu(t)
y(t) = Cx(t)
x(0) = x
0
where x(t) =
_
x
1
(t)
x
2
(t)
_
, A =
_
0 1

K
m

b
m
_
, B =
_
0
1
m
_
, C = [ 1 0 ], x
0
= [ s
0
v
0
].
6.2 Example: RLC Circuit
Consider the electric circuit in Figure 14 consisting of a capacitor C, a resistor R and an
inductor L in series with a voltage source u(t) which represents the input to the system.
Figure 14: RLC Circuit.
We are interested in deriving a model describing the behavior of the voltage across the
capacitor v
C
(t) under any input u(t).
Recall the fundamental equations linking the current i(t) through the inductor and the
the voltage across the inductor (in an ideal inductor wholly characterized by a constant
inductance L)
v
L
(t) = L
di(t)
dt
The circuit equation can be easily derived by using the Kirchhos voltage law (the algebraic
sum of the electrical potential dierences around any closed circuit must be zero):
u(t) v
R
(t) v
C
(t) v
L
(t) = 0
ME 132, Fall 2012, UC Berkeley, F. Borrelli 21
which becomes
u(t) RC v
C
(t) v
C
(t) LC v
C
(t) = 0
The SLODE model with y(t) = v
C
(t) is
y +
R
L
y +
1
LC
y =
1
LC
u(t) (2.13)
y(0) = v
c,0
, y(0) =
dv
C
dt
(0) =
i
0
C
(2.14)
where v
c,0
and i
0
are the initial conditions, i.e., the voltage across the capacitor and the
current through the inductor (and the whole circuit) at time 0.
The state space model consists of 2 coupled rst order dierential equations. Dene the two
states as x
1
(t) = v
C
(t) and x
2
(t) = v
C
(t), then
x
1
= s = x
2
x
2
= s =
R
L
x
2

1
LC
x
1
+
1
LC
u(t)
These equations can be written in matrix form as
_
x
1
x
2
_
=
_
0 1

1
LC

R
L
_ _
x
1
x
2
_
+
_
0
1
LC
_
u
The initial conditions are x
1
(0) = v
c,0
and x
2
(0) =
i
0
C
. Also we have two states but are
interested only in one output (the voltage across the capacitor). For this reason we introduce
the output equation:
y = [ 1 0 ]
_
x
1
x
2
_
to emphasize the fact that out output is only y(t) = x
1
(t) = v
C
(t). The nal model is
_
x(t) = Ax(t) +Bu(t)
y(t) = Cx(t)
x(0) = x
0
where x(t) =
_
x
1
(t)
x
2
(t)
_
, A =
_
0 1

R
L

1
LC
_
, B =
_
0
1
LC
_
, C = [ 1 0 ], x
0
=
_
v
C,0
i
0
C

.
7 n-th Order Linear Dynamical Systems
7.1 SLODE Models
A generic n-th order SLODE model has the form
y
[n]
(t) +a
1
y
[n1]
(t) +a
2
y
[n2]
(t) + +a
n
y(t) =
b
0
u
[n]
(t) +b
1
u
[n1]
(t) +b
2
u
[n2]
(t) + +b
n
u(t)
(2.15)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 22
subject to initial conditions y(0) = y
[0]
0
, y
[1]
(0) = y
[1]
0
, y
[2]
(0) = y
[2]
0
, . . . , y
[n1]
(0) = y
[n1]
0
.
where y
[k]
denotes the kth derivative of the function y,
y
[k]
=
d
k
y
dt
k
7.2 State-Space Models
A generic n-th order state space consist of n coupled rst order dierential equations that
look like:
_
x(t) = Ax(t) +Bu(t)
y(t) = Cx(t) +Du(t)
x(0) = x
0
Here A, B, C, D are the matrices of the state-space realization. We shall reserve the letters
m, n, p for the numbers of inputs, states, and outputs respectively. In this course we will
consider m = 1 and p = 1 (Single-Input Single-Output (SISO) Systems).
The dimension of the system is the number of states n. Note the sizes of the various matrices:
A R
nn
, B R
nm
, C R
pn
, D R
pm
.
7.3 SLODE to State-Space Models and Viceversa
We can rewrite a n-th order SLODE model as a set of n coupled rst-order dierential
equations (and thus a state-space model). For example, consider the dierential equation
model
y
[3]
+ 3 y + 4 y + 7y = u
Dene the states by
x
1
= y, x
2
= y, x
3
= y
We can then re-write this dierential equation model as
x
1
= y = x
2
x
2
= y = x
3
x
3
= y
[3]
= 3 y 4 y 7y +u = 7x
1
4x
2
3x
1
+u
y = x
1
These equations can be written in matrix form as
_
x
1
x
2
x
3
_
=
_
0 1 0
0 0 1
7 4 3
__
x
1
x
2
x
3
_
+
_
0
0
1
_
u (2.16a)
y = [ 1 0 0 ]
_
x
1
x
2
x
3
_
(2.16b)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 23
Lets do the inverse exercise. Assume we are given the state space model (2.16). We want
to derive the equivalent SLODE model. We observe from (2.16b) that y = x
1
. Therefore
y = x
1
, which is y = x
1
= x
2
(use the rst equation in (2.16a)). Therefore y = x
2
, which
is y = x
3
(use the second equation in (2.16a)). Finally y
[3]
= x
3
, which is y
[3]
= x
3
=
7x
1
4x
2
3x
3
+u (use the third equation in (2.16a)). In conclusion y = 7y 4 y 3 y +u
which gives the SLODE:
y
[3]
+ 3 y + 4 y + 7y = u
7.4 The Concept of State
The state x(t) at time t
0
is the information you need at time t
0
that together with future
values of the input (i.e., u(t) for all t t
0
), will let you compute future values of the output
y (i.e., y(t) for all t t
0
).
In other words, past history (before t
0
) of the systems evolution is not important in deter-
mining its evolution beyond t all of the relevant past information is embedded in the state
variables values at t
0
.
For example, suppose we have a point mass subject to a force [input]. In order to predict
the future motion of the particle, we need to know the force, and also the initial condition
which is the position and velocity of the particle.
For an unconstrained rigid body moving in three dimensions, its state consists of the position
and velocity its center of mass and its orientation (three angles) and rotation (three angular
velocities). So its state has 12 dimensions.
The concept of state is very powerful and has applications well beyond control and dynamics.
For example, in a graphical user interface, the state is the value of every button, slider bar,
editable text box on the interface. The idea of the state of a GUI is a very useful construct
in GUI programming. Once we know the current state, if the users takes an action [input]
for example by clicking on a button, we can decide what the program should do to the state.
Maybe if you click this button which is now green, a new button become visible and other
interface options become disabled.
8 Nonlinear Systems
8.1 Example: Magnetically Suspended Ball
A magnetically suspended ball consists of a ball of mass m suspended by an electromagnet
as shown below. Let y be the position of the ball, measured down from the base of the
electromagnet. If a current u is injected into the coils of the electromagnet, it will produce a
ME 132, Fall 2012, UC Berkeley, F. Borrelli 24
magnetic eld which in turn exerts an upward force on the ball given by F
up
=
cu
2
y
2
. Note
that the force decreases as the 1/y
2
because the eect of the magnet weakens when the ball
is further away, and that the force is proportional to u
2
which is representative of the power
supplied to the magnet.
y
mg
up
F
Figure 15: Magnetically suspended ball.
Let us assume that we can measure the position y of the ball. This can be arranged optically
using light-emitting diodes with photocells.
We can then write a simple model for the motion of the ball from Newtons second law as
m y = mg
cu
2
y
2
(2.17)
Note that this is a single-input, single-output nonlinear model. The input and output of this
model are
u the current injected into the magnet coils
y the position of the ball
In the context of numerical exercises, use the following constants:
m 0.15 Kg mass of ball
c 0.01 Kg-m
3
/Coul
2
magnetic coupling constant
We can convert this nonlinear dierential equation model to a state space model by dening
the states:
x
1
= y, x
2
= y
We get the state-space equations:
x
1
= f
1
(x
1
, x
2
, u) = x
2
x
2
= f
2
(x
1
, x
2
, u) = g
cu
2
mx
2
1
= 10
_
u
3.87x
1
_
2
y = h(x
1
, x
2
, u) = x
1
ME 132, Fall 2012, UC Berkeley, F. Borrelli 25
There are a number of sources of modeling error in our simple model above. The most
signicant of these is the leakage of the magnetic eld. This is appreciable as y increases,
and this manifests itself in a decrease in the exponent of u in F
up
. A second serious modeling
omission is that we have treated the motion of the ball as rectilinear. In practice, unless the
ball is conned to a vertical guide, it will have small motions in the horizontal plane also.
These have signicant eects on the dynamics of the ball, as the magnetic force reduces
signicantly o the magnet axis. We have also neglected resistive and inductive eects in
the electromagnet coils, and approximated the ball as a point mass.
Despite the simplicity of this physical system, and the crudeness of our model, we stand
to gain an understanding of nonlinear control using this as a test-bed. Industrial levitation
systems are signicantly more complex.
8.2 Example: Water Tank
Consider the water tank in Figure 16. Denote by q
in
(t) the water ow entering the tank and
q
out
(t) the water ow leaving the tank from a hole of size a.
Figure 16: Water Tank system.
Out goal is to obtain a model that describes the evolution of the tank height h(t) as a
function of the external input u(t) = q
in
(t). Let A be the area of the tank. By using the
conservation law we can state that
A

h(t) = q
in
(t) q
out
(t)
Let v
out
(t) be the speed of the water at the outlet. Then, q
out
(t) = av
out
(t)
Torricellis law states that the speed of a uid through a sharp-edged hole under the force
of gravity is the same as the speed that a body would acquire in falling freely from a height
h, i.e. v
out
(t) =
_
2gh(t), where g is the acceleration due to gravity. In conclusion our
nonlinear model is

h =
1
A
(u(t) a
_
2gh(t))
ME 132, Fall 2012, UC Berkeley, F. Borrelli 26
in state space form we use x(t) = h(t) and write
x =
a
A
_
2gx +
1
A
u
with initial condition x(0) = h
0
8.3 Example: Pendulum
Consider the pendulum shown in Figure 17 below.
Figure 17: Pendulum.
We assume that the pendulum has mass m
1
= 0.333 Kg which is concentrated at the end
point and length l = 0.75 meters. The angle is measured, and an actuator can supply a
torque u = T
c
(t) to the pivot point. The moment of inertia about the pivot point is I = ml
2
By writing Eulers equation for the pendulum, we can readily arrive at a dierential equation
model for this system:
I

(t) = T
c
mglsin((t))
or

(t) =
1
ml
2
T
c

g
l
sin((t))
which is a second order nonlinear dierential equation. The state space model with x
1
(t) =
(t) and x
2
(t) =

(t) is
x
1
= x
2
x
2
=
g
l
sin(x
1
) +
1
ml
2
u
9 Nonlinear Dynamical Systems in State Space Form
Note that in the previous nonlinear examples we cannot write these equations in matrix
form as we did for linear dierential equations. However we can nd a compact form for any
ME 132, Fall 2012, UC Berkeley, F. Borrelli 27
nonlinear dynamical systems in state space form. Consider the dierential equation model
y + 3 yy + 7 cos(y) = 4u
2
+uy
Dene the states by
x
1
= y, x
2
= y
We can then re-write this dierential equation model as
x
1
= y = x
2
x
2
= y = 3 yy 7 cos(y) + 4u
2
+uy = 3x
1
x
2
7x
1
+ 4u
2
+ux
1
y = x
1
Note the form of these equations:
x
1
= f
1
(x
1
, x
2
, u) = x
2
x
2
= f
2
(x
1
, x
2
, u) = 3x
1
x
2
7x
1
+ 4u
2
+ux
1
y = h(x
1
, x
2
, u) = x
1
More generally, for an m-input, p-output nonlinear dierential equation model, we would
get equations like
x
1
= f
1
(x
1
, , x
n
, u
1
, , u
m
)
.
.
.
.
.
.
x
n
= f
n
(x
1
, , x
n
, u
1
, , u
m
)
y
1
= h
1
(x
1
, , x
n
, u
1
, , u
m
)
.
.
.
.
.
.
y
p
= h
p
(x
1
, , x
n
, u
1
, , u
m
)
Here each of the possibly nonlinear functions f
1
, , f
n
and h
1
, , h
p
are scalar-valued.
These equations are quite a mess to write down. By introducing the notation:
x = (x
1
, , x
n
), u = (u
1
, , u
m
), y = (y
1
, , y
p
)
we can write these equation more compactly in standard state-space form as
x = f(x, u)
y = h(x, u)
Note that in this form, the nonlinear functions f and h are vector-valued. This means that
there are actually many scalar functions contained in the symbols f and h.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 28
10 Properties of Models
Consider a general model Mwith input u and output y. Note that u and y are signals. For
a signal u, we let u(t) denote the value of the signal at time t. Let us formally dene some
properties of models, and then explore these denitions using examples.
The model M is said to be memoryless or static if y(t) depends only on u(t). Otherwise,
the output y at time t depends on input values at other times. In this case, the model M
has memory, and is called dynamic.
The model M is called causal if y(t) depends on u() for t, and is called strictly causal
if y(t) depends on u() for < t.
The model M is called linear if
M(
1
u
1
+
2
u
2
) =
1
M(u
1
) +
2
M(u
2
)
for any input signals u
1
and u
2
, and any real numbers
1
and
2
. This is called superposition
principle.
The model M is called time invariant if the response to u(t ) is y(t ) for any 0.
This implies that if the input is delayed by seconds the output is also delayed by seconds.
SLODE models are time invariant if the coecients do not depend on time. Linear models
in state space form are time invariant if the matrices A, B, C and D do not depend on time.
11 Models in Simulink
Simulink is a powerful Matlab toolbox which allows to simulate dynamical systems by using
simple blocks.
We will teach you the basics during the discussion section. Below we report some funda-
mental blocks.
11.1 Composing integrators
In order to simulate a linear or nonlinear model, we will need the simplest model: the
integrator. x = u, x(0) = x
0
is simulated by using the following diagram shown in Figure 18.
where the initial condition x
0
is set by double clicking the integrator block as shown in
Figure 19.
By using multiple integrators in series we can draw more complex systems.
For instance Example 5.1 is simulated by using the following system shown in Figure 20.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 29
Figure 18: Simple Integrator Simulation.
Figure 19: Setting the initial condition in an Integrator.
Example 6.1 and in particular equations (2.9)-(2.10) are simulated by the following sytem
shown in Figure 21.
Note that the initial conditions in (2.10) are set in each integrator.
11.2 State Space Linear Models
A model of the form x = Ax + Bu, Y = Cx + Du and x(0) = x0 is readily simulated by
using the following block shown in Figure 22.
By clicking on the block you can set the matrices A,B,C,D and the initial condition x
0
, see
Figure 23:
ME 132, Fall 2012, UC Berkeley, F. Borrelli 30
Figure 20: Simulink block diagram of a moving mass.
Figure 21: Simulink block diagram of Spring-Mass-Damper system.
12 Additional Example: DC motor
Motors are a central ingredient in almost all control systems
4
. Most actuators contain a
motor that enables some mechanical motion which, in turn, aects the dynamics of the
plant. For example, the fuel ow in an automobile is actuated by a valve which is opened
and closed by means of a motor. Given the importance of motors to control systems, it is
worthwhile to briey examine how they work, and to write down simple models that describe
their dynamics.
The basic principle in modeling a DC motor is that a charge q, moving in a magnetic eld
B with velocity v experiences a force F = qv B. This yields two electromechanical ideas:
4
For a detailed discussion of the operating principles and design of modern motors see Hi-Dong Chai,
Electromechanical Motion Devices, Prentice-Hall, 1998.
Figure 22: Simple State-Space Simulation.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 31
Figure 23: Setting the A,B,C,D matrices and the initial conditions.
a wiring carrying current perpendicular to a magnetic eld experiences a external force; a
wire moving perpendicular to its length and perpendicular to a magnetic eld experiences a
potential dierence across its ends.
The design and modeling of DC motors uses these two ideas. For design,
1. Mount permanent magnet in housing
2. Rigidly wind conductor along a rigid shaft
3. Suspend shaft/windings in magnetic eld
4. Pass current through windings, causing shaft to rotate relative to the housing/magnet
assembly
A simple model for this has three aspects:
Electrical: Although the resistance and inductance of the windings are distributed
along the windings, we treat them as a single lumped resistance and a single lumped
inductance.
Mechanical: All moments acting on the shaft lead to the angular acceleration of the
shaft.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 32
Electromechanical: Relationships between the electrical properties and the mechanical
properties.
A diagram of the electrical circuit is shown in Figure 24.
Figure 24: DC Motor circuit.
The circuit voltages satisfy
e
a
(t) i(t)R L
di
dt
e
b
(t) = 0 (2.18)
The induced voltage due to the motion is
e
b
(t) = K
b
(t) (2.19)
where K
b
is a constant, which depends on the geometry (dimensions) of the motor, and
the strength of the magnetic eld. The torque that is exerted on the shaft due to the
current/magnetic eld interaction is
T
m
(t) = K

i(t) (2.20)
where K

is a constant, which depends on the geometry (dimensions) of the motor, and the
strength of the magnetic eld.
Balance of angular momentum for the shaft gives
J

(t) = T
m
(t) +T
F
(t) +T
L
(t) (2.21)
A simple friction model is linear, viscous friction,
T
F
(t) = B
S
(t) (2.22)
where B
S
is a constant, depending on the lubrication and bearing which supports the shaft.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 33
We can write these equations in the form
di
dt
=
1
L
[Ri(t) K
b
(t) +e
a
(t)]
d
dt
= (t)
d
dt
=
1
J
[K

i(t) B(t) +T
L
(t)]
which is easily put into matrix form
d
dt
_
i(t)
(t)
(t)
_
=
_

R
L
0
K
b
L
0 0 1
K

J
0
B
J
_

_
_
i(t)
(t)
(t)
_
+
_

_
1
L
0
0 0
0
1
J
_

_
_
e
a
(t)
T
L
(t)
_
(2.23)
Note that if we dene
x(t) :=
_
i(t)
(t)
(t)
_
d(t) :=
_
e
a
(t)
T
L
(t)
_
then the equations are of the form x(t) = f(x(t), d(t)), and that the function f is actually
linear,
x(t) = Ax(t) +Bd(t)
Usually, the inductance L is quite small, and we can make an approximation that
L
di
dt
0,
which simplies equation (2.18) into an algebraic equation, i(t)R+e
a
(t)e
b
(t) = 0. Solving
for i gives
i(t) =
e
a
(t) e
b
(t)
R
=
1
R
e
a
(t)
K
b
R
(t)
Hence, i is no longer governed by a dierential equation, but rather an algebraic relation
between e
a
and . This can be substituted into the state equation for , yielding
(t) =
K

K
b
+BR
JR
(t) +
K

JR
e
a
(t) +
1
J
T
L
(t) (2.24)
Combine with

(t) = (t) to get
d
dt
_
(t)
(t)
_
=
_
0 1
0
K

K
b
+BR
JR
_
_
(t)
(t)
_
+
_
0 0
K

JR
1
J
_
_
e
a
(t)
T
L
(t)
_
(2.25)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 34
3 First Order, Linear, Time-Invariant (LTI) ODE
1 The Big Picture
We shall study models described by Linear Time-Invariant input-output dierential equa-
tions. The general form of such a model is
y
[n]
+a
1
y
[n1]
+ +a
n1
y +a
n
y = b
0
u
[m]
+b
1
u
[m1]
+ +b
m1
u +b
m
u (3.1)
where y
[k]
denotes the k
th
derivative of the signal y(t):
d
k
y(t)
dt
k
. Equation (3.1) is often called
SLODE (Single Linear Order Dierential Equation). Here we will require that m n. For
reasons we will understand later, this is equivalent to stating that the model (3.1) is causal.
We will learn how to solve these dierential equations, and more importantly, we will discover
how to make broad qualitative statements about these solutions. Much of our intuition
about control system design and its limitations will be drawn from our understanding of LTI
systems.
A great many models of physical processes that we may be interested in controlling are not
linear. Nevertheless, as we shall see much later, the study of LTI systems is a vital tool
in learning how to control even nonlinear systems. Essentially, feedback control algorithms
make small adjustments to the inputs based on measured outputs. For small deviations of
the input about some nominal input trajectory, the output of a nonlinear system looks like
a small deviation around some nominal output. The eects of the small input deviations on
the output is well approximated by a linear (possibly time-varying) system. It is therefore
essential to undertake a study of linear systems.
In this section, we review the solutions of linear, rst-order dierential equations with time-
dependent forcing functions and constant coecients. The concepts of
stability
time-constant
sinusoidal steady-state
frequency response functions
are introduced. A signicant portion of the remainder of the course generalizes these to
higher order, linear ODEs, with emphasis on applying these concepts to the analysis and
design of feedback systems.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 35
2 Solution of a First Order LTI ODE
Consider the following system
y(t) +a y(t) = b u(t) (3.2)
where u is the input, y is the dependent variable, and a and b are constant coecients (ie.,
numbers). Given the initial condition y(0) = y
o
and an arbitrary input function u(t) dened
on [0, ), the solution of Eq. (3.2) is given by
y
s
(t) = e
at
y
o
. .
y
h
(t), free resp.
+
_
t
0
e
a(t)
b u() d
. .
y
p
(t), forced resp.
. (3.3)
The rst term of the solution above is called the homogeneous solution y
h
(t). It is the part
of the output y that is due to the initial conditions only. It is also called the free response,
the zero-input response, or the initial-condition response.
The second term in the solution above is called the particular solution y
p
(t). This component
is due to the input u alone. It is also called the forced response, the zero-state response, or
the input response.
We can easily check that (3.3) is indeed the solution of (3.2) by verifying two facts: the
function y
s
satises the dierential equation for all t 0; and y
s
satises the given initial
condition at t = 0. The theory of dierential equations tells us that there is one and only
one function that satises both (existence and uniqueness of solutions). To verify, rst check
the value of y
s
(t) at t = 0:
y
s
(0) = e
a0
y
o
+
_
0
0
e
a(t)
b u() d = y
o
.
Taking the time derivative of (3.3) we obtain
y
s
(t) = a e
at
y
o
+
d
dt
_
e
at
_
t
0
e
a
b u() d
_
= a e
at
y
o
a e
at
_
t
0
e
a
b u() d
. .
ays(t)
+e
at
e
at
b u(t)
= a y
s
(t) + b u(t) .
as desired.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 36
3 The Free Response
We begin by plotting below the free response for various values of a. The values plotted
are a = [2 : 1/3 : 1]. Notice that the free response decays to zero if a > 0, approaches a
constant value if a = 0, and grows exponentially if a < 0.
0 1 2 3
0
0.5
1
1.5
2
2.5
3
0 1 2 3 4
0
0.2
0.4
0.6
0.8
1
Figure 25: The free response of a rst-order system.
In the second panel, we have plotted the normalized free response when a > 0. More
precisely, we have plotted y(t)/y
o
versus at. The time
T :=
1
a
is called the time constant of a rst order stable system ( a > 0). T is an indication of how
fast is the response of the system. The larger a, the smaller T and the faster the response
of the system.
Notice that
y
h
(T)
y
o
=
1
e
.37 = 37%
y
h
(2T)
y
o
=
1
e
2
.13 10%
y
h
(3T)
y
o
=
1
e
3
.05 = 5%
The calculations above states that the free response essentially decays to zero within three
time constants. This is a very useful rule-of-thumb to sketch responses to rst-order-systems.
We will say that the system is stable if a > 0. This is a temporary denition, and we will
more formally explore stability in the next section. For now, its just our working denition.
What do we get from our idea of stability? As we observed earlier, if a system is stable, the
free response always decays to zero. This is because with u(t) = 0, we have
lim
t
y(t) = lim
t
e
at
y
o
= 0
ME 132, Fall 2012, UC Berkeley, F. Borrelli 37
Another consequence of stability is that bounded
5
inputs produce bounded outputs. To see
this, suppose |u(t)| K
u
always. Then,
|y(t)| =

e
at
y
o
+
_
t
0
e
a(t)
bu()d

e
at
y
o

+
_
t
0

e
a(t)
bu()

d
|y
o
| +
_
t
0
K
u
e
a(t)
bd |y
o
| +K
u
b = K
y
which establishes that y(t) is also bounded.
Henceforth. we shall assume that the rst-order system under consideration is stable, i.e.
a > 0.
If a < 0 the free response of ODE (3.2) is unstable, i.e. lim
t
|y(t)| = . When a = 0,
y(t) = y
o
and we say that this system is limitedly stable.
4 The Step Response
Now suppose the input is a step function:
u(t) =
_
0 t < 0
u
ss
t 0
We can use equation (3.3) to compute the output as
y(t) = e
at
y
o
+
_
t
0
e
a(t)
bu
ss
d = e
at
y
o
+
bu
ss
a
_
1 e
at
_
= e
at
y
o

b
a
u
ss
e
at
. .
y
tr
(t)
+
b
a
u
ss
..
y
ss
(t)
(3.4)
Notice that the steady-state value of the step-response is
y
ss
= lim
t
y(t) =
b
a
u
ss
(3.5)
so the steady-state gain to step inputs is b/a. This fact critically depends on our assumption
that the system is stable in order to have the transient response decay to zero.
5
A signal z(t) is called bounded if there exists a constant K
z
such that
|z(t)| K
z
< for all t
For example the signal z(t) = sin(t) is bounded, but the signal z(t) = t is not.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 38
0 2 4 6 8 10 12 14 16 18
2
1.5
1
0.5
0
0.5
1
Time (sec)
response
input
Figure 26: Response of the system y +y = u to step-like inputs.
The step response begins at y
o
and converges to y
ss
exponentially with time constant T = 1/a.
Thus, after 3 time constants, i.e. t = 3/a, the response is within 95 % of (y
ss
y
o
). This fact
is very useful in sketching the response of rst-order systems to inputs composed of steps of
various heights, as illustrated in Figure 26.
4.1 Linearity
Why is the dierential equation in (3.2) called a linear dierential equation? Suppose y
1
is
the solution to the dierential equation with the initial condition y
0,1
and forcing function u
1
,
and y
2
is the solution to the dierential equation with the initial condition y
0,2
and forcing
function u
2
. In other words, the function y
1
satises y
1
(0) = y
1,0
and for all t > 0,
y
1
(t) +ay
1
(t) = bu
1
(t),
along with an analogous description for the solution y
2
(dierent initial condition, dierent
forcing).
Now take two constants and . What is the solution to the dierential equation with
initial condition y(0) = y
0,1
+y
0,2
, and forcing function u(t) = u
1
(t) +u
2
(t)? It is easy
(just plug into the dierential equation, or the integral form of the solution) to see that the
solution is
y(t) = y
1
(t) +y
2
(t)
This is often called the superposition property. In this class, we will more typically use the
term linear, indicating that the solution of the dierential equation is a linear function of
the (initial condition, forcing function) pair.
5 The Sinusoidal Response
We now compute the response of a stable rst-order LTI system to sinusoidal inputs. This
is important because any input may be decomposed via the Fourier Transform into a sum
ME 132, Fall 2012, UC Berkeley, F. Borrelli 39
of sinusoidal terms. Since the system under consideration is linear, the forced response is
simply the sum of the forced responses (weighted by the Fourier coecients) to the sinusoidal
terms. Studying the response of a rst order system due to sinusoidal inputs will serve us
well in qualitatively understanding the response to general input signals.
Consider again the rst-order system
y(t) +ay(t) = bu(t) with initial conditions y(0) = y
o
(3.6)
Let us again assume that this system is stable, i.e. a > 0.
Suppose that we apply a sinusoidal input to this system of the form
u(t) =
_
0 t < 0
U sin(t) t 0
As before, we can use equation (3.3) to compute the output as
y(t) = e
at
y
o
+
_
t
0
e
a(t)
bU sin()d
= e
at
y
o
+
bU
a
2
+
2
e
at
. .
y
tr
(t)
+
Ub
a
2
+
2
(a sin(t) cos(t))
. .
y
ss
(t)
(3.7)
The response above is plotted together with the input in Figure 27 with a = U = 1, and
= 1.25. Notice that the transient response pretty much disappears within three time
constants (i.e. 3/a = 3 seconds), after which the total response y is indistinguishable from
the steady state response y
ss
.
0 2 4 6 8 10 12 14 16 18 20
1
0
1
2
3
Time (sec)
u
y
y
ss
Figure 27: Sinusoidal response.
Observe that the response above has three terms: the rst two decay to zero, and the third
persists in time. This observation rests on our assumption that the system is stable. The
components of the sinusoidal response that decay to zero are called the transient response,
ME 132, Fall 2012, UC Berkeley, F. Borrelli 40
while the component that persists in time is called the steady-state response. Lets look more
closely at the steady-state response. Using standard trigonometric identities
6
we can write
y
ss
(t) = M()U sin(t +)
where
M() =
b

a
2
+
2
, () = Tan
1
(

a
) (3.8)
This equation is extremely important. It says that
... if we apply a sine input of frequency to a stable rst order system, in steady-
state the output will also be a sine wave. Moreover, it has the same frequency .
However, it will be amplied or attenuated with a gain M() and phase-shifted
by ().
It is quite easy to verify that the same result holds for cosine inputs also. The amplitude
gain M() and the phase shift () are called the frequency response of the stable rst-order
LTI system (3.6).
6 The Frequency Response
It is very useful to plot the frequency response (3.8). In many physical systems the range of
frequencies we are interested in is quite broad, and the amplitude gain M() can have a wide
range of values. Experience has revealed that it is more informative
7
to plot the magnitude
frequency response on a log-log scale, and the phase frequency response on a linear-log scale.
More precisely, engineers usually plot
20 log
10
M() vs. log
10
, and () vs. log
10

The quantity 20 log


10
M() occurs so commonly that it has its own units called decibels
which is abbreviated as db. The table of Figure 28 converts some gain values to decibels. It
is useful to remember that a ten-fold increase in the gain (i.e. an increase by a factor of 10)
corresponds to an increase of 20 db. Also, doubling the gain corresponds to an increase by
6 db.
In Figure 29, we plot the frequency response of the stable rst-order system (3.6) that we
have derived in the previous section.
6
It is easy to verify that
Asin() +Bcos() =
_
A
2
+B
2
sin( +)
where the phase oset is given by
= Tan
1
(
B
A
)
7
This is particularly true for highly resonant systems.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 41
M() 20 log
10
M()
.01 40 db
.1 20 db
1 0 db
2 6 db
5 14 db
10 20 db
20 26 db
50 34 db
100 40 db
Figure 28: Gain to
decibel conversions.
Normalized Frequency /a (rad/sec)
P
h
a
s
e

(
d
e
g
)



















M
a
g
n
i
t
u
d
e

(
d
b
)

40
30
20
10
0

0.1 1 10 100
80
60
40
20

Figure 29: Frequency response for rst order system.
7 Problems
1. Use the integrating factor method to derive the solution given in equation (3.3) to the
dierential equation (3.2).
2. Suppose f is a piecewise continuous function. Assume A < B. Explain (with pictures,
or equations, etc) why

_
B
A
f(x)dx

_
B
A
|f(x)| dx
This simple idea is used repeatedly when bounding the output response in terms of
bounds on the input forcing function.
3. A stable rst-order system (input u, output y) has dierential equation model
x(t) = ax(t) +bu(t)
= a
_
x(t)
b
a
u(t)

where a < 0 and b are some xed numbers.


(a) Solve for the time-constant and steady-state gain in terms of a and b. Also,
invert these solutions, expressing a and b in terms of the time-constant and steady-
state gain.
(b) Suppose = 1, = 2. Given the initial condition x(0) = 4, and the input signal
u
u(t) = 1 for 0 t < 5
u(t) = 2 for 5 t < 10
u(t) = 6 for 10 t < 10.1
u(t) = 3 for 10.1 t < .
ME 132, Fall 2012, UC Berkeley, F. Borrelli 42
sketch a reasonably accurate graph of x(t) for t ranging from 0 to 20. The sketch
should be based on your understanding of a rst-order systems response (using
its time-constant and steady-state gain), not by doing any particular integration.
(c) Now suppose = 0.001, = 2. Given the initial condition x(0) = 4, and the
input signal u
u(t) = 1 for 0 t < 0.005
u(t) = 2 for 0.005 t < 0.01
u(t) = 6 for 0.01 t < 0.0101
u(t) = 3 for 0.0101 t < .
sketch a reasonably accurate graph of x(t) for t ranging from 0 to 0.02. The
sketch should be based on your understanding of a rst-order systems response,
not by doing any particular integration. In what manner is this the same as
the response in part 3b?
4. Consider the rst-order linear system
x(t) = A[x(t) u(t)]
with A < 0. Note that the system is stable, the time constant is
c
=
1
A
, and the
steady-state gain from u to x is 1. Suppose the input (for t 0) is a unit ramp input,
that is
u(t) = t
starting with an initial condition x(0) = x
0
. Show that the solution for t 0 is
x(t) = t
c
+ (x
0
+
c
) e
at
Hint: you can do this in 2 dierent manners - carry out the convolution integral, or
verify that the proposed solution satises the initial condition (at t = 0) and satises
the dierential equation for all t > 0. Both are useful exercises, but you only need to
do one for the assignment. Note that if we ignore the decaying exponential part of the
solution, then the steady-state solution is also a unit-ramp, but it is delayed from
the input by
c
time units. This gives us another interpretation of the time-constant
of a rst-order linear system (i.e., ramp-input leads to ramp-output, delayed by
c
).
5. (a) Suppose > 0 and > 0. Let y
1
(t) := sin t, and y
2
(t) = sin(t ). Explain
what is meant by the statement that the signal y
2
lags the signal y
1
by

2
of a
period.
(b) Let :=

3
. On 3 separate graphs, plot
i. sin 0.1t and sin(0.1t )
ii. sin t and sin(t )
iii. sin 10t and sin(10t )
ME 132, Fall 2012, UC Berkeley, F. Borrelli 43
(c) Explain how the graphs in part 5b conrm the claim in part 5a.
6. For the rst-order linear system (constant coecients a, b, and c)
x(t) = ax(t) +bu(t)
y(t) = cx(t)
(a) Using the convolution integral for the forced response, nd the output y(t) for
t 0 starting from the initial condition x(0) = 0, subject to input
u(t) = 1 for t 0
u(t) = sin(t) for t 0
(b) For this rst-order system, the frequency-response function G() is
G() =
cb
j a
Make a plot of
log
10
|G()| versus log
10

for 0.001 1000 for two sets of values: system S


1
with parameters (a =
1, b = 1, c = 1) and system S
2
with parameters (a = 10, b = 10, c = 1). Put
both magnitude plots on the same axis. Also make a plot of
G() versus log
10

for 0.001 1000 for both systems. You can use the Matlab command angle
which returns (in radians) the angle of a nonzero complex number. Put both
angle plots on the same axis.
(c) What is the time-constant and steady-state gain of each system?
(d) For each of the following cases, compute and plot y(t) versus t for the :
i. S
1
with x(0) = 0, u(t) = 1 for t 0
ii. S
2
with x(0) = 0, u(t) = 1 for t 0
iii. S
1
with x(0) = 0, u(t) = sin(0.1 t) for t 0
iv. S
2
with x(0) = 0, u(t) = sin(0.1 t) for t 0
v. S
1
with x(0) = 0, u(t) = sin(t) for t 0
vi. S
2
with x(0) = 0, u(t) = sin(t) for t 0
vii. S
1
with x(0) = 0, u(t) = sin(10 t) for t 0
viii. S
2
with x(0) = 0, u(t) = sin(10 t) for t 0
Put cases (a), (b) on the same graph, cases (c), (d) on the same graph, cases
(e), (f) on the same graph and cases (g), (h) on the same graph. Also, on each
graph, also plot u(t). In each case, pick the overall duration so that the limiting
behavior is clear, but not so large that the graph is cluttered. Be sure and get
the steady-state magnitude and phasing of the response y (relative to u) correct.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 44
(e) Compare the steady-state sinusoidal responses of the response you computed and
plotted in 6d with the frequency-response functions that are plotted in part 6b. Il-
lustrate out how the frequency-response function gives, as a function of frequency,
the steady-state response of the system to a sin-wave input of any frequency. Mark
the relevant points of the frequency-response curves.
7. With regards to your answers in problem 6,
(a) Comment on the eect parameters a and b have on the step responses in cases
(a)-(b).
(b) Comment on the amplication (or attenuation) of sinusodal inputs, and its rela-
tion to the frequency .
(c) Based on the speed of the response in (a)-(b) (note the degree to which y follows
u, even though u has an abrupt change), are the sinusoidal responses in (c)-(h)
consistent?
8. Consider the rst-order linear system (constant coecients A, B, C and D)
x(t) = Ax(t) +Bu(t)
y(t) = Cx(t) +Du(t)
and assume that A < 0 (so the system is stable), B = A, C = 1 and D = 0. Let
:= A, so that the equations become
x(t) = [u(t) x(t)]
y(t) = x(t)
Let the initial condition be x(0) = x
0
. Let R be a given, xed number. Suppose
that the input u is a sinusoid, for t 0 u(t) := sin t.
(a) (Trigonometry recap) Sketch a plot of tan(x) versus x, for all x R. Also, sketch
the inverse function tan
1
(w) versus w for all w. Note that the inverse function
is multivalued, since for any angle and any integer n, tan () = tan ( +n).
From now on, when we refer to tan
1
, we mean the function that for every
y R,

2
< tan
1
(y) <

2
, and tan(tan
1
(y)) = y.
(b) Find expressions M() and () such that
x
,ss
(t) = M() sin (t +()) ,
where A() 0 for all . The angle will be known implicitly you will be
able to exactly describe what sin and what cos are. If you divide to write it
in tan
1
form, make sure that you verify the rule we set out above.
(c) Numerically ll in the table below
ME 132, Fall 2012, UC Berkeley, F. Borrelli 45
M() ()
/1000
/100
/10

10
100
1000
(d) Pick several values for . Use MatLab to graph M() .vs. on a log-log plot
(log on the horizontal axis). In your graphs, choose
min

1
1000
|A|, choose

max
1000|A|. Useful functions are logspace, loglog and ./ (period, slash).
On each graph, hand-draw in straightline approximations which come from the
entries in the table you derived above. Specically, plot the 7 points, and connect
them with straight lines. Qualitatively, compare the straightline approximation
to the actual curves.
(e) Qualitatively explain how the function M() changes with parameter .
(f) Using the same values for , graph () .vs. on a linear()-log() plot. Quali-
tatively explain how the function () changes with . On each graph, hand-draw
in straightline approximations which come from the entries in the table you de-
rived above. Qualitatively, compare the straightline approximation to the actual
curves.
(g) So, consider the cascade connection of two, rst-order, stable, systems
x
1
(t) = A
1
x
1
(t) +B
1
u(t)
y
1
(t) = C
1
x
1
(t) +D
1
u(t)
x
2
(t) = A
2
x
2
(t) +B
2
y
1
(t)
y(t) = C
2
x
2
(t) +D
2
y
1
(t)
By stable, we mean both A
1
< 0 and A
2
< 0. The cascade connection is shown
pictorially below.
S
1
S
2
E E E
u
y
1
y
Suppose that the frequency response of System 1 is M
1
(),
1
() (or just the
complex G
1
()), and the frequency response of System 2 is M
2
(),
2
() (ie., the
complex G
2
()). Now, suppose that is a xed real number, and u(t) = sin t.
Show that the steady-state behavior of y(t) is simply
y
,ss
(t) = [M
1
()M
2
()] sin (t +
1
() +
2
())
ME 132, Fall 2012, UC Berkeley, F. Borrelli 46
(h) Let G denote the complex function representing the frequency response (forcing-
frequency-dependent amplitude magnication A and phase shift , combined into
a complex number) of the cascaded system. How is G related to G
1
and G
2
?
Hint: Remember that for complex numbers G and H,
|GH| = |G| |H| , (GH) = G + H
9. Consider a rst-order system P, with inputs (d, u) and output y, governed by
x(t) = ax(t) +b
1
d(t) +b
2
u(t)
y(t) = cx(t)
A proportional control,
u(t) = K
1
r(t) K
2
y
meas
(t)
is used, and the measurement is assumed to the be the actual value, plus measurement
noise,
y
meas
(t) = y(t) +n(t)
As usual, y is the process output, and is the variable we want to regulate, r is the
reference signal (the desired value of y), d is a process disturbance, u is the control
variable, n is the measurement noise (so that y +n is the measurement of y), K
1
and
K
2
are gains to be chosen. For simplicity, we will choose some nice numbers for the
values, specically b
1
= b
2
= c = 1. There will be two cases studied: stable plant,
with a = 1, and unstable plant, with a = 1. You will design the feedback gains
as described below, and look at closed-loop properties. The goal of the problem is to
start to see that unstable plants are intrinsically harder to control than stable plants.
This problem is merely a simple illustration of this fact, not a proof.
(a) Keeping a, K
1
and K
2
are variables, substitute for u, write the dierential equation
for x in the form
x(t) = Ax(t) +B
1
r(t) +B
2
d(t) +B
3
n(t)
Also, express the output y and control input u as functions of x and the external
inputs (r, d, n) as
y(t) = C
1
x(t) +D
11
r(t) +D
12
d(t) +D
13
n(t)
u(t) = C
2
x(t) +D
21
r(t) +D
22
d(t) +D
23
n(t)
Together, these are the closed-loop governing equations. Note that all of the
symbols (A, B
1
, . . . , D
23
) will be functions of a and the controller gains. Below,
we will design K
1
and K
2
two dierent ways, and assess the performance of the
overall system.
(b) Under what conditions is the closed-loop system is stable? Under those conditions,
ME 132, Fall 2012, UC Berkeley, F. Borrelli 47
i. What is the time-constant of the closed-loop system?
ii. What is the steady-state gain from r to y (assuming d 0 and n 0)?
iii. What is the steady-state gain from d to y (assuming r 0 and n 0)?
(c) First we will consider the stable plant case, so a = 1. If we simply look at
the plant (no controller), u and d are independent inputs, and the steady-state
gain from d to y is
cb
1
a
which in this particular instance happens to be 1. Find
the value of K
2
so that: the closed-loop system is stable; and the magnitude of
the closed-loop steady-state gain from d to y is
1
5
of the magnitude of the open-
loop steady-state gain from d to y. That will be our design of K
2
, based on this
disturbance rejection specication.
(d) With K
2
chosen, choose K
1
so that the closed-loop steady-state gain from r to y
is equal to 1 (recall, the goal is that y should track r, as r represents the desired
value of y).
(e) Next, we will assess the design in terms of the closed-loop eect that the external
inputs (r, d, n) have on two main variables of interest (y, u). For a change-of-pace,
we will look at the frequency-response functions, not time-domain responses. For
notational purposes, let H
vq
denote the frequency-response function from a input
signal v to an output signal q (for example, from r to y). We will be making plots
of
|H
vq
()| vs and H
vq
() vs
Specically though, we will actually plot the magnitude on a log
10
scale, frequency
on a log
10
scale, and the angle on a linear scale, in radians. To do this, you
will use commands such as loglog, semilogx, abs and angle. As mentioned, the
plots will be arranged in a 2 3 array, organized as
|H
ry
|
H
ry
|H
dy
| |H
ny
|
|H
ru
|
H
ru
|H
du
| |H
nu
|
Note that because 2 of the entries actually have both the magnitude and angle
plotted, there will be 8 axes. If you forget how to do this, try the following
commands and see what happens in Matlab.
a11T = subplot(4,3,1);
a11B = subplot(4,3,4);
a12 = subplot(2,3,2);
a13 = subplot(2,3,3);
a21T = subplot(4,3,7);
a21B = subplot(4,3,10);
a22 = subplot(2,3,5);
a23 = subplot(2,3,6);
ME 132, Fall 2012, UC Berkeley, F. Borrelli 48
Plot the frequency-response functions. Use (for example) 100 logarithmically
spaced points for , varying from 0.01 to 100. Make the linetype (solid, black)
(f) Next we move to the unstable plant case, a = 1. In order make a fair compar-
ison, we need to make some closed-loop property similar to the previous cases
closed-loop property, and then compare other closed-loop properties. For the
unstable plant design, choose K
1
and K
2
so that
i. the closed-loop system is stable
ii. the time-constant is the same as the closed-loop time constant in the stable
plant case,
iii. the closed-loop steady-state gain from r to y is 1.
With those choices, plot the closed-loop frequency response functions on the ex-
isting plots, using (dashed/red) linetypes for comparison.
(g) Note that several curves are the same as the stable plant case. However in all
the other cases (d u, n y, n u) the unstable plant case has higher gains.
This means that in order to get the same r y tracking and d y disturbance
rejection, the system with the unstable plant uses more control input u, and is
more sensitive to noise at all frequencies.
(h) Look at the paper entitled Respect the Unstable by Gunter Stein. It is in the
IEEE Control Systems Magazine, August 2003, pp. 12-25. You will need to ignore
most of the math at this point, but there are some good paragraphs that reiterate
what I am saying here, and good lessons to be learned from the accidents he
describes. Please write a short paragraph about one of the accidents he describes.
10. Re-read Leibnitzs rule in your calculus book, and consider the time-varying dif-
ferential equation
x(t) = a(t)x(t) +b(t)u(t)
with x(0) = x
o
. Show, by substitution, or integrating factor, that the solution to this
is
x(t) = e

t
0
a()d
x
o
+
_
t
0
e

a()d
b()u()d
11. Suppose two systems are interconnected, with individual equations given as
S
1
: y(t) = [u(t) y(t)]
S
2
: u(t) = 2 [y(t) r(t)]
(3.9)
(a) Consider rst S
1
(input u, output y): Show that for any initial condition y
0
, if
u(t) u (a constant), then y(t) approaches a constant y, that only depends on
the value of u. What is the steady-state gain of S
1
?
(b) Next consider S
2
(input (r, y), output u): Show that if r(t) r and y(t) y
(constants), then u(t) approaches a constant u, that only depends on the values
( r, y).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 49
(c) Now, assume that the closed-loop system also has the steady-state behavior
that is, if r(t) r, then both u(t) and y(t) will approach limiting values, u and
y, only dependent on r. Draw a block-diagram showing how the limiting values
are related, and solve for u and y in terms of r.
(d) Now check your answer in part 4c. Suppose y(0) = 0, and r(t) = 1 =: r for all
t 0. Eliminate u from the equations A.5, and determine y(t) for all t. Make a
simple graph. Does the result agree with your answer in part 4c?
Lesson: since the assumption we made in part 4c was actually not valid, the analysis
in part 4c is incorrect. That is why, for a closed-loop steady-state analysis to be based
on the separate components steady-state properties, we must know from other means
that the closed-loop system also has steady-state behavior.
12. Suppose two systems are interconnected, with individual equations given as
S
1
: y(t) = [u(t) +y(t)]
S
2
: u(t) = 2 [r(t) y(t)]
(3.10)
(a) Consider rst S
1
(input u, output y): If u(t) u (a constant), then does y(t)
approach a constant y, dependent only on the value of u?
(b) Next consider S
2
(input (r, y), output u): If r(t) r and y(t) y (constants),
then does u(t) approach a constant u, dependent only on the values r, y?
(c) Suppose y(0) = y
0
is given, and r(t) =: r for all t 0. Eliminate u from the
equations A.6, and determine y(t) for all t. Also, plugging back in, determine u(t)
for all t. Show that y and u both have limiting values that only depend on the
value r, and determine the simple relationship between r and ( y, u).
Lesson: Even though S
1
does not have steady-state behavior on its own, in feedback
with S
2
, the overall closed-loop system does.
13. Consider a rst-order system P, with inputs (d, u) and output y, governed by
x(t) = ax(t) +b
1
d(t) +b
2
u(t)
y(t) = cx(t)
(a) Assume P is stable (ie., a < 0). For P itself, what is the steady-state gain from
u to y (assuming d 0)? Call this gain G. What is the steady-state gain from d
to y (assuming u 0)? Call this gain H.
(b) P is controlled by a proportional controller of the form
u(t) = K
1
r(t) +K
2
[r(t) (y(t) +n(t))]
Here, r is the reference signal (the desired value of y), n is the measurement noise
(so that y + n is the measurement of y), K
1
and K
2
are gains to be chosen. By
substituting for u, write the dierential equation for x in the form
x(t) = Ax(t) +B
1
r(t) +B
2
d(t) +B
3
n(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 50
Also, express the output y and control input u as functions of x and the external
inputs (r, d, n) as
y(t) = C
1
x(t) +D
11
r(t) +D
12
d(t) +D
13
n(t)
u(t) = C
2
x(t) +D
21
r(t) +D
22
d(t) +D
23
n(t)
All of the symbols (A, B
1
, . . . , D
23
) will be functions of the lower-case given sym-
bols and the controller gains. Below, we will design K
1
and K
2
two dierent
ways, and assess the performance of the overall system.
(c) Under what conditions is the closed-loop system is stable? What is the steady-
state gain from r to y (assuming d 0 and n 0)? What is the steady-state
gain from d to y (assuming r 0 and n 0)?
(d) Design a feed-forward controller based on the steady-state gain G. In particular,
pick K
1
:=
1
G
, and K
2
:= 0. Note that we are now considering a feedback control
system that actually had no feedback (K
2
= 0). Nevertheless, I refer to the system
as the closed-loop system.
i. For the closed-loop system, compute the steady-state gains from all external
inputs (r, d, n) to the two outputs (y, u).
ii. Comment on the steady-state gain from r y.
iii. What is the sensitivity of the steady-state gain from r y to the parameter
b
2
? Here you should treat K
1
as a xed number.
iv. Comment on the relationship between the open-loop steady-state gain from
d y (ie., H computed above) and the closed-loop computed in part 13(d)i.
v. Comment on the steady-state gain from d to u. Based on ds eventual eect
on u, is the answer in part 13(d)iv surprising?
vi. Comment on the steady-state gain from n to both y and u.
vii. What it the time-constant of the closed-loop system.
viii. In this part we have considered a feedback control system that actually had
no feedback (K
2
= 0). So the closed-loop system is in fact an open-loop
system. Summarize the eect of the open-loop control strategy (called feed-
forward, since the control input is actually just a function of the reference
signal r, fed-forward to the process). In this summary, include a compar-
ison of the process time constant, and the closed-loop time constant, as well
as the tracking capabilities (how y follows r), the sensitivity of the tracking
capabilities to parameter changes, and the disturbance rejection properties.
(e) Now design a true feedback control system. Pick K
2
so that the closed-loop
steady-state gain from d y is at least 5 times less than the uncontrolled steady-
state gain from d y (which we called H). Constrain your choice of K
2
so that
the closed-loop system is stable. Since we are working fairly general, for simplicity,
you may assume a < 0 and b
1
> 0, b
2
> 0 and c > 0.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 51
i. With K
2
chosen, pick K
1
so that the closed-loop steady-state gain from r y
is 1.
ii. With K
1
and K
2
both chosen as above, what is the sensitivity of the steady-
state gain from r y to the parameter b
2
?
iii. What is the time-constant of the closed-loop system?
iv. What is the steady-state gain from d u? How does this compare to the
previous case (feedforward)?
v. With K
2
= 0, does the noise n now aect y?
(f) Lets use specic numbers: a = 1, b
1
= 1, b
2
= 1, c = 1. Summarize all compu-
tations above in a table one table for the feedforward case, and one table for
the true feedback case. Include in the table all steady-state gains, time constant,
and sensitivity of r y to b
2
.
(g) Plot the frequency responses from all external inputs to both outputs. Do this in
a 2 3 matrix of plots that I delineate in class. Use Matlab, and the subplot
command. Use a frequency range of 0.01 100. There should be two lines
on each graph.
(h) Indicate on the graph how the true feedback system accomplishes tracking, dis-
turbance rejection, and lower time-constant, but increased sensitivity to noise.
(i) Keeping K
1
and K
2
xed, change b
2
from 1 to 0.8. Redraw the frequency re-
sponses, now including all 4 lines. Indicate on the graph how the true feedback
system accomplishes good tracking that is more insensitive to process parameter
changes than the feedforward system.
14. Consider a system with input u, and output y governed by the dierential equation
y(t) +a
1
y(t) = u(t) +b
1
u(t) (3.11)
This is dierent than what we have covered so far, because the derivative of the input
shows up in the right-hand-side (the overall function forcing y, from the ODE point of
view).
(a) Let q(t) := y(t) u(t). By substitution, nd the dierential equation governing
the relationship between u and q.
(b) Assume that the system is at rest (ie., y 0, u 0, and hence q 0 too),
and at some time, say t = 0, the input u changes from 0 to 1 (eg., a unit-step
function input). Solve for q, using the dierential equation found in part 14a
initial condition q(0) = 0.
(c) Since y = q +u, show that the step-response of 6.3 is
y(t) =
b
1
a
1
+
_
1
b
1
a
1
_
e
a
1
t
ME 132, Fall 2012, UC Berkeley, F. Borrelli 52
(d) Suppose that a
1
> 0. Draw the step response for two cases: b
1
= 0.9a
1
and
b
1
= 1.1a
1
. Comment on the step response for 0 < a
1
b
1
. What happens if
a
1
< 0 (even if b
1
a
1
, but not exactly equal)?
ME 132, Fall 2012, UC Berkeley, F. Borrelli 53
4 Review of SLODEs
Throughout this section, if y denotes a function (of time, say), then y
[k]
or y
(k)
denotes the
kth derivative of the function y,
y
[k]
=
d
k
y
dt
k
In the case of k = 1 and k = 2, it will be convenient to also use y and y.
1 Linear, Time-Invariant Dierential Equations
Often, in this class, we will analyze a closed-loop feedback control system, and end up with
an equation of the form
y
(n)
(t) +a
1
y
(n1)
(t) + +a
n
y(t) = v(t) (4.1)
where y is some variable of the plant that is of interest to us, and v is a forcing function,
usually either a reference signal (y
des
(t)) or a disturbance (ie., inclination of hill), or a
combination of such signals. One job of the control designer is to analyze the resulting
equation, and determine if the behavior of the closed-loop system is acceptable.
The dierential equation in (4.1) is called a forced, linear, time-invariant dierential equa-
tion. For now, associate the fact that the {a
i
}
n
i=1
are constants with the term time-invariant,
and the fact that the left-hand side (which contains all y terms) is a linear combination of y
and its derivatives with the term linear.
The right-hand side function, v, is called the forcing function. For a specic problem, it will
be a given, known function of time.
Sometimes, we are given an initial time t
0
and initial conditions for dierential equation,
that is, real numbers
y
0
, y
0
, y
0
, . . . , y
(n1)
0
(4.2)
and we are looking for a solution, namely a function y that satises both the dierential
equation (4.1) and the initial condition constraints
y(t
0
) = y
0
, y(t
0
) = y
0
, y(t
0
) = y
0
, . . . , y
(n1)
(t
0
) = y
(n1)
0
. (4.3)
For essentially all dierential equations (even those that are not linear, and not time-
invariant), there is a theorem which says that solutions always exist, and are unique:
Theorem (Existence and Uniqueness of Solutions): Given a forcing function v, dened
for t t
0
, and initial conditions of the form (4.3). Then, there exists a unique function y
which satises the initial conditions and the dierential equation (4.1).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 54
2 Importance of Linearity
Suppose that y
P
is a function which satises (4.1) so that
y
(n)
P
(t) +a
1
y
(n1)
P
(t) + +a
n
y
P
(t) = v(t) (4.4)
and y
H
is a function which, for all t satises
y
(n)
H
(t) +a
1
y
(n1)
H
(t) + +a
n
y
H
(t) = 0 (4.5)
y
H
is called a homogeneous solution of (4.1), and the dierential equation in (4.5) is called
the homogeneous equation. The function y
P
is called a particular solution to (4.1), since it
satises the equation with the forcing function in place.
The derivative of y
P
+y
H
is the sum of the derivatives, so we add the equations satised by
y
P
and y
H
to get
[y
P
+y
H
]
(n)
(t) +a
1
[y
P
+y
H
]
(n1)
(t) + a
n
[y
P
+y
H
] (t) = v(t)
This implies that the function y
P
+y
H
also satises (4.1). Hence, adding a particular solution
to a homogeneous solution results in a new particular solution.
Conversely, suppose that y
P
1
and y
P
2
are two functions, both of which solve (4.1). Consider
the function y
d
:= y
P
1
y
P
2
. Easy manipulation shows that this function y
d
satises the
homogeneous equation. It is a trivial relationship that
y
P
1
= y
P
2
+ (y
P
1
y
P
2
)
= y
P
2
+y
d
We have shown that any two particular solutions dier by a homogeneous solution. Hence
all particular solutions to (4.1) can be generated by taking one specic particular solution,
and adding to it every homogeneous solution. In order to get the correct initial conditions,
we simply need to add the right homogeneous solution.
Remark: The main points of this section rely only on linearity, but not time-invariance.
3 Solving Homogeneous Equation
Lets try to solve (4.5). Take a xed complex number r C, and suppose that the function
y
H
, dened as
y
H
(t) = e
rt
is a solution to (4.5). Substituting in, using the fact that for any integer k > 0, y
(k)
H
(t) = r
k
e
rt
,
gives
_
r
n
+a
1
r
n1
+ +a
n
_
e
rt
= 0
ME 132, Fall 2012, UC Berkeley, F. Borrelli 55
for all t. Clearly, e
rt
= 0, always, so it can be divided out, leaving
r
n
+a
1
r
n1
+ +a
n
= 0 (4.6)
Thus, if e
rt
is a solution to the homogeneous equation, it must be that the scalar r satises
(4.6).
Conversely, suppose that r is a complex number which satises (4.6), then simple substitution
reveals that e
rt
does satisfy the homogeneous equation. Moreover, if r is a repeated root,
say l times, then substitution shows that the functions
_
e
rt
, te
rt
, . . . , t
l1
e
rt
_
all satisfy the
homogeneous dierential equation. This leads to the following nomenclature:
Let r
1
, r
2
, . . . , r
n
be the roots of the polynomial equation

n
+a
1

n1
+ +a
n
= 0
This polynomial is called the characteristic polynomial associated with (4.1).
Fact 1 (requires proof): If the {r
i
}
n
i=1
are all distinct from one another , then y
H
satises
(4.5) if and only if there exist complex constants c
1
, c
2
, . . . , c
n
such that
y
H
(t) =
n

i=1
c
i
e
r
i
t
(4.7)
Fact 2 (requires proof): If the {r
i
}
n
i=1
are not distinct from one another, then group the
roots {r
1
, r
2
, , r
n
} as
p
1
, p
1
, . . . , p
1
. .
l
1
, p
2
, p
2
, . . . , p
2
. .
l
2
, , p
f
, p
f
, . . . , p
f
. .
l
f
(4.8)
Hence, p
1
is a root with multiplicity l
1
, p
2
is a root with multiplicity l
2
and so on. Then y
H
satises (4.5) if and only if there exist complex constants c
ij
(i = 1, . . . f, j = 0, . . . l
i
1)
such that
y
H
(t) =
f

i=1
l
i
1

j=0
c
ij
e
p
i
t
t
j
(4.9)
So, Fact 2 includes Fact 1 as a special case. Both indicate that by solving for the roots of the
characteristic equation, it is easy to pick n linearly independent functions which form a basis
for the set of all homogeneous solutions to the dierential equation. Here, we explicitly have
used the time-invariance (ie., the coecients of the ODE are constants) to generate a basis
(the exponential functions) for all homogeneous solutions. However, the fact that the space
of homogenous solutions is n-dimensional only relies on linearity, and not time-invariance.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 56
Basic idea: Suppose there are m solutions to the homogeneous dierential equation, labeled
y
1,H
, y
2,H
, . . . , y
m,H
, with m > n. Then, look at the n m matrix of these solutions initial
conditions,
M :=
_

_
y
(0)
1,H
y
(0)
2,H
y
(0)
m,H
y
(1)
1,H
y
(1)
2,H
y
(1)
m,H
.
.
.
.
.
.
.
.
.
.
.
.
y
(n1)
1,H
y
(n1)
2,H
y
(n1)
m,H
_

_
Since m > n, this must have linearly dependent columns, so there is a nonzero m1 vector
such that M = 0
n1
. Dene y
z
:=
1
y
1,H
+
2
y
2,H
+ +
m
y
m,H
. Since this is a sum
of homogeneous solutions, it itself is a homogeneous solution. Moreover, y
z
satises
y
(0)
z
(t
0
) = 0, y
(1)
z
(t
0
) = 0, , y
(n1)
z
(t
0
) = 0
Note that the function y
I
(t) 0 for all t also satises the same initial conditions as y
z
, and
it satises the homogeneous dierential equation as well. By uniqueness of solutions, it must
be that y
z
(t) = y
I
(t) for all t. Hence, y
z
is actually the identically zero function. Hence, we
have shown that the set of homogeneous solutions is nite dimensional, and of dimension at
most n. Moreover, by the simple substitutions above, we already know how to construct n
linearly independent solutions to the homogeneous dierential equation, so those must form
a basis for all homogeneous solutions.
The reason that terms like t
k
e
rt
appear for dierential equations whose characteristic equa-
tion has repeated roots is partially explored in Problem 6.
3.1 Interpretation of complex roots to ODEs with real-coecients
In all cases we consider, the dierential equation has real coecients (the a
1
, a
2
, . . . , a
n
).
This means that the characteristic equation has real coecients, but it does not mean that
the roots are necessarily real numbers (eg., even a real quadratic equation may have complex
roots). However, since the coecients are real, then complex roots will come in complex-
conjugate pairs, so if := + j is a root, and and are real numbers, and = 0, then
it will also be true that j is a root of the characteristic equation as well.
Given the roots, we know that all homogeneous solutions are given by equation 4.9, where the
constants vary over all choices of complex numbers. We will almost exclusively be interested
in solutions starting from real initial conditions, with real forcing functions, and hence will
only need to consider real homogeneous solutions. This raises the question of how to interpret
the complex functions e
t
which arise when (a root) is complex.
Suppose
1
C is a complex root. Since the characteristic equation has real coecients,
it follows that that complex conjugate of
1
,
2
=

1
is also a root. Let and be real
numbers such that

1
= +j,
2
= j, = 0
ME 132, Fall 2012, UC Berkeley, F. Borrelli 57
The terms of the homogeneous solution associated with these roots are
c
1
e

1
t
+c
2
e

2
t
where c
1
and c
2
are any complex numbers. We want to study under what conditions (on c
1
and c
2
) will this function be purely real. Plugging in gives
c
1
e
t
[cos t +j sin t] +c
2
e
t
[cos t j sin t]
Regrouping gives
(e
t
[(c
1
+c
2
) cos t +j(c
1
c
2
) sint]
Since cos and sin are linearly independent functions, the only conditions for this to be a
purely real function is that c
1
+c
2
be real, and j(c
1
c
2
) be real. This requires that c
1
and
c
2
be complex-conjugates of one another. In other words, for the function
c
1
e
t
[cos t +j sin t] +c
2
e
t
[cos t j sin t]
is real-valued, for all t if and only if c
1
= c
2
.
Let c
2
be any complex number, and let c
1
:= c
2
. Then c
1
+c
2
= 2A, where A is the real part
of c
2
. Also, j(c
1
c
2
) = 2B, where B is the imaginary part of c
2
. Hence, the purely real
homogeneous solutions are of the form
e
t
[2Acos t + 2Bsin t]
where A and B are free real constants. Since they are free, it serves no purpose to write 2A
and 2B, and we can simply write that all real homogeneous solutions arising from the two
roots
1
= +j and
2
= j are
e
t
[Acos t +Bsin t]
where A and B are any real numbers.
With this is mind, we can rewrite a specialized version of Fact 2, for the case when the
coecients of the ODE are real, and we are interested in writing down a description of all
real homogeneous solutions.
Fact 3: Assume that all coecients a
1
, a
2
, . . . , a
n
are real numbers. Group the n roots of
the characteristic equation as
p
1
, p
1
, . . . , p
1
. .
l
1
, , p
d
, p
d
, . . . , p
d
. .
l
d
,

1
+j
1
,
1
+j
1
, . . . ,
1
+j
1
. .
h
1
,
1
j
1
,
1
j
1
, . . . ,
1
j
1
. .
h
1
,
.
.
.

c
+j
c
,
c
+j
c
, . . . ,
c
+j
c
. .
hc
,
c
j
c
,
1
j
c
, . . . ,
c
j
c
. .
hc
(4.10)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 58
where each p, and are real, and each = 0. Then y
H
is a real-valued function which
satises (4.5) if and only if there exist real constants c
ij
(i = 1, . . . d, j = 0, . . . l
i
1), A
ks
, B
ks
(k = 1, . . . c, s = 0, . . . h
k
1)such that
y
H
(t) =
d

i=1
l
i
1

j=0
c
ij
e
p
i
t
t
j
+
c

k=1
h
k
1

s=0
e

k
t
t
s
[A
ks
cos
k
t +B
ks
sin
k
t] (4.11)
4 General Solution Technique
The general technique (conceptually, at least) for nding particular solutions of (4.1) which
also satisfy the initial conditions is a combination of all of the above ideas. It is very
important conceptually, and somewhat important in actual use.
1. Find any particular solution y
P
2. Choose constants c
ij
so that the function
y
P
(t) +
f

i=1
l
i
1

j=0
c
ij
t
j
e
p
i
t
satises the initial conditions.
The resulting function is the solution. Note that in step 2, there are n equations, and n
unknowns.
5 Behavior of Homogeneous Solutions as t
In this section, we study the behavior of the class of homogeneous solutions as t . If we
can show that all homogeneous solutions decay to 0 as t , then it must be that for a give
forcing function, all particular solutions, regardless of the initial conditions, approach each
other. This will be useful in many contexts, to quickly understand how a system behaves.
Suppose r is a complex number, r C, and we decompose it into its real and imaginary
parts. Let := Real(r) and := Imag(r). Hence, both and are real numbers, and
r = +j. We will always use j :=

1. The exponential function e


rt
can be expressed as
e
rt
= e
t
[cos t +j sin t]
Note that the real part of r, namely , determines the qualitative behavior of e
rt
as t .
Specically,
ME 132, Fall 2012, UC Berkeley, F. Borrelli 59
if < 0, then lim
t
e
rt
= 0
if = 0, then e
rt
does not decay to 0, and does not explode, but rather oscillates,
with |e
rt
| = 1 for all t
if > 0, then lim
t
|e
rt
| =
When all of the roots of the chracteristic polynomial are distinct, all homogeneous solu-
tions are of the form e
rt
where r is a root of the characteristic polynomial. Therefore, we
see that the roots of the characteristic polynomial determine the qualitative nature of the
homogeneous solutions.
If the characteristic polynomial has a root r
p
of multiplicity l
p
1, then according to Eq.
(4.9), the homogeneous solution modes associated the root r
p
are
e
rpt
, t e
rpt
, , t
(lp1)
e
rpt
.
Notice that for any real constants m < , and < 0,
lim
t
t
m
e
t
= 0 .
Therefore, the real part of the repeated root r
p
, namely
p
, also determines the qualitative
behavior of the homogeneous solution modes associated with this repeated root as t .
Specically,
if
p
< 0, then lim
t
t
m
e
rpt
= 0 for m = 0, l
p
1.
if
p
= 0, then |e
rpt
| = 1 for all t, but
if
p
0, then lim
t
|t
m
e
rt
| = for m = 1, l
p
1
where l
p
1 is the multiplicity of the root r
p
.
We summarize all of these results as follows:
If all of the roots, {r
i
}
n
i=1
, of the characteristic polynomial satisfy
Real(r
i
) < 0
then every homogeneous solution decays to 0 as t .
If any of the roots, {r
i
}
n
i=1
, of the characteristic polynomial satisfy
Real(r
i
) 0
then there are homogeneous solutions that do not decay to 0 as t .
ME 132, Fall 2012, UC Berkeley, F. Borrelli 60
6 Response of stable system to constant input (Steady-State Gain)
Suppose the system (input u, output y) is governed by the SLODE
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n1
y
[1]
(t) +a
n
y(t)
= b
0
u
[n]
(t) +b
1
u
[n1]
(t) + +b
n1
u
[1]
(t) +b
n
u(t)
Suppose initial conditions for y are given, and that the input u is specied to be a constant,
u(t) u for all t t
0
. What is the limiting behavior of y?
If the system is stable, then this is easy to compute. First notice that the constant function
y
P
(t)
bn
an
u is a particular solution, although it does not satisfy any of the initial conditions.
The actual solution y diers from this particular solution by some homogeneous solution,
y
H
. Hence for all t,
y(t) = y
P
(t) +y
H
(t)
=
b
n
a
n
u +y
H
(t)
Now, take limits, since we know (by the stability assumption) that lim
t
y
H
(t) = 0, giving
lim
t
y(t) =
b
n
a
n
u
Hence, the steady-state gain of the system is
b
n
a
n
.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 61
7 Example
Consider the dierential equation
y(t) + 4 y(t) +y(t) = 1 (4.12)
subject to the initial conditions y(0) = y
0
, y(0) = y
0
. The characteristic equation is
2
+
4 + 1 = 0, which has roots at
= 2

3 {3.7, 0.3}
Hence, all homogeneous solutions are of the form
y
H
(t) = c
1
e
3.7t
+c
2
e
0.3t
Terms of the form e
3.7t
take about 0.8 time units to decay, while terms of the form e
0.3t
take about 10 time units to decay. In general then (though not always - it depends on the
initial conditions) homogeneous solutions will typically take about 10 time units to decay.
A particular solution to (4.12) is simply y
P
(t) = 1 for all t 0. Note that this choice of y
P
does not satisfy the initial conditions, but it does satisfy the dierential equation.
As we have learned, all solutions to (4.12) are any particular solution plus all homogeneous
solutions. Therefore, the general solution is
y(t) = 1 +c
1
e
(2

3)t
+c
2
e
(2+

3)t
which has as its derivative
y(t) = (2

3)c
1
e
(2

3)t
+ (2 +

3)c
2
e
(2+

3)t
Evaluating these at t = 0, and equating to the given initial conditions yields
y(0) = 1 +c
1
+c
2
= y
0
y(0) =
_
2

3
_
c
1
+
_
2 +

3
_
c
2
= y
0
In matrix form, we have
_
1 1
2

3 2 +

3
_ _
c
1
c
2
_
=
_
y
0
1
y
0
_
This is easy to invert. recall
_
a b
c d
_
1
=
1
ad bc
_
d b
c a
_
ME 132, Fall 2012, UC Berkeley, F. Borrelli 62
Hence
_
1 1
2

3 2 +

3
_
1
=
1
2

3
_
2 +

3 1
2 +

3 1
_
so that
_
c
1
c
2
_
=
_
1 1
2

3 2 +

3
_
1
_
y
0
1
y
0
_
For the case at hand, lets take y
0
:= 0, y
0
:= 0, hence
_
c
1
c
2
_
=
1
2

3
_
2

3
2

3
_
A plot of y(t) is shown in the gure below.
0 5 10 15
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Time, t
R
e
s
p
o
n
s
e
,

y
(
t
)
Note that indeed, as we had guessed, the homogeneous solution (which connects the initial
values at t = 0 to the nal behavior at t takes about 10 time units to decay.
8 Stability Conditions for 2nd order dierential equation
Given real numbers a
0
, a
1
and a
2
, with a
0
= 0, we wish to determine if the roots of the
equation
a
0

2
+a
1
+a
2
= 0
have negative real parts. This question is important in determining the qualitative nature
(exponential decay versus exponential growth) of the homogeneous solutions to
a
0
y(t) +a
1
y(t) +a
2
y(t) = 0
ME 132, Fall 2012, UC Berkeley, F. Borrelli 63
Since a
0
= 0 (so that we actually do have a quadratic, rather than linear equation) divide
out by it, giving
y(t) +
a
1
a
0
y(t) +
a
2
a
0
y(t) = 0
Call b
1
:=
a
1
a
0
, b
2
:=
a
2
a
0
. The characteristic equation is
2
+b
1
+b
2
= 0. The roots are

1
=
b
1
+
_
b
2
1
4b
2
2
,
2
=
b
1

_
b
2
1
4b
2
2
Consider 4 cases:
1. b
1
> 0, b
2
> 0. In this case, the term b
2
1
4b
2
< b
2
1
, hence either

_
b
2
1
4b
2
is imaginary

_
b
2
1
4b
2
is real, but
_
b
2
1
4b
2
< b
1
.
In either situation, both Re(
1
) < 0 and Re(
2
) < 0.
2. b
1
0: Again, the square-root is either real or imaginary. If it is imaginary, then
Re(
i
) =
b
1
2
0. If the square-root is real, then then Re(
1
) =
b
1
+

b
2
1
4b
2
2
0. In
either case, at least one of the roots has a nonnegative real part.
3. b
2
0: In this case, the square root is real, and hence both roots are real. However,
_
b
2
1
4b
2
|b
1
|, hence
1
0. so one of the roots has a non-negative real part.
This enumerates all possibilities. We collect these ideas into a theorem.
Theorem: For a second order polynomial equation
2
+b
1
+b
2
= 0, the roots have negative
real parts if and only if b
1
> 0, b
2
> 0.
If the leading coecient is not 1, then we have
Theorem (RH2): For a second order polynomial equation b
0

2
+ b
1
+ b
2
= 0, the roots
have negative real parts if and only if all of the b
i
are nonzero, and have the same sign
(positive or negative).
WARNING: These theorems are not true for polynomials with order higher than 2. We
will study simple methods to determine if all of the roots have negative real parts later. For
instance;
Theorem (RH3): For a third order polynomial equation
3
+ b
1

2
+ b
2
+ b
3
= 0, all of
the roots have negative real parts if and only if b
1
> 0, b
3
> 0 and b
1
b
2
> b
3
.
Note that the condition b
1
b
2
> b
3
, coupled with the rst two conditions, certainly implies
that b
2
> 0. However, the simpler conditions {b
1
> 0, b
2
> 0, b
3
> 0} are only necessary, not
ME 132, Fall 2012, UC Berkeley, F. Borrelli 64
sucient, as an example illustrates: the roots of
3
+
2
++3 are {1.575, 0.2874 j1.35}.
So, use the exact conditions in theorem RH3 to determine the stability of a 3rd order system
by simple examination of its characteristic equation coecients.
Theorem (RH4): For a fourth order polynomial equation
4
+b
1

3
+b
2

2
+b
3
+b
4
= 0, all
of the roots have negative real parts if and only if b
1
> 0, b
4
> 0, b
1
b
2
> b
3
and (b
1
b
2
b
3
)b
3
>
b
2
1
b
4
.
These theorems are specic examples of the Routh-Hurwitz theorem which is often taught in
undergraduate control courses. The Routh-Hurwitz theorem, proven around 1880, indepen-
dently by Routh and Hurwitz, is interested in the determining if all roots of the polynomial
equation

n
+b
1

n1
+ +b
n1
+b
n
= 0
have negative real-parts. The theorem states that all roots have negative real parts if and
only if n simple inequalities, involving polynomial expressions of the coecients (the b
k
) are
satised. Note that the theorem does not nd the roots - it merely proves, unequivocally, that
the roots all lie in the open, left-half plane if and only if some easy-to-evaluate expressions,
involving the coecients, are negative. There is a pattern by which one can simply derive
what the polynomial inequalities are. The three theorems above (RH2, RH3, and RH4)
give the inequalities for n = 2, n = 3 and n = 4, respectively. As you notice, the conditions
become more complex with increasing order. For systems beyond 4th order, it is not clear how
useful (beyond the theoretical elegance) the formula are, especially in the context of modern
laptop computational power, where high-quality root-nding programs are easily accessible
(eg., Matlab, Mathematica, etc). We encourage the student to memorize the 2nd, 3rd and
4th order conditions and through their use, determine if knowing higher-order versions would
be useful. The interested student can nd more information about Routh-Hurwitz on the
web.
9 Important 2nd order example
It is useful to study a general second order dierential equation, and interpret it in a dierent
manner. Start with
y(t) +a
1
y(t) +a
2
y(t) = bv(t) (4.13)
with y(0) = 0, y(0) = 0 and v(t) = 1 for all t 0. Assume that the homogeneous solutions
are exponentially decaying, which is equivalent to a
1
, a
2
> 0. Rewrite using new variables
(instead of a
1
and a
2
) ,
n
as
y(t) + 2
n
y(t) +
2
n
y(t) = bv(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 65
where both ,
n
> 0. In order to match up terms here, we must have
2
n
= a
1
,
2
n
= a
2
which can be inverted to give
=
a
1
2

a
2
,
n
=

a
2
Note that since a
1
, a
2
> 0, we also have ,
n
> 0. With these new variables, the homoge-
neous equation is
y(t) + 2
n
y(t) +
2
n
y(t) = 0
which has a characteristic polynomial

2
+ 2
n
+
2
n
= 0
The roots are at
=
n

n
_

2
1
=
n
j
n
_
1
2
There are three cases to consider:
> 1: Roots are distinct, and both roots are real, and negative. The general homoge-
neous solution is most easily written in the form
y
H
(t) = c
1
e

n+n

2
1

t
+c
2
e

nn

2
1

t
= 1, which results in repeated real roots, at =
n
, so that the general form of
homogeneous solutions are
y
H
(t) = c
1
e
nt
+c
2
te
nt
0 < < 1: Roots are distinct, and complex (complex-conjugate pair), with negative
real part, and the general homogeneous solution is easily expressable as
y
H
(t) = c
1
e

n+jn

1
2

t
+c
2
e

njn

1
2

t
This can be rewritten as
y
H
(t) = e
nt
_
c
1
e
jn

1
2
t
+c
2
e
jn

1
2
t
_
Recall e
j
= cos +j sin . Hence
y
H
(t) = e
nt
_
c
1
cos
n
_
1
2
t + jc
1
sin
n
_
1
2
t
+c
2
cos
n
_
1
2
t jc
2
sin
n
_
1
2
t
_
which simplies to
y
H
(t) = e
nt
_
(c
1
+c
2
) cos
n
_
1
2
t + j(c
1
c
2
) sin
n
_
1
2
t
_
ME 132, Fall 2012, UC Berkeley, F. Borrelli 66
For a general problem, use the initial conditions to determine c
1
and c
2
. Usually, the initial
conditions, y(0), y(0), are real numbers, the dierential equation coecients (a
1
, a
2
or ,
n
)
are real, hence the solution must be real. Since cos
n
_
1
2
t and sin
n
_
1
2
t are
linearly independent functions, it will always then work out that
c
1
+c
2
= purely real
c
1
c
2
= purely imaginary
In other words, Im(c
1
) = Im(c
2
), and Re(c
1
) = Re(c
2
), which means that c
1
is the complex
conjugate of c
2
.
Under this condition, call c := c
1
. The homogeneous solution is
y
H
(t) = e
nt
_
2Re(c) cos
n
_
1
2
t 2Im(c) sin
n
_
1
2
t
_
Use A := 2Re(c), and B := 2Im(c), and the nal form of the real homogeneous solution is
y
H
(t) = e
nt
_
Acos
n
_
1
2
t + Bsin
n
_
1
2
t
_
A and B are two, free, real parameters for the real homogeneous solutions when 0 < < 1.
Of course, it is true that
n
is the real part of the roots, and
n
_
1
2
is the imaginary
part.
The solution is made up of two terms:
1. An exponentially decaying envelope, e
nt
. Note that this decays to zero in approxi-
mately
3
n
2. sinosoidal oscillation terms, sin
n
_
1
2
t and cos
n
_
1
2
t. The period of oscil-
lation is
2
n

1
2
.
Comparing these times, we expect alot of oscillations before the homogeneous solution
decays if
2

n
_
1
2
<<
3

n
Clearly
n
drops out of this comparison, and the above condition is equivalent to
2
3

_
1
2
<< 1
This quantity is very small if and only if is very small, in which case there are many
oscillations in the homogeneous solutions, and the system associated with the dierential
equation is called lightly damped. The quantity is called the damping ratio.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 67
If
2
3

1
2
<< 1, then homogeneous solutions look like
Typical Lightly Damped Response
Time
R
e
s
p
o
n
s
e
Conversely, if
2
3

1
2
>> 1, then then homogeneous solutions look like
Typical Heavily Damped Response
Time
R
e
s
p
o
n
s
e
A moderate value of , say 0.7 gives homogeneous responses that look like the gure
below.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 68
Typical Moderately Damped Response
Time
R
e
s
p
o
n
s
e
Another way to look at this is to consider the quotient
N :=
Time to decay
Period of oscillation
If N is 4, one would expect to see 4 periods of oscillation before the homogeneous solution
has signicantly decayed (since the time it takes to decay is about 4 periods). By contrast, if
N = 0.5, then one would expect to see about
1
2
of a period of oscillation before the solution
has decayed. We can compute N, in terms of and
n
, namely
N =
3
n
2

1
2
=
3
_
1
2
2
The quantity N is graphed, as a function of . Typical plots of homogeneous solutions are
plotted for 5 cases. The corresponding value of N matches quite nicely with the number of
visible oscillations in the solution.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 69
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
1
2
3
4
5
6
7
8
9
10

N

:
=

P
e
r
i
o
d
/
T
T
D
Finally, note that
n
enters y
H
very simply,
y
H
(t) = e
nt
_
Acos
n
_
1
2
t + Bsin
n
_
1
2
t
_
Note, everywhere
n
or t appear, they appear together in a term
n
t. Hence,
n
simply
scales the response y
H
(t) in t. The larger value of
n
, the faster the response.
For a constant input v(t) v, it is easy to write down a particular solution to
y(t) +a
1
y(t) +a
2
y(t) = bv(t)
Note that y
P
(t) =
b
a
2
v satises the dierential equation. Hence, the actual solution (which
must also satisfy the initial conditions) is of the form
b
a
2
v +e
nt
_
Acos
n
_
1
2
t + Bsin
n
_
1
2
t
_
where A and B are chosen suitably to satisfy the initial conditions. So, the homogeneous
solutions connect the initial conditions to the nal conditions. In this case,
lim
t
y(t) =
b
a
2
v, lim
t
y(t) = 0
Shown in Fig. 30 below are plots for b =
2
n
(so that a
2
= b), v = 1, with taking on values
between 0.1 and 10.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 70
0 1 2 3 4 5 6 7 8 9 10
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
Normalized time, w_n t
R
e
s
p
o
n
s
e
,

y
Step response of 2nd order system
Increasing
x
Figure 30: Step response of a second order system for varying values of damping ratio .
ME 132, Fall 2012, UC Berkeley, F. Borrelli 71
10 Problems
1. Consider the dierential equation
y(t) + 3 y(t) + 3y(t) = 0 (4.14)
Let y
H,1
(t) := 2e
t
e
2t
, and y
H,2
(t) := e
t
e
2t
.
(a) Compute y
H,1
(0) and y
H,1
(0). Plot y
H,1
(t) versus t. Show that the function y
H,1
satises the dierential equation in (4.14).
(b) Compute y
H,2
(0) and y
H,2
(0). Plot y
H,2
(t) versus t. Show that the function y
H,2
satises the dierential equation in (4.14).
(c) What is the solution to the ODE with initial conditions y(0) = 6, y(0) = 4?
2. Consider the example equation from Section 7, y(t) + 4 y(t) + y(t) = 1, with initial
conditions y(0) = y
0
, y(0) = v
0
. Consider all possible combinations of initial conditions
from the lists below:
y
0
= {2, 1, 0, 1, 2}
and
v
0
= {2, 1, 0, 1, 2}
(Now, do part (a) rst!)
(a) Note that without explicitly solving the dierential equation, one can easily com-
pute 4 things: limiting value of y (as t ), time constant of the slowest
homogeneous solution, initial value (given) and initial slope (given). With these
numbers, carefully sketch on graph paper how you think all 25 solutions will look.
(b) In the notes, the solution is derived for general initial conditions. Use Matlab (or
similar) to plot these expressions. Compare to your simplistic approximations in
part 2a.
3. The response (with all appropriate initial conditions set to 0) of the systems listed
below is shown. Match the ODE with the solution graph. Explain your reasoning.
(a) y(t) +y(t) = 1
(b) y(t) + 5y(t) = 5
(c) y(t) + 2 y(t) +y(t) = 1
(d) y(t) 2 y(t) y(t) = 1
(e) y(t) 2 y(t) + 9y(t) = 9
(f) y(t) + 0.4 y(t) +y(t) = 1
(g) y(t) + 0.12 y(t) + 0.09y(t) = 0.09
ME 132, Fall 2012, UC Berkeley, F. Borrelli 72
(h) y(t) + 11 y(t) + 10y(t) = 10
(i) y(t) + 0.3 y(t) + 0.09y(t) = 0.09
(j) y(t) + 3 y(t) + 9y(t) = 9
(k) y(t) + 4.2 y(t) + 9y(t) = 9
(l) y(t) + 0.2 y(t) +y(t) = 1
ME 132, Fall 2012, UC Berkeley, F. Borrelli 73
0 20 40 60 80 100
0
1
2
0 2 4 6
0
0.5
1
0 2 4 6
0
0.5
1
0 10 20 30
0
1
2
0 0.5 1 1.5
0
0.5
1
0 0.5 1 1.5 2 2.5
10
5
0
5
0 20 40 60
0
1
2
0 10 20 30 40
0
0.5
1
1.5
0 1 2 3
0
0.5
1
1.5
0 0.2 0.4 0.6 0.8 1
1.5
1
0.5
0
0 2 4 6
0
0.5
1
0 1 2 3 4
0
0.5
1
1.5
4. Consider the homogeneous dierential equation
y
[3]
(t) + 9 y(t) + 24 y(t) + 20y(t) = 0
(a) What is the characteristic polynomial of the ODE?
(b) What are the roots of the characteristic polynomial.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 74
(c) Write the general form of a homogeneous solution. Explain what are the free
parameters.
(d) Show, by direct substitution, that y
H
(t) = te
2t
is a solution.
(e) Show, by direct substitution, that y
H
(t) = t
2
e
2t
is not a solution.
(f) Find the solution which satises initial conditions y(0) = 3, y(0) = 1, y
[2]
(0) = 0.
(g) Find the solution which satises initial conditions y(0) = 3, y(0) = 1, y
[3]
(0) = 0.
5. Suppose a < 0, and consider the function te
at
for t 0.
(a) For what value of t does the maximum occur?
(b) At what value(s) of t is the function equal to 0.05 of its maximum value. For
comparison, recall that for the function e
at
, the function is equal to 0.05 of the
maximum value at about
3
a
.
6. (a) Suppose C and k 0 is an integer. Show that x(t) :=
1
k+1
t
k+1
e
t
is a
solution to the dierential equation
x(t) +x(t) = t
k
e
t
(b) Suppose y and z satisfy the dierential equations
z(t) +z(t) = y(t), y(t) +y(t) = 0
Eliminate y, and nd a 2nd-order dierential equation governing z
(c) Suppose q satises the dierential equation
q(t) + 2 q(t) +
2
q(t) = 0
Dene r(t) := q(t) + q(t). What dierential equation does r satisfy? Hint:
What is r(t) +r(t)
7. In section 9, we considered dierential equations of the form
y(t) +a
1
y(t) +a
2
y(t) = bv(t).
If a
1
> 0 and a
2
> 0, and a
1
< 2

a
2
, then we chose to write the solution in terms of
the (
n
, ) parameters, which are derived from a
1
and a
2
.
If the forcing function v is a constant, v(t) v, we derived that all particular solutions
are of the form
b
a
2
v +e
nt
_
Acos
n
_
1
2
t + Bsin
n
_
1
2
t
_
where A and B are free parameters.
Suppose the initial conditions are y(0) = y
0
and y(0) = y
0
. Find the correct values for
A and B so that the initial conditions are satised. Your answer should be in terms of
the given initial conditions, and system parameters (
n
, , b).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 75
8. Suppose that 0 < < 1, and > 0.
(a) What are the roots of the equation
s
2
+ 2
n
s +
2
n
= 0
(b) Let be the complex number
:=
n
+ j
n
_
1
2
(note that this is one of the roots you computed above). Show that || =
n
,
regardless of 0 < < 1.
(c) The complex number is plotted in the complex plane, as shown below.
E
T

e
e
e
e
Re
Im
C

Express sin in terms of and


n
.
9. The cascade of two systems is shown below. The relationship between the inputs and
outputs are given. Dierentiate and eliminate the intermediate variable v, obtaining a
dierential equation relationship between u and y.
S
1
S
2
E E E
u v
y
S
1
: v(t) +a
1
v(t) +a
2
v(t) = b
1
u(t) +b
2
u(t)
S
2
: y(t) +c
1
y(t) = d
1
v(t)
Repeat the calculation for the cascade in the reverse order, as shown below.
S
2
S
1
E E E
u v
y
S
1
: y(t) +a
1
y(t) +a
2
y(t) = b
1
v(t) +b
2
v(t)
S
2
: v(t) +c
1
v(t) = d
1
u(t)
10. Compute (by analytic hand calculation) and plot the solutions to the dierential equa-
tions below. Before you explicitly solve each dierential equation, make a table listing
each root of the characteristic equation
the damping ratio , and natural frequency
n
for each pair (if there is one) of
complex roots.
the nal value of y, ie., lim
t
y(t).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 76
for each case. For the plots, put both cases in part (a) on one plot, and put both cases
for part (b) on another plot.
(a) i.
d
3
dt
3
y(t) +
_
1 + 10

2
_
y(t) +
_
100 + 10

2
_
y(t) + 100y(t) = 100u(t), subject
to the initial conditions y(0) = y(0) = y(0) = 0, and u(t) = 1 for all t > 0.
Hint: One of the roots to the characteristic equation is 1. Given that you
can easily solve for the other two.
ii. y(t) +y(t) = u(t) subject to the initial conditions y(0) = 0, and u(t) = 1 for
all t > 0.
(b) i.
d
3
dt
3
y(t) + 10.6 y(t) + 7 y(t) + 10y(t) = 10u(t), subject to the initial conditions
y(0) = y(0) = y(0) = 0, and u(t) = 1 for all t > 0. Hint: One of the roots to
the characteristic equation is 10.
ii. y(t) +0.6 y(t) +y(t) = u(t), subject to the initial conditions y(0) = y(0) = 0,
and u(t) = 1 for all t > 0.
11. We have studied the behavior of the rst-order dierential equation
x(t) =
1

x(t) +
1

u(t)
v(t) = x(t)
which has a time-constant of , and a steady-state gain (to step inputs) of 1. Hence,
if is small, the output v of system follows u quite closely. For slowly-varying
inputs u, the behavior is approximately v(t) u(t).
(a) With that in mind, decompose the dierential equation in (10)(a)(i) into the
cascade of
i. a fast 2nd order system, with steady-state gain equal to 1
ii. slow rst order system whose steady-state gain is 1.
Is one of these decomposed systems similar to the system in (10)(a)(ii)? Are the
two plots in (10)(a) consistent with your decomposition?
(b) Do a similar decomposition for (10)(b)(i), and again think/comment about the
response of the 3rd order system in (10)(b)(i) and the 2nd order systems response
in (10)(b)(ii).
12. (a) Suppose is a xed real number. If p(s) is a nth order polynomial, with roots

1
,
2
, . . . ,
n
, what are the roots of the nth order polynomial g(s) dened by
g(s) := p(s )
(b) Do all of the roots of s
3
+ 7s
2
+ 22s + 16 have real parts less than 0?
(c) Do all of the roots of s
3
+ 7s
2
+ 22s + 16 real parts less than 1?
ME 132, Fall 2012, UC Berkeley, F. Borrelli 77
Summary for SLODEs
1 Main Results
SLODEs have the form
y
(n)
(t) +a
1
y
(n1)
(t) + +a
n
y(t) = bv(t) (4.15)
A key role is played by the roots r
1
, r
2
, . . . , r
n
of the polynomial equation

n
+a
1

n1
+ +a
n
= 0
This polynomial is called the characteristic polynomial associated with the dierential
equation.
If the {r
i
}
n
i=1
are all distinct from one another, then the homogenous solution y
H
is
y
H
(t) =
n

i=1
c
i
e
r
i
t
(4.16)
If the {r
i
}
n
i=1
are not distinct from one another, then the homogenous solution y
H
is
y
H
(t) =
f

i=1
l
i
1

j=0
c
ij
e
p
i
t
t
j
(4.17)
where we have grouped the roots {r
1
, r
2
, , r
n
} as
p
1
, p
1
, . . . , p
1
. .
l
1
, p
2
, p
2
, . . . , p
2
. .
l
2
, , p
f
, p
f
, . . . , p
f
. .
l
f
(4.18)
Hence, p
1
is a root with multiplicity l
1
, p
2
is a root with multiplicity l
2
and so on.
If the input u is constant (u(t) u for all t t
0
) and the system is stable, then a
particular solution is
y
P
(t) =
b
a
n
u
For stable systems lim
t
y
H
(t) = 0, and therefore since y(t) = y
P
(t) +y
H
(t)
lim
t
y(t) =
b
a
n
u
Hence, the steady-state gain of the system is
b
n
a
n
.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 78
2 General Solution Technique
1. Find any particular solution y
P
2. Choose constants c
ij
so that the function
y
P
(t) +
f

i=1
l
i
1

j=0
c
ij
t
j
e
p
i
t
satises the initial conditions.
The resulting function is the solution. Note that in step 2, there are n equations, and n
unknowns.
3 Behavior of Homogeneous Solutions as t
If all of the roots, {r
i
}
n
i=1
, of the characteristic polynomial satisfy
Real(r
i
) < 0
then every homogeneous solution decays to 0 as t (THE SYSTEM IS STA-
BLE)
If any of the roots, {r
i
}
n
i=1
, of the characteristic polynomial satisfy
Real(r
i
) 0
then there are homogeneous solutions that do not decay to 0 as t (THE
SYSTEM IS UNSTABLE)
For stable systems, the time constant T is
T =
1
min
i=1,...,n
|Real(r
i
)|
4 Stability of Polynomials
Theorem (RH2): For a second order polynomial equation b
0

2
+ b
1
+ b
2
= 0, the
roots have negative real parts if and only if all of the b
i
are nonzero, and have the same
sign (positive or negative).
Theorem (RH3): For a third order polynomial equation
3
+b
1

2
+b
2
+b
3
= 0, all
of the roots have negative real parts if and only if b
1
> 0, b
3
> 0 and b
1
b
2
> b
3
.
Theorem (RH4): For a fourth order polynomial equation
4
+b
1

3
+b
2

2
+b
3
+b
4
=
0, all of the roots have negative real parts if and only if b
1
> 0, b
4
> 0, b
1
b
2
> b
3
and
(b
1
b
2
b
3
)b
3
> b
2
1
b
4
.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 79
5 2nd order dierential equation
General form is
y(t) +a
1
y(t) +a
2
y(t) = bv(t) (4.19)
For stable systems (a
1
> 0, a
2
> 0), rewrite using new variables ,
n
as
y(t) + 2
n
y(t) +
2
n
y(t) = bv(t)
where both ,
n
> 0.
We have
2
n
= a
1
,
2
n
= a
2
which can be inverted to give
=
a
1
2

a
2
,
n
=

a
2
Note that since a
1
, a
2
> 0, we also have ,
n
> 0.
The characteristic polynomial

2
+ 2
n
+
2
n
= 0
The roots are at
=
n

n
_

2
1
=
n
j
n
_
1
2
6 Solutions of 2nd order dierential equation
> 1: Roots are distinct, and both roots are real, and negative.
y
H
(t) = c
1
e

n+n

2
1

t
+c
2
e

nn

2
1

t
Settling time (Time to decay)=
3
|n+n

2
1|
= 1: Roots are repeated real at =
n
,
y
H
(t) = c
1
e
nt
+c
2
te
nt
Settling time (Time to decay)=
3
n
ME 132, Fall 2012, UC Berkeley, F. Borrelli 80
0 < < 1: Roots are distinct, and complex (complex-conjugate pair), with negative
real part
y
H
(t) = e
nt
_
Acos
n
_
1
2
t + Bsin
n
_
1
2
t
_
or equivalently
y
H
(t) = e
nt
_
_
(A
2
+B
2
) sin(
n
_
1
2
t +)
_
where = atan(A/B)
Settling time (Time to decay)=
3
n
The period of oscillation =
2
n

1
2
.
The number of oscillations that can be observed (during the settling time) is
N :=
Time to decay
Period of oscillation
=
3
_
1
2
2
Everywhere
n
appears together in a term
n
t. Hence,
n
simply scales the
response y
H
(t) in t. The larger value of
n
, the faster the response.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 81
5 Derivatives on the inputs: Eect on the forced re-
sponse
1 Introduction
Consider the bicycle diagram shown in Figure 31, where the input to the system is the
stearing angle u = and the output is the roll angle y = . We can obtain the dynamical
Figure 31: Parameters dening the bicycle geometry. The points P
1
and P
2
are the contact
points of the wheels with the ground, a is the distance from a vertical line through the center
of mass to P
1
, b is the wheel base, h is the height of the center of mass, is the steer angle,
and is the roll angle.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 82
equation of the bicycle by summing the tourques acting on the system (due to gravity, and
centrifugal forces). The momentum balance becomes
y
g
h
y =
aV
bh
u +
V
2
bh
u (5.1)
where V is the velocity of the bicycle. We can notice in (5.1) that the rst-order derivative u
of the input u(t) appears in the right-hand side of the dierential equation. Suppose that we
are given initial conditions y
0
and y
0
, and are asked to compute the response to a unit-step
input, applied just after the system is released from the initial conditions. Note that the
input is not dierentiable at t = 0, and hence the right-hand side of the dierential equation
is not well dened. How do we get a solution in that case? In order to study this, we rst
consider particular solutions to a special class of nonconstant forcing functions.
2 Other Particular Solutions
We have already seen that the dierential equation
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n1
y(t) +a
n
y(t) = 1
has a particular solution y
P
(t) =
1
an
for all t. Recall that all particular solutions can be
generated by adding all homogeneous solutions to any one particular solution.
What about a particular solution to the equation
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n1
y(t) +a
n
y(t) =
0
+
1
t
where
0
and
1
are some xed constants. If we dierentiate both sides, we see that a
particular solution is y taking a constant value, and hence we guess that there is a particular
solution of the form
y
P
(t) = t +
for some proper choice of constants and . Indeed, note that y
P
= , and all higher order
derivatives are identically zero. Plugging in, and equating gives
a
n1
+a
n
(t +) =
0
+
1
t
which must hold for all t. This gives
a
n1
+a
n
=
0
, a
n
=
1
which can be easily solved, yielding
=

1
a
n
, =

0
a
n1

a
n
This approach is easy to generalize for forcing functions of the form

n
k=0

k
t
k
.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 83
3 Limits approaching steps
Return to the original problem, which is computing the step-response of
y(t) +a
1
y(t) +a
2
y(t) = b
1
u(t) +b
2
u(t) (5.2)
subject to initial conditions y(0) = Y
0
, y(0) =

Y
0
, and the input u(t) = (t).
We begin with a simpler problem, which avoids the dierentiability problems of the unit
step function. For each > 0, dene a function

as

(t) :=
_
_
_
0 for t < 0
1

t for 0 t <
1 for t
Note that this is continuous, and piecewise dierentiable, with derivative

(t) =
_
_
_
0 for t < 0
1

for 0 < t <


0 for < t
We want to determine the solution of the dierential equation (5.2) subject to initial con-
ditions y(0) = Y
0
, y(0) =

Y
0
, and the input u(t) =

(t). Let the solution be denoted by


y

(t).
We break the problem into 2 time intervals: (0 ) and ( ).
Over the rst interval, (0 ), we explicitly compute the solution in the standard manner,
nding a particular solution, and then adding in the appropriate homogeneous solution
to match up the initial conditions at 0.
Over the second interval, we follow the same procedure (since the qualitative behavior
of the right-hand-side of the dierential equation is dierent in this time interval, we
need to start with a new particular solution), last values (ie., the values at t = ) of
the solution obtained in the rst interval as initial conditions.
In order to achieve our original objective (response due to unit-step), after completing the
solution in the rst interval, we take the limit as 0 in order to compute the initial
conditions for the second interval.
Reiterating we want to determine properties of the solution at t = , in particular we want
to determine y

(), and y

(), and then take the limit as 0 (ie., as the input function
becomes more and more like a unit-step). We will denote these values as y(0
+
) and y(0
+
);
the values of y and y, just after the step change occurs. They become the initial conditions
for the solution after the inputs step change has taken place.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 84
During the interval (0, ), the right-hand side of (5.2) is well dened, and is
b
1
u(t) +b
2
u(t) =
b
2

t +
b
1

A particular solution (using the method we derived in Section 2) is y


P
(t) = t +, where
=
b
2
a
2

, =
b
1
a
2
a
1
b
2
a
2
2

Let
1
,
2
be the roots of the characteristic polynomial,

2
+a
1
+a
2
= 0
For now, lets assume that they are distinct (you could rework what we do here for the case
when they are not distinct - it all works out the same). For a later calculation, please check
that a
1
=
1

2
, and a
2
=
1

2
. Hence, the solution to the dierential equation for t > 0
must be
y

(t) = t + +c
1
e

1
t
+c
2
e

2
t
(5.3)
where c
1
and c
2
are uniquely chosen to satisfy the initial conditions y

(0) = Y
0
, y

(0) =

Y
0
.
Dierentiating gives that
y

(t) = +c
1

1
e

1
t
+c
2

2
e

2
t
(5.4)
Satisfying the initial conditions at t = 0 gives conditions that the constants c
1
and c
2
must
satisfy
_
1 1

1

2
_ _
c
1
c
2
_
=
_
Y
0

Y
0

_
which can be solved as
_
c
1
c
2
_
=
1

1
_

2
1

1
1
_ _
Y
0

Y
0

_
In terms of c
1
and c
2
, the value of y

and y

at t = are (using equations (5.3 and 5.4))


_
y

()
y

()
_
=
_
e

1
e

2
e

_ _
c
1
c
2
_
+
_
+

_
Substituting, gives
_
y

()
y

()
_
=
1

1
_
e

1
e

2
e

_ _

2
1

1
1
_ _
Y
0

Y
0

_
+
_
+

_
Rearranging gives
_
y

()
y

()
_
=
1

1
_

2
e

1
e

1
_
e

_

2
e

1
e

_ _
Y
0

Y
0

_
+
_
+

_
ME 132, Fall 2012, UC Berkeley, F. Borrelli 85
For notational purposes, let
M

:=
1

1
_

2
e

1
e

1
_
e

_

2
e

1
e

_
Then, we have
_
y

()
y

()
_
= M

_
Y
0

Y
0

_
+
_
+

_
This is further manipulated into
_
y

()
y

()
_
= M

_
Y
0

Y
0
_
+
_
M

+
_
1
0 1
___

_
But recall, and depend on , so that should be substituted,
_
y

()
y

()
_
= M

_
Y
0

Y
0
_
+
1

_
M

+
_
1
0 1
__
_
b
1
a
2
a
1
b
2
a
2
2
b
2
a
2
_
Note that
lim
0
M

= I
2
and using LHospitals rule,
lim
0
1

_
M

+
_
1
0 1
__
=
_
0 0

1

2

1
_
=
_
0 0
a
2
a
1
_
Hence,
_
y(0
+
)
y(0
+
)
_
:= lim
0,>0
_
y

()
y

()
_
=
_
Y
0

Y
0
+b
1
_
In summary, suppose the input waveform is such that the right-hand side (ie., forcing func-
tion) of the dierential equation has singularities at certain discrete instants in time. Between
those instants, all terms of the dierential equation are well behaved, and we solve it in the
classical manner. However, at the instants of the singularity, some specic high order deriva-
tive of y experiences a discontinuity in its value, and the discontinuity can be determined
from the dierential equation. Essentially, we get new initial conditions for the dieren-
tial equation just after the singularity in terms of the solution of the ODE just before the
singularity and the ODE itself.
We have seen that the values of y and y at a time just before the input singularity are related
to the values of y and y just after the singularity.
In the next section we learn some tricks that allow us to redo this type of calculation for
general systems (not just second order). Distributions are mathematical constructions that,
ME 132, Fall 2012, UC Berkeley, F. Borrelli 86
in a rigorous manner, allow us to repeat the rigorous calculation we just did in this section
in a less tedious fashion.
Another point to notice: this calculation shows that the term b
1
u(t), which appears on the
right-hand side of the ODE in equation (5.2) plays a role in the solution. So, both the
left and right sides of an input/output ODE have qualitative and quantitative eects of the
solution. We will formalize this as we proceed...
4 Problems
1. Consider the dierential equation
y(t) + 4 y(t) + 3y(t) = b
1
u(t) + 3u(t),
subject to the forcing function u(t) := (t), and initial conditions y(0

) = 0, y(0

) = 0.
(a) Determine:
the conditions of y (and y) at t = 0
+
,
the roots of the homogeneous equation (and their values of and
n
if com-
plex)
the nal value, lim
t
y(t).
Some of these will be dependent on the parameter b
1
.
(b) Based on your answers, sketch a guess of the solution for 8 cases:
b
1
= 6, 3, 0.3, 0.03, 0.03, 0.3, 3, 6.
Sketch them on the same axes.
(c) Determine the exact solution (by hand). Do as much of this symbolically as you
can (in terms of b
1
) so that you only need to the majority of the work once, and
then plug in the values of b
1
several times. Use the plot command in MatLab
(or other) to get a clean plot of the solution y(t) from 0
+
to some suitable nal
time. Plot them on the same graph.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 87
6 Distributions
In this section we learn some tricks that allow us to redo the calculation in the previous
section for general systems (not just second order). Distributions are mathematical con-
structions that, in a rigorous manner, allow us to repeat the rigorous calculation we just did
in section 5 in a less tedious fashion.
1 Introduction
Recall our goal: determine the response of
y
[n]
(t) +a
1
y
[n1]
(t) +a
2
y
[n2]
(t) + +a
n
y(t) =
b
0
u
[n]
(t) +b
1
u
[n1]
(t) +b
2
u
[n2]
(t) + +b
n
u(t)
(6.1)
subject to u(t) = (t) (a unit step at t = 0) and initial conditions y(0

) = y
[0]
0
, y
[1]
(0

) =
y
[1]
0
, y
[2]
(0

) = y
[2]
0
, . . . , y
[n1]
(0

) = y
[n1]
0
. Here 0

refers to the time just before the unit-


step input is applied. So, the system is placed in initial conditions, and released, the release
time being denoted 0

. At that instant, the inputs value is 0, so u(0

) = 0. An innitesimal
time later, at 0
+
, the input value is changed to +1. The input is actually at unit-step at
t = 0, and the initial conditions are known just before the step-input is applied.
The diculty is that the right-hand side of (6.1) is not classically dened, since u is not
dierentiable. However, we may obtain the solution by considering a sequence of problems,
with smooth approximations to the unit step, and obtain the solution as a limiting process.
Such a procedure goes as follows:
1. Dene a n-times dierentiable family of functions

that have the property

(t) =
_
0 for t < 0
1 for t >
and which converge to the unit step as 0.
2. Compute solution y

(t) to the dierential equation


y
[n]
(t) +a
1
y
[n1]
(t) +a
2
y
[n2]
(t) + +a
n
y(t) =
b
0
u
[n]
(t) +b
1
u
[n1]
(t) +b
2
u
[n2]
(t) + +b
n
u(t)
subject to the forcing function u(t) =

(t) and initial conditions y(0) = y


[0]
0
, y
[1]
(0) =
y
[1]
0
, y
[2]
(0) = y
[2]
0
, . . . , y
[n1]
(0) = y
[n1]
0
.
3. Look at the values of y

(), y

(), y

() . . . , y
[n1]

(). Take the limit as 0, and get


a relationship between the values of y, y, y, . . . , y
[n1]
at t = 0

and t = 0
+
.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 88
4. For t > 0, the right hand side of the ODE in (6.1) is well dened (in fact, its a constant,
b
n
), and the solution can be determined from nding any particular solution, and
combining with the family of homogeneous solutions to correctly match the conditions
at t = 0
+
.
This procedure is tedious, though the following can be proven:
1. It gives the correct answer for the solution of the ODE subject to the unit step input
2. The nal answer for the limits y
[k]

() as 0 are the same regardless of the form of

, as long as it satises the properties given.


Moreover, you can accomplish this in an easier fashion by using generalized functions, called
distributions.
The most common distribution that is not a normal function is the Dirac- function. To
gain intuition about this, consider an -approximation to the unit-step function of the form

(t) =
_
_
_
0 for t < 0
1

t for 0 < t <


1 for t 1
The derivative of this is
d
dt

(t) =
_
_
_
0 for t < 0
1

for 0 < t <


0 for t 1
Call this function

. Note that for all values of > 0,


_

(t)dt = 1
and that for t < 0 and t > ,

(t) = 0. Moreover, for any continuous function f


lim
0
_

f(t)

(t)dt = f(0)
and for any t = 0, lim
0

(t) = 0. Hence, in the limit we can imagine a function whose


value at nonzero t is 0, whose value at t = 0 is undened, but whose integral is nite, namely
1.
Now, we can start another level smoother. Let

be dened as

(t) :=
_

_
0 for t < 0
t

2
for 0 < t <
2t

2
for < t < 2
0 for 2 < t
ME 132, Fall 2012, UC Berkeley, F. Borrelli 89
Note that independent of we have
_

(t)dt = 1
and for any t = 0, lim
0

(t) = 0. The derivative is well dened, and satises


d

dt
=
_

_
0 for t < 0
1

2
for 0 < t <

2
for < t < 2
0 for t > 2
Note that for any continuous function f, we have
lim
0
_

f(t)

(t)dt = f(0)
and for any dierentiable function f, we have
lim
0
_

f(t)
d

dt
dt =

f(0)
and
lim
0
_

dt

dt =
In the limit, we get an even more singular function,

(or
[1]
), which has the property that
it is zero for all nonzero t, not well dened for t = 0, and even the integral of the absolute
value is not well dened.
If we start with a smoother (quadratics) version of

, then we can dierentiate twice, getting

and

, and look at their limiting behavior. Starting still smoother, we can continue the
process, generating a collection of singular functions,
[k]
, dened formally as

[0]
(t) := (t) :=
d
dt
,
[k]
(t) =
d
[k1]
dt
As we have seen in the rst few, each
[k]
is more singular than the preceeding one,
[k1]
.
Hence, there is no manner in which several lower order derivatives of -functions can be
linearly combined to represent a -function of higher order. In other words, the derivatives
of functions are a linearly independent set.
2 Procedure to get step response
Consider our general system dierential equation (6.1), and suppose that u(t) = (t). Then,
the highest order singularity in the right-hand side is associated with the u
[n]
term, which
ME 132, Fall 2012, UC Berkeley, F. Borrelli 90
has
[n1]
. Hence, this is the highest order singularity which must occur on the left-hand
side. If this order singularity occurs in any of the terms y, y, . . . , y
[n1]
, then additional
dierentiation will yield a higher order singularity in the y
[n]
term, which is not possible.
Hence, the only term on the left-hand side with
[n1]
is y
[n]
. This suggests that y
[n]
is of the
form
y
[n]
= e
1

[n1]
+e
2

[n2]
+ +e
n
+e
n+1
+f
n
where f
n
is a continuous function, and the constants e
1
, e
2
, . . . , e
n+1
need to be determined.
Note that if this is the form of the nth derivative of y, then there are constraints on the
lower order derivatives of y as well. Integrating, we get
y
[n]
= e
1

[n1]
+ e
2

[n2]
+ + e
n
+ e
n+1
+ f
n
y
[n1]
= e
1

[n2]
+ + e
n1
+ e
n
+ f
n1
.
.
.
y
[1]
= e
1
+ e
2
+ f
2
y
[0]
= + e
1
+ f
1
where each of the f
i
are continuous functions. Plugging into the ODE, and equating the
dierent singularities gives n equations in n unknowns, expressed in matrix form below
_

_
1 0 0 0
a
1
1 0 0
a
2
a
1
1 0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
a
n1
a
n2
a
1
1
_

_
_

_
e
1
e
2
e
3
.
.
.
e
n
_

_
=
_

_
b
0
b
1
b
2
.
.
.
b
n1
_

_
(6.2)
The matrix is always invertible, and the system of equations can be solved, yielding the e
vector. It is easy to see that it can be solved recursively, from e
1
through e
n
(and even e
n+1
)
as
e
1
= b
0
e
2
= b
1
a
1
e
1
e
3
= b
2
a
1
e
2
a
2
e
1
.
.
.
.
.
.
e
k
= b
k1
a
1
e
k1
a
2
e
k2
a
k1
e
1
The e vector gives the discontinuity in each derivative of y at t = 0, namely
y(0
+
) = y(0

) +e
1
y(0
+
) = y(0

) +e
2
y
[2]
(0
+
) = y
[2]
(0

) +e
3
.
.
.
.
.
.
.
.
.
y
[k]
(0
+
) = y
[k]
(0

) +e
k+1
.
.
.
.
.
.
.
.
.
y
[n1]
(0
+
) = y
[n1]
(0

) +e
n
ME 132, Fall 2012, UC Berkeley, F. Borrelli 91
Given these new initial conditions at t = 0
+
, we can combine the family of all homoge-
neous solutions, with one particular solution (for instance, y
P
(t)
bn
an
) to match the initial
conditions at t = 0
+
, completing our solution. You can/should write a general MatLab
function M-le to compute all of these quantities for given row vectors
A = [ 1 a
1
a
2
a
n1
a
n
] , B = [ b
0
b
1
b
2
b
n1
b
n
]
ME 132, Fall 2012, UC Berkeley, F. Borrelli 92
3 Problems
1. Consider a system with input u, and output y governed by the dierential equation
y(t) +a
1
y(t) = u(t) +b
1
u(t) (6.3)
Find the unit-step response with initial conditions y(0

) = 0. Compare to answer
(should be the same) as that obtained in problem 14 in section 7.
2. Consider
y
[3]
(t) + 3.8 y(t) + 6.8 y(t) + 4y(t) = b
2
u(t) + 3u(t)
subject to the forcing function u(t) := (t), and initial conditions y(0

) = 0, y(0

) =
0, y(0

) = 0. Follow the same instructions as in problem 1 in Section 5, handling the


7 cases
b
2
= 6, 3, 0.3, 0.03, 0.03, 0.3, 3, 6.
Since this is a higher order problem, you will need to also determine y(0
+
). Hint: One
of the roots of the characteristic equation is 1. Also, if you proceed symbolically, you
end up with the coecients of the homogeneous components being of the form
c = M
1
v(b
2
)
where M is a 3 3 matrix made up of the three roots of the characteristic polynomial,
and v is a 3 1 vector that depends on b
2
. On paper, leave it as that (dont bother
computing the inverse). Then, for each of the 6 cases, plug in a particular value for
b
2
, and let MatLab compute the coecients automatically. Set up your plotting script
le to accept a 3 1 vector of homogeneous coecients. In your solutions, include any
useful M-les that you write.
3. Consider the three dierential equations
y
[4]
(t) + 5.8y
[3]
(t) + 14.4 y(t) + 17.6 y(t) + 8y(t) = u(t)
y
[4]
(t) + 5.8y
[3]
(t) + 14.4 y(t) + 17.6 y(t) + 8y(t) = 2 u(t) + 2 u(t) +u(t)
y
[4]
(t) + 5.8y
[3]
(t) + 14.4 y(t) + 17.6 y(t) + 8y(t) = 2 u(t) 2 u(t) +u(t)
Suppose that each is subject to the forcing function u(t) := (t), and initial conditions
y(0

) = 0, y(0

) = 0, y(0

) = 0, y
[3]
(0

) = 0. Compute the roots (hint: one at 1,


one at 2), get nal value of y(t), compute new conditions of y (and derivatives) at
0
+
, and sketch solutions. Then, derive the exact expression for the solutions, and plot
using MatLab.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 93
Summary: Solution of SLODEs with Derivatives on the
inputs
Introduction
Goal: determine the response of
y
[n]
(t) +a
1
y
[n1]
(t) +a
2
y
[n2]
(t) + +a
n
y(t) =
b
0
u
[n]
(t) +b
1
u
[n1]
(t) +b
2
u
[n2]
(t) + +b
n
u(t)
(6.4)
subject to u(t) = (t) (a unit step at t = 0) and initial conditions y(0

) = y
[0]
0
, y
[1]
(0

) =
y
[1]
0
, y
[2]
(0

) = y
[2]
0
, . . . , y
[n1]
(0

) = y
[n1]
0
.
The time 0

refers to the time just before the unit-step input is applied.


The initial conditions are known just before the step-input is applied, i.e. time 0

.
An innitesimal time later, at 0
+
, the input value is changed to +1.
The diculty is that the right-hand side is not classically dened, since u is not dier-
entiable.
The solution can be obtained by considering a sequence of problems, with smooth
approximations to the unit step, and obtain the solution as a limiting process.
Main Concept for obtaining the solution
For > 0, dene a function

as

(t) :=
_
_
_
0 for t < 0
1

t for 0 t <
1 for t
Note that this is continuous, and piecewise dierentiable, with derivative

(t) =
_
_
_
0 for t < 0
1

for 0 < t <


0 for < t
Break the problem into 2 time intervals: (0 ) and ( ).
Over the rst interval, (0 ), compute the solution in the standard manner, nding a
particular solution, and then adding in the appropriate homogeneous solution to match
up the initial conditions at 0

.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 94
Over the second interval follow the same procedure starting from the values at t =
of the solution obtained in the rst interval as initial conditions.
Take the limit as 0 to compute the solution y(t) to the original problem.
Note that the solution of the rst interval will aect the initial conditions for the
second interval.
As 0 we are only interested in computing the new initial conditions, i.e., the values
of y and its derivatives just after the step change occurs (at time 0
+
).
Distributions
Denote the function

(t) dened above as

.
Note that for all values of > 0,
_

(t)dt = 1
and that for t < 0 and t > ,

(t) = 0.
Also, for any continuous function f
lim
0
_

f(t)

(t)dt = f(0)
and for any t = 0, lim
0

(t) = 0.
The function
(t) = lim
0

is the Dirac- function.


The function is equal to 0 at all times with the exception of t = 0. At t = 0 it is
undened, but the integral is nite, namely 1.
We proceed similarly and dene the rst derivative of the function (t), the second
derivative and so on..

[0]
(t) := (t) :=
d
dt
,
[k]
(t) =
d
[k1]
dt
ME 132, Fall 2012, UC Berkeley, F. Borrelli 95
The procedure
Consider our general system dierential equation
y
[n]
(t) +a
1
y
[n1]
(t) +a
2
y
[n2]
(t) + +a
n
y(t) =
b
0
u
[n]
(t) +b
1
u
[n1]
(t) +b
2
u
[n2]
(t) + +b
n
u(t)
(6.5)
and suppose that u(t) = (t).
By using distribution properties we can prove that y
[n]
is of the form
y
[n]
= e
1

[n1]
+e
2

[n2]
+ +e
n
+e
n+1
+f
n
(t)
where f
n
(t) is a continuous function, and the constants e
1
, e
2
, . . . , e
n+1
need to be
determined.
Integrating, we get
y
[n]
= e
1

[n1]
+ e
2

[n2]
+ + e
n
+ e
n+1
+ f
n
(t)
y
[n1]
= e
1

[n2]
+ + e
n1
+ e
n
+ f
n1
(t)
.
.
.
y
[1]
= e
1
+ e
2
+ f
2
(t)
y
[0]
= + e
1
+ f
0
(t)
where each of the f
i
(t) are continuous functions.
Since f
i
(t) are continuous functions, they are continuous at 0.
f
0
(0

) = f
0
(0
+
) = y(0

)
f
1
(0

) = f
1
(0
+
) = y(0

)
f
2
(0

) = f
2
(0
+
) = y(0

)
.
.
.
.
.
.
.
.
.
f
[n1]
(0

) = f
[n1]
(0
+
) = y
[n1]
(0

)
Therefore the e
i
give the discontinuity in each derivative of y at t = 0
+
:
y(0
+
) = y(0

) +e
1
y(0
+
) = y(0

) +e
2
y
[2]
(0
+
) = y
[2]
(0

) +e
3
.
.
.
.
.
.
.
.
.
y
[k]
(0
+
) = y
[k]
(0

) +e
k+1
.
.
.
.
.
.
.
.
.
y
[n1]
(0
+
) = y
[n1]
(0

) +e
n
ME 132, Fall 2012, UC Berkeley, F. Borrelli 96
Plugging into the ODE, and equating the dierent ,
[1]
, . . .,
[n1]
functions gives n
equations in n unknowns, expressed in matrix form below
_

_
1 0 0 0
a
1
1 0 0
a
2
a
1
1 0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
a
n1
a
n2
a
1
1
_

_
_

_
e
1
e
2
e
3
.
.
.
e
n
_

_
=
_

_
b
0
b
1
b
2
.
.
.
b
n1
_

_
(6.6)
The matrix is always invertible, and the system of equations can be solved, yielding
the e vector.
It is easy to see that it can be solved recursively, from e
1
through e
n
as
e
1
= b
0
e
2
= b
1
a
1
e
1
e
3
= b
2
a
1
e
2
a
2
e
1
.
.
.
.
.
.
e
k
= b
k1
a
1
e
k1
a
2
e
k2
a
k1
e
1
Compute the new initial conditions at t = 0
+
:
y(0
+
) = y(0

) +e
1
y(0
+
) = y(0

) +e
2
y
[2]
(0
+
) = y
[2]
(0

) +e
3
.
.
.
.
.
.
.
.
.
y
[k]
(0
+
) = y
[k]
(0

) +e
k+1
.
.
.
.
.
.
.
.
.
y
[n1]
(0
+
) = y
[n1]
(0

) +e
n
Given these new initial conditions at t = 0
+
, we can proceed with the solution of
y
[n]
(t) +a
1
y
[n1]
(t) +a
2
y
[n2]
(t) + +a
n
y(t) = b
n
u(t) (6.7)
with the initial conditions at 0
+
as shown in previous chapters.
Note that in MatLab one can compactly solve the e quantities by using the command
A\b where
A =
_

_
1 0 0 0
a
1
1 0 0
a
2
a
1
1 0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
a
n1
a
n2
a
1
1
_

_
, B = [ b
0
b
1
b
2
b
n1
b
n
]

ME 132, Fall 2012, UC Berkeley, F. Borrelli 97


7 Frequency Responses of Linear Systems
In this section, we consider the steady-state response of a linear system due to a sinusoidal
input. The linear system is the standard one,
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n1
y
[1]
(t) +a
n
y(t)
= b
0
u
[n]
(t) +b
1
u
[n1]
(t) + +b
n1
u
[1]
(t) +b
n
u(t)
(7.1)
with y the dependent variable (output), and u the independent variable (input).
Assume that the system is stable, so that the roots of the characteristic equation are in the
open left-half of the complex plane. This guarantees that all homogeneous solutions decay
exponentially to zero as t .
Suppose that the forcing function u(t) is chosen as a complex exponential, namely is a xed
real number, and u(t) = e
jt
. Note that the derivatives are particularly easy to compute,
namely
u
[k]
(t) = (j)
k
e
jt
It is easy to show that for some complex number H, one particular solution is of the form
y
P
(t) = He
jt
How? Simply plug it in to the ODE, leaving
H [(j)
n
+a
1
(j)
n1
+ +a
n1
(j) +a
n
] e
jt
= [b
0
(j)
n
+b
1
(j)
n1
+ + b
n1
(j) +b
n
] e
jt
For all t, the quantity e
jt
is never zero, so we can divide out leaving
H [(j)
n
+a
1
(j)
n1
+ +a
n1
(j) +a
n
]
= [b
0
(j)
n
+b
1
(j)
n1
+ +b
n1
(j) +b
n
]
Now, since the system is stable, the roots of the polynomial

n
+a
1

n1
+ +a
n1
+a
n
= 0
all have negative real part. Hence, = j, which has 0 real part, is not a root. Therefore,
we can explicitly solve for H as
H =
b
0
(j)
n
+b
1
(j)
n1
+ +b
n1
(j) +b
n
(j)
n
+a
1
(j)
n1
+ +a
n1
(j) +a
n
(7.2)
Moreover, since actual solution diers from this particular solution by some homogeneous
solution, we must have
y(t) = y
P
(t) +y
H
(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 98
In the limit, the homogeneous solution decays, regardless of the initial conditions, and we
have
lim
t
y(t) y
P
(t) = 0
Since y
P
is periodic, and y tends towards it asymptotically (the homogeneous solutions are
decaying), we call this specic particular solution the steady-state behavior of y, and denote
it y
ss
.
The explanation we have given was valid at an arbitrary value of the forcing frequency, .
The expression for H in (7.2) is still valid. Hence, we often write H() to indicate the
dependence of H on the forcing frequency.
H() :=
b
0
(j)
n
+b
1
(j)
n1
+ +b
n1
(j) +b
n
(j)
n
+ a
1
(j)
n1
+ +a
n1
(j) +a
n
(7.3)
This function is called the frequency response of the linear system in (7.1). Sometimes
it is referred to as the frequency response from u to y, written as H
uy
(). For stable
systems, we have proven for xed value u and xed
u(t) := ue
jt
y
ss
(t) = H() ue
jt
Note that H() = G(s)|
s=j
where G(s) is the transfer function of the SLODE (7.1). There-
fore
u(t) := ue
jt
y
ss
(t) = G(j) ue
jt
1 Complex and Real Particular Solutions
What is the meaning of a complex solution to the dierential equation (7.1)? Suppose that
functions u and y are complex, and solve the ODE. Denote the real part of the function u as
u
R
, and the imaginary part as u
I
(similar for y). Then u
R
and u
I
are real-valued functions,
and for all t u(t) = u
R
(t) +ju
I
(t). Dierentiating this k times gives
u
[k]
(t) = u
[k]
R
(t) +ju
[k]
I
(t)
Hence, if y and u satisfy the ODE, we have
_
y
[n]
R
(t) +jy
[n]
I
(t)
_
+a
1
_
y
[n1]
R
(t) +jy
[n1]
I
(t)
_
+ +a
n
[y
R
(t) +jy
I
(t)] =
= b
0
_
u
[n]
R
(t) +ju
[n]
I
(t)
_
+b
1
_
u
[n1]
R
(t) +ju
[n1]
I
(t)
_
+ +b
n
[u
R
(t) +ju
I
(t)]
But the real and imaginary parts must be equal individually, so exploiting the fact that the
coecients a
i
and b
j
are real numbers, we get
y
[n]
R
(t) +a
1
y
[n1]
R
(t) + +a
n1
y
[1]
R
(t) +a
n
y
R
(t)
= b
0
u
[n]
R
(t) +b
1
u
[n1]
R
(t) + + b
n1
u
[1]
R
(t) +b
n
u
R
(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 99
and
y
[n]
I
(t) +a
1
y
[n1]
I
(t) + +a
n1
y
[1]
I
(t) +a
n
y
I
(t)
= b
0
u
[n]
I
(t) +b
1
u
[n1]
I
(t) + +b
n1
u
[1]
I
(t) +b
n
u
I
(t)
Hence, if (u, y) are functions which satisfy the ODE, then both (u
R
, y
R
) and (u
I
, y
I
) also
satisfy the ODE.
2 Response due to real sinusoidal inputs
Suppose that H C is not equal to zero. Recall that H is the real number (unique to
within an additive factor of 2) which has the properties
cos H =
ReH
|H|
, sin H =
ImH
|H|
Then,
Re
_
He
j
_
= Re [(H
R
+jH
I
) (cos +j sin )]
= H
R
cos H
I
sin
= |H|
_
H
R
|H|
cos
H
I
|H|
sin
_
= |H| [cos H cos sin H sin ]
= |H| cos ( +H)
Im
_
He
j
_
= Im[(H
R
+jH
I
) (cos +j sin )]
= H
R
sin +H
I
cos
= |H|
_
H
R
|H|
sin +
H
I
|H|
cos
_
= |H| [cos H sin + sin H cos ]
= |H| sin ( +H)
Now consider the dierential equation/frequency response case. Let H() denote the fre-
quency response function. If the input u(t) = cos t = Re (e
jt
), then the steady-state
output y will satisfy
y(t) = |H()| cos (t +H())
A similar calculation holds for sin, and these are summarized below.
Input Steady-State Output
1 H(0) =
bn
an
cos(t) |H()| cos (t +H())
sin(t) |H()| sin (t +H())
Acos(t +) A|H()| cos (t + + H())
Asin(t +) A|H()| sin (t + +H())
or by using the transfer function G(s)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 100
Input Steady-State Output
1 G(0) =
bn
an
cos(t) |G(j)| cos (t +G(j))
sin(t) |G(j)| sin (t +G(j))
Acos(t +) A|G(j)| cos (t + + G(j))
Asin(t +) A|G(j)| sin (t + +G(j))
3 Problems
1. Write a Matlab function which has three input arguments, A, B and . A and B are
row vectors, of the form of the form
A = [a
0
a
1
a
2
a
n
] , B = [b
0
b
1
b
2
b
n
]
where a
0
= 0. These represent the input/output system
a
0
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n1
y
[1]
(t) +a
n
y(t)
= b
0
u
[n]
(t) +b
1
u
[n1]
(t) + +b
n1
u
[1]
(t) +b
n
u(t)
with y the dependent variable (output), and u the independent variable (input). is a
1-by-N vector of real frequencies. The function should return one argument, H, which
will be the same dimension as , but in general will be complex. The value of H(i)
should be the frequency-response function of the system above at frequency = (i).
2. Using the Matlab function from above, draw the Bode plot of the frequency response
function for the 3rd order system in problem 10(a)(i) in Section 10. On the same graph,
plot the frequency response function for the 1st order system in problem 10(a)(ii).
Comment on the similarities and dierences (eg., in what frequency ranges are they
appreciably dierent?; in the frequency ranges where they are dierent, what is the
magnitude of the response function as compared to the largest value of the response
magnitude?
3. Using the Matlab function from above, draw the Bode plot of the frequency response
function for the 3rd order system in problem 10(b)(i) in Section 10. On the same graph,
plot the frequency response function for the 2nd order system in problem 10(b)(ii).
Comment on the similarities and dierences (eg., in what frequency ranges are they
appreciably dierent?; in the frequency ranges where they are dierent, what is the
magnitude of the response function as compared to the largest value of the response
magnitude?
4. Suppose the ODE for a system is
y(t) + 2
n
y(t) +
2
n
y(t) =
2
n
u(t)
where u is the input, and y is the output. Assume that > 0 and
n
> 0.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 101
(a) Derive the frequency response function of the system. Let denote frequency,
and denote the frequency response function as H().
(b) What are |H()| and |H()|
2
. Is |H()| (or |H()|
2
) ever equal to 0?
(c) Work with |H()|
2
. By dividing numerator and denominator by
4
n
, derive
|H()|
2
=
1
_
1
_

n
_
2
_
2
+ 4
2
_

n
_
2
What is |H()| approximately equal to for for <<
n
? What is log |H()|
approximately equal to for for <<
n
?
(d) Work with |H()|
2
. By dividing numerator and denominator by
4
, derive
|H()|
2
=
_
n

_
4
_
_
n

_
2
1
_
2
+ 4
2
_
n

_
2
Using this, show that for >>
n
, |H()|
_
n

_
2
. As a function of log , what
is log |H()| approximately equal to for for >>
n
? Specically, show that for
>>
n
,
log |H()| 2 log
n
2 log
(e) What is H() for <<
n
?
(f) What is H() for >>
n
?
(g) What are |H()| and H() for =
n
?
(h) For a general function F() that is never 0, show that
d
d
|F()| = 0 at exactly
the same values of as when
d
d
|F()|
2
= 0.
(i) Find the frequencies (real numbers) where
d
d
|H()| = 0.
(j) Show that if <
1

2
, then the maximum of |H()| occurs at a non-zero frequency.
Denote the critical frequency by
crit
, and show namely
crit
=
n
_
1 2
2
.
(k) Assuming that <
1

2
. Show that
|H(
crit
)| =
1
2
_
1
2
(l) Assuming that <
1

2
. Dene := H(
crit
). What is tan?
ME 132, Fall 2012, UC Berkeley, F. Borrelli 102
(m) On graph paper, carefully sketch in all of the derived properties for four cases,
= 0.2, 0.5, 0.7, 0.9 and (in all cases)
n
= 1. Your plots should have the axes
log |H()| versus log , and |H()| versus log . In this problem, you have
derived a few key features of the plots, but not the entire shape of the plot. Your
sketches should only include the facts that you have derived in this problem,
namely parts 4c-4l.
(n) Using Matlab, generate the complete magnitude and angle plots for the two cases
above. Plot them for the range [0.001 1000]. Verify that the actual plots
have all of the features that you derived and sketched in the previous part.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 103
8 Bode Plots
1 Problems
1. Graph paper, suitable for Bode plots, is provided at at BSPACE. In each problem label
all axis appropriately.
(a) Suppose H(s) =
1
s
, which is the transfer function of an integrator. For all > 0,
it is easy to see that
|H(j)| =
1

, H(j) =

2
Obviously log |H(j)| = log . Using these facts, draw a Bode plot of H for
varying from 0.001 to 1000.
(b) On the graph paper provided, sketch the Bode plot of
C(s) =
s +z
s
for 3 values of z = 0.02, 0.07, 0.2. Use the straight-line rules developed in class.
Note that |C(j)| >> 1 for << z, and that C(j) 1 for >> z.
(c) On the graph paper provided, sketch the Bode plot of
F(s) =
1
s + 1
for 3 values of = 0.02, 0.07, 0.2. Use the straight-line rules developed in class.
Note that |F(j)| << 1 for >>
1

, and that F(j) 1 for <<


1

.
(d) On the graph paper provided, sketch the Bode plot of C(s)F(s) as described
above, with z = 0.2 and = 0.2.
2. We have talked about sensor noise extensively, but have not done much with regard
to simulations (numerical solutions to the ODEs). In this problem, we learn how the
command lsim can be used to compute the response of a system (described by its
transfer function) to any specied input.
Described a system by specifying its transfer function, for example
>> G = tf(1,[0.1 1]); % time constant 0.1
>> H = tf(1,[1.0 1]); % time constant 1.0
Create an evenly-space vector of times, TVEC, using (for example) linspace. Make
the vector a column vector (the command lsim is forgiving, and a row-vector
works as well).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 104
>> TVEC = linspace(0,10,100);
Create a column vector of signal values, UVAL, which are the corresponding values
of the forcing function at the times specied in TVEC. In this example, we will
make a random input, using RANDN. This signal is typical of what we refer to as
noise. It is a random function of time.
>> UVALS = randn(100,1);
>> plot(TVEC,UVALS); % the constructed input-signal
Call LSIM, and plot the results.
>> Yg = lsim(G,UVALS,TVEC);
>> Yh = lsim(H,UVALS,TVEC);
>> plot(TVEC,Yg,r,TVEC,Yh,g);
Note that the fast system (G, with time-constant 0.1) responds to the input signal
more than the slow system (H,with time-constant 1.0). This is consistent with Bode
magnitude plots of G and H, which shows that G responds more to high-frequency
signals than does H (and both respond equally to low-frequency signals).
3. This problem builds on the ideas from problems 1 and 2. Consider the feedback
architecture of Section A with a two simplications: Let S = 1, and assume the
disturbance d enters directly (no H), but enters at the input to the plant G. The
plant model is
G(s) =
1
s
There are two controllers to consider
C
1
(s) = 1, C
2
(s) =
s + 0.2
s
and two lters to consider
F
1
(s) = 1, F
2
(s) =
1
0.2s + 1
We will consider two closed-loop systems: System #1 with (G, C
1
, F
1
) and System #2
with (G, C
2
, F
2
). For ease of notation, these are referred to as S
1
and S
2
.
(a) Using Matlab, draw the Bode (magnitude and phase) plot of the transfer function
from R Y for both S
1
and S
2
. Put both lines on the same axes. Use the
command bode.
(b) Using Matlab, draw the Bode (magnitude only) plot of the transfer function from
D Y for both S
1
and S
2
. Put both lines on the same axes. Use the command
bodemag.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 105
(c) Using Matlab, draw the Bode (magnitude only) plot of the transfer function from
N Y for both S
1
and S
2
. Put both lines on the same axes. Use the command
bodemag.
(d) Using Matlab, draw the time-response of y due to a unit-step in r for both S
1
and
S
2
. Put both lines on the same axes. You can use the command step.
(e) Using Matlab, draw the time-response of y due to a unit-step in d for both S
1
and S
2
. Put both lines on the same axes. You can use the command step.
(f) Using Matlab, draw the time-response of y due to a random-input in n for both S
1
and S
2
. Put both lines on the same axes, using a dierent color for the dierent
systems outputs. You can use the command lsim. Create the random input
using the method in problem 2, using 200 by 1 randomly generated vector on
the time interval [0 10]. Use a for-loop, and hold on, and repeat this simulation
5 times, placing all plots on the same axes.
(g) Carefully explain, in each case (r y, d y, n y) how the relationship
between the Bode plots is consistent with the relationship of the time-response
plots. The r y is somewhat dicult to draw distinctions as both the Bode plots
and time-responses look quite similar (this is somewhat the point), although the
eect that d and n have on y are dierent in the two cases.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 106
9 Transfer functions
Associated with the linear system (input u, output y) governed by the ODE
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n1
y
[1]
(t) +a
n
y(t)
= b
0
u
[n]
(t) +b
1
u
[n1]
(t) + +b
n1
u
[1]
(t) +b
n
u(t)
(9.1)
we write in transfer function form
Y =
b
0
s
n
+b
1
s
n1
+ +b
n1
s +b
n
s
n
+ a
1
s
n1
+ +a
n1
s +a
n
U (9.2)
The expression in (9.2) is interpreted to be equivalent to the ODE in (9.1), just a dierent
way of writing the coecients. The notation in (9.2) is suggestive of multiplication, and we
will see that such an interpretation is indeed useful. The function
G(s) :=
b
0
s
n
+b
1
s
n1
+ +b
n1
s +b
n
s
n
+a
1
s
n1
+ +a
n1
s +a
n
is called the transfer function from u to y, and is sometimes denoted G
uy
(s) to indicate
this. At this point, the expression in equation (9.2),
Y = G
uy
(s)U
is nothing more than a new notation for the dierential equation in (9.1). The dif-
ferential equation itself has a well-dened meaning, and we understand what each term/symbol
(derivative, multiplication, sum) represents, and the meaning of the equality sign, =. By
contrast, in the transfer function expression, (9.2), there is no specic meaning to the individ-
ual terms, or the equality symbol. The expression, as a whole, simply means the dierential
equation to which it is associated.
Nevertheless, in this section, we will see that, in fact, we can assign proper equality, and
make algebraic substitutions and manipulations of transfer function expressions, which will
aid our manipulation of linear dierential equations. But all of that requires proof, and that
is the purpose of this section.
1 Linear Dierential Operators (LDOs)
Note that in the expression (9.2), the symbol s plays the role of
d
dt
, and higher powers of s
mean higher order derivatives, ie., s
k
means
d
k
dt
k
. If z is a function of time, let the notation
_
b
0
d
n
dt
n
+b
1
d
n1
dt
n1
+ +b
n1
d
dt
+b
n
_
(z) := b
0
d
n
z
dt
n
+b
1
d
n1
z
dt
n1
+ +b
n1
dz
dt
+b
n
z
ME 132, Fall 2012, UC Berkeley, F. Borrelli 107
We will call this type of operation a linear dierential operation, or LDO. For the purposes
of this section, we will denote these by capital letters, say
L :=
_
d
n
dt
n
+a
1
d
n1
dt
n1
+ +a
n1
d
dt
+a
n
_
R :=
_
b
0
d
n
dt
n
+b
1
d
n1
dt
n1
+ +b
n1
d
dt
+b
n
_
Using this shorthand notation, we can write the original ODE in (9.5) as
L(y) = R(u)
With each LDO, we naturally associate a polynomial. Specically, if
L :=
_
d
n
dt
n
+a
1
d
n1
dt
n1
+ +a
n1
d
dt
+a
n
_
then p
L
(s) is dened as
p
L
(s) := s
n
+a
1
s
n1
+ +a
n1
s +a
n
Similarly, with each polynomial, we associate an LDO if
q(s) := s
m
+b
1
s
m1
+ +b
m1
s +b
m
then L
q
is dened as
L
q
:=
_
d
m
dt
m
+ b
1
d
m1
dt
m1
+ +b
m1
d
dt
+b
m
_
Therefore, if a linear system is governed by an ODE of the form L(y) = R(u), then the
transfer function description is simply
Y =
p
R
(s)
p
L
(s)
U
Similarly, if the transfer function description of a system is
V =
n(s)
d(s)
W
then the ODE description is L
d
(v) = L
n
(w).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 108
2 Algebra of Linear dierential operations
Note that two successive linear dierential operations can be done in either order. For
example let
L
1
:=
_
d
2
dt
2
+ 5
d
dt
+ 6
_
and
L
2
:=
_
d
3
dt
3
2
d
2
dt
2
+ 3
d
dt
4
_
Then, on a dierentiable signal z, simple calculations gives
L
1
(L
2
(z)) =
_
d
2
dt
2
+ 5
d
dt
+ 6
_ __
d
3
dt
3
2
d
2
dt
2
+ 3
d
dt
4
_
(z)
_
=
_
d
2
dt
2
+ 5
d
dt
+ 6
_
_
z
[3]
2 z + 3 z 4z
_
= z
[5]
2z
[4]
+ 3z
[3]
4z
[2]
5z
[4]
10z
[3]
+ 15z
[2]
20z
[1]
6z
[3]
12z
[2]
+ 18z
[1]
24z
= z
[5]
+ 3z
[4]
z
[3]
z
[2]
2z
[1]
24z
which is the same as
L
2
(L
1
(z)) =
_
d
3
dt
3
2
d
2
dt
2
+ 3
d
dt
4
_ __
d
2
dt
2
+ 5
d
dt
+ 6
_
(z)
_
=
_
d
3
dt
3
2
d
2
dt
2
+ 3
d
dt
4
_
_
z
[2]
+ 5 z + 6z
_
= z
[5]
+ 5z
[4]
+ 6z
[3]
2z
[4]
10z
[3]
12z
[2]
z
[3]
+ 15z
[2]
+ 18z
[1]
4z
[2]
20z
[1]
24z
= z
[5]
+ 3z
[4]
z
[3]
z
[2]
2z
[1]
24z
This equality is easily associated with the fact that multiplication of polynomials is a com-
mutative operation, specically
(s
2
+ 5s + 6) (s
3
2s
2
+ 3s 4) = (s
3
2s
2
+ 3s 4) (s
2
+ 5s + 6)
= s
5
+ 3s
4
s
3
s
2
2s + 24
We will use the notation [L
1
L
2
] to denote this composition of LDOs. The linear dierential
operator L
1
L
2
is dened as operating on an arbitrary signal z by
[L
1
L
2
] (z) := L
1
(L
2
(z))
Similarly, if L
1
and L
2
are LDOs, then the sum L
1
+L
2
is an LDO dened by its operation
on a signal z as [L
1
+L
2
] (z) := L
1
(z) +L
2
(z).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 109
It is clear that the following manipulations are always true for every dierentiable signal z,
L(z
1
+z
2
) = L(z
1
) +L(z
2
)
and
[L
1
L
2
] (z) = [L
2
L
1
] (z)
In terms of LDOs and their associated polynomials, we have the relationships
p
[L
1
+L
2
]
(s) = p
L
1
(s) +p
L
2
(s)
p
[L
1
L
2
]
(s) = p
L
1
(s)p
L
2
(s)
In the next several subsections, we derive the LDO representation of an interconnection from
the LDO representation of the subsystems.
3 Feedback Connection
The most important interconnection we know of is the basic feedback loop. It is also the
easiest interconnection for which we derive the dierential equation governing the intercon-
nection from the dierential equation governing the components.
Consider the simple unity-feedback system shown below in Figure 32
S
Ed E E
T
r
u
y

+
Figure 32: Unity-Feedback interconnection
Assume that system S is described by the LDO L(y) = N(u). The feedback interconnection
yields u(t) = r(t) y(t). Eliminate u by substitution, yielding an LDO relationship between
r and y
L(y) = N(r y) = N(r) N(y)
This is rearranged to the closed-loop LDO
(L +D)(y) = N(r).
Thats a pretty simple derivation. Based on the ODE description of the closed-loop, we can
immediately write the closed-loop transfer function,
Y =
p
N
(s)
p
[L+N]
(s)
R
=
p
N
(s)
p
L
(s) +p
N
(s)
R.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 110
Additional manipulation leads to further interpretation. Let G(s) denote the transfer func-
tion of S, so G =
p
N
(s)
p
L
(s)
. Starting with the transfer function expression we just derived, we
can formally manipulate to an easily recognizable expression. Specically
Y =
p
N
(s)
p
L
(s) +p
N
(s)
R
=
p
N
(s)
p
L
(s)
1 +
p
N
(s)
p
L
(s)
R
=
G(s)
1 +G(s)
R
This can be interpreted rather easily. Based on the original system interconnection, redraw,
replacing signals with their capital letter equivalents, and replacing the system S with its
transfer function G. This is shown below.
S
Ed E E
T
r
u
y

+
G
Ed E E
T
R
U
Y

+
The diagram on the right is interpreted as a diagram of the equations U = R Y , and
Y = GU. Note that manipulating these as though they are arithmetic expressions gives
Y = G(R Y ) after substituting for U
(1 +G)Y = GR moving GY over to left hand side
Y =
G
1+G
R solving for Y.
This is is precisely what we want!
4 More General Feedback Connection
Consider the more general single-loop feedback system shown below. For diversity, well use
a positive-feedback convention here.
S
1
S
2
E E E
'
T
d
r
y
q
v
+
+
Assume that system S
1
is described by the LDO L
1
(y) = N
1
(u), and S
2
is governed by
L
2
(v) = N
2
(q). Note that by denition then, the transfer function descriptions of S
1
and S
2
ME 132, Fall 2012, UC Berkeley, F. Borrelli 111
are
Y =
p
N
1
p
L
1
..
:=G
1
U, V =
p
N
2
p
L
2
..
:=G
2
Q
The interconnection equations are u = r+v, and q = y. In order to eliminate v (for example),
rst substitute for u and q, leaving
L
1
(y) = N
1
(r +v) governing equation forS
1
L
2
(v) = N
2
(y) governing equation forS
2
Now apply L
2
to rst equation, and N
1
to second equation, yielding (after using the
notation for composing linear dierential operators),
L
2
L
1
(y) = L
2
N
1
(r) +L
2
N
1
(v)
N
1
L
2
(v) = N
1
N
2
(y)
The expressions involving v cancel, leaving
[L
2
L
1
N
1
N
2
] (y) = L
2
N
1
(r)
In transfer function terms, this is
Y =
p
L
2
N
1
p
L
2
L
1
N
1
N
2
R
which is easily rewritten as
Y =
p
L
2
p
N
1
p
L
2
p
L
1
p
N
1
p
N
2
R
But, again, this can be formally manipulated into a recognizable expression involving the the
individual transfer functions of S
1
and S
2
. Divide top and bottom of the transfer function
by p
L
1
p
L
2
, to give
Y =
p
L
2
p
N
1
p
L
2
p
L
1
1
p
N
1
p
N
2
p
L
2
p
L
1
R
=
G
1
1 G
2
G
1
R
Again, this can be interpreted rather easily. Based on the original system interconnection,
redraw, replacing signals with their capital letter equivalents, and replacing the systems S
i
with their transfer functions G
i
. This is shown below.
S
1
S
2
E E E
'
T
d
r
y
q
v
+
+
G
1
G
2
E E E
'
T
d
R Y
Q
V
+
+
ME 132, Fall 2012, UC Berkeley, F. Borrelli 112
The diagram on the right is interpreted as a diagram of the equations U = R G
2
Y , and
Y = G
1
U. Note that manipulating these as though they are arithmetic expressions gives
Y = G
1
(R G
2
Y ) after substituting for U
(1 G
1
G
2
)Y = G
1
R moving G
1
G
2
Y over to left hand side
Y =
G
1
1G
2
G
1
R solving for Y.
This is is precisely what we want!
5 Cascade (or Series) Connection
Suppose that we have two linear systems, as shown below,
S
1
S
2
E E E
u
y
v
with S
1
governed by
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n
y(t) = b
0
u
[n]
(t) +b
1
u
[n1]
(t) + +b
n
u(t)
and S
2
governed by
v
[m]
(t) +c
1
v
[m1]
(t) + +c
m
v(t) = d
0
y
[m]
(t) +d
1
y
[m1]
(t) + +d
m
y(t)
Let G
1
(s) denote the transfer function of S
1
, and G
2
(s) denote the transfer function of S
2
.
Dene the dierential operations
L
1
:=
_
d
n
dt
n
+a
1
d
n1
dt
n1
+ +a
n1
d
dt
+a
n
_
R
1
:=
_
b
0
d
n
dt
n
+b
1
d
n1
dt
n1
+ +b
n1
d
dt
+b
n
_
and
L
2
:=
_
d
m
dt
m
+c
1
d
m1
dt
m1
+ +c
m1
d
dt
+c
m
_
R
2
:=
_
d
0
d
m
dt
m
+d
1
d
m1
dt
m1
+ +d
m1
d
dt
+d
m
_
Hence, the governing equation for system S
1
is L
1
(y) = R
1
(u), while the governing equation
for system S
2
is L
2
(v) = R
2
(y). Moreover, in terms of transfer functions, we have
G
1
(s) =
p
R
1
(s)
p
L
1
(s)
, G
2
(s) =
p
R
2
(s)
p
L
2
(s)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 113
Now, apply the dierential operation R
2
to the rst system, leaving
R
2
(L
1
(y)) = R
2
(R
1
(u))
Apply the dierential operation L
1
to system 2, leaving
L
1
(L
2
(v)) = L
1
(R
2
(y))
But, in the last section, we saw that two linear dierential operations can be applied in any
order, hence L
1
(R
2
(y)) = R
2
(L
1
(y)). This means that the governing dierential equation
for the cascaded system is
L
1
(L
2
(v)) = R
2
(R
1
(u))
which can be rearranged into
L
2
(L
1
(v)) = R
2
(R
1
(u))
or, in dierent notation
[L
2
L
1
] (v) = [R
2
R
1
] (u)
In transfer function form, this means
V =
p
[R
2
R
1
]
(s)
p
[L
2
L
1
]
(s)
U
=
p
R
2
(s)p
R
1
(s)
p
L
2
(s)p
L
1
(s)
U
= G
2
(s)G
1
(s)U
Again, this has a nice interpretation. Redraw the interconnection, replacing the signals with
the capital letter equivalents, and the systems by their transfer functions.
S
1
S
2
E E E
u
y
v
G
1
G
2
E E E
U Y V
The diagram on the right depicts the equations Y = G
1
U, and V = G
2
Y . Treating these as
arithmetic equalities allows substitution for Y , which yields V = G
2
G
1
U, as desired.
Example: Suppose S
1
is governed by
y(t) + 3 y(t) +y(t) = 3 u(t) u(t)
and S
2
is governed by
v(t) 6 v(t) + 2v(t) = y(t) + 4y(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 114
Then for S
1
we have
L
1
=
_
d
2
dt
2
+ 3
d
dt
+ 1
_
, R
1
=
_
3
d
dt
1
_
, G
1
(s) =
3s 1
s
2
+ 3s + 1
while for S
2
we have
L
2
=
_
d
2
dt
2
6
d
dt
+ 2
_
, R
2
=
_
d
dt
+ 4
_
, G
2
(s) =
s + 4
s
2
6s + 2
The product of the transfer functions is easily calculated as
G(s) := G
2
(s)G
1
(s) =
3s
2
+ 11s 4
s
4
3s
3
15s
2
+ 2
so that the dierential equation governing u and v is
v
[4]
(t) 3v
[3]
(t) 15v
[2]
(t) + 2v(t) = 3u
[2]
(t) + 11u
[1]
(t) 4u(t)
which can also be veried again, by direct manipulation of the ODEs.
6 Parallel Connection
Suppose that we have two linear systems, as shown below,
S
2
S
1
E
E
c
T
d E
u
y
1
y
2
y
+
+
System S
1
is governed by
y
[n]
1
(t) +a
1
y
[n1]
1
(t) + +a
n
y
1
(t) = b
0
u
[n]
(t) +b
1
u
[n1]
(t) + + b
n
u(t)
and denoted as L
1
(y
1
) = R
1
(u). Likewise, system S
2
is governed by
y
[m]
2
(t) +c
1
y
[m1]
2
(t) + +c
m
y
2
(t) = d
0
u
[m]
(t) +d
1
u
[m1]
(t) + +d
m
u(t)
and denoted L
2
(y
2
) = R
2
(u).
Apply the dierential operation L
2
to the governing equation for S
1
, yielding
L
2
(L
1
(y
1
)) = L
2
(R
1
(u)) (9.3)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 115
Similarly, apply the dierential operation L
1
to the governing equation for S
2
, yielding and
L
1
(L
2
(y
2
)) = L
1
(R
2
(u))
But the linear dierential operations can be carried out is either order, hence we also have
L
2
(L
1
(y
2
)) = L
1
(L
2
(y
2
)) (9.4)
Add the expressions in (9.3) and (9.4), to get
L
2
(L
1
(y)) = L
2
(L
1
(y
1
+y
2
))
= L
2
(L
1
(y
1
)) +L
2
(L
1
(y
2
))
= L
2
(R
1
(u)) +L
1
(R
2
(u))
= [L
2
R
1
] (u) + [L
1
R
2
] (u)
= [L
2
R
1
+L
1
R
2
] (u)
In transfer function form this is
Y =
p
[L
2
R
1
+L
1
R
2
]
(s)
p
[L
2
L
1
]
(s)
U
=
p
[L
2
R
1
]
(s) +p
[L
1
R
2
]
(s)
p
L
2
(s)p
L
1
(s)
U
=
p
L
2
(s)p
R
1
(s) +p
L
1
(s)p
R
2
(s)
p
L
2
(s)p
L
1
(s)
U
=
_
p
R
1
(s)
p
L
1
(s)
+
p
R
2
(s)
p
L
2
(s)
_
U
= [G
1
(s) +G
2
(s)] U
So, the transfer function of the parallel connection is the sum of the individual transfer
functions.
This is extremely important! The transfer function of an interconnection of systems
is simply the algebraic gain of the closed-loop systems, treating individual subsystems as
complex gains, with their gain taking on the value of the transfer function.
7 General Connection
The following steps are used for a general interconnection of systems, each governed by a
linear dierential equation relating their inputs and outputs.
Redraw the block diagram of the interconnection. Change signals (lower-case) to upper
case, and replace each system with its transfer function.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 116
Write down the equations, in transfer function form, that are implied by the diagram.
Manipulate the equations as though they are arithmetic expressions. Addition and
multiplication commute, and the distributive laws hold.
8 Systems with multiple inputs
Associated with the multi-input, single-output linear ODE
L(y) = R
1
(u) +R
2
(w) +R
3
(v) (9.5)
we write
Y =
p
R
1
(s)
p
L
(s)
U +
p
R
2
(s)
p
L
(s)
W +
p
R
3
(s)
p
L
(s)
V (9.6)
This may be manipulated algebraically.
9 Poles and Zeros of Transfer Functions
Consider to Linear Dierential operators, L and R, and the input/output system described
by L(y) = R(u). Associated with L and R are polynomials, p
L
(s) and p
R
(s), and the transfer
function of the system is G :=
p
R
(s)
p
L
(s)
.
As we already know, the roots of p
L
(s) = 0 give us complete information regarding the form
of homogeneous solutions to the dierential equation L(y) = 0. These roots, which are roots
of the denominator of the transfer function G are called the poles of the transfer function.
The zeros of the transfer function are dened as the roots of the numerator, in other words,
roots of p
R
(s). Obviously, these roots yield complete information regarding homogeneous
solutions of the dierential equation R(u) = 0. In sections 5 and 6, we saw the importance
of the right-hand-side of the dierential equation on the forced response. Later we will learn
how to interpret this in terms of the number and location of the transfer function zeros.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 117
10 Remarks/Summary
Transfer function represent the SLODE when the initial conditions are set to zero.
Consider the SLODE
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n1
y
[1]
(t) +a
n
y(t)
= b
0
u
[n]
(t) +b
1
u
[n1]
(t) + +b
n1
u
[1]
(t) +b
n
u(t)
(9.7)
and the associated transfer function
G(s) =
b
0
s
n
+b
1
s
n1
+ +b
n1
s +b
n
s
n
+a
1
s
n1
+ +a
n1
s +a
n
(9.8)
We have proven that for stable system with constant input u(t) = u
ss
, the output at
steady-state is y
ss
=
bn
an
u
ss
. Therefore
y
ss
= G(0)u
ss
The roots of the denominator of the transfer function G(s) (s
n
+a
1
s
n1
+ +a
n1
s +a
n
)
are called the poles of the transfer function. The roots of the denominator of the trans-
fer function G(s) (b
0
s
n
+b
1
s
n1
+ +b
n1
s +b
n
) are called the poles of the transfer
function.
The zeros aect the discontinuity of the initial conditions.
The poles are the roots of the characteristic equation. (if there is no zero-pole cance-
lation)
G(s) representation useful for computing SLODE of complex systems.
11 Problems
1. Consider the feedback interconnection shown below. The signals r and w represent a
reference and disturbance input.
S
1
S
2
E E E
c
e ' '
w
T
e
r
y
q
u
T
v
+

+
+
Assume that system S
1
is described by the LDO L
1
(y) = N
1
(u), and S
2
is governed
by L
2
(v) = N
2
(q).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 118
(a) Find the dierential equation relating r and w to y. The ODE will involve
sums/dierences/compositions of the Linear Dierential Operators L
1
, N
1
, L
2
, N
2
.
(b) Find the dierential equation relating r and w to u. The ODE will involve
sums/dierences/compositions of the Linear Dierential Operators L
1
, N
1
, L
2
, N
2
.
Note that the characteristic equation is the same, whether the equations are written
as (r, w) forcing y, or (r, w) forcing u.
2. Find the transfer function from u to y for the systems governed by the dierential
equations
(a) y(t) =
1

[u(t) y(t)]
(b) y(t) +a
1
y(t) = b
0
u(t) +b
1
u(t)
(c) y(t) = u(t) (explain connection to Simulink icon for integrator...)
(d) y(t) + 2
n
y(t) +
2
n
y(t) =
2
n
u(t)
3. Consider the interconnection below. The transfer functions of systems S
1
and S
2
are
G
1
(s) =
3
s + 6
, G
2
(s) =
s + 2
s + 1
Determine the dierential equation governing the relationship between u and y.
S
1
S
2
E E E
u
y
4. (a) F, G, K and H are transfer functions of systems. A block diagram of an inter-
connection is shown below. The input r and output y are labeled with their
corresponding capital letters. Find the transfer function from r to y.
F G
K
H
E E E E E
'
T
d
R Y +
+
(b) For a single-loop feedback system, a rule for determining the closed-loop transfer
function from an specic input to a specic output is
forward path gain
1 feedback path gain
Explain how part 4a above is a proof of this fact.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 119
5. (a) F, G, K and H are transfer functions of systems. A block diagram of an inter-
connection is shown below. The input r and output y are labeled with their
corresponding capital letters. Find the transfer function from r to y.
F G
K
H
E E E E E
'
T
d
R Y +

(b) For a single-loop feedback system, with negative feedback, a rule for determining
the closed-loop transfer function from an specic input to a specic output is
forward path gain
1 + feedback path gain
Explain how part 5a above is a proof of this fact.
6. G and K are transfer functions of systems. A block diagram of an interconnection is
shown below. The input r and output y are labeled with their corresponding capital let-
ters. Find the transfer function from r to y, and express it in terms of N
G
, D
G
, N
K
, D
K
,
the numerators and denominators of the transfer functions G and K.
G
K
E E E
'
T
d
R Y +
+
7. A feedback connection of 4 systems is shown below. Let the capital letters also denote
the transfer functions of each of the systems.
d d
G
E H
F
E E E E E
'
c
'
T

+
+
r
y
(a) Break this apart as shown below.
d d
G
E
E E E E
c
'
T

+
+
r x
d
ME 132, Fall 2012, UC Berkeley, F. Borrelli 120
What is the transfer function from r and d to x? Call your answers G
1
and G
2
.
(b) Now, draw the overall system as
F
G
2
G
1 H
E Ed E E
'
E
T
y
r +
+
In terms of G
1
, G
2
and F and H, what is the transfer function from r to y?
Substitute for G
1
and G
2
, and get the transfer function from r to y in terms of
the original subsystems.
(c) In terms of numerators and denominators of the individual transfer functions
(G(s) =
N
G
(s)
D
G
(s)
, for example), what is the characteristic equation of the closed-
loop system?
8. (a) Suppose that the transfer function of a controller, relating reference signal r and
measurement y to control signal u is
U = C(s) [R Y ]
Suppose that the plant has transfer function relating control signal u and distur-
bance d to output y as
Y = G
3
(s) [G
1
(s)U +G
2
(s)D]
Draw a simple diagram, and determine the closed-loop transfer functions relating
r to y and d to y.
(b) Carry out the calculations for
C(s) = K
P
+
K
I
s
, G
1
(s) =
E
s + 1
, G
2
(s) = G, G
3
(s) =
1
ms +
Directly from this closed-loop transfer function calculation, determine the dier-
ential equation for the closed-loop system, relating r and d to y.
(c) Given the transfer functions for the plant and controller in (8b),
i. Determine the dierential equation for the controller, which relates r and y
to u.
ii. Determine the dierential equation for the plant, which relates d and u to y.
iii. Combining these dierential equations, eliminate u and determine the closed-
loop dierential equation relating r and d to y.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 121
9. Find the transfer function from e to u for the PI controller equations
z(t) = e(t)
u(t) = K
P
e(t) +K
I
z(t)
10. Suppose that the transfer function of a controller, relating reference signal r and mea-
surement y
m
to control signal u is
U = C(s) [R Y
M
]
Suppose that the plant has transfer function relating control signal u and disturbance
d to output y as
Y = [G
1
(s)U +G
2
(s)D]
Suppose the measurement y
m
is related to the actual y with additional noise (n), and
a lter (with transfer function F)
Y
M
= F(s) [Y +N]
(a) Draw a block diagram
(b) In one calculation, determine the 3 closed-loop transfer functions relating inputs
r, d and n to the output y.
(c) In one calculation, determine the 3 closed-loop transfer functions relating inputs
r, d and n to the control signal u.
11. A rst order system has a transfer function
G(s) =

s + 1
(a) What is the dierential equation relating the input and output?
(b) Under what conditions is the system stable?
(c) If the system is stable, what is the time-constant of the system?
12. Assume G
1
, G
2
and H are transfer functions of linear systems.
(a) Compute the transfer function from R to Y in the gure below.
G
1
G
2
H
E j E E
c
j
'
T
E E
R Y

+
ME 132, Fall 2012, UC Berkeley, F. Borrelli 122
(b) Suppose that the transfer functions are given in terms of numerator and denomi-
nator pairs, so
G
1
=
N
1
D
1
, G
2
=
N
2
D
2
, H =
N
H
D
H
where all of the N and D are polynomials. Assume each denominator is of higher
order than its associated numerator. Carefully express the transfer function from
R to Y in terms of the individual numerators and denominators.
(c) What is the characteristic equation of the closed-loop system? Be sure that its
order is the sum of the individual orders of the the 3 subsystems.
13. Read about the command tf in Matlab. Use the HTML help (available from the
menubar, under Help, as well as the command-line (via >> help tf).
14. Read about the command step in Matlab. Use the HTML help (available from the
menubar, under Help, as well as the command-line (via >> help step).
15. Execute the following commands
>> sys1 = tf(1,[1 3.8 6.8 4])
>> sys2 = tf([3 1],[1 3.8 6.8 4])
>> sys3 = tf([-3 1],[1 3.8 6.8 4])
>> step(sys1,sys2,sys3)
Relate these to problem 2 in Section 3.
16. Execute the following commands
>> sys1 = tf(1,[1 5.8 14.4 17.6 8])
>> sys2 = tf([2 2 1],[1 5.8 14.4 17.6 8])
>> sys3 = tf([2 -2 1],[1 5.8 14.4 17.6 8])
>> step(sys1,sys2,sys3)
Relate these to problem 3 in Section 3.
17. Execute the commands
>> sys1.den
>> class(sys1.den)
>> sys1.den{1}
>> class(sys1.den{1})
>> size(sys1.den{1})
>> roots(sys1.den{1})
>> pole(sys1)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 123
Explain what is being referenced and displayed. Recall that the poles of a transfer
function are the roots of the associated characteristic polynomial.
18. Manipulating transfer function objects in Matlab.
(a) Transfer functions are multiplied (which represents a series connection of the
systems, as described in Section 5) with the usual * operator.
(b) Transfer functions are added (which represents a parallel connection of the sys-
tems, as described in Section 6) with the usual + operator.
(c) Feedback connections (as described in Section 4 are done the the feedback com-
mand. The default
ME 132, Fall 2012, UC Berkeley, F. Borrelli 124
10 Simple Cruise-Control
The car model that will consider in this chapter is made up of:
An accurate positioning motor, with power amplier (well see how to make these later
in the course) that accepts a low-power (almost no current) voltage signal, and moves
the accelerator pedal in a manner proportional to the voltage signal.
The engine, which produces a torque that is related to the position of the accelerator
pedal (current and past values).
The drivetrain of the car, which transmits this torque to the ground through the driven
wheels. We will assume that the car is also subjected to air and rolling resistance.
A vehicle, which gets accelerated due to the forces (road/tire interface, aerodynamic)
which act on it.
Changes in the slope of the highway, which act as a disturbance force on the car. We
do not assume that the car has a sensor which can measure this slope.
A speedometer, which converts the speed (in miles/hour, say), into a voltage signal
for feedback purposes. We will assume for now that we get 1 volt for every mile/hour.
Hence, the variables v
meas
and v are related by
v
meas
(t)|
volts
= v(t)|
miles/hour
.
A diagram for the system is shown in Fig. 33.
1 Dynamic Model
There are 3 forces acting on the car
F
eng
(t), the static friction force at wheel/road interface, due to the torque applied to
the driveshaft from engine.
F
drag
, Aerodynamic drag forces, which depend on the speed of the car.
d
F
(t) disturbance force, for instance the gravitational force due to inclination in the
road, or additional aerodynamic forces due to wind gusts. For now well take d
F
=
0.01mgw = Hw, with H = 0.01mg, where w is the percent inclination.
We will model the engine and aero forces as follows:
ME 132, Fall 2012, UC Berkeley, F. Borrelli 125
controller
car &
air resistance
speedometer
road
incline
des
engine
pedal
actuator
+
-

desired
measured
speed
speed
actual
speed
f
d
control
input
u
Controlled Plant
v
v
Figure 33: Cruise Control System
1. There is a DC motor which controls the throttle position. We assume that the engine
force is related to the voltage signal to the DC motor by a constant of proportionality,
E, hence
F
eng
(t) = Eu(t)
where u(t) is the voltage applied to the DC motor.
2. For simplicity, we assume that the aerodynamic force is proportional to the speed of
the car, hence
F
drag
(t) = v(t)
where is a positive constant.
Hence, the dierential equation relating u, d
F
(or w) and v is simply
m v(t) = v(t) +Eu(t) +d
F
(t)
= v(t) +Eu(t) +Hw(t)
(10.1)
Eq. (10.1) is a rst order, Linear, Time Invariant (LTI) Ordinary Dierential Equation
(ODE).
2 Control of the First Order Car Model
We can now return to analyzing both the open-loop and closed-loop response of the cruise
control system, when the car is modeled by the rst order ODE in (10.1). Suppose that u(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 126
is constant, at u, and w(t) is constant, w. The steady-state velocity of the car is just
v =
E

u +
H

w
which is of the simple form (with P :=
E

, D :=
H

).
2.1 Open-Loop Control System
In the absence of a disturbance force (w(t) 0), the steady-state speed of the car due to a
constant input voltage u(t) u is
v := lim
t
v(t) =
E

u
Hence, a feasible Open-Loop control system would invert this relationship, namely
u(t) =

E
v
des
(t)
Here, we let K
ol
:=

E
is the open-loop controller gain. Note that this gain must be imple-
mented in the control circuitry, and hence must be computed using values of E and that
are believed accurate.
The equations which govern the open-loop car are now
v(t) =

m
v(t) +
EK
ol
m
v
des
(t) +
H
m
w(t) . (10.2)
2.2 Closed-Loop Control System
We now consider a closed-loop control system. The feedback controller will be a circuit,
which combines the desired speed voltage (which is also in the same units 1 volt for every
mile/hour) and the actual speed voltage to produce a control voltage, which commands the
throttle positioning DC motor system. For simplicity, take the control law to be a constant
gain control law,
u(t) = K
ff
v
des
(t) K
fb
v(t) (10.3)
The block diagram of the control system is shown in Fig. 34
Plugging this control law into the car model (10.1) gives
v(t) =

m
v(t) +
E
m
[K
ff
v
des
(t) K
fb
v(t)] +
H
m
w(t)
=
+EK
fb
m
v(t) +
EK
ff
m
v
des
(t) +
H
m
w(t) . (10.4)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 127
input
desired
speed
v
des
+
actual
speed
v
control
Vehicle
w
u
K
ff
fb
controller
+
K
-
H
+
E
1
+
-
dt

m
m
d
f
Figure 34: Cruise Closed-Loop Control System
2.3 Open/Closed Loop Comparison
Equations (10.2) and (10.4) respectively govern the behavior of the car under open-loop and
closed-loop control. We will compare the performance, using the subcript []
ol
to refer to
open-loop control, and []
cl
to refer to closed-loop control.
First notice that both are sysems are governed by rst-order linear ODEs with constant
coecients.
First, the time constants are dierent,
T
ol
=
m

, T
cl
=
m
+EK
fb
.
For positive K
fb
, the response of the closed-loop system is always faster than that of the
open-loop system.
Now assume that both the desired velocity and the incline disturbance are both constants,
respectively given by v
des
,

d
F
. The resulting steady-state speeds (in open and closed-loop)
are
v
ol
= v
des
+
1

d
F
, v
cl
=
EK
ff
+EK
fb
v
des
+
1
+EK
fb

d
F
As in the earlier steady state analysis, by selecting K
fb
suciently large, and setting
EK
ff
+EK
fb
1
we can achieve better disturbance rejection and tracking with closed-loop control than with
open-loop control.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 128
Do a numerical simulation to study the responses of both the open-loop and closed-loop
control system. For the closed-loop system, take K
fb
:= 8, K
ff
:= 9.5.
Assume the following numerical values for the parameters: m = 1000, = 60, E = 40 and
H = 98, and assume the following conditions: v(0) = 25.
v
des
(t) =
_
25 if 0 < t < 10
30 if t 10
w(t) =
_
0 if t < 80
5 if t 80
The time response of the two control systems is shown below
0 20 40 60 80 100 120 140
22
23
24
25
26
27
28
29
30
Time (seconds)
C
a
r

V
e
l
o
c
i
t
y
Velocity (perfect car): Open and ClosedLoop Control
The control signal u(t) is shown in the gure below
ME 132, Fall 2012, UC Berkeley, F. Borrelli 129
0 20 40 60 80 100 120 140
35
40
45
50
55
60
65
70
75
80
85
Time (seconds)
C
o
n
t
r
o
l

R
e
s
p
o
n
s
e

(
u
)
Control response (perfect car): Open and ClosedLoop Control
3 Integral Control
The car is governed by
m v(t) = v(t) +Eu(t) +Hw(t)
For a given constant value of v
des
, w, the ideal steady-state input u is
u :=

E
v
des

w
This is the only possible value for the steady-state value of u which gives a steady-state
velocity exactly equal to the desired velocity. Note that the correct control depends on
both v
des
and w.
However, with our current closed-loop control law, if the car has speed v(t) = v
des
, then the
control eort is
u(t) = (K
ff
K
fb
) v
des
With the proportional control, the car stops accelerating when the force from the controller
signal balances the force from air resistance and the incline.
The commanded force from the controller, with v
des
xed, is a linear (actually linear+oset,
called ane) function of v. Hence, it is easy to see that for dierent values of w, the car
will cease accelerating (ie. steady-state) for values of v which are dierent from v
des
. The
problem is that the instantaneous throttle position is simply a function of the instantaneous
ME 132, Fall 2012, UC Berkeley, F. Borrelli 130
desired speed and actual speed. There is no mechanism for the throttle to be opened further
if this error in speed does not eventually decrease.
A new strategy should incorporate a term that corresponds to if the speed is below the
desired speed, increase the throttle. A mathematical version of this statement is given
below:
u
I
(t) = K
I
[v
des
(t) v(t)]
Note that by this strategy, at any time t, for which v
des
(t) > v(t), the control law is, at that
instant, increasing the throttle angle. Likewise, at any time t, for which v
des
(t) < v(t), the
control law is, at that instant, decreasing the throttle angle. Finally, at any time t, for which
v
des
(t) = v(t), the control law is, at that instant, not changing the throttle angle.
Integrating from t = 0 to t gives
u
I
(t) = u
I
(0) +K
i
_
t
0
[v
des
() v()] d
which shows that the control action, u(t), is a running integral of the error between the
desired value and the actual value. This is called integral control action. As you would
expect, integral control can be used to reduce the steady-state error due to hills.
A block diagram of the closed-loop system, using integral control is shown in Fig. 35.]]
E
+
H
1
m
dt
a
m
+ +
-
+
-
dt K
I
v
v
des
u
w
vehicle
controller
z
Figure 35: Cruise Control System with Integral Control
The equation for the car is as before
v(t) =
1
m
[v(t) +Eu
I
(t) +Hw(t)]
The equations for the controller are
z(t) = v
des
(t) v(t)
u
I
(t) = K
I
z(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 131
The variable z is called the integrator in the control system, since it is a running integral
of the error v
des
v. Recall from circuit theory that an integrating circuit can be built with
a single op-amp and capacitor (we will review this standard circuitry later).
To understand the closed-loop behavior, we need to eliminate u
I
and z from the equations.
This is done as follows - dierentiate the car equation model, yielding
v(t) =
1
m
[ v(t) +E u(t) +H w(t)] (10.5)
Now u appears, but this is known from the controller equations. In fact
u
I
(t) = K
I
z(t)
= K
I
[v
des
(t) v(t)]
Substitute this into (10.5) to yield
v(t) =
1
m
[EK
I
(v
des
(t) v(t)) v(t) +H w(t)]
which can be manipulated into the form
v(t) +

m
v(t) +
EK
I
m
v(t) =
EK
I
m
v
des
(t)
H
m
w(t) (10.6)
In this nal equation, w does not explicitly enter, only w does. Hence, if w(t) approaches
a constant limit, say w, then w 0, and the particular nal value of w (ie., w) has
no eect on the limiting value of v(t).
This is the amazing thing about integral control it eliminates the steady-state error due
to steady disturbances.
But, lets go further, and try this out for a realistic car model, with m = 1000kg, E = 40,
= 60, H = 98. The simulation is carried under the following conditions
The initial speed of car is v(t
0
) = 25 m/s.
Initially, the desired speed is v
des
(t) = 25m/s.
Initially, the hill inclination is w(t) = 0.
The initial condition on control system integrator is z(t
0
) =
25
EK
I
v
des
(t) = 30m/s for t 10s.
w(t) = 3 for t 160s.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 132
Hence, at t = t
0
, the value of u(t) is just right to maintain speed at 25m/s, if there is no hill
(check that at t = t
0
, the equations for v and z give v(t
0
) = 0, z(t
0
) = 0).
The trajectories for v
des
(t) and w(t) for t > t
0
are shown below.
0 50 100 150 200 250 300
24
25
26
27
28
29
30
31
32
Time (seconds)
C
a
r

V
e
l
o
c
i
t
y
Velocity Response with Integral Control
Increasing K
I
Four dierent plots of v(t) are shown, for K
I
taking on values from 0.03 to 0.24. Although its
not pretty, at steady-state, the value of v(t) is equal to v
des
, regardless of the hill. However,
the response is generally unacceptable - either too oscillatory, or too sluggish. Moreover
notice that these type of responses, which include overshoots and oscillations, are not possible
with 1st order systems and are due to the fact that the close loop system is now a second
order dierential equation.
3.1 Cruise Control with Integral Action and Velocity Feedback
Notice that the feedback control system in Eq. (10.3) in Section 2.2 was of the form
u(t) = K
ff
v
des
(t) K
fb
v(t) .
We can replace the feedforward term K
ff
v
des
(t) by the integral action and keep the feedback
term K
fb
v(t). The resulting controller
u(t) = u
I
(t) K
fb
v(t) (10.7)
u
I
(t) = K
I
z(t)
z(t) = v
des
(t) v(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 133
consists of an integral action and velocity feedback, and its block diagram is shown in Fig.
36.
E
+
H
1
m
dt
m
+ +
-
+
-
dt K
I
v
v
des
u
w
vehicle
controller
z
+
-
K
fb
u
I
a
Figure 36: Cruise Control System with Integral Action and Velocity Feedback
Inserting the control law (10.7) into the dierentiated vehicle dynamics in (10.5) , and
performing a similar set of manipulations to eliminate u
I
(t) as described above, results in
the following close loop velocity dynamics
v(t) +
_

m
+
EK
fb
m
_
v(t) +
EK
I
m
v(t) =
EK
I
m
v
des
(t)
H
m
w(t) . (10.8)
Notice that only the coecient that multiplies v(t) has changed when we compare Eq.
(10.8) with the close loop dynamics with I-action alone in (10.6) . This coecient can now
be changed by changing the feedback gain K
fb
but it could not be changed in Eq. (10.6) .
Moreover, as in Eq. (10.6) , only w enters explicitly in (10.8) . Hence, if w(t) approaches a
constant limit, say w, then w 0, and the particular nal value of w (ie., w) has no eect
on the limiting value of v(t).
In order to compare the eect of adding the additional velocity feedback action on the cruise
controller with integral action, we repeat the simulations done above with a realistic car
model, with m = 1000kg, E = 40, = 60, H = 98. The simulation are again carried under
the following conditions
The initial speed of car is v(t
0
) = 25 m/s.
Initially, the desired speed is v
des
(t) = 25m/s.
Initially, the hill inclination is w(t) = 0.
The initial condition on control system integrator is z(t
0
) =
25
EK
I
v
des
(t) = 30m/s for t 10s.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 134
w(t) = 3 for t 160s.
K
I
= 0.24 and K
fb
= 4 or
K
I
= 0.24 and K
fb
= 0.
0 50 100 150 200 250 300
25
26
27
28
29
30
31
32

C
a
r

V
e
l
o
c
i
t
y
Time (seconds)
K
I
= 0.24,
K
fb
= 0
K
I
= 0.24,
K
fb
= 4
K
I
= 0.24,
K
fb
= 0
Figure 37: Close Loop Response of a Cruise Control System with Integral Action and Velocity
Feedback
Notice that setting the feedback term K
fb
= 4 eliminates the oscillations in the response of
the close loop system. In order to fully understand how the values of the control gains K
I
and K
fb
aect the response of the close loop system, we need to study dierential equations
more carefully.
4 Understanding the Integral Controller By Using Second Order
SLODE
As we saw in section 3, the integral controller was eective at reducing the steady-state
error due to constant slope hills, but the transient response was simply either to slow, or too
oscillatory. Based on our work in section 9, we should be able to explain this undesirable
behavior in terms of
n
and .
For generality, the analysis will be carried out for a proportional-integral (PI) controller,
which has the form
z(t) = v
des
(t) v(t)
u(t) = K
P
[v
des
(t) v(t)] +K
I
z(t)
(10.9)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 135
The behavior of the closed-loop system with just the I-controller can be investigated simply
by setting K
P
0.
Recall that the car is governed by
v(t) =

m
v(t) +
E
m
u(t) +
H
m
w(t) (10.10)
The dierential equation governing the closed-loop system is obtained eliminating z and u
from the equations (10.9) and (10.10). This is obtained by dierentiating equation (10.10)
and substituting from (10.9) for u. This yields
v(t) +
+EK
P
m
v(t) +
EK
I
m
v(t) =
EK
I
m
v
des
(t) +
EK
P
m
v
des
(t) +
H
m
w(t) (10.11)
This is a second order system, and the characteristic equation is

2
+
+EK
P
m
+
EK
I
m
= 0.
Since this is second order polynomial, we know from section 8 that the conditions for stability
are
+EK
P
m
> 0,
EK
I
m
> 0.
In this application, all of the physical variables (m, E, ) are already positive, hence the
conditions for stability are
K
I
> 0, and K
P
>

E
The roots of the characteristic equation can be expressed as functions of K
P
and K
I
. We
can also express the natural frequency (
n
) and damping ratio () in terms of K
P
and K
I
as well. This is easily done, yielding

n
=
_
EK
I
m
, =
+EK
P
2

mEK
I
Note that

n
increases with increasing K
I
, but is unaected by K
P
. Roughly, we expect that
increasing K
I
will increase the speed of response of the system, while K
P
will not
have a dominant eect on the speed of response.
Th damping ratio, , decreases with increasing K
I
, but increases with increasing K
P
.
Of course, if K
P
= 0 (as in the integral control situation in section 3), then the observations
simplify:
ME 132, Fall 2012, UC Berkeley, F. Borrelli 136

n
increases with increasing K
I
the damping ratio, , decreases with increasing K
I
This is exactly consistent with our time-domain simulations from section 3.
The roots of the characteristic equation are at

1,2
=
( +EK
P
)
_
( +EK
P
)
2
4EK
I
m
2m
(10.12)
This is simple enough to study how the roots depend on the values of K
P
and K
I
.
1. Fix K
P
>

E
. At K
I
= 0, the roots are real, at
_

+EK
P
m
, 0
_
. As K
I
increases, the
two roots remain real, but move toward each other. When K
I
=
(+EK
P
)
2
4Em
, the roots
are equal, with value
(+EK
P
)
2m
. As K
I
increases further, the term inside the square
root is negative, so that the real part of the roots remains xed at
(+EK
P
)
2m
, while the
imaginary part simply increases with increasing K
I
. This is sketched in Fig. 38 with
(+EK
P
)
2m
= 10.
10 9 8 7 6 5 4 3 2 1 0
2.5
2
1.5
1
0.5
0
0.5
1
1.5
2
2.5
Root Locus
Real Axis
I
m
a
g
in
a
r
y

A
x
is
Figure 38: Roots of Eq. (10.12) for K
I
[0, ) when
(+EK
P
)
2m
= 10.
2. Fix K
I
> 0. As K
P
increases from

E
, the roots are complex, and move in circles with
radius
_
EK
I
m
. When K
P
satises ( +EK
P
)
2
= 4EK
I
, the roots are equal, and real
(at
_
EK
I
m
). As K
P
continues to increase, the roots split apart, one going o to ,
and the other root heading to 0 (from the left, always remaining negative). This is
sketched in Fig. 39 with
_
EK
I
m
= 4.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 137
6 5 4 3 2 1 0
4
3
2
1
0
1
2
3
4
Root Locus
Real Axis
I
m
a
g
in
a
r
y

A
x
is
Figure 39: Roots of Eq. (10.12) for K
P
[

E
, ) when
_
EK
I
m
= 4.
Finally, if desired values for
n
and are given, it is straightforward to solve for the appro-
priate K
P
and K
I
,
K
I
=
m
2
n
E
, K
P
=
2
n
m
E
These might be referred to as design equations, since they determine the necessary con-
troller parameters in order to achieve a certain goal (prespecied
n
and in the closed-loop
system).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 138
5 Problems
1. Consider the car model, equation (10.1). The model parameters m, , E are positive,
while G is negative. Suppose that for physical reasons, it is known that
u(t) u
max
where u
max
is some xed, upper bound on the available control action. For the questions
below, assume that w 0 we are on a at road.
(a) In terms of the parameters, what is the maximum acceleration achievable by the
car? Note: this will be a function of the current velocity.
(b) Starting from v(0) = 0, what is the minimum time, T
min
, for the car to reach a
speed v. Your answer should be T
min
as a function of v, and will depend on the
model parameters.
(c) Take the parameters = 60, E = 40, m = 1000, where all are SI units. Also
suppose that u
max
= 90. Recompute your answer in part (a), and plot T
min
( v)
versus v for v in the interval [0, 30 meters/second]. Are the answers reasonable,
and similar to cars that we drive?
(d) Qualitatively, explain how would things change if F
drag
had the form
F
drag
(t) =
1
v(t)
2
v
2
(t)
2. The closed-loop cruise control system equations are given in equation (10.4). Modify
the equations of the controller to include a measurement noise term, so
u(t) = K
ff
v
des
(t) K
fb
_
_
v(t) +n(t)
. .
v
measured
_
_
Here, n represents the measurement noise. The car parameters are given in Section
2.3.
(a) Dene outputs of interest y
1
:= v and y
2
:= u (the actual speed and throttle).
Find A, B
1
, B
2
, C
1
, . . . , D
23
so that the equations governing the closed-loop system
are
v(t) = Av(t) +B
1
v
des
(t) +B
2
w(t) +B
3
n(t)
(v =)y
1
(t) = C
1
v(t) +D
11
v
des
(t) +D
12
w(t) +D
13
n(t)
(u =)y
2
(t) = C
2
v(t) +D
21
v
des
(t) +D
22
w(t) +D
23
n(t)
Your answer for the coecients will be in terms of the car parameters, and the
feedback gains. Assume that m, E and are positive.
(b) Under what conditions is the closed-loop system stable?
ME 132, Fall 2012, UC Berkeley, F. Borrelli 139
(c) What is the steady-state ( = 0) gain from v
des
to v? Your answer should be in
terms of the car parameters, and K
ff
and K
fb
.
(d) What is the steady-state ( = 0) gain from w to v? Your answer should be in
terms of the car parameters, and K
ff
and K
fb
.
(e) What is the steady-state ( = 0) gain from n to v? Your answer should be in
terms of the car parameters, and K
ff
and K
fb
.
(f) If K
fb
is given, what is the correct value of K
ff
so that the steady-state gain
( = 0) from from v
des
to v is exactly 1? Under that constraint, what are the
values of the steady-state gain from w to v and n to v? What is the motivation
for picking K
fb
large? What is a drawback for picking K
fb
large?
(g) Consider three cases, K
fb
= 2, 4, 8. For each case, compute the appropriate value
of K
ff
based on steady-state gain considerations in part 2f above.
(h) Using Matlab (subplot, loglog, abs, semilogx, angle) make a 2-by-3 plot of
the frequency response functions (ie., the sinusoidal steady-state gain) from the
inputs (v
des
, w and n) to the outputs (v and u). The plots should be layed out as
shown below.
|G
v
des
u
|
G
v
des
v
|G
v
des
v
|
|G
wu
|
|G
wv
|
|G
nu
|
|G
nv
|
For magnitude plots, use loglog. For angle plots, use semilogx. Each axes
should have 3 plots (associated with K
fb
= 2, 4, 8 and the corresponding values
for K
ff
.
(i) Using Simulink, compute and plot the responses v and u for the system subjected
to the inputs v
des
and w given on page 38/39. Use n(t) = 0 for all t. Do this for
the 3 dierent gain combinations. Plot the two outputs of interest in a 2-by-1
array of subplots, with y
1
in the top subplot, and y
2
in the bottom. Both axes
should have 3 graphs in them.
(j) Certain aspects of the frequency-response curves are unaected by the specic
(K
fb
, K
ff
) values (eg., the graphs are the same regardless of the value, the graphs
ME 132, Fall 2012, UC Berkeley, F. Borrelli 140
converge together in certain frequency ranges, etc). Mark these situations on your
graphs, and in each case, explain why this is happening. Compare/connect to the
time-response plots if possible/necessary.
(k) Certain aspects of the frequency-response curves are signicantly aected by the
specic (K
fb
, K
ff
) values (eg., the graphs have dierent magnitudes at low fre-
quency, the graphs bend down (or up) at dierent frequencies, etc). Mark these
situations on your graphs, and in each case, explain why this is happening. Com-
pare/connect to the time-response plots if possible/necessary.
(l) At high frequency, the sinusoidal steady-state gain from v
des
to u is not zero. This
is easily observed in the frequency response plots. Where does this show up in
the time response plots? Can you quantitatively connect the two plots?
(m) Notice how the frequency-response from v
des
to v is nearly 1 (as a complex num-
ber) over a frequency range beginning at 0 and extending to some mid-frequency
value. Beyond that value, the frequency response plot fades unremarkably to 0.
Moreover, as we increase K
fb
the range of frequencies over which the frequency-
response from v
des
to v is nearly 1 is extended. Where does this show up in the
time response plots? Can you quantitatively connect the two plots?
(n) Notice that as K
fb
increases, the magnitude of the frequency response from w
to v decreases (less eect at high frequency though, and no eect at innite
frequency). Where does this show up in the time response plots? Can you
quantitatively connect the two plots?
(o) Using Simulink, compute and plot the responses v and u for the system subjected
to the inputs v
des
and w given on page 36. From the Sources library, use the
Band-Limited White Noise block. Set the noise power to about 0.033, and the
sample time to 0.1 seconds. Set the Seed eld to clock*[0;0;0;0;0;1]. This
means that every time you simulate, Matlab will call the clock function, which
returns a 1-by-6 array (year,month,day,hour,minute,second) and then pick o
the seconds value. This is used as the seed in the random number generator,
ensuring that you get a dierent noise trajectory each time you simulate. Do
this for the 3 dierent gain combinations. Plot the two outputs of interest in a
2-by-1 array of subplots, with y
1
in the top subplot, and y
2
in the bottom. Both
axes should have 3 graphs in them. Comment on the eec that measurement
noise has on the outputs, and how the increased feedback gain aects this.
(p) In doing the simulation, we chose (nearly) a constant for w, but a quickly, ran-
domly varying signal for n? Why? What is the interpretation of these two signals?
(q) Look at the frequency response plots governing the eect that n has on v and u.
Are these consistent with what you see in part 2o?
One aspect to understanding the performance of closed-loop systems is getting com-
fortable with the relations between frequency responses and time responses.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 141
3. Let y
p
(t) be a particular solution for the following rst order ODE
y(t) +ay(t) = b u(t) (10.13)
and assume that a > 0 and b > 0 are real constants.
(a) Assume that the input u(t) is expressed as
u(t) = u
R
(t) +j u
I
(t),
where j
2
= 1 and u
R
(t) and u
I
(t) are real functions of time.
If a particular solution y
p
(t) for the above input is expressed as
y
p
(t) = y
p
R
(t) +j y
p
I
(t),
write down the dierential equations that y
p
R
(t) and y
p
I
(t) respectively satisfy.
(b) Assume that
u(t) = e
jt
,
where > 0 is a real constant.
i. A particular solution y
p
(t) for this input can be written as
y
p
(t) = G() u(t) . (10.14)
Determine an expression for the complex number G() in terms of the pa-
rameters a, b and .
(continues on the next page)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 142
ii. The particular solution y
p
(t) in Eq. (10.14) can also be written as
y
p
(t) = M() e
(jt+())
.
where M() 0 and () are real. Obtain expressions for M() and ()
in terms of the parameters a, b and .
(c) Assume that
u(t) = cos(t) = Real
_
e
jt
_
. (10.15)
where > 0 is a real constant.
i. A particular solution y
p
(t) for this input can be written as
y
p
(t) = Y () cos (t +()) . (10.16)
Determine expressions for Y () and () in terms of a, b and .
ii. Fig. 40 shows the response of the ODE in Eq. (10.13) when the input u(t)
is given by Eq. (10.15) and y(0) = 0. A steady state response is achieved
for t 1.
Determine the values of the parameters , a and b.
4. Consider the cruise-control problem, with parameters E = 40, m = 1000, = 60. Using
a PI controller, choose K
P
and K
I
so that the roots of the closed-loop characteristic
equation are in the complex plane, with

n
= 0.6, = 1.05
Plot these two roots in the complex plane. For the remainder of this problem, this is
referred to as the ideal case, and those are the ideal roots.
In the notes, we assumed that the relationship between the adjustable voltage u(t)
and the force exerted on the car by the tires is instantaneous (also called static or
non-dynamic), namely
F
engine
(t) = Eu(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 143
0 0.125 0.25 0.375 0.5 0.625 0.75 0.875 1 1.125 1.25 1.375 1.5 1.625 1.75 1.875 2
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
Time

i
n
p
u
t

u



a
n
d

o
u
t
p
u
t

y



u
y
Figure 40: Response y(t) for a cosine input function.
Recall that this force is generated in 2 steps rst a DC motor must reposition the
throttle, and then the engine must actually produce this force. A slightly more realistic
model for this force generation is
q(t) =
1

(u(t) q(t))
F
engine
(t) = Eq(t)
Note that this has the following properties:
1st order system between u F
engine
, with q acting as an internal state variable.
The time constant is , hence the smaller is, the faster the response is.
For a constant input u(t) u, the steady state response is lim
t
F
engine
(t) = E u.
NOTE: Although this is a dynamic relationship between u and F
engine
, the steady-state
behavior is identical to the original non-dynamic model in the notes.
(a) Draw a block diagram of the closed-loop system, with the full 2nd order model
for the car. Overall, your block diagram should have 3 integrator blocks 1 in
the controller, 1 in the new engine model, and 1 in the car (simply representing
that velocity is the integral of acceleration).
(b) Write down dierential equations for v, w and z. Write the equation in the forms
v(t) = f
1
(v(t), q(t), z(t), v
des
(t), w(t), parameters)
q(t) = f
2
(v(t), q(t), z(t), v
des
(t), w(t), parameters)
z(t) = f
3
(v(t), q(t), z(t), v
des
(t), w(t), parameters)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 144
(c) Dene a vector
x(t) :=
_
v(t)
q(t)
z(t)
_
Write the equations in the form
x(t) = Ax(t) +B
_
v
des
(t)
w(t)
_
where A R
33
and B R
32
are matrices whose entries depend only on the
parameters (E, m, , G, ), and the controller gains (K
P
, K
I
).
(d) Let v be a positive number. Suppose that at some instant t, v(t) = v, q(t) =
v
E
, z(t) =
v
EK
I
, and v
des
(t) = v. Using the equations and assuming that w(t) = 0,
show that v(t) = q(t) = z(t) = 0. Hence, if v
des
remains at this value and w
remains 0, then all of the variables v, q and z remain constant in time. This gives
some idea as to how the initial condition on z is set in the cruise control circuitry
as the cruise control system is turned on while driving.
(e) Now, back to the problem. Dierentiate the v(t) equation twice, and substitute as
necessary to get a dierential equation for the closed-loop system only involving
v, v
des
, w and their derivatives (and the parameters, or course). What is the
characteristic equation of the closed-loop system?
(f) Make a table of the roots of the characteristic equation (there will be three roots)
for several values of , {0.01, 0.033, 0.1, 0.33, 1, 3.3, 10}. Remember, is the time
constant of the dynamic engine model.
(g) Compare the actual roots obtained in part 4f, to the 2 roots obtained at the
beginning of the problem, which are calculated using the non-dynamic engine
model, and to
1

, which is the root of the characteristic equation associated only


with the dynamic engine model. You should note the following pattern:
When the engine speed-of-response is much faster than the ideal closed-loop
response, then the two systems (ideal car/PI controller and fast, but not ideal,
engine) which are in a feedback loop together do not really interact - the
roots of the closed-loop system are pretty much the individual roots. However,
when the engine speed-of-response becomes comparable to the desired response
of the ideal closed-loop system, then interaction takes place, and performance
degradation results. This shows that in some cases, you can neglect very fast
subsystems in your systems, and replace them by their steady-state behavior when
doing the control design. However, the objectives of your simplied control design
(ie., the roots of the characteristic equation) should be signicantly slower than
the neglected systems roots in order for the approximation to be accurate.
(h) Using the gains K
P
and K
I
calculated for the original ideal system (with non-
dynamic engine model), and Simulink, compute and plot some time responses.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 145
The initial condition should be v(0) = 25, with q(0) and z(0) as derived earlier.
The input signals should be
v
des
(t) =
25 for 0 t 10
30 for 10 t 40
35 for 40 t 80
32 for 80 t
and
w(t) =
0 for 0 t 30
3 for 30 t 60
3 for 60 t 90
0 for 90 t
Do these for the values of described above (hence you should get 7 dierent
simulations). On each response plot, also plot the response of the idealized closed-
loop system (without the 1st order engine model), and make a small plot (in a
complex plane) the roots (3 of them) of the closed-loop characteristic equation.
5. Use Simulink to reproduce the plots at the end of section 2.6, concerning the response
of the car using integral control.
6. In this problem, we consider a simple model for the roll axis of an airplane, and start
working on a control system which keeps the plane at a desired roll-angle. A diagram
of the system is shown below.
"!
#

Take I
C
= 4.5e5, c = 3.3e5, with also measured in degrees. The dierential equation
model for the roll axis is a simplistic balance of angular momentum for the rigid body
I
C

(t) +c

(t) = M
a
(t) +M
d
(t)
where M
d
(t) is a disturbance moment, caused by external wind and turbulence, and
M
a
(t) is the moment generated by the ailerons. A model for the moment exerted by
the ailerons is
M
a
(t) = E(t)
where E = 1.4e5 and (t) is the deection (in degrees) of the ailerons from their
nominal position.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 146
(a) Fill in the boxes, signs on summing junctions, and label the signals so that the
block diagram below depicts the cause/eect dynamic relationship between , M
d
and .
e E E E E E E
'
T
c
airplane
(b) (writing a state-space model:) Dene x
1
(t) := (t), x
2
(t) :=

(t). Find 2 2
matrices A and B (depending only on the parameters E, I
C
, and c) such that the
airplane model is governed by
_
x
1
(t)
x
2
(t)
_
= A
_
x
1
(t)
x
2
(t)
_
+B
_
(t)
M
d
(t)
_
Hint: The equation governing x
1
is very simple...
(c) Assume that we have a small powerful motor which will move the ailerons to
any commanded position. Suppose that to control the roll axis, we implement a
proportional control law,
(t) = K
P
[
des
(t) (t)]
Write down the closed-loop dierential equation governing the relationship be-
tween (and its derivatives),
des
and M
d
(you must eliminate ). What is the
characteristic equation of this closed-loop dierential equation.
(d) Draw a block diagram of the closed-loop system, clearly delineating the plant
(airplane) from the control system.
(e) Design the roll-axis proportional controller gain, K
P
, to place the roots of the
closed-loop characteristic equation in the complex plane with damping ratio of
= 0.9.
(f) What is
n
of the roots? Plot a step response (for 10 seconds) of the closed-loop
system for all initial conditions equal to zero (steady, level ight), with M
d
(t) 0,

des
(t) = 10. Also plot the aileron deection (t) during the manuever.
(g) On an airplane, there are rate gyros which directly measure the roll rate,

(t).
Draw a block diagram of the closed-loop system with the control law
(t) = K
P
(
des
(t) (t)) K
D

(t)
(h) What is the characteristic equation of the closed-loop system?
ME 132, Fall 2012, UC Berkeley, F. Borrelli 147
(i) For what values of control gains K
P
and K
D
is the closed-loop system stable?
(j) Using both the proportional and the rate feedback, what control do you have
on the roots of the closed-loop characteristic equation?
(k) Choose the gains K
P
and K
D
so that the roots of the closed-loop characteristic
equation have = 0.9,
n
= 1.0.
(l) Plot a step response (for 10 seconds) of the closed-loop system for all initial
conditions equal to zero (steady, level ight), with M
d
(t) 0,
des
(t) = 10, and
another response with
des
(t) 0,
M
d
(t) =
_
0 0 < t < 2
5e6 2 < t <= 6
0 t > 6
Also plot the aileron deection (t) during the manuevers.
(m) Plot the magnitude of the acceleration vector of a passenger sitting 2 meters from
the center of the airplane during the large disturbance in the previous part?
(n) How do you expect the real parameter E, which models the relationship between
aileron deection to moment, would vary with airspeed? Keeping the control gains
K
P
and K
D
xed, recalculate the roots of the closed-loop characteristic equation
for four dierent cases E = 1.0e5, 1.2e5, 1.6e5, 1.8e5. Also, recalculate and plot
the time responses of part 6l. How sensitive is the closed-loop system to these
(upwards of 40%) changes in E?
(o) This problem treats the airplane as a rigid body. If you have ever been in rough
weather on a large passenger jet and looked out the window, you know that this
is not true. What are some of the aspects that this problem has neglected.
7. Consider the block diagram on page 3 of the powerpoint slides from the February 23
lecture.
(a) The control strategy sets u based on the values of v
des
, v
meas
(= v + n), and its
internal variable z. Write u as a linear combination of these variables.
(b) Dierentiate this expression to get an expression for u involving only v
des
, v, n
and their rst derivatives.
(c) Dierentiate the governing equation for the car, and substitute for u. This should
give you dierential equation governing v in the closed-loop system (it should
match with the bottom equation on page 3 of the powerpoint slides).
ME 132, Dynamic Systems and Feedback
Additional Class Notes
Andrew Packard, Roberto Horowitz, Kameshwar Poolla, Francesco Borrelli
Fall 2012
Instructor:
Prof. F. Borrelli
Department of Mechanical Engineering
University of California
Berkeley CA, 94720-1740
copyright 1995-2010 A. Packard, Horowitz, Poolla, Borrelli
ME 132, Fall 2012, UC Berkeley, F. Borrelli 149
A Arithmetic of Feedback Loops
Many important guiding principles of feedback control systems can be derived from the
arithmetic relations, along with their sensitivities, that are implied by the gure below.
g
C G
g
H
F
S
g'
E E E E
E
c
E
c
c
'
T
Process to be controlled
Sensor
Controller
Filter
r
d
e u
y
n
y
m
y
f

The analysis in this section is oversimplied, and at a detail-oriented level, not realistic.
Nevertheless, the results we derive will reappear throughout the course (in more precise
forms) as we introduce additional realism and complexity into the analysis.
In this diagram,
lines represent variables, and
rectangular block represent operations that act on variables to produce a transformed
variable.
Here, r, d and n are independent variables. The variables e, u, y, y
m
, y
f
are dependent, being
generated (caused) by specic values of (r, d, n). The blocks with upper-case letters repre-
sent multiplication operations, namely that the input variable is transformed into the output
variable via multiplication by the number represented by the upper case letter in the block.
For instance, the block labeled Filter indicates that the variables y
m
and y
f
are related by
y
f
= Fy
m
. Each circle represents a summing junction, where variables are added (or sub-
tracted) to yield an output variable. Addition is always implied, with subtraction explicitly
denoted by a negative sign () next to the variables path. For example, the variables r, e
and y
f
are related by e = r y
f
.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 150
Each summing junction and/or block can be represented by an equation which relates the
inputs and outputs. Writing these (combining some steps) gives
e = r y
f
generate the regulation error
u = Ce control strategy
y = Gu +Hd process behavior
y
m
= Sy +n sensor behavior
y
f
= Fy
m
ltering the measurement
(A.1)
Each block (or group of blocks) has a dierent interpretation.
Process: The process-to-be-controlled has two types of input variables: a freely manipu-
lated control input variable u, and an unknown disturbance input variable d. These
inputs aect the output variable y. As users of the process, we would like to regulate y
to a desired value. The relationship between (u, d) and y is y = Gu+Hd. G is usually
considered known, but with some modest potential error. Since d is unknown, and G
is slightly uncertain, the relationship between u and y is not perfectly known.
Controller: The controller automatically determines the control input u, based on the
dierence between the desired value of y, which is the reference input r, and the
ltered measurement of the actual value of y.
Sensor: Measured variable is the noisy output of another system, called the sensor. Like the
process, the sensor is also subjected to external disturbances. Because these corrupt
the output of the sensor, which is supposed to represent the process output variable,
the disturbance to the sensor is often called noise.
Filter: Electrical/Mechanical/Computational element to separate (as best as possible) the
noise n from the signal y
m
.
The goal (unattainable) of feedback (the S, F and C) is: for all reasonable (r, d, n), make
y r, independent of d and n, and this behavior should be resilent to modest/small changes
in G (once C is xed).
Note that there is a cycle in the cause/eect relationships - specically, starting at y
f
we
have
r, y
f
cause e
e causes u
u, d cause y
y, n cause y
m
y
m
causes y
f
This is called a feedback loop, and can be benecial and/or detrimental. For instance,
ME 132, Fall 2012, UC Berkeley, F. Borrelli 151
Note that d (and u) also aects y, and through the the feedback loop, ultimately aects
u, which in turn again aects y. So, although u explicitly only depends on e, through
the feedback loop the control action, u, may in actuality compensate for disturbances
d.
However, through the feedback loop, y is aected by the imperfection to which it is
measured, n.
Eliminating the intermediate variables (such as e, y
f
and y
m
) yields the explicit dependence
of y on r, d, n. This is called the closed-loop relationship.
y =
GC
1 +GCFS
. .
(ry)
CL
r +
H
1 +GCFS
. .
(dy)
CL
d +
GCF
1 + GCFS
. .
(ny)
CL
n (A.2)
Note that y is a linear function of the independent variables (r, d, n), but a nonlinear function
of the various component behaviors (the G, H, F, C, etc). Each term which multiplies one
of the external variables is called a closed-loop gain, and the notation for a closed-loop gain
is given.
Now, in more mathematical terms, the goals are:
1. Make the magnitude of (d y)
CL
signicantly smaller than the uncontrolled eect
that d has on y, which is H.
2. Make the magnitude of (n y)
CL
small, relative to
1
S
.
3. Make (r y)
CL
gain approximately equal to 1
4. Generally, behavior should be insensitive to G.
Implications
Goal 1 implies

H
1 +GCFS

<< |H| ,
which is equivalent to

1
1 +GCFS

<< 1
This, in turn, is equivalent to |GCFS| >> 1.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 152
Goal 2 implies that any noise injected at the sensor output should be signicantly
attenuated at the process output y (with proper accounting for unit changes by S).
This requires

GCF
1 +GCFS

<<
1
|S|
.
This is equivalent to requiring
|GCFS| << 1.
So, Goals 1 and 2 are in direct conict. Depending on which is followed, Goal 3 is accom-
plished in dierent manners. By itself, goal 3 requires
GC
1 +GCFS
1.
If Goal 1 is satised, then |GCFS| is large (relative to 1), so
GC
1 +GCFS

GC
GCFS
=
1
FS
.
Therefore, the requirement of Goals 1 and 3 are
1
FS
1, |GC| >> 1. (A.3)
On the other hand, if Goal 2 is satised, then |GCFS| is small (relative to 1), so
GC
1 +GCFS
GC
Therefore, the requirement of Goals 2 and 3 are
|FS| << 1, GC 1 (A.4)
The requirements in (A.3) and (A.4) are completely dierent. Equation (A.3) represents a
feedback strategy, and equation (A.4) an open-loop, calibration strategy.
Since goal 1 is in opposition to Goal 2, and both cannot be achieved, it is important to
introduce an additional goal, which can be achieved in both cases.
5. Ensure that (d y)
CL
is not much larger than the open-loop d y gain. For example,
requiring that |(d y)
CL
| is less than 3 times the open-loop d y gain constrains
GCFS to satisfy |1 +GCFS| >
1
3
. Note that if |GCFS| >> 1 or |GCFS| << 1, this
condition holds. However, if |GCFS| 1, then it is possible that GCFS 1, which
would violate this goal.
We will revisit this type of goal/constraint many times in later sections.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 153
1 Tradeos
Several of the implications are at odds with each other. Let T(G, C, S, F) denote the factor
that relates r to y
T(G, C, S, F) =
GC
1 + GCFS
Recall that G represents the process behavior, how control action u inuences the regulated
output y, and that S represents the sensor, which is a transducer (physical device) that
converts the variable y into a measurable quantity y
m
. Typically both G and S are complex
systems, subject to the environment, and they may age/change slowly with time.
Use T to denote T(G, C, F, S) for short, and consider two sensitivities: sensitivity of T to
G, and sensitivity of T to S. Recall that for any variable X, the sensitivity of T to X is
dened as
S
T
X
:=
T
X
X
T
It is unitless.
Simple calculation gives
S
T
G
=
1
1 +GCFS
, S
T
S
=
GCFS
1 +GCFS
Note that (always!)
S
T
G
= 1 +S
T
S
Hence, if one of the sensitivity measures is very small, then the other sensitivity measure
will be approximately 1. So, if T is very insensitive to G (for example

S
T
G

= 0.01), then T
will be nearly 1-to-1 sensitive to S, since the relation shows that

S
T
S

1.
Note that while it is impossible for both sensitivity measures to be small (relative to 1), it
is possible for both sensitivity measures to be large. Generally this would represent a bad
design.
2 Signal-to-Noise ratio
Suppose r = 0, so the desired value of y is zero. Consider the eect of d and n on y. If no
control is used C = 0, then y = Hd. For notational purposes, call that y
no control
. Conversely,
if control is used, then
y
with control
=
H
1 + GCFS
d
GCF
1 +GCFS
n
We want to compare the size of the disturbance d to the size of the noise n. However,
they are in dierent units. By redrawing the block diagram, it is clear that Hd should be
compared to
1
S
n.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 154
Lets look at the ratio of

y
with control
y
no control

as compared to the signal-to-noise ratio,


SNR :=
Hd
n
S
Dividing out gives
y
with control
y
no control
=
1
1+GCFS
+
GCFS
1+GCFS
n
S
Hd
=
1
1+GCFS
+
GCFS
1+GCFS
1
SNR
The desired value of this ratio is 0, since we want y = 0. What are the limits (as related to
the noise-to-signal ratio)?
If Noise-to-Signal ratio is large, the quotient can be made only so small, namely about 1, by
choosing FC 0 (no feedback).
If Noise-to-Signal ratio is small, then by using high-gain (|GCFS| >> 1), the quotient made
about equal to the Noise-to-Signal.
3 Whats missing?
The most important thing missing from the analysis above is that the relationships are not
in fact constant multiplications, and the special nature of the types of signals. Nevertheless,
many, if not all, of the ideas presented here will be applicable even in the more general
setting.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 155
4 Problems
1. (a) For complex numbers A and B, it is a fact that |A+B| |A| + |B|. This is
called the triangle inequality. Draw a picture (in the complex plane) to illustrate
this in a few examples.
(b) Using the triangle inequality, show that for any complex numbers A and B,
|A B| |A| |B|
What is the simple reason that
|A B| |B| |A|
is also true?
2. Suppose L is a complex number, and 0 < < 1.
(a) Show that

1
1 +L

|L|
1

1
(b) Show that
|L|
1

+ 1

1
1 +L


(c) If is very small compared to 1, then
1

1
1

+ 1
1

Combine the rst two parts of this problem into the following quasi-theorem:
If L is a complex number, and 0 < << 1, then

1
1 +L

|L|
1

3. Suppose L is a complex number, and 0 < < 1.


(a) Show that

L
1 +L

|L|

1
(b) Show that
|L|

1 +

L
1 +L


ME 132, Fall 2012, UC Berkeley, F. Borrelli 156
(c) If is very small compared to 1, then

1 +


1

Combine the rst two parts of this problem into the following quasi-theorem:
If L is a complex number, and 0 < << 1, then

L
1 +L

|L|
4. Suppose two systems are interconnected, with individual equations given as
S
1
: y(t) = [u(t) y(t)]
S
2
: u(t) = 2 [y(t) r(t)]
(A.5)
(a) Consider rst S
1
(input u, output y): Show that for any initial condition y
0
, if
u(t) u (a constant), then y(t) approaches a constant y, that only depends on
the value of u. What is the steady-state gain of S
1
?
(b) Next consider S
2
(input (r, y), output u): Show that if r(t) r and y(t) y
(constants), then u(t) approaches a constant u, that only depends on the values
( r, y).
(c) Now, assume that the closed-loop system also has the steady-state behavior
that is, if r(t) r, then both u(t) and y(t) will approach limiting values, u and
y, only dependent on r. Draw a block-diagram showing how the limiting values
are related, and solve for u and y in terms of r.
(d) Now check your answer in part 4c. Suppose y(0) = 0, and r(t) = 1 =: r for all
t 0. Eliminate u from the equations A.5, and determine y(t) for all t. Make a
simple graph. Does the result agree with your answer in part 4c?
Lesson: since the assumption we made in part 4c was actually not valid, the analysis
in part 4c is incorrect. That is why, for a closed-loop steady-state analysis to be based
on the separate components steady-state properties, we must know from other means
that the closed-loop system also has steady-state behavior.
5. Suppose two systems are interconnected, with individual equations given as
S
1
: y(t) = [u(t) +y(t)]
S
2
: u(t) = 2 [r(t) y(t)]
(A.6)
(a) Consider rst S
1
(input u, output y): If u(t) u (a constant), then does y(t)
approach a constant y, dependent only on the value of u?
(b) Next consider S
2
(input (r, y), output u): If r(t) r and y(t) y (constants),
then does u(t) approach a constant u, dependent only on the values r, y?
ME 132, Fall 2012, UC Berkeley, F. Borrelli 157
(c) Suppose y(0) = y
0
is given, and r(t) =: r for all t 0. Eliminate u from the
equations A.6, and determine y(t) for all t. Also, plugging back in, determine u(t)
for all t. Show that y and u both have limiting values that only depend on the
value r, and determine the simple relationship between r and ( y, u).
Lesson: Even though S
1
does not have steady-state behavior on its own, in feedback
with S
2
, the overall closed-loop system does.
6. Consider a problem associated with the general block diagram of the section, involving
C, G, H, S and F. Assume that each component has the steady-state, sinusoidal gain
(SStG) property (see end of Section ?? where the SStG property is dened). Also
assume the the overall interconnection has the SStG property as well (remember: as
illustrated in problem 4, the SStG property of an interconnection does not necessarily
follow from the SStG property of the individual systems, since the interconnection may
itself be unstable).
Below are the frequency-response functions of each component.
G() =
40
j1000 + 60
, H() =
98
j1000 + 60
, C() =
j18.5 + 6.25
j
F() =
1
j0.01 + 1
, S() = 1
Plot the following:
(a) On a single axes, plot

1
1+GCFS

GCFS
1+GCFS

. These should be log


10
-frequency versus
log
10
magnitude.
(b) On the plot above, mark the range of frequencies where Goal 1 (disturbance rejec-
tion) is being achieved. Also mark the range of frequencies where Goal 2 (noise
insensitivity) is being achieved. In lecture, we dened these as being some par-
ticular gain being signicantly less than 1. For the purposes of your markings,
lets agree on a convention that 0.2 will be the limit for signicantly less than
1.
(c) Directly below the rst plot, make a second plot, using the same frequency-range,
showing |GCFS|. This plot relates to the rst set of plots through problems 2
and 3. Please make the connection between this plot and the plots in part 6a.
(d) Directly below the existing plots, make a plot reecting Goal 3 (recall Goal 3 is
reference input tracking, which is that the contribution of r to y is about 1). In
other words, in the absence of d and n, y should behave like r. Plot

1
GC
1 +GCFS

Mark the range of frequencies where this is less than 0.2.


ME 132, Fall 2012, UC Berkeley, F. Borrelli 158
(e) Directly below the existing plots, make a plot of the important quantities reecting
both Goal 1 and Goal 3. Specically, plot |GC| and |1 FS|. Explain how these
plots are consistent with the plots of Goal 1 and Goal 3, looking at the plots in
part 6a and 6d.
(f) Is there a range of frequencies where Goal 2 and Goal 3 are obtained? We can also
check the separate conditions that would have to hold. Directly below the existing
plots, make a plot of the important quantities reecting both Goal 2 and Goal 3.
Specically, plot |1 GC| and |FS|. Explain how these plots are consistent with
the plots of Goal 2 and Goal 3.
(g) Each axes has only a few (1 or 2) plots on them. Create a 2nd copy of the plots,
and then, using dashed lines, add additional lines to the plots for 2 modications
to F, listed below.
F() =
1
j0.001 + 1
, and F() =
1
j0.1 + 1
Roughly, in the frequency ranges where F was already small, we have changed its
magnitude. How does this change manifest itself in Goal 1 and Goal 2.
(h) Create a 3rd copy of the original plots, and then, using dashed lines, add additional
lines to the plots for 2 modications to C, listed below.
C() =
j18.5 + 2
j
, and C() =
j18.5 + 0.625
j
Roughly, in the frequency ranges where C was large, we have changed its magni-
tude. How does this change manifest itself in Goal 1 and Goal 2.
7. Use elementary algebra to derive (A.2) from equation (A.1).
8. We have seen many advantages of feedback, particularly the ability to reduce the
eect of external disturbances and to reduce the sensitivity of the of the overall system
to changes in the plant itself. Feedback also has a linearizing eect, which is used
benecially in the design of ampliers and actuators. In this problem, we study a
non-dynamic analysis of this property.
Suppose that you can build a high-power amplier, whose input/output characteristic
is y = (u), as graphed below.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 159
5 4 3 2 1 0 1 2 3 4 5
4
3
2
1
0
1
2
3
4
5

(
u
)
u
The slope of varies from approximately 0.3 to 1.6.
Now, because of power considerations, assume that you can build a low-power amplier
that is much more linear, in fact, assume that its input/output relationship is u = Ke,
where K is a constant. Consider the closed-loop system shown below.
K
()
g

+
E E E E
T
r e u
y
(a) Write down the relationship between y and r. Because we dont have an exact
formula for , you cannot solve for y in terms of r - instead, you can only write
down the relationship, which implicitly determines how r aects y. Make sure
your equation only involves , r, y and K. It should not involve u or e.
(b) Take K = 5. On graph paper, make a graph of (u) versus u (as above). Also on
the graph, for many dierent values of r, plot
r
1
K
u versus u
Each one of these graphs (straight lines) should intersect the (u)-versus-u graph
at one point. Explain why the intersection point gives the value y(r) (for the
specic r). On a separate graph, graph this function y(r) versus r.
(c) Using the relationship you derived in part 8a, and treating it as an implicit de-
scription of the dependence that y has on r, dierentiate it with respect to r to
get y

(r).
(d) What should be K be chosen as so that the slope of the closed-loop behavior
between y and r varies at most between 0.9 and 1.1.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 160
B Saturation and Antiwindup Strategies
Often times, the allowable values of the control input u(t) are limited. For instance, there
may be constant absolute upper and lower bounds, u, u such that
u u(t) u
must hold for all t. As examples,
the ailerons on an airplane wing may only deect about 30

before they reach structural


stops
In a car (the cruise-control example) there is a maximum throttle opening
Other types of constraints are possible: in the airplane example, the ailerons (along with
other movable surfaces) have maximum rates of movement. On a ghter plane, for instance,
there may be a physical limit on the ailerons of 250

/sec.
This can lead to performance, which is worse than the situation with no limits, for two
reasons:
1. Ultimate response-times of the system are usually longer, since the actual inputs are
generally smaller. This is a simple fact-of-life, and must be accepted.
2. The control strategy does not take this possibility into account, and has poor behavior
if there is any time interval where the input becomes saturated. This is potentially
much worse than the rst reason, and must be remedied.
In all of these dierent cases, the control action (ie., u(t)) is limited, or constrained. Explicitly
designing the control law to respect these limiting constraints is a very dicult mathematical
problem. Often times, the constraints are dealt with using special tricks, and intuition, often
on a problem-by-problem basis.
1 Saturation
We will consider a special case of the general problem. In the ideal situation, there are no
limits on the control action, and the block diagram of the closed-loop system appears as
usual, as below
C P
E E E E
T
i
+

r(t)
e(t) u(t)
y(t)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 161
The nonideal, or real, scenario is that there is a saturating element in between the controller
and the plant, which limits the control action, regardless of the control systems output.
C P
E E E E E
T
i
+

r(t)
e(t) u
des
(t) u(t)
y(t)
The behavior of the saturating element is simply
u(t) =
U
max
if u
des
(t) U
max
u
des
(t) if U
min
< u
des
(t) < U
max
U
min
if u
des
(t) U
min
Note that one manner to think about this situation is that the controller asks for a desired
control input, though the actuator can only deliver inputs that satisfy certain problem-
dependent constraints.
Our goal is to learn how to implement the controller with extra logic so that when u is
in bounds, the performance is the ideal performance, and for scenarios where u reaches
its limits, the presence of the saturating element should not wreak too much havoc on the
performance of the closed-loop system.
First, to see that this may cause problems, consider the cruise-control problem, from Section
4, with PI control. The simulations are performed for several values of U
min
and U
max
. For
simplicity, we take U
min
:= U
max
(so the saturating element is symmetric, which may or
may not be realistic in a car example...). The details of the simulations are:
parameters are E = 40, = 60, G = 98, m = 1000,
K
P
and K
I
are chosen so that the closed-loop poles are characterized by ( = 0.7,
n
=
0.6).
Initial conditions are v(0) = 25, z(0) =
v(0)
EK
I
. This choice for z(0) ensures that when
the simluation starts, with v
des
(0) = 25 (which is the current speed), the value of z
is the correct value so that speed of the car remains at 25 (until v
des
changes, or a
disturbance acts).
Several values of U
max
, namely {, 110, 100, 90, 80, 70, 60}
Step change of v
des
, from 25 to 30 at t = 10
Step change of d, from 0 to 2.5 at t = 40
ME 132, Fall 2012, UC Berkeley, F. Borrelli 162
0 10 20 30 40 50 60
25
26
27
28
29
30
31
32
33
Velocity
0 10 20 30 40 50 60
20
40
60
80
100
120
140
Actual Control
0 10 20 30 40 50 60
4
6
8
10
12
14
16
18
20
Controller Integrator
ME 132, Fall 2012, UC Berkeley, F. Borrelli 163
Note that as U
max
decreases, the closed-loop performance degrades quite ungracefully. Even
though the maximum acceleration is limited, and the slope is decreased, the overshoot ac-
tually gets worse!.
The problem is that once the controller output u(t) exceeds U
max
, it is of no use for the
variable z to keep increasing, since increases its value, which causes increases in u(t) =
K
P
[v
des
(t) v(t)] +K
I
z(t) occur with no benet the maximum force, that associated with
U
max
is already being applied. In fact, not only is there no benet to increasing the variable z
in this scenario, there is actually a signicant drawback. Once z is increased beyond a useful
value, decreasing it has no immediate eect, since the value of K
P
[v
des
(t) v(t)] + K
I
z(t)
is still well above the threshold U
max
. So, the control circuitry wastes valuable time getting
z back down to a useful level, at which changes in it actually lead to changes in the true
applied force.
In this case, the accepted terminology is that the integral controller wound up, causing
unnecessary overshoot and oscillations.
In order to avoid integral wind-up, we need some additional circuitry or software in the
control logic which essentially turns o the controller integrator in certain situations.
2 Anti-Windup PI control action
For a general PI controller, let r(t) denote the reference signal, which is the desired value of
the plant output, and let y(t) denote the actual plant output. The PI controller equations
are
z(t) = r(t) y(t)
u
des
(t) = K
P
[r(t) y(t)] + K
I
z(t)
(B.1)
The saturating element maps the desired control input into the actual control input,
u(t) =
U
max
if u
des
(t) U
max
u
des
(t) if U
min
< u
des
(t) < U
max
U
min
if u
des
(t) U
min
Suppose (for clarity) that K
I
> 0. You need to rearrange some inequalities if K
I
< 0. One
viable strategy is
If u is in-bounds, run as usual
If u is at U
max
, and r y > 0, running as usual would increase z, increasing u
des
, at
no benet, only screwing up the ability to come o (since decreasing z would initially
then have no benet). So, stop integrator.
If u is at U
max
, and r y < 0, continue integrating.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 164
If u is at U
min
, and r y > 0, run as usual
If u is at U
min
, and r y < 0, stop integrator.
Mathematically, this is
u
des
(t) := K
P
[r(t) y(t)] + K
I
z(t)
if u
des
(t) U
max
and r(t) y(t) z(t) = 0
elseif u
des
(t) U
max
and r(t) y(t) z(t) = r(t) y(t)
if u
des
(t) U
min
and r(t) y(t) z(t) = 0
elseif u
des
(t) U
min
and r(t) y(t) z(t) = r(t) y(t)
(B.2)
Doing so yields much better performance. The plots are shown on the next page.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 165
0 10 20 30 40 50 60
25
26
27
28
29
30
31
Velocity
0 10 20 30 40 50 60
20
40
60
80
100
120
140
Actual Control
0 10 20 30 40 50 60
4
4.5
5
5.5
6
6.5
7
7.5
8
8.5
Controller Integrator
ME 132, Fall 2012, UC Berkeley, F. Borrelli 166
3 Alternate architecture for AntiWindup Logic
Shown below is an alternate architecture, that uses traditional feedback to approximately
prevent windup.
K
P
_
K
I
K
P
SAT
G
K
AW
E E E E E E E E
E
E
f f f
f f
f
c
c
'
T
c c
' ' '
T

u
act,meas

1
f
If we look at the inner-loop, where the antiwindup loop is, we see
_
K
I
K
P
K
AW
E e E E E e E
c
e' '
T
c



u
des
u
act

Note that the response from u


act
to u
des
is a rst-order system, with steady-state gain equal
to 1, and time constant equal to
K
P
K
I
K
AW
. So, this logic attempts to keep the value of the
output of the integrator (using feedback to the integrators input) such that the desired value
of u stays close to the actual value of u, implicitly preventing integrator windup.
This will be demonstrated in class with a Simulink model, and you will carry this out in lab
next week.
4 Problems
1. In simple mathematical models for actuators (like the motor/aileron control surface on
an airplane), often we would like to capture the fact that the output of the actuator
(the angular position of the ap) cannot move faster than a certain limit, but otherwise
responds like a rst-order system.
(a) A block diagram of a model for this behavior is shown below. Assume that > 0.
The saturation block has the static (nondynamic) relationship shown in its block
- the output is the input for small inputs, but beyond a certain range, the output
is limited.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 167
1

sat

()
_
g

+
E E E E E
T
r v
y y
sat

(v) =
if v >
v if v
if v <
There are actually three (3) dierent regimes in which this model behaves dier-
ently. For each of the cases below, explain what y(t) is in each regime:
i. What is y(t) when r(t) < y(t) < r(t) +
ii. What is y(t) when y(t) < r(t)
iii. What is y(t) when r(t) + < y(t)
(b) Starting from zero (0) initial conditions, determine the steady-state value of y due
to a step input r(t) = r, where r is some xed real number. Think carefully how
y will transition from its initial condition of y(0) = 0 to its nal value.
(c) An input signal r(t) is shown below. On the same graph, draw the resulting
output y(t), starting from initial condition y(0) = 0. Do this using your results
in part (1a), for the following cases
i. = 0.5, = 0.4.
ii. = 0.5, = 0.7.
iii. = 0.5, = 1.0.
iv. = 0.5, = 1.4.
v. = 0.5, = 5.0.
Two sets of axes are given for your convenience. As you are thinking out roughly
how things look, use the top axes to sketch your ideas. As you nalize your
answer, please make your nal (neat) graphs on the bottom axes.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 168
0 1 2 3 4 5 6 7 8 9 10
0
0.5
1
1.5
2
2.5
3
0 1 2 3 4 5 6 7 8 9 10
0
0.5
1
1.5
2
2.5
3
ME 132, Fall 2012, UC Berkeley, F. Borrelli 169
C Robustness Margins
Three common measures of insensitivity of a closed-loop system to variations are
the time-delay margin,
the gain margin, and
the percentage variation margin.
All are easily computed, and provide a quantitative measure of the insensitivity of the closed-
loop system to specic types of variations. The nominal closed-loop system is shown below.
C P
E E E E
T
i
+

r(t)
e(t) u(t)
y(t)
We assume that both P and C are governed by linear, ordinary dierential equations, and
that the nominal closed-loop system is stable.
The perturbed closed-loop system is shown below, with both a gain variation in the plant,
a time-delay in the feedback measurement, and a change in process from P to

P.
C


P
delay, T
E E E E E
'
T
i
+

r(t)
e(t) u(t)
y(t)
f(t) = y(t T)
Note that if T = 0, = 1 and

P = P, then the perturbed system is simply the nominal
closed-loop system.
The time-delay margin is characterized by the minimum time delay T > 0 such that the
closed-loop system becomes unstable, with set equal to its nominal value, = 1, and

P = P.
The gain margin is characterized by the largest interval
_
,
_
, containing 1, such that the
closed-loop system is stable for all
_
,
_
, with T set to its nominal value, T = 0, and

P = P
ME 132, Fall 2012, UC Berkeley, F. Borrelli 170
The percentage variation margin is a frequency-dependent bound (), such that the closed-
loop system is stable for all

P which satisfy satises

P(j) P(j)
P(j)

< () for all .


assuming = 1, T = 0.
Two viewpoints can be taken regarding the interpretation of these margins:
1. We are explicitly concerned about the destabilizing eects of time-delays, gain changes
and percentage changes in frequency responses, and these margins give exact answers
with respect to those variations.
2. While not being explicitly concerned with time-delays and/or gain changes and/or
percentage changes in frequency response functions, we are cognizant of the fact that
the model dierential equation we use for the plant is not entirely accurate. In that
vein, we would like some easily computable information concerning the sensitivity (or
insensitivity) of the stability of the closed-loop system to unmodeled variations. We
use the computed margins as indications of the potential for instability brought on by
variations in the plants behavior.
In any case, the goal of this section is to learn how to compute such margins and do examples
to gain understanding. Initially, we will focus on the gain margin and time-delay margin,
and return to the percentage variation margin at the end of the section.
Since linear, single-input, single-output systems commute, we can redraw the diagram, pre-
serving both the stability characteristics, and the relationship from r to y as

C P
L
delay, T
E E E E E
'
T
i
+

r(t)
e(t) v(t)
y(t)
f(t) = y(t T)
By convention, if P denotes the nominal plant, then

P(s) will denote the transfer function
of the nominal plant. Similar convention for controller and in fact, any dynamical system. A
capital letter denotes the system itself while the hatted capital letter denotes the systems
transfer function.
For certain computational purposes, we denote the cascade of C and P as the system L. In
terms of transfer functions, we have

L(s) =

P(s)

C(s) (see section 9). Assume

L is of the
form

L(s) =
b
1
s
n1
+ +b
n1
s +b
n
s
n
+a
1
s
n1
+ +a
n1
s + a
n
ME 132, Fall 2012, UC Berkeley, F. Borrelli 171
This is equivalent to the dierential equation relating v to y as
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n1
y
[1]
(t) +a
n
y(t) = b
1
v
[n1]
(t) + +b
n1
v
[1]
(t) +b
n
v(t)
Under both types of perturbations, we get that
v(t) = [r(t) y(t T)]
Note that for any k, v
[k]
(t) =
_
r
[k]
(t) y
[k]
(t T)

. Plugging in and rearranging gives the


closed-loop delay-dierential equation
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n1
y
[1]
(t) +a
n
y(t)
+
_
b
1
y
[n1]
(t T) + +b
n1
y
[1]
(t T) +b
n
y(t T)

=
_
b
1
r
[n1]
(t) + +b
n1
r
[1]
(t) +b
n
r(t)

(C.1)
It is from this equation that we begin our analysis, though most of our computations will
ultimately involve the transfer function

L(s) evaluated along the imaginary axis s = j.
1 Gain Margin
The setup for the gain margin problem is shown in Figure C, with T = 0. Here, a plant
and controller are in closed-loop along with a gain at the plant input. We assume that
the closed-loop system is stable for = 1, and we wish to know the largest interval
_
,
_
such that closed-loop stability is maintained for all
_
,
_
. Since the closed-loop system
is stable for = 1, it is clear that < 1 < .
With the time-delay T = 0, the dierential equation (C.1) becomes an ordinary dierential
equation,
y
[n]
(t) + (a
1
+b
1
) y
[n1]
(t) + + (a
n1
+b
n1
) y
[1]
(t) + (a
n
+b
n
) y(t)
=
_
b
1
r
[n1]
(t) + +b
n1
r
[1]
(t) +b
n
r(t)

Clearly, the closed-loop characteristic polynomial is a function of , namely


p

() =
n
+ (a
1
+b
1
)
n1
+ (a
2
+b
2
)
n2
+ + (a
n1
+b
n1
) + (a
n
+b
n
)
It is a fact from mathematics that the roots of the characteristic polynomial are continuous
functions of the parameter , hence as varies, the roots vary continuously. Therefore,
the only way for a root of p

to move (as changes) from the left-half plane


into the right-half plane is to cross the imaginary axis, either at 0, or at some
j, with > 0 (since complex roots come in conjugate pairs, if they cross the
imaginary axis, one will cross positively, and one negatively - we can focus on
one or the other, and for no specic reason, we look at the positive crossing).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 172
Hence, in assessing the gain margin, we are looking for values and , with close to 1,
and 0 such that = j is a root of p

. Plugging in gives
(j)
n
+ (a
1
+b
1
)(j)
n1
+ (a
2
+b
2
)(j)
n2
+ + (a
n1
+b
n1
)(j) + (a
n
+b
n
) = 0
Rearranging gives
[(j)
n
+a
1
(j)
n1
+a
2
(j)
n2
+ +a
n1
(j) +a
n
]
+ [b
1
(j)
n1
+b
2
(j)
n2
+ +b
n1
(j) +b
n
] = 0
. (C.2)
This is two equations (since it relates complex quantities) in two real unknowns ( and ).
We need to nd all solutions, and then isolate the solutions whose coordinate is closest to
1.
First, we can look for solutions to (C.2) by looking for imaginary-axis roots (ie., real ) to
p
=0
(j) = 0, namely
(j)
n
+a
1
(j)
n1
+a
2
(j)
n2
+ +a
n1
(j) +a
n
= 0.
If there are roots, then coupled with = 0, we have found some solutions to equation (C.2).
There likely are others, with = 0, which are described below.
We can also look for solutions to (C.2) with (j)
n
+a
1
(j)
n1
+a
2
(j)
n2
+ +a
n1
(j) +
a
n
= 0, so that after dividing, we manipulate equation (C.2) into
1 =
b
1
(j)
n1
+b
2
(j)
n2
+ +b
n1
(j) +b
n
(j)
n
+a
1
(j)
n1
+a
2
(j)
n2
+ +a
n1
(j) +a
n
But, this is recognized as
1 =

L(s)

s=j
This can be solved graphically, nding values of for which

L(s)

s=j
is a real number (and
then taking a negative reciprocal to nd the associated value).
Summarizing, a simple method to determine all solutions to equation (C.2) is
1. Let
i
denote all (if any) of the real solutions to
(j)
n
+a
1
(j)
n1
+a
2
(j)
n2
+ +a
n1
(j) +a
n
= 0.
If there are any, then the pairs (
i
, 0) are solutions to equation C.2.
2. Next, plot (in the complex plane, or on separate magnitude/phase plots) the value of

L(j) as ranges from 0 to . By assumption, this plot will not pass through the
1 point in the complex plane (can you explain why this is the case?).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 173
3. Mark all of the locations, {
1
,
2
, . . . ,
k
}, where

L(j) is a real number. The fre-
quencies
k
are called the phase-crossover frequencies. Sometimes, the terminology
phase-crossover frequencies only refers to frequencies where where

L(j) is a negative
real number.
4. At each phase crossover point,
k
, determine the associated value of by computing

k
:=
1

L(s)

s=j
k
5. Make a list of all of the values obtained in the calculations above (step 1 and 4).
For all solutions with
k
< 1, nd the one closest to 1. Label this . Similarly, for all
solutions with
k
> 1, nd the one closest to 1. Label this . In the event that there
are no solutions less than 1, then = . Similarly, if there are no solutions greater
than 1, then = .
Graphically, we can determine the quantity easily. Find the smallest number > 1 such
that if the plot of L(j) were scaled by this number, it would intersect the 1 point. That
is . This is easily done by computing the closest intersection of the curve

L(j) (as
varies) with the real axis, to the right of 1, but less than 0. If the intersection occurs at
the location , then scaling the plot of

L by
1

will cause the intersection. By choosing


the closest intersection, is close to 1, and hence :=
1

is the desired value. Note: It


is possible that there are no intersections of the curve

L(j) of the real axis to the right of
1 but less than 0. In that case, the closed-loop system is stable for all values of in the
interval [1, ), hence we dene := .
If the plot of

L(j) as varies intersects the negative real axis to the left of 1, then > 0,
and it is easy to determine. Simply nd the largest positive number < 1 such that if the plot
of

L(j) were scaled by , it would intersect the 1 point. This is easily done by computing
the closest intersection of the curve

L(j) (as varies) with the real axis, to the left of 1.
If the intersection occurs at the location , then scaling the plot of

L by
1

will cause the


intersection. By choosing the closest intersection, is close to 1, and hence :=
1

is the
desired value.
In the above computations, each intersection of the curve

L(j) (as varies) with the
negative real axis is associated with two numbers:
1. The location (in the complex plane) of the intersection, of which the negative reciprocal
determines the gain that would cause instability.
2. The value of at which the intersection takes place, which determines the crossing
point (on the imaginary axis) where the closed-loop root migrates from the left-half
plane into the right-half plane, and hence determines the frequency of oscillations just
at the onset of instability due to the gain change.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 174
2 Time-Delay Margin
The homogeneous equation, with = 1, but T > 0 of equation (C.1) is
y
[n]
(t) +a
1
y
[n1]
(t) + +a
n1
y
[1]
(t) +a
n
y(t)
+ b
1
y
[n1]
(t T) + +b
n1
y
[1]
(t T) +b
n
y(t T) = 0
(C.3)
Recall that we assume that for T = 0, the system is stable, and hence all homogeneous
solutions decay exponentially to 0 as t . It is a fact (advanced) that as T increases
the system may eventually become unstable, and if it does, then at the critical
value of T for which stability is violated, sinusoidal solutions to the homoge-
neous equation exist. In other words, the system goes unstable by rst exhibiting purely
sinusoidal homogeneous solutions. The frequency of this sinusoidal solution is not known
a-priori, and needs to be determined, along with the critical value of the time-delay.
The delay terms may cause a non-decaying homogeneous solution to exist. We pose the
question: what is the minimum T and corresponding frequency such that a sinusoidal
solution to (C.3) of the form y
H
(t) = e
jt
exists? If such a solution exists, then by plugging
it into (C.3), and canceling the common e
jt
term, which is never 0, we get a necessary
algebraic condition
(j)
n
+a
1
(j)
n1
+ +a
n1
j +a
n
e
jT
_
b
1
(j)
n1
+ +b
n1
j +b
n

= 0
Rearranging gives
1 = e
jT
b
1
(j)
n1
+b
2
(j)
n2
+ +b
n1
(j) +b
n
(j)
n
+a
1
(j)
n1
+a
2
(j)
n2
+ +a
n1
(j) +a
n
But, this is recognized as
1 = e
jT

L(s)

s=j
This is two equations (since it relates complex quantities) in two real unknowns (T and ).
We want to solve for solutions with T close to 0 (recall that 0 was the nominal value of T,
and we assumed that the closed-loop system was stable for that). Since T is real, it follows
that

e
jT

= 1. This gives conditions on the possible values of , namely

L(j)

= 1.
Once these values of are known, the corresponding values of T can be determined, and
the smallest such T becomes the time-delay margin.
In order to understand the graphical solution techniques described, recall that for any com-
plex number , and any real number , we have
e
j
= +
Hence, at any value of , we have
e
jT

L(j) = T +

L(j)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 175
Also, (1) = .
Hence, a simple method to determine solutions is:
1. Plot (in the complex plane, or on separate magnitude/phase plots) the quantity

L(j)
as varies from 0 to .
2. Identify all of the frequencies
i
> 0 where

L(j
i
)

= 1. These are called the gain-


crossover frequencies.
3. At each gain-crossover frequency
i
, (which necessarily has

L(j
i
)

= 1), determine
the value of T > 0 such that e
j
i
T

L(j
i
) = 1. Recall that multiplication of any
complex number by e
j
i
T
simply rotates the complex number
i
T radians in the
clockwise (negative) direction. Hence, each T can be determined by calculating the
angle from

L(j) to 1, measured in a clockwise direction, and dividing this angle
by . On a phase plot, determine the net angle change in the negative direction
(downward) to get to the closest odd-multiple of (or 180

).
4. Repeat this calculation for each gain-crossover frequency, and choose the smallest of
all of the Ts obtained.
3 Percentage Variation Margin
Suppose that P and C are the transfer functions of a plant and controller, respectively.
Assume that the closed-loop system, shown below, is stable.
C P
E k E E k
c
E E
T
u
1
e
1
e
2
y
1
y
2
u
2

Hence all of the closed-loop transfer functions (from u


i
to e
j
and from u
i
to y
k
) have poles
in the open-left-half plane.
Suppose that due to uncertainty, the actual plant transfer function is
P
actual
= P(1 + (s))
ME 132, Fall 2012, UC Berkeley, F. Borrelli 176
where is an unknown, stable system, representing the uncertainty in P. In block-diagram
form, P
actual
looks like

P
E E E e
E
c
With this model, it follows that
=
P
actual
P
P
so in some sense, represents a relative uncertainty.
In this case, the closed-loop system is actually of the form
C P

E E E E E E
T
e

E
c
e
c
e
Note that is eectively in positive feedback with the transfer function
PC
1+PC
. In other
words, the perturbed closed-loop system can be thought of as the feedback interconnection
of two stable systems, namely and
PC
1+PC
. Since the nominal closed-loop is stable,
PC
1+PC
is
stable, and hence the addition of the stable transfer function can only lead to instability
if the loop introduced by that introduces is unstable.
C P

E E E E E E
T
e

T
E
c
c
e
c
e
PC
1+PC
Therefore, stability of the perturbed closed-loop can be assessed by studying the stability of
ME 132, Fall 2012, UC Berkeley, F. Borrelli 177
PC
1+PC

E E E
c
' ' '
T
e
e
where only limited information about is available. For this type of analysis, we
3.1 The Small-Gain Theorem
This section presents an important theorem from system theory, called the Small Gain
Theorem. We introduce it in its simplest form, and then derive a test for establishing
stability in the presence of uncertain components.
Small Gain Theorem: Suppose G is a stable system. Let

G(s) be its transfer function. If
max
R

G(j)

< 1 (C.4)
then the unity feedback connection of G, shown below, is stable.
G
Ed E E
T
r
u
y
+
+
Derivation: Let the transfer function of G be

G(s) =
N(s)
D(s)
=
b
0
s
n
+b
1
s
n1
+ +b
n1
s +b
n
s
n
+a
1
s
n1
+ +a
n1
s +a
n
where the N and D are polynomials. By assumption of stability of G, we know that the
roots of D(s) = 0 are all in the left-half plane. Also, setting s = j, and taking very large,
the assumption in equation (C.4) implies that |b
0
| < 1.
The characteristic polynominal of the feedback connection is
p(s) = N(s) D(s)
We want to verify that the roots of p(s) = 0 all have negative real-parts.
For 0 1, consider the polynomial
p

(s) = N(s) D(s)


= (b
0
1)s
n
+ (b
1
a
1
)s
n1
+ + (b
n
a
n
)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 178
For every value of in between 0 and 1, this is an nth order polynomial, and it has n roots.
Note that at = 0 and = 1, we have two extremes.
p
0
= D(s), p
1
(s) = p(s)
We ultimately want to conclude that p
1
has no roots in the RHP.
We know that the roots of p
0
all have negative real parts.
We know that the roots of p

are continuous functions of .


Note: If we show that for every in between 0 and 1, the polynomial p

has no roots on
the imaginary axes (ie., no roots with zero real-parts), then it must be that p
0
and p
1
have
the same number of roots in the left-half-plane (since as varied from 0 to 1, no roots cross
the imaginary axes).
So, pick any in between 0 and 1, and any . By assumption
|G(j)| =

N(j)
D(j)

|G(j)| < 1
Hence N(j) D(j) = 0. This shows that for every in between 0 and 1, the polynomial
p

has no roots on the imaginary axes, completing the proof.


Small Gain Theorem #2: Suppose G and H are both stable systems. If
max
R

G(j)

H(j)

< 1
then the feedback connection of G and H, shown below, is stable.
H
G
E E E
c
' ' '
T
e
e
Derivation: The cascade of G and H is itself a stable system, and the frequency response
function of the cascade is the product of the individual frequency responses.
Corollary: Suppose G and H are both stable systems. If
max
R

G(j)

max
R

H(j)

< 1
then the feedback connection of G and H is stable.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 179
3.2 Necessary and Sucient Version
Theorem NS1: Suppose G is a given, stable system. Given any > 0, if
max
R

G(j)

> ,
then there is a stable system H such that
max
R

H(j)

<
1

such that the feedback connection of G and H is unstable.


Theorem NS2: Suppose G is a given, stable system. Assume G(j) = 0 for all R.
For any frequency R with > 0, there exists a stable system H

such that
1. for all R, =
|H

(j)| <

1
G(j)

2. at ,
|H

(j )| =

1
G(j )

3. The feedback connection of G and H is unstable.


There are two independent facts about transfer functions that are used to prove these theo-
rems
Fact 1: Given a positive > 0, and a complex number , with Imag () = 0, there is a
> 0 such that by proper choice of sign
||
s
s +

s=j
=
Remark: In other words, given any positive frequency > 0, and any complex number
, there is a stable, rst-order system, (s) that has a at frequency-response magnitude
(across all frequency) and satises (j ) = .
The proof is as follows (details provided in class): For a positive , the plot of
s
s +
as s
takes on values of j, with ranging from 0 to +, traverses a circular arc in the complex
plane, from 1 (at = 0) to 1 (as +) clockwise, centered at 0, and in the top-half of
the complex plane. Similarly, the plot of
s
s +
as s takes on values of j, with ranging
from 0 to +, traverses from 1 (at = 0) to 1 (as +) clockwise, in the bottom-half
plane. Therefore, the choice of + or sign depends on the imaginary part of . Here is a
constructive procedure for the case Imag() > 0 (verify that this is indeed correct).
ME 132, Fall 2012, UC Berkeley, F. Borrelli 180
1. Write as = || e
j
for a real number .
2. Pick :=
_
1cos
1+cos
If Imag() < 0, use above procedure with replacing . Then, add the () sign to the
transfer function.
Fact 2: For any > 0 and any 0 < < 1, dene the transfer function
I(s) :=
2 s
s
2
+ 2 s +
2
Then
1. for all R, =
|I(j)| <

1
G(j)

2. at ,
I(j ) = 1
3. I is stable.
The proof of this is just simple verication of the claims.
Now, returning Theorem NS1. Suppose G is a given, stable system, > 0, and
max
R

G(j)

> ,
Pick > 0 so that

G(j )

> . Next, construct H using the construction above, with


:=
1

G(j )
. It follows that
max
R

H(j)

=
1

G(j )

<
1

and
_
1 +

G(s)

H(s)
_

s=j
= 0, implying that
1
1+

G

H
has a pole at s = j .
Alternatively, for Theorem NS2, since G(j) is never 0, it follows that you can write
G(s) =
n
L
(s)n
R
(s)
d(s)
where the roots of n
L
(s) = 0 are in the open left-half plane, and the roots of n
R
(s) = 0 are
in the open right-half plane. Dene
(s) :=
d(s)
n
L
(s)n
R
(s)
There are two relevant facts about the polynomial n
R
(s), which are:
ME 132, Fall 2012, UC Berkeley, F. Borrelli 181
1. since the roots of n
R
(s) = 0 are in the open right-half plane, it follows that the roots
of n
R
(s) = 0 are in the open left-half plane;
2. since the coecients of n
R
(s) are real, it follows that n
R
(j) is the complex conjugate
of n
R
(j) and consequently the magnitudes are the same.
Therefore is stable, and for all
|(j)| =
1
|G(j)|
Now pick > 0, and the proper choice of so that

s
s +
(s)

s=j
=
1
G(j )
Finally with any 0 < < 1, dene H as
H(s) := ()
2 s
s
2
+ 2 s +
2
s
s +
(s)
It is easy to verify that H has all of the properties claimed in Theorem NS2.
3.3 Application to Percentage Variation Margin
Recall that the stability of the perturbed closed-loop can be assessed by studying the stability
of
PC
1+PC

E E E
c
' ' '
T
e
e
We can now apply the various small-gain theorems, with
PC
1+PC
playing the role of G, and
playing the role of H.
The rst small gain theorem implies that if is stable, and satises
|(j)| <
1
PC(j)
1+PC(j)
=

1 +PC(j)
PC(j)

for all , then stability is assured.


By contrast, Theorem NS2 implies that for any , there exists a stable such that
ME 132, Fall 2012, UC Berkeley, F. Borrelli 182
1. for all R, =
|(j)| <

1 +PC(j)
PC(j)

2. at ,
|(j )| =

1 +PC(j)
PC(j)

3. The feedback connection of


PC
1+PC
and is unstable, with a closed-loop pole at s = j .
Hence, the function
M
PV
() :=

1 +PC(j)
PC(j)

is a robustness margin, representing how much relative uncertainty, frequency-by-frequency,


that can tolerated in the plant without loss of stability in the closed-loop system.
4 Summary
We have introduced 3 margins. Each measure, in dierent senses, how close the loop gain, L,
gets to the (-1) point. The gain margin measures the distance along the real axis; the time-
delay margin measures the distance along a circular arc (the unit circle) and normalizes by
frequency; while the Percentage-Variation margin quanties the distance in a more absolute
manner. All 3 margins are easy to compute, knowing the loop-gain, and should be computed
and compared when understanding tradeos between multiple competing control system
designs.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 183
5 Examples
5.1 Generic
Consider a system with

L(s) =
4
(0.5s + 1)
3
The plots of

L(j)

L(j), and

L(j) as varies are shown below. We will do calculations
in class.
10
0
10
1
10
2
10
1
10
0
10
1
Loop Gain
1 0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
3
2.5
2
1.5
1
0.5
0
0.5
1
Nyquist Plot
10
0
10
1
250
200
150
100
50
0
Loop Phase
ME 132, Fall 2012, UC Berkeley, F. Borrelli 184
5.2 Missile
A missile is controlled by deecting its ns. The transfer function of a the Yaw axis of a
tail-n controlled missile is

P(s) =
0.5(s
2
2500)
(s 3)(s
2
+ 50s + 1000)
A PI controller, with transfer function

C(s) =
10(s + 3)
s
is used. This results in a stable closed-loop system, with closed-loop roots at
8.1 j14.84, 18.8, 6.97
Plots of the

L are shown below, along with some time responses.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 185
10
0
10
1
10
2
10
0
10
1
10
2
L
o
g

M
a
g
n
i
t
u
d
e
Frequency (radians/sec)
10
0
10
1
10
2
80
100
120
140
160
180
200
220
P
h
a
s
e

(
d
e
g
r
e
e
s
)
Frequency (radians/sec)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 186
5 4 3 2 1 0 1
2
1.5
1
0.5
0
0.5
1
1.5
2
Nyquist Plot
0 0.05 0.1 0.15 0.2 0.25 0.3
0.1
0
0.1
0.2
0.3
0.4
0.5
Time: seconds
G

s
OpenLoop Missile Step Response
ME 132, Fall 2012, UC Berkeley, F. Borrelli 187
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.5
0
0.5
1
1.5
2
Missile Acceleration Response
Time: Seconds
Y
a
w

A
c
c
e
l
e
r
a
t
i
o
n
:

G

s
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
8
6
4
2
0
2
4
6
8
10
12
Fin Deflection
Time: Seconds
D
e
g
r
e
e
s
ME 132, Fall 2012, UC Berkeley, F. Borrelli 188
5.3 Application to percentage variation margin
Take the missile example from Section 17,
P(s) =
0.5(s
2
2500)
(s 3)(s
2
+ 50s + 1000)
, C(s) =
10(s + 3)
s
We will also try
P
perturbed
(s) = P(s)
1
s + 1
Note this is the same as
P(s)
1
s + 1
= P(s)
_
1 +
s
s + 1
_
Hence, the percentage variation in going from P to P
perturbed
is
P
perturbed
P
P
=
s
s + 1
Lets plot the magnitude of this versus the percentage-variation margin for dierent values
of .
ME 132, Fall 2012, UC Berkeley, F. Borrelli 189
10
0
10
1
10
2
10
3
10
3
10
2
10
1
10
0
10
1
10
2
10
3
10
0
10
1
10
2
10
3
80
100
120
140
160
180
200
220
ME 132, Fall 2012, UC Berkeley, F. Borrelli 190
10
0
10
1
10
2
10
3
10
5
10
4
10
3
10
2
10
1
10
0
10
1
10
2
10
3
Step Response
Time (sec)
A
m
p
l
i
t
u
d
e
0 0.5 1 1.5
0
0.5
1
1.5
2
ME 132, Fall 2012, UC Berkeley, F. Borrelli 191
10
0
10
1
10
2
10
3
10
3
10
2
10
1
10
0
10
1
10
2
10
3
Step Response
Time (sec)
A
m
p
l
i
t
u
d
e
0 0.5 1 1.5
0
0.5
1
1.5
2
ME 132, Fall 2012, UC Berkeley, F. Borrelli 192
6 Problems
1. Consider the multiloop interconnection of 4 systems shown below.
d d d
T
c c
G
E H
F
E E E E E E
'
c
'
T

+
+
r
y
q
z p
(a) What is the transfer function from q to z? Denote the transfer function as G
qz
(b) What is the transfer function from q to p? Denote the transfer function as G
qp
(c) Verify that 1 +G
qp
= G
qz
.
2. Suppose C(s) =
4
s
and P(s) = 2 in a standard Controller/Plant feedback architecture,
with negative feedback.
(a) Is the closed-loop system stable?
(b) What is the closed-loop transfer function from r to y.
(c) What is the steady-state gain from r y?
(d) What is the time-constant of the closed-loop system.
(e) What is the time-delay margin? Denote it by T
d
. At what frequency will the
self-sustaining (ie., unstable) oscillations occur?
(f) Verify your answers with Simulink, using time delays of 0,
1
10
T
d
,
3
10
T
d
,
5
10
T
d
,
7
10
T
d
,
9
10
T
d
,
9.9
10
T
d
.
3. Suppose C(s) =
K
s
and P(s) = in a standard Controller/Plant feedback architecture,
with negative feedback. Assume both and K are positive.
(a) Is the closed-loop system stable?
(b) What is the closed-loop transfer function from r to y.
(c) What is the steady-state gain from r y?
(d) What is the time-constant of the closed-loop system.
(e) What is the time-delay margin?
(f) What is the ratio of the time-constant of the closed-loop system to the time-delay
margin? Note that this ratio is not a function of and/or K.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 193
4. The transfer functions of several controller/process (C/P) pairs are listed below. Let
L(s) := P(s)C(s) denote the loop transfer function. For each pair, consider the closed-
loop system
C P
E E E E
T
i
+

r(t)
e(t) u(t)
y(t)
determine the closed-loop characteristic polynomial;
compute the roots of the closed-loop characteristic polynomial, and verify that
the closed-loop system is stable;
for the gain-margin problem, nd all of the phase-crossover frequencies, and the
value of L at those frequencies;
determine the gain-margin of the closed-loop system;
for the time-delay-margin problem, nd all of the gain-crossover frequencies, and
the value of L at those frequencies;
determine the time-delay-margin of the closed-loop system;
determine and plot (as a function of frequency) the percentage-variation margin,
considering changes in P. For cases (a) and (b) below, plot this margin on the
same plot for comparison purposes later.
The systems are:
(a) C(s) =
2.4s+1
s
, P(s) =
1
s1
(b) C(s) =
0.4s+1
s
, P(s) =
1
s+1
(c) C(s) =
10(s+3)
s
, P(s) =
0.5(s
2
2500)
(s3)(s
2
+50s+1000)
5. In problem 4 above, the rst two cases have identical closed-loop characteristic polyno-
mials, and hence identical closed-loop roots. Nevertheless, they have dierent stability
margins. In one case, the plant P is unstable, and in the other case it is stable. Check
which case has better stability margins in each of the dierent measures. Make a con-
clusion (at least in the case) that all other things being equal, it is harder to reliably
control an unstable plant than it is a stable one. This is a similar conclusion to what
we reached in problem 9 of Section 7.
6. Find L
e
for determining time-delay and/or gain margins at the locations marked by
1, 2 and 3.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 194
d d
C
1 A G
1
G
2
C
2
E E E E E E
T
'
T

1
2
3
7. A closed-loop feedback system consisting of plant P and controller C is shown below.
C P
E E E E
T
i
+

r(t)
e(t) u(t)
y(t)
It is known that the nominal closed-loop system is stable. In the presence of gain-
variations in P and time-delay in the feedback path, the closed-loop system changes
to
C

P
delay, T
E E E E E
'
T
i
+

r(t)
e(t) u(t)
y(t)
f(t) = y(t T)
In this particular system, there is both an upper and lower gain margin - that is, for
no time-delay, if the gain is decreased from 1, the closed-loop system becomes
unstable at some (still positive) value of ; and, if the gain is increased from 1, the
closed-loop system becomes unstable at some value of > 1. Let
l
and
u
denote
these two values, so 0 <
l
< 1 <
u
.
For each xed value of satisfying
l
< <
u
the closed-loop system is stable.
For each such xed , compute the minimum time-delay that would cause instability.
Specically, do this for several (say 8-10) values satisfying
l
< <
u
, and plot
below.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 195
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 2.1 2.2 2.3 2.4 2.5
GAMMA
M
i
n

T
i
m
e

D
e
l
a
y
The data on the next two pages are the magnitude and phase of the product

P(j)

C(j).
They are given in both linear and log spacing, depending on which is easier for you to
read. Use these graphs to compute the time-delay margin at many xed values of
satisfying
l
< <
u
.
10
1
10
0
10
1
10
2
10
1
10
0
10
1
10
2
Frequency, RAD/SEC
M
a
g
n
it
u
d
e
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
0.5
0.75
1
1.25
1.5
1.75
2
2.25
2.5
2.75
3
3.25
3.5
3.75
4
Frequency, RAD/SEC
M
a
g
n
i
t
u
d
e
ME 132, Fall 2012, UC Berkeley, F. Borrelli 196
10
1
10
0
10
1
10
2
100
110
120
130
140
150
160
170
180
190
200
210
220
Frequency, RAD/SEC
P
h
a
s
e

(
D
E
G
R
E
E
S
)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
170
172.5
175
177.5
180
182.5
185
187.5
190
192.5
195
197.5
200
202.5
205
207.5
210
Frequency, RAD/SEC
P
h
a
s
e

(
D
E
G
R
E
E
S
)
8. An unstable plant, P, with dierential equation relating its input u and output y,
y(t) 16 y(t) + 15y(t) = u(t) + 5u(t)
is given.
(a) Calculate the range of the parameter K
P
for which the closed-loop system is
stable.
K
P P
e

+
E E E E
T
r e u
y
(b) If K
P
= 30, what is the steady state error, e
ss
, due to a unit-step reference input?
(c) A integral controller will reduce the steady-state error to 0, assuming that the
closed-loop system is stable. Using any method you like, show that the closed-
loop system shown below, is unstable for all values of K
I
.
_
K
I P
e

+
E E E E E
T
r e u
y
(d) Find a PI controller, that results in a stable closed-loop system.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 197
(e) Consider the system with just Proportional-control, along with a time-delay, T,
in the feedback path. We wish to determine the maximum allowable delay before
instability occurs. Find the equation (quadratic in
2
) that must satisfy for
there to exist homogeneous solutions y
H
(t) = e
jt
for some . The equation
should involve , K
P
, and the parameters in the plant, but not the time delay, T.
K
P P
delay, T
e

+
E E E E
' '
T
r e u
y
(f) For two cases of proportional control: K
P
= 20 and K
P
= 30; determine in each
case the time delay T that will just cause instability and the frequency of the
oscillations as instability is reached.
9. Let L be the transfer function of a system. Consider the diagram below.
d Ed E
L
T

T
c
T
z
q
p
Let N denote the transfer function from q to z. Let S denote the transfer function
from q to p. Derive N and S in terms of L.
10. In the diagram below,
d d
PI
_ _
K
D
E E E E E
T
'
T

1
2
3
derive S, N and L at each marked location. In each case, verify (after the derivation)
that
L =
N
1 +N
=
1 S
S
D Nonlinear Systems
ME 132, Fall 2012, UC Berkeley, F. Borrelli 198
1 Input-output Dierential Equation Models
So far, we have focused our study on linear time invariant (LTI) systems. But, a great
many models of physical processes that we may be interested in controlling are not linear.
Fortunately, the study of LTI systems is a vital tool in learning how to control even nonlinear
systems. Essentially, feedback control algorithms make small adjustments to the inputs based
on measured outputs. For small deviations of the input about some nominal input trajectory,
the output of a nonlinear system looks like a small deviation around some nominal output.
The eects of the small input deviations on the output is well approximated by a linear
(possibly time-varying) system.
Many nonlinear systems are modeled by nonlinear dierential equations that relate the inputs
u to the outputs y like:
y + 3 yy + 7 cos(y) = 4u
2
+uy
When we have many inputs and many outputs, we will still have dierential equations but
there will be more of them. We will have one dierential equation for each output.
We cannot use transfer function methods for nonlinear systems. Transfer functions make
sense only of linear time-invariant dierential equations.
2 State-space Realizations
We can rewrite n
th
nonlinear dierential equation models as a set of n coupled rst-order
dierential equations. For example, consider the dierential equation model
y + 3 yy + 7 cos(y) = 4u
2
+uy
Dene the states by
x
1
= y, x
2
= y
We can then re-write this dierential equation model as
x
1
= y = x
2
x
2
= y = 3 yy 7 cos(y) + 4u
2
+uy = 3x
1
x
2
7x
1
+ 4u
2
+ux
1
y = x
1
We cannot write these equations in matrix form as we did for LTI dierential equations. But
note the form of these equations:
x
1
= f
1
(x
1
, x
2
, u) = x
2
x
2
= f
2
(x
1
, x
2
, u) = 3x
1
x
2
7x
1
+ 4u
2
+ux
1
y = h(x
1
, x
2
, u) = x
1
ME 132, Fall 2012, UC Berkeley, F. Borrelli 199
More generally, for a m input, p output nonlinear dierential equation model, we would get
equations like
x
1
= f
1
(x
1
, , x
n
, u
1
, , u
m
)
.
.
.
.
.
.
x
n
= f
n
(x
1
, , x
n
, u
1
, , u
m
)
y
1
= h
1
(x
1
, , x
n
, u
1
, , u
m
)
.
.
.
.
.
.
y
p
= h
p
(x
1
, , x
n
, u
1
, , u
m
)
Here each of the possibly nonlinear functions f
1
, , f
n
and h
1
, , h
p
are scalar-valued.
These equations are quite a mess to write down. By introducing the notation:
x = (x
1
, , x
n
), u = (u
1
, , u
m
), y = (y
1
, , y
p
)
we can write these equation more compactly in standard state-space form as
x = f(x, u)
y = h(x, u)
Note that in this form, the nonlinear functions f and h are vector-valued. This means that
there are actually many scalar functions contained in the symbols f and h.
3 Example: Magnetically Suspended Ball
We will study a magnetically suspended ball in homework and in lectures. This consists of
a ball of mass m suspended by an electromagnet as shown below. Let y be the position
of the ball, measured down from the base of the electromagnet. If a current u is injected
into the coils of the electromagnet, it will produce a magnetic eld which in turn exerts an
upward force on the ball given by F
up
= cu
2
/y
2
. Note that the force decreases as the 1/y
2
because the eect of the magnet weakens when the ball is further away, and that the force
is proportional to u
2
which is representative of the power supplied to the magnet.
Let us assume that we can measure the position y of the ball. This can be arranged optically
using light-emitting diodes with photocells.
We can then write a simple model for the motion of the ball from Newtons second law as
m y = mg
cu
2
y
2
(D.1)
Note that this is a single-input, single-output nonlinear model. The input and output of this
model are
ME 132, Fall 2012, UC Berkeley, F. Borrelli 200
u the current injected into the magnet coils
y the position of the ball
In the context of numerical exercises, use the following constants:
m 0.15 Kg mass of ball
c 0.01 Kg-m
3
/Coul
2
magnetic coupling constant
We can convert this nonlinear input-output dierential equation model to state-space by
dening the states:
x
1
= y, x
2
= y
We get the state-space equations:
x
1
= f
1
(x
1
, x
2
, u) = x
2
x
2
= f
2
(x
1
, x
2
, u) = g
cu
2
mx
2
1
= 10
_
u
3.87x
1
_
2
y = h(x
1
, x
2
, u) = x
1
4 Equilibrium Points
Consider the general time-invariant nonlinear realization
x = f(x, u), y = h(x, u) (D.2)
An equilibrium point of (D.2) is a pair (x
eq
, u
eq
) such that if we start with initial condition
x(0) = x
eq
and apply the constant input u(t) = u
eq
, t 0, then the state trajectory remains
at the equilibrium point, i.e.
x(0) = x
eq
, u(t) = u
eq
= x(t) = x
eq
y
mg
up
F
Figure 41: Magnetically suspended ball.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 201
Notice that the output function h(x, u) plays no role in nding equilibrium points. Also, we
should stress that x
eq
and u
eq
are constants and not functions of time.
The following result tells us how to nd equilibrium points.
Theorem 1 (x
eq
, u
eq
) is an equilibrium point of (#) if and only if f(x
eq
, u
eq
) = 0
Proof: (not rigorous) If we initialize the dierential equations x = f(x, u) at x(0) = x
eq
and apply the constant inputs u(t) = u
eq
, we see that
x = f(x
eq
, u
eq
) = 0
This means that x(t) does not change with time. So it stays at x(t) = x
eq
.
For a nonlinear system, there can be many equilibrium points. To nd all the equilibrium
points of a nonlinear system, we simple set
f(x
eq
, u
eq
) = 0
and solve for x
eq
, u
eq
.
If we start the system at x
eq
and apply the constant input u
eq
, then x(t) stays at the
equilibrium value x
eq
. Corresponding to this equilibrium point, y(t) stays at its equilibrium
value
y
eq
= h(x
eq
, u
eq
)
Example 2 Returning to the magnetically suspended ball example, we calculate the equi-
librium points:
f(x
eq
, u
eq
) = 0 = f
1
(x
eq
1
, x
eq
2
, u
eq
) = 0 and f
2
(x
eq
1
, x
eq
2
, u
eq
) = 0
= x
eq
2
= 0 and 10
_
u
eq
3.87x
eq
1
_
2
= 0
= x
eq
2
= 0, x
eq
1
= 0.082u
eq
The equilibrium points are:
x
eq
1
= 0.082, x
eq
2
= 0, u
eq
=
The resulting value of output is
y
eq
= h(x
eq
, u
eq
) = x
eq
1
= 0.082
Note that here we have many equilibrium points. in this case, we have parameterized these
equilibrium points by the free variable u
eq
= .
We could also parameterize these equilibrium points by the free variable y
eq
= as follows:
x
eq
1
= , x
eq
2
= 0, u
eq
= 12.195, y
eq
= 0.082 =
This parametrization is sometimes more convenient when we study gain-scheduling to control
nonlinear systems.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 202
5 Jacobians and the Taylor Theorem
First consider a scalar values function (x
1
, x
2
, , x
n
) of n variables. The Jacobian of is
the row vector
(x
1
, , x
n
) =
_

x
1


xn
_
For example for the function (x
1
, x
2
, x
3
) of three variables,
(x
1
, x
2
, x
3
) = x
1
x
2
2
1/x
1
+ sin(x
3
)
the Jacobian is
=
_

x
1

x
2

x
3
_
=
_
x
2
2
+ 1/x
2
1
2x
1
x
2
cos(x
3
)

The Jacobian is a function of the variables x


1
, x
2
, x
3
. We can evaluate the Jacobian at
a point and get actual numbers. In this example, we could evaluate the Jacobian at
(x
1
, x
2
, x
3
) = (1, 2, 0) to get
(1, 1, 0) = [ 5 4 1 ]
Now consider a vector-valued function : R
n
R
m
. What this actually means is that we
have m individual functions in n variables. These functions are collectively represented by
, and the variables are collectively represented by x. Let us write this function as
(x) = (x
1
, x
2
, , x
n
) =
_
_

1
(x
1
, , x
n
)
.
.
.

m
(x
1
, , x
n
)
_
_
The Jacobian of is the mn matrix of functions
=
_

1
x
1


1
xn
.
.
.
.
.
.
m
x
1

m
xn
_

_
Fix a vector R
n
. We can evaluate the Jacobian at to get an mn matrix of numbers.
Our notation for this is
() =
_

1
x
1


1
xn
.
.
.
.
.
.
m
x
1

m
xn
_

_
@
For example, consider the function
(x
1
, x
2
, x
3
) =
_

1
(x
1
, x
2
, x
3
)

2
(x
1
, x
2
, x
3
)
_
=
_
x
1
sin(x
2
)
x
2
2
cos(x
3
)
_
ME 132, Fall 2012, UC Berkeley, F. Borrelli 203
The Jacobian of (x) evaluated at (1, 1, 0) is
(x
1
, x
2
, x
3
) =
_
sin(x
2
) x
1
cos(x
2
) 0
0 2x
2
cos(x
3
) x
2
2
sin(x
3
)
_
@(1,/2,0)
=
_
1 1 0
0 0
_
Analogous to the classical Taylor series expansion of a scalar function of one variable, we
can write the Taylor series expansion of around as
(x) = () +() (x ) + higher order terms
The rst two terms above are the linear approximation of around . We can therefore
approximate as
(x) () +() (x )
and this approximation will be good in some (possibly small) neighborhood of .
6 Linearization about Equilibrium Points
We will now use the Taylor Theorem to approximate a nonlinear plant model by a LTI plant
model. This approximation is called the Jacobian Linearization and is good as long as the
applied input u(t) is close to its equilibrium value u
eq
and the resulting state trajectory x(t)
is close to the equilibrium value x
eq
.
Theorem 3 Consider a nonlinear time-invariant input-output dierential equation model
realized as
x = f(x, u), y = h(x, u)
Let = (x
eq
, u
eq
) be an equilibrium point of this model, and dene y
eq
= h(x
eq
, u
eq
).
Dene the deviation variables
x = x x
eq
u = u u
eq
y = y y
eq
and compute the matrices
A =
_

_
f
1
x
1

f
1
xn
.
.
.
.
.
.
fn
x
1

fn
xn
_

_
@
B =
_

_
f
1
u
1

f
1
um
.
.
.
.
.
.
fn
u
1

fn
um
_

_
@
C =
_

_
h
1
x
1

h
1
xn
.
.
.
.
.
.
hp
x
1

hp
xn
_

_
@
D =
_

_
h
1
u
1

h
1
um
.
.
.
.
.
.
hp
u
1

hp
um
_

_
@
ME 132, Fall 2012, UC Berkeley, F. Borrelli 204
Then, we can approximate the nonlinear system in the vicinity of the equilibrium point by
the linear time-invariant state space realization

x(t) = Ax(t) +Bu(t)


y(t) = Cx(t) +Du(t)
Proof: The basic tool we use to prove this result is the Taylor theorem. We can approximate
f in a neighborhood of as
f(x, u) f(x
eq
, u
eq
) +f()
__
x
u
_

_
x
eq
u
eq
__
=
_

_
f
1
x
1

f
1
xn
.
.
.
.
.
.
fn
x
1

fn
xn
_

_
@
(x x
eq
) +
_

_
f
1
u
1

f
1
um
.
.
.
.
.
.
fn
u
1

fn
um
_

_
@
(u u
eq
)
= A(x x
eq
) +B(u u
eq
)
In a similar fashion we can approximate g in a neighborhood of as
h(x, u) h(x
eq
, u
eq
) +h()
__
x
u
_

_
x
eq
u
eq
__
= y
eq
+
_

_
h
1
x
1

h
1
xn
.
.
.
.
.
.
hp
x
1

hp
xn
_

_
@
(x x
eq
) +
_

_
h
1
u
1

h
1
um
.
.
.
.
.
.
hp
u
1

hp
um
_

_
@
(u u
eq
)
= y
eq
+C(x x
eq
) +D(u u
eq
)
Let us now dene the deviation variables x = x x
eq
, u = u u
eq
, and y = y y
eq
.
Observe that

x = x = f(x, u) Ax + Bu, y = h(x, u) y


eq
Cx +Du
Thus, the original nonlinear system can be approximated by a linear time-invariant system.
This approximation is good provided we remain suciently close to the equilibrium point
= (x
eq
, u
eq
).
The original nonlinear plant and its Jacobian linearization are illustrated in Figure 42.
Example 4 Consider again the magnetically suspended ball. We linearize the dynamics
about the equilibrium point
x
eq
=
_

0
_
u
eq
= 12.195 y
eq
=
ME 132, Fall 2012, UC Berkeley, F. Borrelli 205
u
eq
y
eq
u
Nonlinear
Plant
y
u
Linearized
Plant
y
+

u
y
+

Figure 42: Nonlinear Plant and its Linearized Approximation.


Dene the deviation variables x = x x
eq
, u = u u
eq
, and y = y y
eq
. We calculate the
matrices
A =
_
f
1
x
1
f
1
x
2
f
2
x
1
f
2
x
2
_
@eq
=
_
0 1
76.86

0
_
B =
_
f
1
u
f
2
u
_
@eq
=
_
0
6.31

_
C =
_
h
x
1
h
x
2

@eq
= [ 1 0 ] D =
_
h
u

@eq
= 0
Then, the nonlinear system can be approximated by the linear time-invariant state space
realization

x(t) = Ax(t) +Bu(t)


y(t) = Cx(t) +Du(t)
Notice that the A-matrix here has eigenvalues at 8.77/

. One of these eigenvalues is in


the right half-plane. So the linearized approximation is unstable. This means that locally
the nonlinear system is unstable. Small deviations from the equilibrium point will send the
ball away from the equilibrium point.
7 Control using Jacobian Linearized Plant Models
Let us begin with a nonlinear plant model P. We could choose an equilibrium point of this
plant model, and nd the Jacobian linearization H(s) of the plant about this equilibrium
point. Now we have a LTI plant model, and we can use the state-space methods or PID
methods to design a controller K(s) for the linearized plant model H(s). This feedback
system is shown in Figure 43. The command for this feedback system is r(t). This signal
is what we want the linearized plant output y(t) to track, and this is what the controller
K(s) is designed to do.
Let us gure out what r(t) should be. We want the output of the nonlinear plant y(t) to
track the command r(t). This signal r(t) will be generated externally (by a human operator,
a computer, or another control system). Since y(t) = y(t) y
eq
, this implies that we want
y(t) to track r(t) y
eq
. Therefore, we should choose
r(t) = r(t) y
eq
ME 132, Fall 2012, UC Berkeley, F. Borrelli 206
H(s) y(t)
K(s) r(t)
u

+
Figure 43: Control System for Linear Plant Model H(s).
y
y
u
K(s)
r u
K(s) r
+

Figure 44: Control System for Linear Plant Model.


NL Plant
y
u
eq
K(s) r
+
+

+
controller
Figure 45: Final Implementation of Controller based on Jacobian Linearization.
The control system for the linearized plant model is shown in Figure 44.
But the linearized model H(s) is not a physical plant, it is just a construct of our imagination.
So we now need to gure out how we actually implement the controller K(s) for the nonlinear
physical plant P. If we examine the controller K(s) in isolation, its input is r(t) y
eq
. The
output of the controller is u(t). Notice that u(t) = u(t) u
eq
. so we can generate the input
to the nonlinear physical plant easily as
u(t) = u(t) +u
eq
The nal implementation of control system for the nonlinear plant is shown in Figure 45.
This controller is based on a linearized model of the nonlinear plant about the equilibrium
point (u
eq
, x
eq
). The linearized model is a good approximation of the plant as long as we
stay close to this equilibrium point. This means that the controller will work well as long as
the input applied to the plant is close to u
eq
, the initial condition of the plant is close to x
eq
,
and the subsequent state trajectory x(t) of the plant remains close to x
eq
.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 207
8 Gain Scheduling
In many situations, we cannot be assured that we will stay close to a particular equilibrium
point of a nonlinear plant during control maneuvers. To eectively control the nonlinear
plant we will need to design controllers at many equilibrium points (also called operating
points) and switch between these controller in an intelligent way. This control strategy is
called gain scheduling.
NL Plant
y
u
eq
(y)
K(y) r
+
+

+
controller
Figure 46: Gain Scheduling.
The strategy for Gain Scheduling is illustrated in Figure 46. The idea is to rst parameterize
equilibrium points of the nonlinear system to be controlled using the free variable y
eq
= .
So the equilibrium points look like:
x
eq
= a(), u
eq
= b(), y
eq
=
Here a and b are functions of the variable . We will refer to the equilibrium point above
simply as .
Next, we can linearize the nonlinear plant about the equilibrium point . We will get a
linearized model

x(t) = Ax(t) +Bu(t)


y(t) = Cx(t) +Du(t)
The matrices A, B, C, D clearly depend on the equilibrium point and so they are functions
of . Now we can design controllers based on these linearized models. This is just what
we did in the previous section, only this time we have a continuous family of equilibrium
point parameterized by . So the controller designed at the equilibrium point might have
a state-space realization
K(s)
_
F

0
_
Clearly the controller state-space matrices F, G, H depend on as indicated by the super-
scripts. Remember that the nal implementation of the controller (see previous section)
is
u(t) = u(t) +u
eq
(), where u(t) =
_
K

(s)

(r(t) y(t)) (D.3)


ME 132, Fall 2012, UC Berkeley, F. Borrelli 208
This implementation of controller K(s) for the nonlinear plant is shown in Figure 45. Now
let us write this more carefully. Let z(t) denote the state of the controller. We can write
(D.3) as
z(t) = F

z(t) +G

(r(t) y(t))u(t) = H

z(t) +u
eq
()
Again, we stress that the matrices F, G, H depend on . Recall that is the equilibrium
point used to design the controller. A natural choice for is to set = y(t) which is the
current output of the nonlinear plant. This is the closest equilibrium point to where the
plant is now. So our nal controller implementation is
z(t) = F
y
z(t) +G
y
(r(t) y(t))
u(t) = H
y
z(t) +u
eq
(y) (D.4)
This discussion is summarized nicely in Figure 46 which shows the nal form of the gain-
scheduled controller.
A very important point we must make us that it of often necessary to slow down or low-
pass lter the command for gain-scheduling to work. In the context of the magnetically
suspended ball, if we gave a command that attempted to change the position of the ball
abruptly from 0.25 meters to 0.5 meters, we are asking the ball to move very fast (large
speed) from one position to the other. At no point would the ball be anywhere near an
equilibrium point. This is because at all the equilibria, the speed of the ball is zero. By
slowing down the command, we are allowing the ball to move slowly from one position to
the other, and it stays close to equilibrium points.
9 Feedback Linearization
A powerful technique for treating nonlinear systems in the context of control problems is
feedback linearization or dynamic inversion. The essential idea here is to cancel the non-
linearities.
Consider a physical system modeled by the nonlinear realization
x = f(x, u) y = h(x, u)
In many cases it is possible to construct a feedback function
u = (v, y)
such that the dynamics from the new inputs v to the outputs y are linear and time-invariant.
We can then design a controller for the linearized system using standard techniques that we
have studied earlier. These ideas are illustrated in Figure 47.
By setting u = (v, y), we are essentially building an input-redening box that has new
inputs v and generates the plant inputs u based on measurements of the plant outputs y.
This box is part of the controller that we would implement for the nonlinear plant.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 209
v
Static Nonlinear-
ity
(v, y)
u Nonlinear
Plant
y
feedback linearized system
Figure 47: Feedback Linearization.
Example 5 Consider again the magnetically suspended ball. If we set
u = (y, v) = y
_
m(g +v)
c
we obtain the linear time-invariant model
x
1
= x
2
, x
2
= v, y = x
1
Many nonlinear systems are not output feedback linearizable. Sometimes, if we have the
states (or good estimates) available, we can perform state feedback linearization. It is im-
portant to note that this technique is based on a model of some physical system. If this
model is inaccurate, the nonlinearity will not cancel exactly. It is therefore critical to
understand the robustness of this technique with respect to plant modeling errors.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 210
E Complex Arithmetic
1 Basic Stu
The set of real numbers is written R, and the set of complex numbers is written as C. For
a complex number z = a + jb, a is called the real part of z, written Re(z), and b is called
the imaginary part of z, written Im(z). The complex-conjugate of z is the complex number
z = a jb.
2 Magnitude and Phase
The magnitude of z is the non-negative real number |z| =

a
2
+b
2
. Note that |z|
2
= zz.
The phase of a nonzero complex number z, written z, is the angle such that
cos() = a/|z|, and sin() = b/|z|
The phase of z = 0 is undened. Thus, if the complex number z is in the rst or fourth
quadrant (i.e. a > 0), its phase is z = Tan
1
(b/a). Here Tan
1
is the principal branch of
the inverse tangent function, i.e. the branch whose range is restricted to /2 < Tan
1
(y)
/2.
For products of complex numbers we have
|z
1
z
2
| = |z
1
||z
2
| (z
1
z
2
) = z
1
+z
2
For ratios of complex numbers we have (if z
1
= 0),
|z
1
/z
2
| = |z
1
|/|z
2
| (z
1
/z
2
) = z
1
z
2
3 Functions of a Complex Variable
An extremely important formula dening the complex exponential function is Euler identity:
exp(j) = cos() +j sin()
From this and the denition of phase, it follows that any complex number z can be written
in polar form as
z = |z| exp(jz)
Once we write a nonzero complex number z in polar form as above, we can naturally dene
its (natural) logarithm as
ln z = ln |z| +jz
ME 132, Fall 2012, UC Berkeley, F. Borrelli 211
Note that because z = 0, the logarithm ln |z| is well-dened. We can also dene square-roots
of a complex number z as

z =
_
|z| exp(jz)/2)
4 Polynomials
We shall also need the following fact: any polynomial of degree n
p(s) = p
n
s
n
+p
n1
s
n1
+ +p
1
s +p
0
has exactly n roots in the complex plane. This is called the Fundamental Theorem of
Algebra. While it has become common knowledge, it is actually quite dicult to prove.
If the coecients of the polynomial are all real, i.e. p
i
R, then the roots of p(s) occur in
conjugate-pairs. In other words, if z = a +jb is a root of p(s), then z = a jb is also a root.
Thus, if p(s) has odd degree, it must have a real root.
5 Subsets of the complex-plane
We shall often deal with certain sets of the complex-plane. These are
the unit circle = C = {z : |z| = 1} = {exp(j) : [0, 2)}
the open unit disk = D = {z : |z| < 1}
the open left-half-plane = H

= {z : Re (z) < 0}
the open right-half-plane = H
+
= {z : Re (z) > 0}
For any subset S C, its closure (i.e. the set obtained by including its boundary) is written
S. For example, the closed left-half plane is H
+
. Similarly, we can write D, etc.

Exercises.
1) Let a be real. Show that

j a
j +a

= 1 for all R
ME 132, Fall 2012, UC Berkeley, F. Borrelli 212
2) Plot the log-magnitude and phase of the complex number
H(j) =
a
j +b
versus log as varies from 0 to in the following cases.
(a) a = 1, b = 3
(b) a = 1, b = 3
(a) a = 1, b = 3
(b) a = 1, b = 3
3) Plot the log-magnitude and phase of the complex number
H(j) = exp(jT)
versus log as varies from 0 to in the following cases.
(a) T = 1 (b) T = 10
4) What is the equation of a circle in the complex plane of radius R and centered at z
o
?
ME 132, Fall 2012, UC Berkeley, F. Borrelli 213
F Linear Algebra
1 Matrices and Vectors
We are very comfortable with vectors in 3 dimensions. Concepts such as vector addition,
orthogonality, the angle between vectors, dot products, changing co-ordinate systems are
intimately familiar. As we shall see, Linear Algebra allows us to generalize these concepts
to treat vectors in many dimensions, and to even more abstract notions of vectors.
The set of all n 1 column vectors of real numbers is written R
n
. The i
th
entry of a column
vector v is denoted v
i
. Analogous is the set C
n
where the vectors have complex entries. We
add vectors component-wise.
The set of all mn rectangular matrices of real numbers is written R
mn
. The element in
the i
th
row and j
th
column of a matrix M is written as m
ij
. Similarly, we have the set C
mn
.
The n n matrix whose diagonal elements are 1 and whose other elements are all 0 is the
identity matrix and is written I or I
n
to explicitly exhibit its size.
We will assume familiarity with elementary matrix concepts such as matrix multiplication,
transposes, determinants, and inverses. Matrices do not commute, i.e. in general, for ma-
trices A and B of compatible dimension AB = BA. So we must be careful to respect the
order in expressions with matrices. Indeed, if v C
n
, v

v is a real number, while vv

is an
n n matrix.
It is very useful to think of matrices in terms of their columns (or rows). For example, the
product
Av =
_
a
11
a
12
a
13
a
21
a
22
a
23
a
31
a
32
a
33
__
v
1
v
2
v
3
_
= v
1
_
a
11
a
21
a
31
_
+v
2
_
a
12
a
22
a
32
_
+v
3
_
a
13
a
23
a
33
_
=
3

i=1
v
i
a
[i]
is the weighted sum of the columns of A, the weights coming from the vector v.
It is also very useful to deal with block-partitioned matrices. For example, we could write
A =
_

_
a
11
a
12
a
13
b
12
b
13
a
21
a
22
a
23
a
12
a
13
a
31
a
32
a
33
a
12
a
13
a
31
a
32
a
33
a
12
a
13
_

_
=
_
A
11
A
12
A
21
A
22
_
Multiplication of block-partitioned matrices is as one would expect.
AB =
_
A
11
A
12
A
21
A
22
_ _
B
11
B
12
B
21
B
22
_
=
_
A
11
B
11
+A
12
B
21
A
11
B
12
+A
12
B
22
A
21
B
11
+A
22
B
21
A
21
B
12
+A
22
B
22
_
This, of course, requires A and B to be partitioned conformably, i.e. so that the various
products make sense. For example, in the equation above we would need A
11
to have as
many columns as B
11
has rows.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 214
Through these notes, we will make assertions about matrices in various Theorems, Propo-
sitions, and Lemmas. To make the results more transparent, we will not always explicitly
state the dimensions of the matrices involved. The reader should assume that the results
hold only when the matrices have appropriately sensible dimensions. For example suppose
we write A
1
in the statement of some Theorem. It will imply we are assuming that A is
square and invertible. Or if we write the expression I + AB in some lemma, it must imply
that A is mn and B is n m. But it does not imply that A and B are square matrices.
2 Linear Simultaneous Equations
Matrices can be used to write a collection of linear equations in several unknowns compactly.
For example:
x
1
+ 2x
2
+ 7x
3
= 4
3x
2
4x
3
= 8
5x
1
6x
2
= 9
x
3
= 1

_
1 2 7
0 3 4
5 6 0
0 0 1
_

_
_
x
1
x
2
x
3
_
=
_

_
4
8
9
1
_

_
Ax = b
Any collection of linear equations can be written as
Ax = b A C
mn
Here x is the vector of n unknowns, and A, b are constructed from the coecients of the m
equations. There are only three possibilities:
(a) Over-determined. The equation Ax = b has no solution.
(b) Under-determined. The equation Ax = b has several solutions.
(c) The equation Ax = b has only one solution.
3 Transposes and Adjoints
Denition 1 Let A C
mn
.
The transpose of A written A
T
is an n m matrix whose i, j
th
entry is a
j,i
The adjoint of A, written A

is its complex-conjugate-transpose, i.e. A

= (A)
T
Lemma 2 Properties of Adjoints.
(a) (A

= A
(b) (A +B)

= A

+B

(c) (AB)

= B


ME 132, Fall 2012, UC Berkeley, F. Borrelli 215
4 Determinants and Inverses
Denition 3 Let A C
nn
.
The inverse of A is the unique matrix A
1
such that AA
1
= I
We will assume you are familiar with minors, co-factors, determinants, and computing in-
verses.
Here are some useful facts that we will use frequently.
Lemma 4 Properties of Inverses.
(a) AA
1
= A
1
A = I
(b) (AB)
1
= B
1
A
1
(c) (A

)
1
= (A
1
)


Lemma 5 Properties of Determinants.
Let A and B are square matrices of the same size. Then
(a) det (AB) = det (BA) = det(A) det(B)
(b) det(A
T
) = det(A)
(c) det (A

) = det(A)
Proposition 6 Inverses for Block-partitioned Matrices.
(a) If X and Z are square and invertible, then
_
X Y
0 Z
_
1
=
_
X
1
X
1
Y Z
1
0 Z
1
_
(b) If A and D are square, and D is invertible, then
_
A B
C D
_
=
_
ABD
1
C BD
1
0 I
_ _
I 0
C D
_
(c) Suppose A and D are square. If D and = ABD
1
C are invertible, then
_
A B
C D
_
1
=
_

1

1
BD
1
D
1
C
1
D
1
C
1
BD
1
+D
1
_

ME 132, Fall 2012, UC Berkeley, F. Borrelli 216


Corollary 7 (Determinants for Block-partitioned Matrices.)
(a) If X and Z are square, then
det
_
X Y
0 Z
_
= det(X) det(Z)
(b) If A and D are square, and D is invertible, then
det
_
A B
C D
_
= det
_
A BD
1
C
_
det(D)
5 Eigenvalues and Eigenvectors
Denition 8 Let A C
nn
. The characteristic polynomial of A written

A
(s) = det(sI A) = s
n
+
n1
s
n1
+ +
1
s
1
+
0
s
0
The roots of
A
(s) of which there are n are called the eigenvalues of A.
Lemma 9 Let A C
nn
and be an eigenvalue of A. Then, there exists a vector v = 0
such that Av = v. This vector v is called an eigenvector of A with associated eigenvalue .
Proof. Since is an eigenvalue of A, we have
det(I A) =
A
() = 0
Thus the matrix (I A) is not invertible. Consequently, its null space is not trivial, i.e.
v = 0 such that (I A)v = 0
proving the claim.
It is evident that any nonzero multiple of v is also an eigenvector corresponding to the same
eigenvalue. We view an eigenvector as a vector whose direction is invariant under the action
of A. In the context of this interpretation, we regard all (nonzero) scalar multiples of an
eigenvector as being the same eigenvector.
Let A have distinct eigenvalues. Then it has a full set of (i.e. n linearly independent)
eigenvectors. This assertion will be proved shortly. If however A has repeated eigenvalues a
pathology may arise in that we are unable to nd a full set of eigenvectors.
ME 132, Fall 2012, UC Berkeley, F. Borrelli 217
6 Simple-case of the Jordan form
Let A C
nn
be a (square!) matrix. We can think of A as a box. Vectors u C
n
go in, and
vectors y = Au C
n
come out. For example, the box could mean rotate vector coming in
by 30

clockwise to produce a new vector.


We can change coordinates by the transformation
xT x or x = T
1
x
where T C
nn
is an invertible matrix. The box does the same thing it hasnt changed.
But in these new coordinated, the matrix describing the box changes as follows to

A. We
can nd this new matrix easily:
y = Au = y = T
1
y = T
1
Au = T
1
AT u
So the action of the matrix A in the new coordinates is represented by the matrix

A = T
1
AT
The matrices A and

A are said to be similar.
We wish to make a special choice of basis so that the (new) matrix representation of A has
particularly lucid structure. Equivalently, we wish to select a nonsingular matrix T in order
that T
1
AT has a transparent form called the Jordan canonical from.
In the special case where A has distinct eigenvalues, we have the following key result.
Theorem 10 Let A C
nn
be simple with eigenvalues
i
and corresponding eigenvectors
v
i
, for i = 1, , n. Dene the n n matrices
T = [ v
1
v
n
] , =
_

1
0 0
0
2
0
.
.
.
.
.
.
.
.
.
0 0
n
_

_
Then,
(a) The eigenvectors v
1
, , v
n
are linearly independent, i.e. T is invertible.
(b) T
1
AT =
Proof. (a) We will use contradiction. Suppose v
1
, , v
n
are linearly dependent. Then one
of these vectors can be expressed as a linear combination of the remaining vectors. Without
loss of generality, we can write
v
1
=
n

k
v
k
(F.1)
ME 132, Fall 2012, UC Berkeley, F. Borrelli 218
Suppose Av = v. Dene the matrix
M = (
2
I A)(
3
I A) (
n
I A)
and consider the expression:
Mv = (
2
I A)(
3
I A) (
n1
I A)(
n
)v
= (
2
I A)(
3
I A) (
n2
I A)(
n1
)(
n
)v
= (
2
)(
3
) (
n2
)v
Using the fact that A has distinct eigenvalues, we have
Mv
1
= (
2

1
)(
3

1
) (
n2

1
)v
1
= 0
For k = 2, 3, , n, we have
Mv
k
= (
2

k
)(
3

k
) (
n2

k
)v
k
= 0
It now follows from (F.1) that
0 = Mv
1
= M
_
n

k
v
k
_
=
n

k
Mv
k
= 0
This is a contradiction, proving that the eigenvectors v
1
, , v
n
are linearly independent.
Equivalently, the matrix
T = [ v
1
v
2
v
n
] C
nn
is invertible.
(b) Observe that
AT = [ Av
1
Av
2
Av
n
] = [
1
v
1

2
v
2

n
v
n
] = T
Pre-multiplying by T
1
yields T
1
AT = , completing the proof.
Essentially, Theorem (10) states that simple matrices can be diagonalized using similarity
transformations. The matrix above is called the Jordan form of A. Observe that this
matrix is diagonal and its diagonal entries are the eigenvalues of A.
Example 11 Let
A =
_
2 3
1 2
_
This matrix is simple and has eigenvalues at 1, 1 with associated eigenvectors [ 3 1 ]

and
[ 1 1 ]

. It then follows that


T
1
AT =
_
1 0
0 1
_
, where T =
_
3 1
1 1
_
ME 132, Fall 2012, UC Berkeley, F. Borrelli 219
7 Matrix Exponentials
Matrix exponentials are particularly important and arise in connection with systems of cou-
pled linear ordinary dierential equations. Since the Taylor series
e
st
= 1 +st +
s
2
t
2
2!
+
s
3
t
3
3!
+
converges everywhere, we can dene the exponential of any matrix A C
nn
by
e
At
= I +At +
A
2
t
2
2!
+
A
3
t
3
3!
+
Theorem 12 (Properties of Matrix Exponentials)
(a) e
A0
= I
(b) e
A(t+s)
= e
At
e
As
(c) If AB = BA then e
(A+B)t
= e
At
e
Bt
= e
Bt
e
At
(d) det
_
e
At

= e
trace(A)t
(e) e
At
is nonsingular for all < t < and
_
e
At

1
= e
At
(f ) e
At
is the unique solution X of the linear system of ordinary dierential equations

X = AX, subject to X(0) = I


Example 13 Consider the matrix
A =
_


_
You should be able to check that
e
At
= e
t
_
cos(t) sin(t)
sin(t) cos(t)
_

You might also like