2400 Lecturenotes Current PDF
2400 Lecturenotes Current PDF
U N D E R S TA N D , I N T O S H A P E S W E C A N N O T P R E C I S E LY A N A LY S E S O A S T O
W I T H S TA N D F O R C E S W E C A N N O T P R O P E R LY A S S E S S , I N S U C H A W AY T H AT
RANCE.
– D R . A . R . DY K E S , B R I T I S H I N S T I T U T I O N O F S T R U C T U R A L E N G I N E E R S
A S S U M E T H E C O W I S A S P H E R E T O M A K E T H E M AT H E A S I E R .
– UNKNOWN
W E D E M A N D R I G I D LY D E F I N E D A R E A S O F D O U B T A N D U N C E R TA I N T Y !
ENGG*2400
ENGINEERING
S Y S T E M S A N A LY S I S
WINTER 2019
Copyright © 2019 Dr. Julie Vale
Much thanks to Dr. Bob Dony for his assistance in providing content and in editing the document and to
Dr. Cam Farrow for his input into content organization, assignment problems, and course focus.
Contents
1 Systems: an Introduction 9
1.1 What is a System? . . . . . . . . . . . . . . . . . . . . . . . 10 Text: Ch. 1
1.1.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . 11
1.1.2 Modelling requires assumptions! . . . . . . . . . . 12
1.1.3 Through, Across, and Elements . . . . . . . . . . 13
1.2 Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.
x ( a + b) = xa + xb, and
x a xb + ya
+ = , and
y b yb
a
b ayz
x w = .
y + z xbz + wyb
By the end of this section, you will be able to Secondary Text: Section 1.1
Inputs: Signals that act on a system and cause it to react. User de-
fined inputs are applied to the system via an ‘actuator’, but not all
inputs are user defined.
Outputs: Signals that are a result of the actions of the input on the
system. Outputs of interest are often measured via a ‘sensor’.
In this course, we make the simplifying assumption that all sys- Text: See Ch. 9 for additional infor-
tems are Linear unless stated otherwise. You learned about linearity mation - you will not be required to
‘linearize’ models in this course.
in ENGG*1500.
systems: an introduction 13
Across variables are those variables that are changed by the element
in some way, in the sense that what is measured on one side of the
element is different than the other. These variables yield a net differ-
ence when measured across the element. Think of these as variables
that express ‘effort’. Examples include:
These through and across variables can be used together with funda-
mental properties of the element to write an element law. We can express these element laws as
an impedance Z, yielding the relation-
ship Across = Through × Z.
14 engg*2400 engineering systems analysis
1.2 Assignment
This course relies heavily on mathematics; to that end, consider the following questions (modified
somewhat) from some old final exams. All of these questions can be answered using tools and techniques
that you learned in first year and in highschool. If you find any of these problems overly difficult or feel
like you have never seen these concepts before, I strongly suggest that you take the time to seek help from
your TAs or from the course instructors.
1. Perform the following calculations. In all cases, provide the answer in reduced form.
Rπ
a) 0 cos(t)dt
R
b) cos(t)dt
d(e at )
c) dt
Rt
d) 0 e−sτ dτ
e) 12 +x
− 624
17
f) ( x + 2y)(4x − y)
g) (s2 + 13s − 2)(s − 1)
h) Find the roots of the polynomial s2 − 3s + 12
√
i) Express 3 − 3 3j in polar form (you shouldn’t need a calculator)
j) Express (1 − j)4 in both polar and rectangular form (you shouldn’t need a calculator)
x +( a−w)z
2. Solve the following equation for a. Show your work. w− a =b
3. Consider the following system of equations relating an applied force f to a resulting position p:
Convert those equations to their matrix equivalent by filling in the boxes below.
" # " #
ẋ1 (t) h i x (t)
1
h i
= + f (t)
ẋ2 (t) x2 ( t )
| {z } | {z }
=: ẋ (t) =:x (t)
h i h i
p(t) = x (t) + f ( t ).
4. Sketch and label the curves for the following functions, including what happens when the independent
variable is negative.
5. Using graphical methods, sketch and label the integral of the curve shown below.
y1 ( t )
1 2 t
6. Using graphical methods, sketch and label the derivative of the curve shown below. On your sketch,
clearly indicate any locations where the derivative is ‘undefined’.
Current
8
-2
-4
-6
-8
0 2 4 6 8
7. You have tested a circuit in the lab and obtained the following voltage v and current i signals.
a) Using the equation power(t) = p(t) = v(t)i (t), sketch and label the power curve.
Rt
b) Using the equation energy(t) = w(t) = −∞ p(τ )dτ, sketch and label the energy curve.
Current Voltage
8
2
6
4
1.5
2
0 1
-2
0.5
-4
-6
0
-8
0 2 4 6 8 0 2 4 6 8
2
First Order Systems
By the end of this section, you will be able to: Secondary Text: Sections 5.3 and 5.4
Signals of interest:
• The volume flow rate of the fluid q(t), usually in m3 /s. In the Flow is a through variable (more on this
figure, we have two arrows, each of which is a flow (we could add later!). Also, the text uses the variable ω
for flow instead of q.
more arrows to illustrate more flows, but we won’t do that right
now).
• The height of water in the tank h(t). Height is related to pressure Notice that both pressure and height
(we’ll see how very soon) and is often used to replace pressure can be measured relative to different
choices of ‘zero-reference’! For example,
in equations since we are typically more interested in how much we could measure pressure relative to
water is in the bathtub that we are in what the pressure is on the vacuum (0kPa), or we could measure
it relative to atmosphere (101kPa).
bottom of the tub. The latter is more common. What are
different zero-references for height that
might be relevant for this bathtub?
Across and through In Hydraulic systems, the through variable is
q, the volumetric flow rate (i.e., the mass flow of the fluid) and the
across variable is P, the pressure.
Incompressible means that the fluid does not change volume when
put under pressure. Water is incompressible (the volume does change
with pressure, but that change is negligible unless the pressure is
huge), but air is not.
Laminar flow is ‘nice’ in the sense that the water particles flow in
clean, parallel streams. When the water in your tap is running clear,
it is laminar. The other type of flow is called ‘turbulent’; here, parti-
cles dance and swirl around a lot. Modelling turbulent flow is very
difficult and requires complex, highly nonlinear equations, so we’re
going to avoid it. You’ll learn more in your Fluids course. We can identify whether or not flow is
laminar by using something called the
Reynolds number, which is a unit-less
There are two elements of interest in our bathtub example:1 the number that is based on a combination
hydraulic resistance (in the pipe), and the open tank. of the fluid’s properties and the pipe’s
properties. We tend to get laminar flow
when the fluid is slow or when the pipe
2.1.1 Hydraulic Elements - Pipes/Hydraulic Resistance has a large diameter.
1
There’s a third hydraulic element, but
we’ll learn more about that one after
the midterm.
Let’s look at the resistance first, but, before getting into the
gory details, let’s take a moment to figure out (at a high level) what’s
going on. Consider a simple, cylindrical pipe:
The pressure difference from one end of the pipe to the other is like a
‘push’2 . If the pressure on one end of the pipe is the same as on the 2
Remember that Pressure is Force per
other end (i.e., P+ = P− ), the fluid won’t move (flow will be zero) unit area!
because there is nothing ‘pushing’ the fluid through that pipe. Now,
what if P+ is larger than P− ? Which direction will the fluid flow?
Okay, so now we have a relationship between the direction of flow
and the pressure drop. Next, we need to figure out the details of that
relationship. To do so, we need to acknowledge that the fluid will
experience friction on the sidewalls of the pipe as it flows through
that pipe, and that friction will resist the flow of the fluid. More
resistance means slower flow OR a higher pressure drop (i.e., you
need to push harder to get the fluid to flow at the same speed!). It
turns out that this resistance R is a function of the dimensions of the
pipe and of the fluid properties:
32µ`
R= .
Ad2
For the case where the pipe is a cylin-
Great, so how do we use this resistance? Well, jumping through a der, can you simplify this expression
to remove A? (Hint: yes, you can! Try
few hoops and some assumptions about linearity yields the following it...) What happens if the pipe isn’t a
element law: cylinder? You’ll learn how to handle
this in your fluids course...
1
q(t) = ( P+ (t) − P− (t)) ⇔ ∆P(t) = Rq(t).
R| {z }
∆P(t)
Now it’s time to take a closer look at the tank. The most
important thing to keep in mind is that a tank is a storage device,
but what does it store? To answer this question, ask yourself ‘what is
accumulating in the tank’?
It turns out that some of the above questions are easier to answer
than they first appear. Let’s start by relating pressure to height by
using the force of the water acting on the bottom of the tank: F = mg;
except we really want the pressure, which is force per unit area, so
let’s divide: F/A = mg/A = Pb − Patm = ∆P. In fluids, we prefer to Why are we using ∆P instead of just
deal with fluid properties and object properties, so let’s remove m by the pressure at the bottom of the tank?
Because we’re only using the force due
to the water, not the force due to the
water and the entire atmosphere above
it! Next question: Why is it Pb − Patm
instead of the other way around? Well...
does adding fluid make the pressure
higher or lower? Based on that, which
choice ensures we get the right sign?
22 engg*2400 engineering systems analysis
mg ρVg
∆P = = = ρgh.
A A
Great, now we can relate pressure to height. Why does this mat-
ter? Because height is much easier to visualize, especially when we’re
trying to find a relationship between pressure and flow (which we
need to do to determine our element law), and because height is of-
ten an output signal of interest. Consider the total flow through the
tank q6 . If q > 0, then the tank is filling; if q < 0, then the tank is 6
By ‘through’ the tank, we mean the
emptying; and if q = 0, then the tank volume (or height) is staying sum of all the flow into the tank minus
the sum of all the flow out of the tank.
the same (which we call steady). Furthermore, since q is defined as
the change in volumetric flow per unit time q = V̇, we can use our
derived relationships to find the element law
A
q(t) = V̇ (t) = A ḣ(t) = ∆ Ṗ(t)
ρg
|{z}
=:C
Hydraulic
first order systems 23
Assumptions:
Variables: The through variable is the volumetric flow rate q and the
across variable is the pressure P.
Element Laws
1 128µ`
• Pipe resistance: q = R ( P+ − P− ), R = πd4
A
• Open Tank: q = C ( Ṗ+ − Ṗ− ), C = ρg
2.1.5 Assignment
None - see next lecture
24 engg*2400 engineering systems analysis
Steady state vs Transient: These are paired ideas! The transients are
the pieces of a function (or signal) f (t) that decay to zero. A sys-
tem response tends to have transient components corresponding
to changes in the forcing function changes (e.g., the forcing func-
tion changes from a sinusoid to a constant). The steady state portion
of a function f (t) is the part that is still sticking around after the It is possible for a signal to have no
steady state component (e.g., if the
transients are (more or less) gone. The steady state must be either
signal goes to infinity, such as et ).
constant or periodic.
6sin(t)
-2
-4
e(-2t)+6sin(t)
-6
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
What about the transient part of the response? (Think about the
‘speed’ of that response)
2.2.1 Assignment
1. Show that, for a cylinder,
128µ`
R= .
πd4
2. From the text, consider the problem outlined in 12.5 (pg 413). Consider the flow w0 to be the output.
Find the differential equation modelling this system. Note that Pa is atmospheric pressure and the incre-
mental pressures are defined as p̂i := pi − p a . Note also that this question introduces the idea of a pump,
which you can read about on page 403. For now, just use the equation of the pump that you’ve been
provided and know that the flow rate into the pump is equal to the flow rate out of the pipe.
3. In the following output signals, identify the transient and the steady state components. Sketch the
curves and (where appropriate) indicate where the transient component is (approximately) ‘gone’.
a) y(t) = e−2t + 6, t ≥ 0.
b) y(t) = 3(e−2t + 6), t ≥ 0.
c) y(t) = e2t + 6, t ≥ 0.
d) y(t) = 1 − e−2t , t ≥ 0.
first order systems 29
By the end of this section, you will be able to: Secondary Text: Section 6.2
We can ask lots of questions about this tank. E.g., one common ques-
tion is how can we determine how long it will take the water in the
tank to warm up or cool down to a pre-specified temperature? To
answer this question, we’ll need a model.
There are a number of ways that heat can move, but in the
course, we’ll care about two: conduction and forced convection. Both Other methods of heat transfer include
of these heat transfer methods can be modelled as a thermal resis- free convection, black body radiation,
etc.
tance. For conduction, we’re essentially interested in heat transfer
through an object (like a wall): when we apply heat to one side of
this object, what is the heat flow to the other side? For convection,
we’re looking at the effect of fluid flow against a surface to model the
change in heat on that surface. Text: Convection is not covered in this
In both cases, just like with hydraulic systems, we can find a ther- text
Secondary Text: Section 6.2.2
mal resistance R that satisfies the following element law: Derivations of thermal resistance are
beyond the scope of this course. You’ll
∆T (t) = ( T+ (t) − T− (t)) = Rq(t) learn more in thermo!
we get
ln(ro /ri )
R= .
2πα`
Forced convection yields a similar result for R. We’ll need the
following parameters:
since temperature is our across variable and flow is our through, we ⇔ Ṫ = Ṫc + 0 = Ṫc
Hydraulic
Thermal
Assumptions:
Variables: The through variable is the heat flow q and the across
variable is the temperature T.
Element Laws
• Thermal resistance: Rq = ( T+ − T− )
d
– Conduction flat plate R = αA
(ro /ri )
– Conduction radial pipe R = ln2πα `
1
– Forced convection R = hA
Sources:
2.4 Assignment
None
first order systems 35
Example: You’ve just finished a shower and used up all of the hot
water. Your roommate needs to know how long to wait until they can
shower.
We’ll use ENGG*2400 techniques to solve this problem. Let’s start
by finding a relationship between the heater element and the tem-
perature of the water in the tank, using variables R and C in place of
numeric values.
But wait.... we’re still missing some important information: what is
the impact of the cold water inflow? For simplicity, let’s assume that,
as we remove water from the tank (for our shower), the water gets
replaced by cold water from the city’s system, maintaining a constant
volume of water in the tank. If we go back to our energy equation
with this assumption, then we have
Let’s worry about finding the actual values of the R and C terms To make a flow diagram, identify
each element and label the across and
later. For now, let’s proceed with finding a parametric model by
through variables for that element.
constructing a flow diagram. Then, look for branches that have the
same across variable and connect them
up into nodes. Indicate the direction of
flow with an arrow, and you’re done.
Now write the element laws and the conservation laws (based on
the flow diagram), and simplify the resulting set of equations:
first order systems 37
Okay, now let’s find our parameters. You find the following infor-
mation though observation, on the internet, and on the tags on your
water heater: Specific heat of water 4.2kJ/(kg K ), volume of water in
the heater 150L, density of water 1kg/L, power of the heater 4000W,
average temperature of water from the city 15o C, ambient temper-
ature in the room 21o C, thermal conductivity of the tank insulation
0.004W/(m C ), and the tank is a cylinder with diameter 0.5m and
height 1.2m (measured from the outside). The insulation is 5cm thick.
Find R and C. (remember to think carefully about assumptions!)
And finally, let’s put it all together to get our model: We’ll figure out the rest of the answer
(i.e., the ‘how long’ part of the question)
in the ‘System responses Part 2’ lecture.
38 engg*2400 engineering systems analysis
2.5.1 Assignment
1. From the text, do 11.1 (pg 390) (Hint 1: Don’t worry about capacitance. Hint 2: treat each plate as a
resistance, then write the equations and see if you can simplify it all down to one equation that satisfies
∆T = Req q, then Req is the equivalent resistance. Hint 3: Rules for combining resistors (like the kind
from circuits) that are all in parallel might help here)
2. From the text, do 11.5 a (pg 391)
3. From the text, do 11.9 a and c (pg 393) Hint: notice how there is no q variable... you’ll need to do some
rearranging to make the equations match! Also, FYI, these equations are structured in a state space form!
(We’ll get to state space later in the term)
4. Sketch the flow diagrams for the three problems above. Remember to treat each across variable (temper-
ature) as a node and remember to use conservation of flow.
first order systems 39
• In your own words, explain what an input and output is (in any
system)
Let’s see how we can use these ideas to help break a com-
plicated problem up into smaller parts. When heating milk
in an industrial setting, we don’t want to use an electric heater be-
cause it is too hot: the milk will scald and stick to the heater, affecting
the flavour. Instead, milk is heated using a two stage process: hot wa-
ter (possibly steam) is heated by an electric heater, then the hot water
is used to heat the milk. Note that modelling of thermal systems
is covered in much greater detail in
ENGG*3260.
Cold Milk inflow
Milk
Tm
Hot Water
Tw
Hot milk outflow
qin
Great. Our other input is already well understood (we figured it out Note that an implicit assumption here is
when we did the heat exchanger!), so all that is left is to model the that the mass flow rate ṁ is constant, so
V̇ is also constant, as is w.
tank itself.
42 engg*2400 engineering systems analysis
Based on what we just did, can you write down the equation for
the hot water tank without doing any additional work? Hint: it is
essentially the same system as the milk tank, with one minor modifi-
cation.
Excellent. Let’s collect all of our equations and our block diagram
in one place to ensure that we haven’t missed anything (remember,
we need to have enough equations that we can actually solve for our
unknowns!)
first order systems 43
2.6.3 Assignment:
1. Answer the following questions as true or false. If you answer false, state a counter-example.
a) Inputs are always through variables
b) Outputs are always across variables
c) All of the across variables are outputs
d) All of the through variables are inputs
e) An output from one sub-system can not be an input to another sub-system
2. From the text, consider the problem outlined in 12.5 (pg 413). When we looked at this problem before,
we considered the flow w0 to be the output, but we didn’t give a reason. Consider the following sce-
narios and identify the appropriate outputs for each (note: listing every signal as an output is not a
reasonable answer!). Justify your selections.
a) Tank 2 is a water tower for the city of Guelph and Tank 1 manages overflow
b) This is an irrigation system
c) This is an industrial batch reactor system managing two connected, volume-sensitive, processes.
3. Consider the system given in Figure P12.7 in the text (p 414). Identify the sub-systems, their inputs and
outputs, and draw and label the interconnected block diagram. Write the input-output equation(s) for
each block.
4. Consider the system given in Figure P11.6 in the text (p 392). Let each of the ‘rooms’ be a sub-system of
interest. Draw and label the interconnected block diagram. Write the input-output equation(s) for each
block.
5. Consider the system given in Figure P12.5 in the text (p 413). Treat each tank and the pump as individ-
ual sub-systems. Draw and label the interconnected block diagram. Write the input-output equation(s)
for each block.
6. You want to model the coupled tanks system from the ENGG*4280 lab (shown on the next page), but it
is a complicated, interconnected problem.
a) What assumptions can/should you make to simplify this problem?
b) Identify the subsystems.
c) Identify the inputs and outputs from each subsystem.
d) Draw the complete, interconnected block diagram.
44 engg*2400 engineering systems analysis
By the end of this section, you should be able to: Secondary Text: Section 9.2
• Derive the step and impulse responses for a first order linear ODE
• Explain, in your own words, what k and τ mean and how they
affect a first order system’s step and impulse response
Remember the water heater from a few lectures ago? Let’s use it
as the basis for this lecture. Recall that the problem was laid out as
follows:
You’ve just finished a shower and used up all of the hot water.
Your room-mate needs to know how long to wait until they can
shower. You’ve found the following information though observa-
tion, on the internet, and on the tags on your water heater: Specific
heat of water 4.2kJ/(kg K ), volume of water in the heater 150L, den-
sity of water 1kg/L, power of the heater 4000W, average temperature
of water from the city 15o C, ambient temperature in the room 21o C,
thermal conductivity of the tank insulation 0.004W/(m C ), and the
tank is a cylinder with diameter 0.5m and height 1.2m (measured
from the outside). The insulation is 5cm thick.
We already determined the relationship between the heater el-
ement and the temperature of the water in the tank in a previous
lecture:
1
C Ṫ (t) + ( T (t) − Ta ) = qin (t).
R
1
C Ṫ (t) + ( T (t) − Ta ) = qin (t)
R
so that it fits the k and τ model above. Hint: You may want to con-
vert from absolute temperature T to a relative temperature Tr (t) =
T (t) − Ta
What are k and τ in terms of the tank parameters? We could do the same to the bathtub
problem from earlier in the term!
y(t) = e− at y0 = e−t/τ y0 , t ≥ 0.
I generated the figure below for a = 1/τ = 4 and for two initial
conditions: y0 = 2, −3. Notice that the title of the figure is
‘impulse response’ – this is because
I used a bit of a hack in Matlab to
generate this figure. We’ll see soon
how the impulse response and the free
response are similar to each other!
We can see that the initial condition y0 affects the starting location
and that the response always decays to zero. What affect does τ (or
the pole a) have? And what about k or b?
48 engg*2400 engineering systems analysis
Step: The step input is zero for all negative time and 1 for all positive
time In this course, we give the step function the label u:
u(t)
(
0, t < 0
u(t) :=
1, t ≥ 0.
1
If we set the input to a system to be a step and initial conditions to
zero, then we call the corresponding output the step response.
t
Notice that the area under the curve is always exactly 1! This means
that Z t
δ(τ )dτ = u(t)! ε t
−∞
If we set the input to a system to be an impulse and the initial con-
dition to zero, then we call the corresponding output the impulse
response.
For now, we’ll focus on steps and impulses. We’ll talk about fre-
quency responses more in a later lecture.
first order systems 49
ẏ ( t ) + ay ( t ) = bδ ( t ) , y ( 0 − ) = 0, t ≥ 0.
Using Calculus, we get the following: If you want the details of this solution,
we can show you after class, or you can
k − t/τ ask your Calculus professor.
y im pul se ( t ) = be − at = e ,
τ
Okay, so we can see that b affects the starting location, what about
τ (or the pole a)? I generated the figure below for y 0 = 0, b = 4, and
a = 1/τ = 4.
Let’s look a little more closely at the impact of τ. It turns out Equivalently, we can say that the pole a
also determines how quickly the curve
that τ determines how quickly the curve moves and is called the
moves.
time constant. To see how τ (or a) affects things, I’ve plotted the case
where b = 1 and 1/τ = a = 2:
Recall that yimpulse (t) = be− at , and that b = 1 and a = 2. Using this
equation, find and label the points where t = τ = 0.5, t = 2τ = 1,
t = 3τ = 1.5, and t = 4τ = 2 on the curve.
Can we generalize this? Sure!
Now we’ll turn to the case of the step input of some fixed
size x̂ ∈ R, so (
0, t < 0
x (t) = x̂u(t) =
x̂, t ≥ 0.
As engineers, we don’t care about what happened before we started
looking at the system (i.e., before time zero), so we can replace x
by x̂, use initial conditions, and rewrite our differential equation as
follows
ẏ(t) + ay(t) = b x̂, y(0− ) = 0, t ≥ 0.
Using the same techniques as before, we can find
b
1 − e− at x̂, t ≥ 0.
ystep (t) =
a
If we rewrite this using k and τ, we get
ystep (t) = k 1 − e−t/τ x̂, t ≥ 0.
y(t) = k (1 − e−t/τ ), t ≥ 0.
Since we already understand both the forced and the free parts, we
don’t need to do any additional work to find the complete response!
Cool!
Putting it all together: How does this relate back to our heating
example?? Well, start by expressing τ and k in terms of R and C, then
sketch the response for the 4000W heater and the initial temperature
of 15o C. When does the water reach a temperature of 49o C? Q: What is the steady state tempera-
ture? Does this make sense? A: The
steady state temp is 21,200 (obviously
not possible). Hot water tanks would
have a temperature controller to ensure
the tank doesn’t overheat.
first order systems 55
2.7.6 Assignment
1. Find k and τ (and a and b) for the bathtub example from section 2.1.
2. Consider the figure below containing 6 different responses for a first order system. You know that the
input is a step of size x̂ and the initial condition is given by y0 . Match the curve to the corresponding
pair of inputs and initial conditions.
a) x̂ = 1 and y0 = 2
b) x̂ = 5 and y0 = −2
c) x̂ = −5 and y0 = 2
d) x̂ = 1 and y0 = −2
e) x̂ = 5 and y0 = 2
f) x̂ = −5 and y0 = −2
g) Based on your answers, is it possible to determine k? If so, what is it?
h) (Challenging!) Find τ. Hint: use a combination of the graphs and the values you know/have calcu-
lated.
3. From the text, do 7.11 (note that the text uses u as a general input here, and not as the specific unit step
input). In all cases, indicate the forced and the free components of the solution. Hint: to answer c, you’ll
need to use superposition and the idea of time shifting... time shifting is an advanced idea that we
haven’t explicitly discussed, but the key idea is that, if you shift the input by a certain amount of time,
you shift the output by the same amount of time.
4. From the text, do 12.10 (p 416).
56 engg*2400 engineering systems analysis
5. Go back to the sketches that you created in the assignment from section 2.2 question 3 and relabel
the diagrams, this time including τ and 4τ (Hint: you weren’t given a differential equation, but you
should be able to look at those functions and relate them to a first order step response, then extract the
τ value). Use 4τ as the time at which the transients have ‘died out’ and the system is (approximately) at
steady state. Why do you think it makes sense to use 4τ? When/why might you use a different value
(e.g., 5τ or 3τ)?
6. You’re a coroner, and you come upon a body at 8am and you’d like to determine time of death. The
overnight temperature was 5o C, you know that the victim was approximately 70kg, that the specific heat
of the human body is approximately 4.2K J/(kg K ), and that the thermal resistance of fat and skin on a
person of this size is approximately 1/20 K/W.
a) Find a differential equation that relates the temperature of the body to the ambient temperature.
b) Find τ and k.
c) Standard (healthy) body temperature is approximately 37o C, and the temperature of the body when
you found it is 10o C. If you’re trying to determine time of death, what should you choose as your
initial condition and your forcing function?
d) Using your answers above, find the solution for the body temperature with respect to time and
sketch the associated curve. On your graph, label τ and the steady state.
e) Based on what you’ve done so far, determine the approximate time of death.
first order systems 57
By the end of this section, you will be able to: Secondary Text: Chapter 4
Signals of interest:
• The current i (t), usually in Amps (A). Current is the through variable.
• The Voltage e(t) (or sometimes v(t)) at various nodes, usually in Voltage is the across variable
Volts (V).
Assumptions: Assume that all conductors are perfect and that all ele-
ments are ideal (e.g., a capacitor is purely capacitive with no resistive
component)
58 engg*2400 engineering systems analysis
We’re not going to worry about deriving the models for the resis-
tance R and the capacitance C, instead we’re going to assume (very
reasonably) that we can read them or measure them directly from
the element. That said, we still need the element laws for C and R in
electrical systems:
What should we use as our reference? Where should we put it? iin (t) R C vc (t)
Great. Now let’s find the differential equation relating the input
voltage to the output voltage. Start by sketching the flow diagram. Remember, when sketching flow
diagrams, connect elements at nodes,
and ensure that those nodes all have
the same across variable... labeling of
your initial diagram is very important
iin (t) R C vc (t) to ensure that your flow diagram is
correct.
What do you notice about the structure of your flow diagram com-
pared to the circuit? Okay... now write your equations and find the
differential equation relating the input to the output.
What’s τ? k? How long will it take for the transients in the capaci-
tor’s voltage to (approximately) die out?
60 engg*2400 engineering systems analysis
∆across(t) = R through(t),
d ∆across(t)
through(t) = C = CD∆across(t).
dt
Now, here’s the dirty trick. We’re going to use the idea of an impedance.
If we define the impedance for a resistor to be Zr = R and the
impedance for a capacitor to be Zc = 1/(CD ), then we can write
all of our element laws as Note that impedances are functions of
the D operator!
∆across(t) = Z through(t).
It’s easy to see this works for a resistive element, so let’s double
check to see if it works for a capacitive one:
first order systems 61
Impedances satisfy:
ZR = Zc =
Hydraulic
Thermal
Electrical
62 engg*2400 engineering systems analysis
Now we just need to put them together in their flow diagram, then
convert that to a circuit: Why do we want to convert systems to
circuits? Because we’re going to learn
a tool called nodal analysis that will let
us write down our model equations
quickly and efficiently, and it is easiest
to apply nodal to a flow diagram,
which is essentially the same as a
circuit diagram!
first order systems 63
2.8.3 H (D)
One last fun fact before we finish this big picture unit.
From our last example, notice that we can express our differential
equation with the D operator:
1
P(t) = q ( t ).
(CD + R) in
| {z }
H (D)
Output = H ( D )Input.
I’ve placed the Matlab code that I used to generate the Responses
part 2 figures in Courselink for you to play with. You’ll note that it
leverages all of these functions.
For first order systems, we can also get the complete response
very easily (higher order systems are a bit more convoluted and need
state space tools – we’ll see how to handle this later). In the example
above, we can rearrange to find that a = 2/5 and b = 3/5. If the
initial condition is P(0− ) = 4, the input is sin(4t), and we want to
simulate from t = 0 to 15 at intervals of 0.01, we can get the complete
response using
a=2/5;
b=3/5;
sys=ss(-a,b,1,0);
64 engg*2400 engineering systems analysis
ic=4;
t=0:0.01:15;
in=sin(4*t);
lsim(sys,in,t,ic)
Note that the command lsim will plot the input and the output for
you on the same plot (nice!)
first order systems 65
Assumptions:
• Ideal conductors
• Ideal components
Variables: The through variable is the current i and the across vari-
able is the voltage e.
Element Laws
• Inductance: TBD
Sources:
2.8.5 Assignment:
1. From the text (p178), do 6.1, 6.4, and 6.17 (Hint: 6.17 this is a static system, so you don’t need deriva-
tives or D anywhere. Also, using a matrix to solve might come in handy here...). If your answer is first
order, identify k and τ and sketch the step response. Express your answers using the D operator.
2. From the text, do 7.7 a. and b. (pg 237). ‘No stored energy’ means that initial conditions are all zero.
du(t)
Hint 1: Notice that dt = δ(t). Hint 2: You may want to use superposition (i.e., the property that you
can solve for at one part of an input, then solve for another part of the input, and sum up the answers
to find the actual solution). Hint 3: Yes, you actually have everything you need to be able to do this
question without needing to use first principles calculus.
3. From the text, do 7.9 a. and b. (also, what is the time constant? what are the forced and free compo-
nents of the solution?)
4. For the thermal problem given in lecture 4, find the equivalent circuit.
5. For the hydraulic problem given in tutorial 2, find the equivalent circuit.
6. For the thermal problem given in figure P11.9 (p393), draw the flow diagram, the equivalent circuit, and
the equivalent hydraulic system.
7. This is a summative problem that takes many of the elements of modelling and response analysis
that you’ve learned so far and puts them together.
This is a modified version of a question from a ENGG*3430 Heat and Mass midterm (Yes, seriously!
This would be a mid/hard question for 2400 and an easy/fundamentals question in 3430).
Heater
Slab A Slab B
A square heater with surface 15cm × 15cm is inserted between two very tall slabs. Slab A is 2cm thick
(α = 50W/mC) and slab B is 1cm thick (α = 0.2W/mC). The convection coefficient on sides A and B
are 200W/m2 C and 50W/m2 C respectively. The temperature of the surrounding air is 25C. The heater is
rated at 1kW.
a) Assume that the system is at steady state (i.e., the thermal capacitance of the slabs can be neglected).
Find
i) The hottest temperature in the system.
ii) The outer surface temperature of the two slabs.
b) Now include the capacitance (this part was not on the 3430 midterm, but is totally reasonable for a
2400 midterm!)
i) What are the inputs and outputs of the system?
first order systems 67
Now that we’ve finished with first order systems, there are
a few things we can learn to make our lives easier before we formally
move to second order and higher.
• Write the nodal equations in matrix form and solve the resulting
matrix
τ ẏ ( t ) + y ( t ) = kx ( t ) .
τ Dy ( t ) + y ( t ) = kx ( t ) ,
but, if you recall from last lecture, we can ‘factor’ these D terms:
( τ D + 1 ) y ( t ) = kx ( t ) .
70 engg*2400 engineering systems analysis
output ( t ) = H ( D ) × input ( t ) ,
so, for the specific example above, y is the output, x is the input,
what’s H ( D ) ? This function is really important in
systems. The textbook talks about the
transfer function H (s), which is closely
related to H ( D ). For now, whenever
you see ‘transfer function’ in the text,
just replace the s with a D and move
on.
A x − A1 A x − A2
+ + · · · = 0;
Z1 Z2
i.e., always work from the node outwards. This means that you
have assumed that all flows are leaving the node.
interesting things we can do with h ( d ) 71
Z3 Z4
Z5
Z2
Z1
Our end goal is to find the value of every nodal across variable.
Before proceeding, let’s think about how many equations we will
need.
72 engg*2400 engineering systems analysis
1. Identify and label all of the nodes including the ground node.
Label any nodes attached to a grounded voltage source with the
(appropriately signed) value of that voltage source.
2. Choose a node. Imagine that all currents are leaving that node
and write KCL in voltage/impedance form at that node.
3. Repeat the previous step for all nodes except for the ground node
and any nodes attached to a voltage source.
Z3 Z4
Z5
Z2
Z1
Great. Now we can solve for every across variable in the system.
How can we use this information to find the through variables? Or a
system model?
Z1
Ain Z2 Z3 Aout
74 engg*2400 engineering systems analysis
3.1.1 Assignment:
1. Use nodal analysis and linear algebra to solve for all nodal voltages in the following figures from the
text (starting on pg177) P6.1, P6.4, P6.15, P6.16, and P6.17 (note: for P6.17, swap the location of the volt-
age source and the 3Ω resistor)
2. For the problem we solved at the end of the lecture, answer the following questions: (Hint: You should
be able to answer all of those questions by looking at H ( D ))
a) What is τ?
b) What is k?
c) If the input is a step, how long will it take for the system to reach steady state?
d) If there is no input, how long will it take for the initial voltage to die away?
e) Sketch the response of the system for zero initial conditions when the input is Ain (t) = u(t) − u(t −
∆t) when ∆t = τ, 2τ, 3τ, and 4τ. Which part of this response is a forced response? Which portion of
this response is similar to a free response? What’s happening to the capacitors?
f) Check your answers using Matlab. The code from the end of the Section 2.7 will be useful.
3. Consider the optional thermal problem from the end of tutorial 3. Sketch the flow diagram, write the
nodal equations in matrix form, and solve the resulting matrix to find an expression for each of the
temperatures as a function of the input heat flow. Find the associated H ( D ) for each temperature.
4. For Figure P12.7 (pg 414) in the text, draw the equivalent flow diagram and use nodal analysis to solve
for the pressures P1 and P2 as functions of the input pressure Pi . Find the associated H ( D ) for each
pressure.
interesting things we can do with h ( d ) 75
By the end of this section, you will be able to: Secondary Text: None
Tw
qin Tm
qe
Water Exch. Milk
qwc qcm
r y
G1
r y
G2
y y
r r
G
r y r y
G
x x
r y
G
r y
H
interesting things we can do with h ( d ) 77
d
G
r y
C H
78 engg*2400 engineering systems analysis
Example: Now let’s tackle that milk problem! We want to find the
overall outputs as functions of the two inputs. For now, let’s try to
get Tm as a function of q in . You will do the rest in the homework!
Tw
qin Tm
qe
Water Exch. Milk
qwc qcm
First, we need to turn these blocks into things that look more like
what we’ve been dealing with during this lecture. Let’s go back to
the equations we developed to do so:
Rw Rqw
Water heater: Tw = (q + qwc )
Rw Rq wCw D + ( Rw + Rqw ) in
| {z }
=:Hw ( D )
Now you should have something that looks like the following. This
is everything you need to solve, but doesn’t quite look like it. Let’s
manipulate it a bit more so that we can more easily see some of the
structures from earlier today.
qcm
qin Tw qe Tm
Hw 1/Re Hw
−
k Milk heater
Tm = Hm (qe + qcm )
qwc
1/Re
3.2.2 Assignment:
1. From the text starting on pg 448, do 13.1-3, 13.9, 13.14a, 13.16a-b.
2. Finish the milk problem!
interesting things we can do with h ( d ) 81
• Calculate and plot (Bode) the frequency response for a first order
system Secondary Text: Section 8.3.3
τ ẏ ( t ) + y ( t ) = k sin ( ωt ) .
After a lot of heavy Calculus, we get Ask your calc prof if you’re interested
in the details, the derivation is about a
k h i page long and is beyond the scope of
y(t) = √ sin ωt − Tan− 1 ( τ ω ) − ωe − t/τ , t ≥ 0. 2400, but well within the scope of your
τ2 ω2 + 1 calculus course.
That’s pretty messy. Notice that the e t/τ term has shown up again,
but we already understand that behaviour (from the step and im-
pulse response discussion), so let’s focus on the steady state part:
k
y(t) = √ sin ωt − Tan− 1 ( τ ω ) , t ≥ 0.
τ2 ω2 + 1
Example: Recall that the input was sin ( ωt ) . When we compare this
steady state response to that input, we can identify a phase offset and
gain (in the amplitude). What are they functions of?
82 engg*2400 engineering systems analysis
Example: For the case where τ = 10, ω = 0.1, and k = 4, find the
gain and the phase offset.
b) Identify the frequency of the input and the output. Are they the
same or different?
k
H(D) = .
τD + 1
Let’s write this as a complex number instead, by replacing D by jω,
then convert to polar form and see what happens
k
H ( jω ) = = r ( jω ) e jθ ( jw ) .
τ ( jw ) + 1
Recall that, by definition, r = | H ( jw)|
and θ = ∠ H ( jw).
Now, with this figure, we can easily answer the question: what is the steady state output for this system
when the input is sin(0.06t)?
So we’ve done some math and drawn (and used) a figure. We’d like to understand what they actually
tell us...
interesting things we can do with h(d) 85
4. If you look at the second figure (I zoomed in a bit), you can see
the phase offset in steady state part of the responses, and that
phase offset is consistent with the equations and with the Bode
plot.
86 engg*2400 engineering systems analysis
Vin C Vout
This circuit can be used as a filter that ‘passes’ all frequencies be-
low 1/RC and ‘attenuates’ all frequencies above 1/RC! If we let Be careful with your units!!! Hint:
1Hz = 2πrad/s.
R = 10kΩ and C = 15nF, find the cut-off frequency in kHz
So what does this mean? The circuit is an audio filter that keeps the
bass and removes the treble!
interesting things we can do with h(d) 87
3.3.1 Assignment:
1. At the end of the lecture in section 3.1, we analysed a circuit, then answered a number of questions
about it in the homework. Now that you know about frequency response, answer one last question:
if the input is a sinusoid, at what frequency will the output be half the size of the input? Check your
answer in Matlab by using lsim (remember to simulate for long enough that you are looking at the
steady state part!)
2. For the circuit that we analyzed in the last lecture, find H ( D ) and sketch the Bode plot if R = 8200Ω
and C = 2.2µF.
3. Imagine that we are interested in a complicated circuit that satisfies the following:
1
H (D) = ,
D2 + 100D + 1
which yields the Bode Plot below. (note: you don’t have to know how to sketch these more complicated
plots, although you do need to know what the first order Bode plot looks like!)
Bode Diagram
0.8
Magnitude (abs)
0.6
0.4
0.01
0.2
0
0
Phase (deg)
-45
-90
-4 -3 -2 -1 0
10 10 10 10 10
Frequency (rad/s)
1.5
0.5
-0.5
-1
-1.5
-2
0 2 4 6 8 10 12 14
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 200 400 600 800 1000 1200 1400
5. Calculate the magnitude, M, and phase angle, θ (radians), of the frequency response for the following
systems for ω = 0, 1, 2, 4, 8 radians/s
1
H (D) = M = 0.25 M = 0.2425 M = 0.2236 M = 0.1768 M = 0.1118
D+4
θ=0 θ = −0.2450 θ = −0.4636 θ = −0.7854 θ = −1.1071
D+1
H (D) = M = 0.25 M = 0.3162 M = 0.3953 M = 0.4610 M = 0.4888
2D + 4
θ=0 θ = 0.3218 θ = 0.3218 θ = 0.2187 θ = 0.1206
1
H (D) = M = 0.25 M = 0.3162 M = 0.5000 M = 0.0791 M = 0.0165
D2 + D + 4
θ=0 θ = −0.3218 θ = −1.5708 θ = −2.8198 θ = −3.0090
2D + 3
H (D) = M=3 M = 0.7211 M = 0.4789 M = 0.3418 M = 0.2181
D2 + 5D + 1
θ=0 θ = −0.9828 θ = −0.9350 θ = −1.0023 θ = −1.1904
D
H (D) = M=0 M = 0.1667 M = 0.1617 M = 0.1413 M = 0.1010
D2 + 6D + 1
θ=0 θ=0 θ = −0.2450 θ = −0.5586 θ = −0.9197
D+4
H (D) = M=4 M = 1.4577 M = 0.4000 M = 0.0807 M = 0.0171
D3 + 3D2 + 3D + 1
θ=0 θ = −2.1112 θ = −2.8578 θ = 3.0911 θ = 3.0510
4
Second order systems
By the end of this section, you will be able to: Secondary Text: Ch 3.3 and 3.6
• Write the physical laws that relate force to position, velocity, and
acceleration for a mass, spring, and damper (or viscous friction).
• Use the free body diagram and the conservation law to determine
the differential equation that models the behaviour of mechanical
systems.
Just like with our other system types, there are funda-
mental systems elements that we’re interested in when
92 engg*2400 engineering systems analysis
Signals of interest:
• Velocity v(t) = ẋ (t), usually in m/s. This is our across variable, although it
isn’t clear why yet.
• Acceleration a(t) = v̇(t) = ẍ (t), usually in m/s2 .
Just like with our other system types, we can use a reference.
When dealing with springs, it is easiest to choose the position refer-
ence such that x (t) = 0 when the spring is relaxed (or equivalently
unsprung). Using this reference, we can capture the behaviour with
Hook’s law:
What force is the hand applying to the spring? What force is the
spring applying to the wall? What force is the wall applying to the
spring? Hint: Think about Newton’s third
law... the one about equal and opposite
forces....
x1 x2
piston moves through the oil, the flow of the oil resists the movement
of the piston. The faster the piston moves, the higher the opposing
force. In both cases, the relationship between the applied force and The principle of direction of motion
versus force applied or felt is the same
the velocity is given by
as in the discussion of the spring.
v2
viscous
fluid
v1
Example: Let’s try drawing the FBD for the following simple Mass
Spring Damper (MBK) system: Ask yourself: which node is the refer-
ence in this case? I.e., at which node
x will we NOT write a conservation
equation?
f(t) M
Now, we’d like to use this FBD in the context of our course’s con-
servation laws and element laws, but right now we can’t quite do that
because the inertia term is ’hiding’. So, we’re going to slightly rear-
range Newton’s equation to more explicitly reflect the inertia term as
a (sort of) applied force of it’s own, and we’re going to include that
inertia in our FBD. This rearrangement is called
D’Alembert’s law, and allows us to
0= ∑ applied forces − ma (t) .
| {z }
treat a mass as a node and talk about
the conservation of the ‘flow’ of Force at
inertia that mass (or ‘node’).
Great, now let’s put this conservation law together with the FBD
to find the differential equation relating the applied force F to the
position of the mass x. Also find H ( D ). What’s the input and the output in this
case?
96 engg*2400 engineering systems analysis
x2
x3
F M2 B2
K2
K1
M1
B1
x1
second order systems 97
4.1.4 Assignment:
Note that this is a long assignment! Many of them are somewhat repetitive and can be treated as drill to
help you build FBD skills.
1. Consider the system shown in figure P2.23 (p 45). Assume that the mass M1 is stationary. Find a dif-
ferential equation relating the output position x2 to the force due to gravity. Find the associated H ( D ).
(You can read about ideal pulleys on pg 31)
2. Consider the system showing in figure 2.17 in the text (pg30). Assume that the mass M1 is stationary.
Find a differential equation relating the output position x2 to the force due to gravity. Find the associ-
ated H ( D ).
3. From the text, do P2.26 (pg 46) Do not find Beq .
4. From the text, do P2.29 (pg47) (Hint: remember to draw a FBD at the massless point!).
5. From the text, do 2.23 (pg. 45). Compare your answer here to when you held M1 stationary in Q1. Does
this makes sense? Why/why not?
6. From the text chapter 2 starred problems (starting on page 39) do 2.1, 2.4, 2.7, 2.12, 2.15, 2.22.
7. (Challenge problems) From the text chapter 2 starred problems (starting on page 39) do 2.10, 2.18.
98 engg*2400 engineering systems analysis
• Explain, in your own words, the idea of resonance Secondary Text: pg243
• Identify the inertial elements in all system types and write down
the associated element law x
f(t) M
Last day, we modelled a very simple mass-spring-damper
setup, and we talked about how the spring stores poten- B
And when I release the mass, that energy gets (slowly) transferred to
where?
When does the mass have maximum kinetic energy and the spring
have zero potential?
Similarly, when does the mass have zero kinetic energy and the
spring have maximum potential? (Hint: there are TWO locations!)
second order systems 99
4.2.1 Resonance
1
H (D) = .
MD2 + K
Find H ( jω ) and write it in polar form.
So, according to this result, the steady state of the position will be an
p
infinitely large sinusoid if the input looks like F (t) = sin( (K/M) t).
p
This is called resonance, and (in this case) (K/M ) is the resonant
frequency.
100 engg*2400 engineering systems analysis
Below, I’ve included the Bode plot for a system with M = 4kg and
K = 9N/m. Find and label the resonant frequency on the plot. What
does this plot tell you about the input/output behaviour above that
frequency? Below it?
4.2.2 Inertiance
Hmm... that didn’t seem to work since dampers don’t actually store
energy. What happens if we consider ∆v to be our across instead?
Okay, so that implies that force is the through variable... does that
make sense?? Think about what happens when we apply a force
to one end of an element.... does the other end of the element ex-
perience the same force? Yes! Neat! So this means that force is our
through variable. We can now write our mechanical system equations
in terms of these across and through variables:
Mass:
Damper:
Spring:
Okay, what’s going on with the spring? Remember that the new
thing we noticed in our mechanical system was the ability to store
the force, or more broadly, the flow. It turns out that other systems
have elements that do this as well.
but for longer pipes this effect is crucial. Since this is an inertial ef-
fect, we’ll need to use F = ma, but we’ve talked before about how
fluids people don’t like to use mass, so lets replace it with density
and volume: m = ρV = ρA`1 . Additionally, we want to write our 1
Recall, ρ is density, V is volume
relationships in terms of the hydraulic across (P) and through (q), so
we’ll need to remember that force relates to pressure2 via f = AP 2
We’re working with hydraulics now,
so force is no longer the through
variable!
A ( P1 − P2 ) = ρA` a = ρA` ẍ
| {z } |{z}
∆P m
4.2.3 Assignment:
2
1. A third year student models a complicated electrical system and finds that H ( D ) = 0.1D2 +12
. Find
H ( jω ) and write it in polar form. What is the resonant frequency of this system?
2. Redo the problem from Tutorial 2, but this time, also consider the inertiance in the long pipe. Find an
equation relating the pressure at the left side of that long pipe to the pump flow w p . Based on what
you found, do you think it is possible to have resonance in a fluid system? If so, what would need to be
true?
3. Consider the circuit below.
5nF
a) Find H ( D ) relating the input voltage to the voltage across the capacitor.
b) Let time be measured in micro-seconds. Find the steady state of the voltage drop across the capaci-
tor if the input is Vin (t) = sin(t) Volts.
c) For the same input, find the steady state of the current through the capacitor (hint: you know how to
integrate and differentiate sinusoids.... use that knowledge!)
d) Find the resonant frequency ωr of this system (include units in your answer).
e) What will happen if the input voltage is Vin (t) = sin(ωr t) Volts?
f) How are your answers the same/different from the example in class?
second order systems 105
By the end of this section, you will be able to: Secondary Text: Section 2.2.3
• Identify the state variables for each element in each system type
That’s not useful yet, since we still have y on the RHS. What if we let
z2 = ẏ? Then that first equation becomes
106 engg*2400 engineering systems analysis
Are we stuck? It may look like it, but we’re not... we really just need
to go back to the original equation and back-substitute:
ż = Az + Bx
y = Cz + Dx
So, does this mean we can always choose the first state to be the
output, then next state the derivative and so on? Unfortunately no.
Fortunately though, if we know something about the system, then
there are natural choices of states that will always work. The key is
to identify the energy storage elements and their associate variables, There are ‘tricks’ for going from any
differential equation to a state space
then write first order differential equations in terms of only those
representation, but you’ll learn more
variables. about those when you take ENGG*3410.
So, how do we choose the energy storage variables to be interested
in? Typically, we choose either the ∆across or the through variable
associated with that element, and we typically choose whichever
variable is ‘stored’. So, for a circuit, we’d choose the current through
the inductor and the voltage change across a capacitor.
second order systems 107
lecture two lectures from now), but for now let’s see what we can fig- M1
ure out from what we already know. In an earlier lecture, we found
B1
the FBDs for a two mass system, and the resulting equations were
x1
We know that the spring stores potential energy and the masses
store kinetic, but which variables should we choose? If we were to
think like a circuit, we’d choose ∆v for the mass, which corresponds
exactly to ∆across. We’d also choose ‘force’ for the spring, but that
’force’ term doesn’t show up directly in our equations... instead,
we have k( xi − x j ) type terms, so instead of choosing the through
variable f , we’ll choose the equivalent, ∆x. We know from a moment
ago that we’ll need four states. Based on what we just discussed,
what should those four states be?
Find the response when the input is 2 cos(4t) and the initial condi-
tions are x1 (0− ) = −1 and x2 (0− ) = 5.
A=[0 1; -2 -3]
B=[0;1]
C=[1 0]
D=0
sys=ss(A,B,C,D)
t=0:0.1:10;
q=2*cos(4*t);
ic=[-1;5]
lsim(sys,q,t,ic)
4.3.2 Assignment:
1. Finish the mechanical problem given at the end of the lecture and express your answer in matrix form.
Recall that we use z1 = x1 , z2 = ẋ1 = v1 , z3 = x2 , z4 = ẋ2 . Treat x1 as the output. How does your
answer change if the input is x3 instead of F?
2. From the text, do 3.5, 3.9, 3.13, 3.18, and 3.29 (starts on p 70)
3. From the text, do 6.9, 6.21, and 6.38 (starts on p 179). Also do 6.3, 6.7, 6.12, and 6.18.
4. From the text, do 11.7, 11.9, and 11.11 (starts on p 392) For 11.9, find H ( D ) and compare to what you
got when you solved this system in a previous assignment.
5. From the text, do 12.5 (take wo and p̂2 as the outputs) and 12.7 a (also find H ( D )) (starts on p413)
second order systems 111
4.4 Second order step and impulse responses Text: Subsection starting on p258
By the end of this section, you will be able to: Secondary Text: Sections E.3.2 and 8.4.1
• In your own words, explain the idea of damping and natural fre-
quency
• Sketch and label the step and impulse responses for underdamped
systems
kωn2
y(t) = x (t)
1D2+ 2ζωn D + ωn2
k
= 1 2ζ
x (t), ζ ≥ 0, ωn > 0.
D 2 + D + 1
w 2 ω n
n
Again, just like with first order systems when we investigated k and Just like before, k is the static gain. Our
new terms are ζ, the damping ratio and
τ, here we want to understand what k, ζ, and ωn mean.
ωn , the un-damped natural frequency.
Before jumping into the math, consider that we’ve already talked
about resonance, where we got something that looked like
1
H (D) = ,
MD2 +K
if we put this into standard form, we get
Okay, so what does this mean? We can have real or complex roots:
Purely imaginary:
Complex:
Now, with all this in hand, let’s rewrite the poles in their polar
form and sketch the result in the complex plan to see if we notice
anything interesting about what happens as ζ moves from 0 to 1. These ideas are crucial in many me-
chanical courses, such as Vibrations
and in any other system where energy
exchange or oscillation is present.
Does that matter? Yes, it turns out that it does! To see how, we
need to look at one system type at a time.
Let’s start with the simplest case: real roots. Let’s assume
that we can write the differential equation such that
k
, τ1 , τ2 ∈ R.
(τ1 D + 1)(τ2 D + 1)
which is just two first order systems added together! This is signif- If τ1 6= τ2 , in calculus you called this
icant, because it means that we can write the output as a sum of two ‘non-repeated roots’, but in systems
we call these systems overdamped. If
first order system responses τ1 = τ2 , in calculus you said this was
‘repeated roots’, but in systems we
kτ1 kτ2 call the system critically damped and
τ1 −τ2 −τ1 +τ2
y(t) = x (t) + x ( t ), the partial fraction expansion yields
τ1 D + 1 τ2 D + 1 something slightly different - you’ve
already investigate the details of both of
which means that the step response is the sum of those two first these types of differential equations in
order system responses: your calculus course.
kτ1 kτ2
ystep = (1 − et/τ1 ) + (1 − et/τ2 ), t ≥ 0.
τ1 − τ2 −τ1 + τ2
You’ll spend some time exploring this and the associated impulse
response in the assignment.
114 engg*2400 engineering systems analysis
Step Response
0.8
0.7
0.6
0.5
Amplitude
0.4
0.3
0.2
0.1
0
0 2 4 6 8 10 12 14 16
Time (seconds)
value of ζωn (i.e. the real part of the pole) seems to be related to how Find k, wn , and ζ. Do these values make
sense to you?
quickly the curve decays, so it has a similar role to 1/τ from the first
order case. We also see that the frequency of oscillation depends on
the damped frequency
q
ωd = ωn 1 − ζ 2 ,
Let’s take a second to look at two plots, one that shows what hap-
pens as we change ζ and the other as we change ωn :
1
H (D) = .
MD2 + BD + K
Put this in standard form, find k, ζ, and ωn . Which parameters affect
which terms? Does this make sense based on what we know about A great way to gain intuition about the
behaviour of second order systems is
things like friction, resonance, and steady state? Why/why not?
via this Mass-Spring-damper system,
you’ll explore it further in Tutorial 7.
The impulse response is given by Let’s sanity check this... it should be the
derivative of the step response.... yup
it is! (Note that this is not trivial to do!!
q
kω
p n e−ζωn t sin ωn 1 − ζ 2 t , t ≥ 0 You’ll need some trig identities.)
1 − ζ2
Step Response
0.6
0.5
0.4
0.3
Amplitude
0.2
0.1
-0.1
-0.2
-0.3
0 2 4 6 8 10 12 14 16 18
Time (seconds)
Again, notice that ζωn determines how quickly the curve decays
p This is the impulse response for the
and that the frequency of oscillation depends on ωn 1 − ζ 2 . As with transfer function
the first order case, the static gain does not explicitly show up in this 1
H (D) = .
figure. Also, notice that this impulse response differs from the first D2 + 0.7D + 2
order case in that the curve starts out at zero instead of at a constant
(non-zero) value.
As with the step responses, let’s take a look at two plots, one that
shows what happens as we change ζ and the other as we change ωn :
second order systems 119
π
• Time to first peak tmax = ωd
4.4.5 Assignment:
1
1. Consider the system given by H ( D ) = (τ1 D +1)(τ2 D +1)
with τ1 , τ2 ∈ R. Let τ1 = 1. Consider four cases:
• τ2 = 1
• τ2 = 2
• τ2 = 10
• τ2 = 50
a) Find an equation for, and then sketch the step responses.
b) For the step responses, calculate the value of the output, y, at time t = 4τ2 . What do you notice as τ2
changes?
c) For the case where the system is critically damped, calculate the value of the step response y at time
t = 5.8τ. What does this tell you about how this type of system relates to a ‘pure’ first order system?
d) Find an equation for, and then sketch the impulse responses.
e) For the impulse responses, calculate the value of the output, y, at time t = 4τ2 . What do you notice
as τ2 changes?
f) For the case where the system is critically damped, calculate the value of the impulse response y at
time t = 5.8τ. What does this tell you about how this type of system relates to a ‘pure’ first order
system?
g) Use Matlab to check all of your answers (you don’t need state-space!).
2. From the text (pg. 289-293), do 8.8, 8.9, 8.10, 8.12, 8.34, and 8.36.
3. From the text pg. 451, do 13.18b and d (recall that you already solved a in chapter 3!)
4. On the next page, you’ll find a favourite assignment problem from one of my old professors. The plots
on the bottom show the location of the poles as mapped into the complex plane; ignore the poles given
in (5) and (7) and their associated curves (b) and (d). Hint: From the pole locations given in the complex
plane, you can determine ζ and ωn or your value(s) of τ, whichever is appropriate. Hint2: You should
be able to figure out (6) by process of elimination. Based on what you discovered in Q1, does it make
sense that the addition of a real, slow pole has this affect on the under-damped step response?
second order systems 121
122 engg*2400 engineering systems analysis
We’ve been holding off on this for a long time, but we’re
finally ready to do it: finding the equivalent circuit (or
flow diagram) for mechanical systems. The key idea here
is to leverage the equivalencies we determined in the table above to
translate the free body diagram into a flow diagram. Just like when
we did flow diagrams back in the first order unit, the key to writing
the flow diagram is to identify the nodes and to connect each node
to other nodes via elements. So, what are the nodes in a mechanical Hint: remember that we like to do
conservation of flow at a node and that
system?
flow in mechanical systems is force, so
where in mechanical systems do we
write conservation of force equations?
F
M B
x1
Holy crap. That’s the same circuit we got in the First Order big
picture lecture!
second order systems 123
Okay, now we’re finally ready to make our ‘Big picture’ table.
After this, we’ll do some examples.
Impedances satisfy:
ZR = Zc = Zl =
Across
Through
Resistance
Stores?
State Variable?
Capacitance
Stores?
State Variable?
Inductance
Stores?
State Variable?
124 engg*2400 engineering systems analysis
K2 K1
F
M2 M1
B2 B1
x2 x1
Great. That’s second order, all done! Now we just need to learn
about Laplace and about interconnected systems, and the course is
over :)
second order systems 125
4.5.1 Assignment:
1. For the problems given in 2.10, 2.23, 2.27 (starts p41), find the equivalent circuit.
2. For the problems given in 6.7 (p179), find the equivalent mechanical and fluid systems. Is there an
equivalent thermal system? Why/why not?
5
Laplace Transform
5.1 Definitions and Transfer Functions Text: Sections 7.2 and 7.3
By the end of this section, you will be able to: Secondary Text: Section F.1-F.3
Note that the lower limit of integration is a zero!2 This means that 2
This is why we call the Laplace trans-
any part of the function f that occurs during t ≤ 0 will not affect the form a ‘single sided’ transform.
δ(t) 1
1
u(t) s
e− at 1
s+ a
te− at 1
( s + a )2
ω
sin(ωt) s2 + ω 2
s
cos(ωt) s2 + ω 2
e− at sin(ωt) ω
( s + a )2 + ω 2
e−at cos(ωt) s+ a
( s + a )2 + ω 2
With this definition, you can find the following state space represen-
tation (I encourage you to try this at home!)
Example: Apply the Laplace transform, then isolate for Z (s). Write
your answer in matrix form and also in non-matrix form.
In the solution above, identify the free and the forced part for each
state equation. For the free part, what does the initial condition rep-
resent? How does this fit with concepts of energy storage, memory,
and dynamic systems?
laplace transform 133
Example: Finally, substitute into the general form (the one using
( A, B, C, D )) using your answer above to solve for X (s). Identify the
free and forced part. Can you find the transfer function here? Finish
the problem by substituting in for the actual values of the matrices
and confirm that your answer matches the solution we got when we
took the transform of the differential equation (in item 1.)
Next day, we’ll look at how we can use this new form of the differ-
ential equation to solve for many different forcing functions.
134 engg*2400 engineering systems analysis
5.1.3 Assignment:
1. From the text, do 7.3 (p236)
2. From the text, consider the differential equations given in 7.7, 7.8, and 7.11 (starts on p 237). Note: For
7.7 and 7.8, the input is i and the output is e. For each differential equation,
a) Apply the Laplace transform to the differential equations
b) Find the Forced and Free part of the responses
c) Find the Transfer function
d) Find the poles
e) Zeros are defined to be the roots of the numerator of the transfer function. Find the zeros. Note that
a zero at 0 is NOT the same as having no zeros at all.
laplace transform 135
By the end of this section, you will be able to: Secondary Text: F.7
1 1 8s + 2
X (s) = · + 2
2s2
+ s + 10 s 2s + s + 10
8s2 + 2s + 1
=
s(2s2 + s + 10)
What we’d like to do now is figure out how to use this to find x (t).
We’d like to do so by using the table of common transforms that
we had last day, but this structure doesn’t match any of those, so
we need to make it so that it does. This is where the idea of Partial
Fraction Expansion (PFE) comes in. PFE uses the idea of a common
denominator in reverse. Essentially, if you can take a sum of terms
with different denominators and use cross-multiplication and a com-
mon denominator to add them all up, then you can take a single
term with a complicated denominator and break it up into a sum of
smaller bits.
3s − 10 3s − 10 A B
F (s) = = = +
s2 + 3s + 2 (s + 1)(s + 2) s+1 s+2
136 engg*2400 engineering systems analysis
Great. Now that we have A and B, can you use the RHS of the origi-
nal equation to find f (t)? Hint: use the tables from last day...
See if you can get the same result using Laplace transform and PFE.
Hint: Start by writing the differential equation in Laplace domain,
then solve for Y (s), the substitute in for your initial condition and
your input. THEN apply PFE and match your terms to the tables. Notice that the tables all have the
leading coefficient in the denominator
as a 1.... for this reason, you’ll make
fewer mistakes when doing PFE and
inverse Laplace if you rearrange your
denominator so that the highest order
coefficient is a one!
laplace transform 137
Is there a faster way to get these coefficients? Yes! It’s called Heav-
iside coverup and it works in almost all cases.
Example: We want to find the step response for the following second
order, overdamped system:
3s − 10
Y (s) = X ( s ).
(s + 1)(s + 2)
Our first step is to substitute in X (s) = 1/s, then we need to use PFE:
3s − 10
Y (s) =
s(s + 1)(s + 2)
A B C
= + + .
s+1 s+2 s
3s − 10
A = Y (s) × (s + 1)|s+1=0 = ×
(s
+ )|s=−1
1
(s
s + ) ( s + 2)
1
So, when can we use this? Any time the roots are real and not
repeated. What happens when they are repeated?
3s − 10
Y (s) =
s ( s + 1)2
8s2 + 2s + 1
X (s) = .
s(2s2 + s + 10)
If you check the denominator, you’ll notice that the roots are com-
plex.4 How do we handle this? For now, let’s just factor it out as its 4
This system is underdamped! What do
own term, then see what we can figure out. you expect the response to look like?
8s2 + 2s + 1
X (s) =
s(2s2 + s + 10)
4s2 + 1s + 0.5
=
s(s2 + 0.5s + 5)
A Bs + C
= + 2
s s + 0.5s + 5
A Bs + C
= +
s ( s + a )2 + ω 2
A αω β(s + a)
= + + .
s ( s + a )2 + ω 2 ( s + a )2 + ω 2
5.2.1 Assignment:
1. (Drill) From the text, do 7.17, 7.18 (starts pg 237)
2. There is one special case that we didn’t discuss in class: what to do if the order of the numerator is the
same as the denominator. Here, we need a ‘static’ term with no denominator, then we do the rest of
PFE as per usual. To find the static term, just take the highest order coefficient in the numerator and
divide by the highest order coefficient in the denominator, then just do PFE as usual (using coverup if
appropriate). In the following, find the static term A and the other coefficient B, then find f (t). Do so
using two methods: coverup and long division.
3s − 2 B
F (s) = = A+
s + 10 s + 10
3. Let’s go back to system given in the text in problem 12.5 (p 413) on more time. Like before, let the out-
put be the flow wo . In prior assignments you already found the differential equation and the states-
space models of this system. Based on those answers, find the Transfer function, the poles, and the free
response (express your answer in terms of the initial conditions on wo ).
4. You have analysed a hydraulic system and found the following differential equation
Consider the case where the input of interest is wi (t) = 6e−3t u(t) and the initial conditions on the
output are given by wo (0− ) = 9. Using Laplace methods, find the forced, the free, and the complete
responses. Identify the transient and steady state portion of each.
5. From the text, problem 7.7 (pg 241), find the forced and the free responses for the case where the initial
conditions are zero and i (t) = 1, ∀t. Compare this to the answer you got when you found the step
response in way back in section 2.8.5 – they should be different! Why?
6. (Warning, challenging!) From the text, consider the step response given in 8.36. Find the transfer func-
tion of this system
140 engg*2400 engineering systems analysis
Let’s assume that we start with all tanks at steady state and the
voltage of pump 2 set to 6V and pump 1 set to 0V. We then change
pump 2 to 10V and plot the voltage and height on the same graph.
To figure this out, we need to ask ourselves a series of questions: Hint: if we could apply 2400 rules
to this system, what order would we
1. Does this response look (more or less) first order or second order? expect it to be? Maybe that’s a good
place to start?
2. What are the key parameters for that system order?
2
1.8
1.6
1.4
1.2
1
0.8
Input
0.6
0.4
0.2
Amplitude
0
-0.2
Output
-0.4
-0.6
-0.8
-1
-1.2
-1.4
-1.6
-1.8
-2
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.51010.51111.51212.51313.51414.515
Time (seconds)
5.3.1 Assignment:
None! Although you might want to think about how you’d solve these problems if you were given a free
response or an impulse response...
laplace transform 143
• In your own words, explain the idea of stability using the free
response
• In your own words, explain why the pole locations determine the
stability of the system
Example: Find the transfer function for, and determine the stability
of, the system with differential equation
ÿ + 4ẏ + 3y = 2ẋ + x
2s + 1
H (s) = .
s ( s + 1)
2s + 1
H (s) = .
(s − 1)(s + 1)
laplace transform 145
Okay, so we’ve seen some interesting stuff with real poles, what
about complex ones?
2
H (s) = .
s2 + 2s + 2
2
H (s) = .
s2 − 2s + 2
2
H (s) = .
s2 + 2
For all of the above cases, go back and draw the location of the
poles in the complex plane. What can you hypothesize about the
relationship between stability and the pole locations?
iL
1
IL (s) = Iin (s)
16s2 +1
laplace transform 147
Now that we’ve got the math out of the way, based on the
definition of stability and on this neat input/output result, what are
some examples of real systems that are unstable?
In your own words, explain why you think that stability is impor-
tant to a systems engineer:
Looking at the Laplace transform solutions for the output, can you This is why we care so much about
the system poles, plus it is an extremely
see why this is happening?
powerful sanity check for your solu-
tions!!
148 engg*2400 engineering systems analysis
5.4.3 Assignment:
1. Consider the second order thermal system given in problem 11.9 from the text (p393). Assume that the
ambient temperature θ a is NOT constant and therefore acts as an input, NOT as the reference.
a) Find a state space representation of the system.
b) Find the transfer function of the system.
c) Find the poles of the transfer function and the eigenvalues of the A matrix from your state space
representation. Are they the same or different?
d) Assess the stability of the system. Can you use the state space representation? The Transfer func-
tion? Both? Justify your answer.
2. Are the following systems stable or unstable? If the system is unstable, find a bounded input that yields
an unbounded output. Check your answer by finding the free response and determining whether or
not it reaches a zero at steady state. Hint: You’ll need to convert the transfer function back into the
differential equation, then determine the free response from that...
a)
s+5
H (s) =
(s + 2)(2s + 6)
b)
s−5
H (s) =
(s + 2)(2s + 6)
c)
s+5
H (s) =
(s − 2)(2s + 6)
d)
s−5
H (s) =
( s2 + 5s + 25)
e)
s+5
H (s) =
( s2 − 5s + 25)
Hint: You don’t need to complete the square and do this the ‘long hard’ way... remember that mul-
tiplying by s is the same as taking a derivative... if you know what the free response is for a second
order system, then you can find the free response of s× that system by taking a derivative of the free
response that you already have!
f)
1
H (s) =
s2 + 16
g)
1
H (s) =
s2 − 16
h)
5
H (s) =
s(s + 10)
i)
5s
H (s) =
(s + 10)
laplace transform 149
By the end of this section, you will be able to: Secondary Text:
• Apply the Final Value Theorem (FVT) to determine the final values
of time functions
• In your own words, explain the idea of static gain for any stable
system
• Use the FVT to find the static gain of any stable system
So, if we have F (s) and we have some way of knowing that the
steady state of f (t) is well defined, but we don’t know what f (t)
actually is, then we can use FVT to find it.
Example: Find the steady state of the function f (t) whose Laplace
transform is given by
( s + 2)
F (s) =
(s + 1)(s + 5)
Let’s look at a few more examples to see what we can figure out:
( s + 2)
F (s) =
(s − 1)(s + 5)
( s − 1)
F (s) =
(s − 1)(s + 5)
( s + 2)
F (s) =
( s2 + 1)
( s + 2)
F (s) =
( s2 + 2s + 2)
152 engg*2400 engineering systems analysis
Static gain: The static gain of a system is the ratio of the output to
the input once the system has reached a constant steady state.
There are a few key things here, so let’s unpack this definition.
First, the input and output must be constant at steady state (which
is what FVT relates too... cool!). Second, we’re looking for a ratio, so
taking an input of size 1 should be equivalent to taking an input of
size x̂. How does this relate to the differential equation? Consider the
simple first order system:
τ ẏ + y = kx
If the input and output are constant, then what is the derivative of
that output? And therefore what’s the static gain?
Putting this into the FVT, we get How do we know the FVT can be used
here?
laplace transform 153
The simplest possible input that has a constant steady state is just
x (t) = x̂u(t), so let’s see what happens when we put that into the Did I need to use x̂, or could I just have
used 1 instead?
FVT:
What does this tell us about the static gain? Given what we already mentioned
about the static gain being related to
when all derivatives are zero, does
it make sense to look at the transfer
function and set all of the s terms to
zero?
Let’s try this on a few systems where we already know the static
gain:
k
H (s) =
τs + 1
kωn2
H (s) =
s2 + 2ζωn s + ωn2
5.5.2 Assignment:
1. From the text, do 8.5 (p288) - focus on part d. Similarly, do 8.19, focusing on c.
2. Determine the final value of output y for the given transfer functions H (s) and input(s) X (s) by using
the FVT. If the FVT does not apply, state why. In all cases, check your answer by using Laplace tech-
niques to determine the response y(t) of the system to the given input.
a)
s 3 5
H (s) = , i ) X (s) = , ii ) X (s) =
s2 + 2s + 1 s s2
b)
s−3 1
H (s) = , X (s) =
s2 + 3s + 2 s
c)
s3 − 8s + 4 1 1 5
H (s) = , i ) X (s) = , ii ) X (s) = + 2
s4 + 19s3 + 191s2 + 1189s + 2920 s s s
d)
s+1 1
H (s) = , X (s) =
s2 − 9s − 10 s
e)
1
H (s) = , X (s) = 1
s2 +9
3. From the text pg. 451, do 13.14b, 13.16d (recall that you already solved a in chapter 3!)
4. Can you use the FVT to find the steady state response if the input is a sinusoid? Why/why not? If not,
what can you use instead?