Uploaded by devangtavkari001

Application of Math Principles to Engineering Systems - Problems and Solutions 6-20-21 (3)

advertisement
Application of Math Principles
To Engineering Systems
Problems and Solutions
By
Professor David A. Hullender
June 20, 2021
1
Table of Contents
Topic
Example Problems
Solutions to Example Problems
Previous Quiz Problems and some solutions
Previous Homework and some solutions
Previous Exams and some solutions
page number
3
31
88
114
302
2
Example Problems
4.1
A mass sits at equilibrium on top of a spring and damper as shown below.
Mass
Spring
x
Damper
It can be shown that the differential equation for the position of the mass ๐‘ฅ is given by
๐‘‘2๐‘ฅ
๐‘‘๐‘ฅ
10 2 + 60
+ 80๐‘ฅ = 160
๐‘‘๐‘ก
๐‘‘๐‘ก
(a) What is the dependent variable in the differential equation?_________
(b) What is the independent variable in the differential equation?__________
(c) What is the order of the differential equation?________
(d) Is the differential equation linear or nonlinear? ________
(e) What is the equilibrium value of x? ______
(f) If the mass is disturbed, it will eventually return to the equilibrium position. Why?
4.2
Consider the following differential equation for a suspension system:
๐‘ฆฬˆ + 6.5๐‘ฆฬ‡ + 9,800๐‘ฆ 3 = 9.8
1. What is the order of the differential equation? ____________
2. Assuming ๐‘ฆ(๐‘ก) → ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก as ๐‘ก → ∞, what will be the value of this constant?_____________
3. Assuming that the initial conditions for this differential equation are ๐‘ฆฬ‡ (0− ) = 0 ๐‘Ž๐‘›๐‘‘ ๐‘ฆ(0− ) = 0,
draw a sketch of ๐‘ฆ(๐‘ก) v. t starting at ๐‘ก = 0 showing the initial and final values and an estimate of
y(t) between these values.
4. Obtain a linear approximation for this differential equation by obtaining a straight line
approximation for ๐‘ฆ 3 using the two point method with the two points 0.1 and 0. Be sure to
start by sketching ๐‘ฆ 3 and noting the two points for your straight line.
5. After substituting your straight line into the original differential equation, check to see if the
new linearized differential equation gives the correct final value.
3
4.3
Consider the following spring-mass-damper system with input u(t).
z
M
k
b
k
b
u
The input (independent variable) to this system is the displacement u. The equations for this
suspension system are
10๐‘งฬˆ + ๐‘“1 + ๐‘“2 = 0
๐‘“1 = 100(๐‘ง − ๐‘ฃ)
๐‘“2 = 5(๐‘งฬ‡ − ๐‘ฃฬ‡ )
๐‘“3 = 100(๐‘ฃ − ๐‘ข)
๐‘“4 = 5(๐‘ฃฬ‡ − ๐‘ขฬ‡ )
๐‘“1 + ๐‘“2 − ๐‘“3 − ๐‘“4 = 0
(a) List the unknowns (dependent variables) and confirm that the number of equations matches
the number of unknowns.
(b) Use the "D" operator to convert the differential equations to algebraic equations.
(c) Eliminate ๐‘“1 , then eliminate ๐‘“2 , then eliminate ๐‘“3 , and then eliminate ๐‘“4 . How many
equations with which unknowns do you have left?
4.4
Laplace transform the following differential equation and solve for the Laplace transform Z(s).
2๐‘งฬˆ + 12๐‘งฬ‡ + 36๐‘ง = 24
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 4
Note, the answer should be in the format of a numerator polynomial over a denominator polynomial.
Your answer is not complete until it is in this format.
(a) The final value theorem is
๐‘ง(๐‘ก)๐‘ก→∞ = ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘(๐‘ )๐‘ →0
Apply the final value theorem to your Z(s) and see if it gives the correct final value.
(b) The initial value theorem is ๐‘ง(0+ ) = ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘(๐‘ )๐‘ →∞
Apply the initial value theorem and see if it gives ๐‘ง(0− ); note, ๐‘ง(0+ ) should equal ๐‘ง(0− ) if there
is no impulse input to create an instantaneous change in z at t = 0.
4
4.5
(a) Solve the following differential equation x(t) using separation of variables if x(0-) =4.
2๐‘ฅฬ‡ + 6๐‘ฅ = 0
(b) Confirm that your solution is correct by substituting the solution into the original differential
equation.
4.6
1. The Laplace transform of z(t) is as follows:
6๐‘  2 + 12๐‘  + 5
๐‘(๐‘ ) =
๐‘ (๐‘  + 4)[(๐‘  + 2)2 + 82 ]
Show that the inverse Laplace of Z(s) will be of the following format:
๐‘ง(๐‘ก) = ๐‘Ž๐‘’ ๐‘๐‘ก + ๐‘๐‘’ ๐‘‘๐‘ก + ๐‘“๐‘’ ๐‘”๐‘ก sin (๐œ”๐‘ก + ๐œ‘)
๐‘Ž =?
๐‘ =?
๐‘ =?
๐‘‘ =?
๐‘” =?
๐œ” =?
2. The equation for Y(s) is written below in terms of the input U(s).
6๐‘  2 + 3๐‘  + 84
๐‘Œ(๐‘ ) = [
] ๐‘ˆ(๐‘ )
(๐‘  + 3)[(๐‘  + 5)2 + 92 ]
(a)
(b)
(c)
(d)
What is the transfer function?
What are the eigenvalues?
What are the time constants?
If u(t) is a unit impulse, what is U(s) and what is Y(s)?
4.7
Laplace transform the differential equation below and then solve for Z(s).
3๐‘งฬˆ + 6๐‘งฬ‡ + 12๐‘ง = 18
๐‘ง(0− ) = 2
๐‘งฬ‡ (0− ) = 4
5
4.8
Consider the following Laplace transform:
15๐‘  3 + 2๐‘  2 + 640
๐‘ (5๐‘  4 + 162๐‘  3 + 1424๐‘  2 + 3744๐‘  + 1280)
What will be the final value of z(t) found using the final value theorem?
What is the initial value of z(t) as determined from the initial value theorem?
What are the MATLAB commands for generating a plot of z(t) using the ‘impulse’ command.
๐‘(๐‘ ) =
4.9
Consider the two simultaneous equations below for a mechanical lift system with step input u(t)
with magnitude of 5.
10๐‘ฆฬˆ + 6๐‘ฆฬ‡ + 3๐‘ฆ = 2๐‘ฃ
๐‘ฆ(0− ) = 0 ๐‘ฆฬ‡ (0− ) = 5
2๐‘ฃฬ‡ + +10๐‘ฃ − 4๐‘ฆ = 2๐‘ข
๐‘ฃ(0− ) = 4
Convert these equations to the Laplace domain by Laplace transforming the equations.
4.10
For the differential equation below, use Euler’s numerical integration to compute the first two solution
values of x(t) using a time step of 0.01.
๐‘ฅฬ‡ + 10๐‘ฅ = 20
๐‘ฅ(0− ) = 1
4.11
The differential equations for the suspension shown below with input displacement u(t) are
10๐‘งฬˆ + 100๐‘งฬ‡ + 1000๐‘ง = 100๐‘คฬ‡ + 1000๐‘ค
100๐‘คฬ‡ + 4000๐‘ค = 100๐‘งฬ‡ + 1000๐‘ง + 3000๐‘ข
(a) Assume all initial conditions are zero and convert the equations above to Laplace domain.
Z
W
U
(b) Demonstrate that if you solve for W(s) in the first equation and then substitute this
expression for W(s) into the 2nd equation, when you solve for Z(s) you get
3000 + 300๐‘ 
๐‘(๐‘ ) = [ 3
] ๐‘ˆ(๐‘ )
๐‘  + 40๐‘  2 + 300๐‘  + 3000
6
4.12
Express the following differential equation with input u in state variable format. What are the initial
conditions for the state variables?
๐‘ฃฬˆ + 5๐‘ฃฬ‡ + 10๐‘ฃ = 20๐‘ขฬ‡ + 40๐‘ข
๐‘ฃ(0− ) = 3
๐‘ฃฬ‡ (0− ) = 0.5
๐‘ข(0− ) = 0
4.13 A dynamic system is represented by the differential equation shown below.
๐‘งฬˆ + 7๐‘งฬ‡ + 10๐‘ง = 14๐‘ขฬ‡ + 20๐‘ข
(a) What is the transfer function of this system?
(b) What are the eigenvalues of this system?
(c) What are the time constants for this system?
(d) Suppose the input u(t) is a unit step. What will be the final value of z(t)?
(e) How long will it take for z(t) to be within 1% of this final value?
4.14 (a) Perform the following matrix operations:
1 2 3
๐‘Ž = [4 5 6]
๐‘Ž๐‘‡ =
7 8 9
1 2 3
1
(2) ๐‘Ž = [4 5 6]
๐‘ = [ 1]
7 8 9
1
๐‘ฅ1
(3) [−2 4 −1] [๐‘ฅ2 ] =
๐‘ฅ3
1 2 ๐‘ข
1
(4) [3 4] [๐‘ข ] =
2
5 6
(1)
๐‘Ž๐‘ =
1
(5) [2] [4 5 6] =
3
1
1
(6) [2] .∗ [2]
3
3
(b) Express the differential equation below in matrix state variable format, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘งโƒ› + 2๐‘งฬˆ + 3๐‘งฬ‡ + 8๐‘ง = 10๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
๐‘ฆ = 0.1๐‘งฬˆ
7
4.15
Solve the following differential equation using separation of variables.
20๐‘งฬ‡ + 60๐‘ง = 80
๐‘ง(0− ) = 2
4.16
The differential equation for the suspension system shown below is
๐‘งฬˆ + 0.8๐‘งฬ‡ + ๐‘ง = 0.8๐‘ขฬ‡ + ๐‘ข
z
u
(a) Express this differential equation in state variable format assuming y = u -z is the output of
interest.
(b) Enter your state variable equations in MATLAB using the ‘ss’ command.
(c) Use the ‘eig’ command to get the eigenvalues? Are these the correct values?
(d) Use the command ‘step’ to get a plot of y(t) for u(t) a step with magnitude 0.1. Does the plot
start and end at the correct initial and final values?
4.17
Obtain a straight line approximation for x3 in the neighborhood of x = 2.
4.18
Two simultaneous differential equations are shown below.
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −100๐‘ฅ1 − 2๐‘ฅ2
What are the two unknowns? _______________________
Using the ‘D’ operator, eliminate ๐‘ฅ2 and find a single differential equation for ๐‘ฅ1 .
8
4.19
(a) Express the differential equation shown below in state variable format using matrices, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =?
The output of interest is ๐‘ฆ = ๐‘ง.
4๐‘งฬˆ + 24๐‘งฬ‡ + 40๐‘ง = 24๐‘ขฬ‡ + 40๐‘ข
๐‘ง(0− ) = 3
๐‘งฬ‡ (0− ) = 2 ๐‘ข(๐‘ก) = ๐‘ข๐‘›๐‘–๐‘ก ๐‘ ๐‘ก๐‘’๐‘
(b) What are the initial conditions for the state variables, i.e. ๐‘ฅ1 (0− ) =?, ๐‘ฅ2 (0− ) =?, ๐‘’๐‘ก๐‘.
(c) For an ode45 numerical simulation, what would you specify for the final time (when to stop
the simulation)?
4.20
1. For each differential equation below, answer the following questions:
(a) ๐‘ฃฬˆ + 16๐‘ฃฬ‡ + 12๐‘ฃ = 5
Is the equation linear?________ What is the order? _______ What is the dependent
variable?_______
What is the input to the differential equation?_____ What is the final value of the dependent
variable?________
(b) 2๐‘ฆโƒ› + 0.4๐‘ฆฬˆ + 0.1(๐‘ฆฬ‡ )5 + 10๐‘ฆ = 24
Is the equation linear?________ What is the order? _______ What is the dependent
variable?_______
What is the input to the differential equation?_____ What is the final value of the dependent
variable?________
2. Before the valve on the water tank shown below is opened, the height H of the water in the
tank is 10 m. Once the valve is opened, water flows out of the tank. The differential equation
for H with water flowing out is as follows
4๐ปฬ‡ + 0.8√๐ป = 0
(a) On the sketch below, draw a reasonable estimate of H as a function of time.
H
H
valve
flow
0
time
Use separation of variables to solve this differential equation for H(t).
Does your equation for H(t) give the correct initial and final values for H?
Equation for H(t) _______________________________
Initial value of H from the equation __________
Final value of H from the equation ___________
9
3. A pendulum is attached to a cart as shown below. The system is shown in equilibrium, that
is, nothing is moving.
cart
spring
pendulum
If the cart is rolled to the right or left and released or if the pendulum is raised to the right or left
and then released, the cart will start rolling back and forth compressing and extending the spring
while the pendulum swings back and forth.
z
๏ฑ
It can be shown, for small angles, the following two simultaneous equations with unknowns
๐‘ง ๐‘Ž๐‘›๐‘‘ ๐œƒ accurately model the dynamics of this system
๐œƒฬˆ + 3๐œƒฬ‡ + 9๐œƒ = −0.9๐‘งฬˆ ๐œƒ(0− ) = ๐œƒ๐‘œ ๐œƒฬ‡(0− ) = 0
7๐‘งฬˆ + 175๐‘ง = −2๐œƒฬˆ
๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 0
Using the Laplace transform, convert these equations to algebraic equations, eliminate ๐œƒ, and
finally end up with an equation for ๐‘(๐‘ ).
4.21
1.
Obtain a linear approximation to the following differential equation using the initial and final
values of z.
๐‘งฬˆ + 3๐‘งฬ‡ + 6√๐‘ง = 12
๐‘ง(0− ) = 1
2. Consider the following Laplace transform for Z(s):
๐‘(๐‘ ) =
6๐‘  2 + 20๐‘  + 80
๐‘ [๐‘  2 + 12๐‘  + 40]
(a) Use the final value theorem (FVT) to compute the final value of z(t).
(b) Use the initial value theorem (IVT) to compute the value of z(t) at t = 0+.
(c) What are the poles of Z(s) which are the roots of the denominator polynomial?
10
3. The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 − ๐ป2 = 250๐‘„ฬ‡
H1
๐ป1 (0− ) = 3
๐ป2 (0− ) = 5
๐‘„(0− ) = 0
H2
Q
(a)
(b)
(c)
(d)
Laplace transform each of these three equations.
Reduce the equations down to two equations with unknowns H1(s) and H2(s) .
Reduce the equations down to one equation for the unknown H1(s).
Use the final value theorem to determine the final value of H1. Does this value make
sense?
(e) Use the initial value theorem to check the initial value. Is it correct?
4.22
1. The differential equations for the suspension shown below with input displacement u(t) are
๐‘งฬˆ + 10๐‘งฬ‡ + 100๐‘ง = 10๐‘คฬ‡ + 100๐‘ค
๐‘คฬ‡ + 40๐‘ค = ๐‘งฬ‡ + 10๐‘ง + 30๐‘ข
(a) Assume all initial conditions are zero and convert the equations above to Laplace domain.
Z
W
U
(b) Demonstrate that if you solve for W(s) in the first equation and then substitute this
expression for W(s) into the 2nd equation, when you solve for Z(s) you get
3000 + 300๐‘ 
๐‘(๐‘ ) = [ 3
] ๐‘ˆ(๐‘ )
๐‘  + 40๐‘  2 + 300๐‘  + 3000
(c) What is the transfer function for this system?
11
(d) Consider the following MATLAB command and results:
>> roots([1 40 300 3000])
ans =
-33.7442
-3.1279 + 8.8950i
-3.1279 - 8.8950i
What are the eigenvalues of this system?
(e) What are the time constants of this system?
(f) If the input u(t) is a unit step, the general form of the equation for z(t) can be shown to be
๐‘ง(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘๐‘’ −๐‘‘๐‘ก + ๐‘“๐‘’ −๐‘”๐‘ก sin (โ„Ž๐‘ก + ∅)
What are a = ? b = ? c = ? d = ? f = ? g = ? h = ? ∅ =?
(g) For a unit step input, what is the final value of z(t) and how long will it take to get within 1%
of this value?
2. Use the residue theorem to solve the following differential equation for y(t).
22๐‘ฆฬ‡ + 44๐‘ฆ = 88
๐‘ฆ(0− ) = 5
4.23
1. Find the magnitude and angle of the following complex numbers:
(a) 4 + j4
(b) -4 + j4
(c) -4 – j4
(d) 4 - j4
(e)
(4+๐‘—4)(−4+๐‘—4)
4−๐‘—4
2.
For the differential equation below,
2๐‘งฬˆ + 24๐‘งฬ‡ + 40๐‘ง = 20๐‘ข
๐‘ง(0− ) = 0.5
๐‘งฬ‡ (0− ) = 3
๐‘ข(๐‘ก) = 5
(a) Solve for the Laplace transform of z(t), Z(s).
(b) Check your Z(s) to see if it gives the correct initial value using the initial value theorem.
(c) Check your Z(s) to see if it gives the correct final value using the final value theorem.
3. (a) Find the inverse Laplace transform of Y(s) below.
32
๐‘Œ(๐‘ ) =
๐‘ [(๐‘  + 4)2 + 42 ]
(b) Plug t = 0 into your equation for y(t) and see if it gives the same value as the IVT.
Plug t=∞ into your equation for y(t) and see if it gives the same value as the FVT.
12
4.24
1. Consider the following differential equation for y(t).
2๐‘ฆฬ‡ + 5๐‘ฆ = 25 ๐‘ฆ(0− ) = 6
(a) Use the Laplace transform and the residue theorem to solve this differential equation for y(t)
(b) Check your equation for y(t) at t = 0 and at t = ∞. Does your equation give the correct
values at t = 0 and at t = ∞?
(c) Perform two steps of Euler's integration to get y(T) and y(2T). Use 1/10 of the time
constant for T.
2. Consider the hydraulic lift system shown below. Fluid flows, Q, into the bottom of the
hydraulic cylinder. The pressure, P, increases and pushes the mass upwards with velocity ๐‘ฃ.
The model for the system is represented by the following equations :
1000๐‘ฃฬ‡ + 0.05๐‘ƒ = 9800
๐‘ƒ = 100000๐‘„
๐‘„ = 0.05๐‘ฃ
Velocity
v
Pressure
P
Flow Rate
Q
(a) We have three equations. What are the three unknowns?
(b) Assuming the initial velocity is zero, Laplace transform the equations and then find a single
equation for the Laplace transform of the pressure P(s).
(c) What is the final value for P(t) and how long does it take for P(t) to reach this final value
within 1 %?
3. Express the following 3rd order differential equation in a format of three simultaneous 1st
order differential equations; that is, state variable format. All initial conditions are zero.
2๐‘งโƒ› + 16๐‘งฬˆ + 8๐‘งฬ‡ + 5๐‘ง = 10
13
4. Consider the Laplace transform W(s) shown below. Pretend that W(s) is a transfer function
with the input being a unit impulse. What are the MATLAB commands for getting a plot of w(t)
using the 'impulse' command in MATLAB?
2๐‘  + 4
๐‘Š(๐‘ ) = 2
3๐‘  + 20๐‘  + 5
4.25
1. Use Laplace transform to solve the following differential equations for z(t):
(a) ๐‘งฬ‡ + 25๐‘ง = 2๐‘ขฬ‡ + 15๐‘ข ๐‘ง(0− ) = 4
The input u(t) is a step with magnitude 5.
(b) ๐‘งฬˆ + 6๐‘งฬ‡ + 25๐‘ง = 50๐‘ข(๐‘ก) ๐‘ง(0− ) = 1 ๐‘งฬ‡ (0− ) = 0 The input u(t) is a unit impulse.
(c) What are MATLAB commands to get a plot of z(t) in part (a) using the ‘impulse’ command.
2. A vehicle suspension system is defined by the following differential equations with input u(t):
100๐‘คฬˆ + 600๐‘คฬ‡ + 2500๐‘ค = 600๐‘ฃฬ‡ + 2500๐‘ฃ
200๐‘ฃฬˆ + 900๐‘ฃฬ‡ + 5000๐‘ฃ = 600๐‘คฬ‡ + 2500๐‘ค + 300๐‘ขฬ‡ + 2500๐‘ข
(a) Define state variables and then find the equations for the derivatives of the state variables.
(b) Express your state variable derivative equations from (a) in state variable matrix format
assuming the output of interest is y = u - v, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =?
3. Consider the following non-linear differential equation for v(t):
๐‘ฃฬˆ + 84๐‘ฃฬ‡ + 300๐‘ฃ 3 = 2400
๐‘ฃ(0− ) = 1.9 ๐‘ฃฬ‡ (0− ) = 2
(a) What is the equilibrium (final value) of v(t)?
(b) Find a straight line approximation for ๐‘ฃ 3 for values of ๐‘ฃ in the neighborhood of the
equilibrium value.
(c) Substitute you straight line equation for ๐‘ฃ 3 in the original differential equation to obtain a
linear differential equation.
(d) The equilibrium value of your linear differential equation should be the same as the
equilibrium value for the original differential equation. Is this the case?
(e) What are the eigenvalues of your linearized differential equation? Time constants?
4.26
1. Use Laplace transform to solve the following differential equations for z(t):
(a) 2๐‘งฬ‡ + 10๐‘ง = 4๐‘ขฬ‡ + 20๐‘ข ๐‘ง(0− ) = 3
The input u(t) is a step with magnitude 2.
(b) (15%) 10๐‘งฬˆ + 60๐‘งฬ‡ + 250๐‘ง = 24๐‘ข(๐‘ก) ๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 0 The input u(t) is a unit
impulse.
2. A vehicle suspension system is defined by the following differential equations with input u(t):
14
100๐‘คฬˆ + 600๐‘คฬ‡ + 2500๐‘ค = 600๐‘ฃฬ‡ + 2500๐‘ฃ
200๐‘ฃฬˆ + 900๐‘ฃฬ‡ + 5000๐‘ฃ = 600๐‘คฬ‡ + 2500๐‘ค + 300๐‘ขฬ‡ + 2500๐‘ข
(a) Express this system of equations in state variable format.
(b) Express your state variable equations from (a) in state variable matrix format assuming the
output of interest is y = v - w, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข ๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =?
3. Consider the following non-linear differential equation for v(t):
๐‘ฃฬˆ + 2.4๐‘ฃฬ‡ + 3๐‘ฃ 3 = 3000
๐‘ฃ(0− ) = 10.01 ๐‘ฃฬ‡ (0− ) = 2
(a) What is the equilibrium (final value) of v(t)?
(b) Find a straight line approximation for ๐‘ฃ 3 for values of ๐‘ฃ in the neighborhood of the
equilibrium value.
(c) Substitute you straight line equation for ๐‘ฃ 3 in the original differential equation to obtain a
linear differential equation.
(d) The equilibrium value of your linear differential equation should be the same as the
equilibrium value for the original differential equation. Is this the case?
(e) What are the eigenvalues of your linearized differential equation? Time constants?
4.27
After Laplace transforming a differential equation for y(t) with input u(t), the following result
was achieved:
๐‘ 2 +11๐‘ +30
๐‘Œ(๐‘ ) = [(๐‘ +2)[(๐‘ +3)2+42 ]] ๐‘ˆ(๐‘ )
(a)
(b)
(c)
(d)
(e)
What is the transfer function for this system? ____________________________
What are the eigenvalues of this system?_________________________________
What are the time constants for this system? _____________________________
What is the damping ratio of this system? _______________________
What is the damped natural frequency of this system? ____________
(f) What is the undamped natural frequency of this system? _____________
(g)Suppose u(t) is a unit step input. It can be shown that y(t) will be of the form
๐‘ฆ(๐‘ก) = ๐ถ1 ๐‘’ −๐‘Ÿ1๐‘ก + ๐ถ2 ๐‘’ −๐‘Ÿ2๐‘ก + ๐ถ3 ๐‘’ −๐‘Ÿ3๐‘ก ๐‘ ๐‘–๐‘›( ๐œ”๐‘ก + ๐œ‘)
What are the following:
๐‘Ÿ1 =? C1 = ?
๐‘Ÿ2 =? C2 = ?
๐‘Ÿ3 =? C3 = ?
๐œ” =? ๐œ‘ = ?
(h)What will be the final value of y(t), i.e. y(∞)?
4.28 For the differential equation given below, obtain a straight line approximation for ๐‘ฅ 3 and
use it to obtain an approximation for the eigenvalues.
2๐‘ฅฬˆ + 8๐‘ฅฬ‡ + 20๐‘ฅ 3 = 160
๐‘ฅ(0− ) = 1 ๐‘ฅฬ‡ (0− ) = 0
15
4.29 (a) What are the eigenvalues of the suspension system shown below? What is the damping
ratio? What is the undamped natural frequency?
z
M=10
K=90
y
10๐‘งฬˆ + 90๐‘ง = 90๐‘ฆ
(b) It is desired to add a shock absorber (or viscous damper) as shown below so as to improve
the ride quality of the suspension for bumps in the road. Derive a value for the damping
coefficient b that will give an eigenvalue damping ratio of 0.707.
10๐‘งฬˆ + ๐‘๐‘งฬ‡ + 90๐‘ง = ๐‘๐‘ฆฬ‡ + 90๐‘ฆ
M=10
K=90
b=?
Bump
4.30
A system is expressed in the following transfer function format:
2(๐‘  + 2)(๐‘  + 8)
]๐‘ˆ(๐‘ )
(๐‘  + 10)(๐‘  + 20)(๐‘  2 + 10๐‘  + 925)(๐‘  2 + 24๐‘  + 2644)
๐‘(๐‘ ) = [
(a) What are the eigenvalues of this system? Note, check you work since the rest of this
problem depends on you getting this part correct!
(b) Is this system stable? Explain how you know?
(c) What are the time constants of this system?
16
(d) What are the damping ratios, damped natural frequencies, and undamped natural
frequencies of this system?
(e) We know that if the input u(t) is a step input at time t=0, then z(t) will be of the following
form:
๐‘ง(๐‘ก) = ๐ถ1 ๐‘’ −๐‘Ÿ1๐‘ก + ๐ถ2 ๐‘’ −๐‘Ÿ2๐‘ก + ๐ถ3 ๐‘’ −๐‘Ÿ3๐‘ก + ๐ถ4 ๐‘’ −๐‘Ÿ4๐‘ก ๐‘ ๐‘–๐‘›( ๐œ”1 ๐‘ก + ๐œ‘1 ) + ๐ถ5 ๐‘’ −๐‘Ÿ5๐‘ก ๐‘ ๐‘–๐‘›( ๐œ”2 ๐‘ก + ๐œ‘2 )
What are each of the following:
๐‘Ÿ1 =? ___๐‘Ÿ2 =? ___๐‘Ÿ3 =? ___๐‘Ÿ4 =? ___๐‘Ÿ5 =? ___๐œ”1 =? ___๐œ”2 =?
4.31 The equations for a water tank are as follows:
๐‘„๐‘– − ๐‘„๐‘œ − 5๐ปฬ‡ = 0
๐‘„๐‘œ = 10√๐ป
Assume ๐‘„๐‘– = 0 and ๐ป(0− ) = 4.
Estimate how long it will take for the tank to drain by obtaining a straight line approximation for
√๐ป and then getting an estimate for the time constant of the draining tank.
Qi
H
Qo
4.32
Express the following differential equation in state variable matrix form; the output of interest
is y=z-u.
๐‘งฬˆ + 8๐‘งฬ‡ + 16๐‘ง = 25๐‘ขฬ‡ + 32๐‘ข
4.33
The equations for an inverted pendulum are shown below. The force Fi is used to stabilize the
mass Ms in the vertical position using a feedback controller; the input to the controller is ๐œƒ.
Assuming small angles, the differential equations for this system are
๐œƒฬˆ + 0.5๐‘งฬˆ − 4.9๐œƒ = 0
๐‘งฬˆ + 0.18๐œƒฬˆ + 0.09๐น๐‘– = 0
And the differential equation for the feedback controller is
17
๐น๐‘–ฬ‡ + 8๐น๐‘– = −149.6[๐œƒฬ‡ + 6๐œƒ]
Prove mathematically that without the controller, this system is unstable.
Ms
๏ฑ
L
z
Mc
Fi
4.34 The differential equation for the roll angle,๐œƒ, of a ship resulting from wave and wind
disturbances, Td, is shown below
๏ฑ
๐œƒฬˆ + 1.8๐œƒฬ‡ + 9๐œƒ = 10−6 ๐‘‡๐‘‘
Assume that the torque disturbance ๐‘‡๐‘‘ is a sine wave, i.e.
๐‘‡๐‘‘ = 5000 ๐‘ ๐‘–๐‘›( 1.5๐‘ก)
The roll angle ๐œƒ of the ship will also be a sine wave. What will be the steady state amplitude and
frequency of ๐œƒ(๐‘ก)?
4.35
The transfer function relating ๐‘(๐‘ ) to the input ๐‘ˆ(๐‘ ) is given below.
๐‘ +5
๐‘(๐‘ ) = [๐‘ 2 +30๐‘ +200] ๐‘ˆ(๐‘ )
9
Assume that the input u(t) is a sine wave, that is ๐‘ˆ(๐‘ ) = ๐‘ 2 +9.
18
It can be shown that the inverse Laplace transform of ๐‘(๐‘ ) is of the form
๐‘ง(๐‘ก) = ๐ถ1 ๐‘’ −๐‘Ÿ1๐‘ก + ๐ถ2 ๐‘’ −๐‘Ÿ2๐‘ก + ๐ถ3 ๐‘’ −๐‘Ÿ3๐‘ก ๐‘ ๐‘–๐‘›( ๐œ”๐‘ก + ๐œ‘)
Fill in the following table:
๐ถ1
r1
๐ถ2
๐‘Ÿ2
๐‘Ÿ3
๐œ”
4.36 The transfer function for the output of a system is shown below; R is the input and N(s) is a
rational polynomial such as as2+bs+c, etc.
๐‘Œ(๐‘ ) = [
(a)
(b)
(c)
(d)
(e)
๐‘(๐‘ )
] ๐‘…(๐‘ )
(๐‘  + 2)[(๐‘  + 4)2 + 32 ][(๐‘  + 100)2 + 1002 ]
What are the eigenvalues?
What are the time constants?
What are the damping ratios?
What are the damped natural frequencies?
If the input is a step, write the general form of the inverse Laplace of Y(s). Be as
specific as possible.
4.37 After Laplace transforming a differential equation for z(t) with input r(t), the following
result was achieved:
15๐‘ +680
๐‘(๐‘ ) = [(๐‘ +4)[(๐‘ +2)2+82]] ๐‘…(๐‘ )
(a)
(b)
(c)
(d)
(e)
(f)
What is the transfer function for this system? _______________________
What are the eigenvalues of this system?___________________________
What are the time constants for this system? ________________________
What is the damping ratio of this system? _______________________
What is the damped natural frequency of this system? ____________
What is the undamped natural frequency, ๐œ”๐‘› , of this system? ____________
19
(g) (Suppose r(t) is a unit step input. It can be shown that z(t) will be of the form
๐‘ง(๐‘ก) = ๐ถ1 ๐‘’ −๐‘Ÿ1๐‘ก + ๐ถ2 ๐‘’ −๐‘Ÿ2๐‘ก + ๐ถ3 ๐‘’ −๐‘Ÿ3๐‘ก ๐‘ ๐‘–๐‘›( ๐œ”๐‘ก + ๐œ‘)
What are the following:
๐‘Ÿ1 =? _______________
๐‘Ÿ2 =? _______________
๐‘Ÿ3 =? _______________
๐œ” =? _______________
(h) What will be the final value of z(t), i.e. z(∞)? _______________________
4.38 For the differential equation given below, demonstrate that z is always in the neighborhood
of 2. Obtain a straight line approximation for ๐‘ง 3 and use it to obtain an estimate of the damping
ratio and time constant of the system.
2๐‘งฬˆ + 3๐‘งฬ‡ + 5๐‘ง 3 = 40 ๐‘ง(0− ) = 2.001
๐‘งฬ‡ (0− ) = 0.1
4.39 An analog controller Gc has been converted to z-transform format using the MATLAB
10๐‘ +1
commands shown below.
๐‘ˆ(๐‘ ) = ๐บ๐‘ (๐‘ )๐ธ(๐‘ ) = 100๐‘†+1 ๐ธ(๐‘ )
>> Gc=tf([10 1],[100 1]);
>> Gcd=c2d(Gc,0.001)
๐บ๐‘๐‘‘ =
0.1๐‘ง−0.0999
๐‘ง−1
What is the digital code for this controller to be used in a digital computer program?
4.40 Consider the following differential equation for z:
๐‘งโƒ› + 12๐‘งฬˆ + 189๐‘งฬ‡ + 338๐‘ง = 16๐‘ขฬˆ + 32๐‘ขฬ‡ + 169๐‘ข
(a) What is the transfer function for z?
(b) If ๐‘  3 + 12๐‘  2 + 189๐‘  + 338 = (๐‘  + 2)[(๐‘  + 5)2 + 122 ]
(b.1) What are the eigenvalues of this system?
(b.2) What are the time constants of this system?
(b.3) What is the damping ratio?
(b.4) How long will it take for z(t) to reach its final value within 1%?
(b.5) What are MATLAB commands for entering this transfer function into MATLAB?
(c) If the input u is a unit step and all initial conditions are zero,
(c.1) What is Z(s)?
20
(c.2) What is the general format equation for z(t)? If you don’t know what ‘general format’
means, find z(t).
(c.3) What is the final value of z(t)?
4.41 (a) Use Laplace transform and the residue theorem to solve the following differential
equation for v(t); the input u is a unit step.
๐‘ฃ(0− ) = 3
2๐‘ฃฬˆ + 24๐‘ฃฬ‡ + 40๐‘ฃ = 16๐‘ขฬ‡ + 80๐‘ข
๐‘ฃฬ‡ (0− ) = 0
(b) What is the final value of v? Check your answer using the final value theorem.
(c) What are the MATLAB commands to get a plot of v(t) using the command ‘impulse’?
(d) Express this differential equation in state variable format; assume z is the output of
interest denoted by y below. A=? B=? C=? D=?
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
4.42 Express the following system in state variable format assuming E is the output of interest.
Matrix format, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘…
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘…
E
R
+
-
4
s
u
s+2
s+5
v
w
+
-
1
s
z
6
Note, w and v are mistakenly reversed in the diagram above.
4.43 Consider the differential equation below.
2๐‘ฆฬˆ + 48๐‘ฆฬ‡ + 800๐‘ฆ = 60๐‘Ÿฬ‡ + 1600๐‘Ÿ
(a) If r(t) is the input, what is the transfer function for y?
(b) What is the DC gain of this system? ____________________
(c) What is the characteristic equation? ______________________
(d) What are the eigenvalues? ___________________________________
(e) What is the time constant? __________
What is the damping ratio? _____________
What is the undamped natural frequency?______________
What is the damped natural frequency? _____________
(f) If r is a step input, we know that the general form of y(t) will be
๐‘ฆ(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘“๐‘’ −๐‘‘๐‘ก sin(๐œ”๐‘ก + ๐œ‘)
b= _________
d=__________
๐œ” = __________
21
4.44 Consider the block diagram shown below.
(a) Express ๐บ๐‘ (๐‘ ) in state variable format (note, in this case E is the input).
(b) Express G(s) in state variable format (note, in this case U is the input).
(c) Using the results of (a) and (b) above, express the total system in matrix state
variable format; assume u(t) is the output of interest in the equation for y, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘…
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘…
A=? B=? C=? D=?
Gc (s )
R
+-
E
0.2 s + 1 U
0.02 s + 1
G (s )
2s + 3
s + 4 s + 12
V
2
4.45
As shown below, two water tanks with the same diameter are connected by a long pipe. Initially, before
the water is allowed to flow through the pipe, the height H1 of the water in tank #1 is greater than the
height H2 of the water in tank #2. The volume of the water in the pipe is significantly larger than the
tank volumes; thus, the inertia of the moving water in the pipe is significant.
H1
H2
Q
The equations for this system are as follows:
Equation for height of water in tank #1: −๐‘„ − 10๐ปฬ‡1 = 0
Equation for height of water in tank #2:
๐‘„ − 10๐ปฬ‡2 = 0
๐ป1 (0− ) = 10 ๐‘š
๐ป2 (0− ) = 5 ๐‘š
Equation for turbulent flow ๐‘„ through pipe: (๐ป1 − ๐ป2 ) = 50๐‘„ฬ‡ + 2๐‘„
๐‘„(0− ) = 0
๐‘š3
๐‘ 
1. Knowing the initial and final values and given that the time constant for this system is 50
seconds, draw an estimate of the graph of H1(t).
2. Laplace transform the equations and solve for H1(s).
3. It can be shown that the inverse Laplace transform of the correct H1(s) is as follows
22
๐ป1 (๐‘ก) = 7.5 + 2.638๐‘’ −0.02๐‘ก sin (0.06๐‘ก + 1.2483)
As demonstrated in the 2nd lecture, use MATLAB to plot H1(t). What aspects of your estimated
plot and the MATLAB plot agree? What aspects do they not agree?
Note, in MATLAB when multiplying two functions of time, you must use .* instead of just *
since t is a vector of time values. This is equivalent to the dot product of two vectors.
4.46
1. Show the 4-quadrant position and then find the magnitude and angle of each of the following
complex numbers:
(a) 3+j4
(b) -3+j4
(c) -3-j4
(d) 3-j4
2. Find the magnitude and angle of the complex number A below:
(3 + ๐‘—4)(−3 + ๐‘—4)
−3 − ๐‘—4
3. Repeat 1. and 2. above but this time use MATLAB to do the calculations to confirm your
answers. In MATLAB, to compute the magnitude use command ‘abs’; to compute the 4quadrant angle, use the command ‘angle’.
๐ด=
4. The 2-mass system shown below with force input Fi is defined by the following two
simultaneous differential equations:
5๐‘ฆฬˆ + 42๐‘ฆฬ‡ + 500๐‘ฆ = 90๐‘ง + 6๐‘งฬ‡
10๐‘งฬˆ + 6๐‘งฬ‡ + 90๐‘ง = 90๐‘ฆ + 6๐‘ฆฬ‡ + ๐น๐‘–
y
z
force
input
Fi
Use MATLAB to find the following:
23
(a)
(b)
(c)
(d)
(e)
(f)
Find the transfer function relating Y(s) to the input Fi(s).
What are the eigenvalues?
What are the damped natural frequencies?
What are the time constants?
What are the undamped natural frequencies?
What is the DC gain of the transfer function? What is the meaning of the DC gain?
4.47
The equations for an inverted pendulum are shown below. The force Fi is used to move the cart
in order to keep the pendulum mass vertical. The pendulum angle ๐œƒ is continuously measured
and used to generate the force Fi on the cart. Assuming small angles, the differential equations
for the pendulum and cart are
๐œƒฬˆ + 0.5๐‘งฬˆ − 4.9๐œƒ = 0
๐‘งฬˆ + 0.18๐œƒฬˆ + 0.09๐น๐‘– = 0
And the differential equation for the force Fi is
๐น๐‘–ฬ‡ + 8๐น๐‘– = −149.6[๐œƒฬ‡ + 6๐œƒ]
Ms
๏ฑ
L
z
Mc
Fi
(a) What are the unknowns in these three equations?
(b) Find the Laplace transform for the pendulum angle assuming all initial conditions are zero
except the initial pendulum angle ๐œƒ(0− ) = 0.1 ๐‘Ÿ๐‘Ž๐‘‘. Note, there is no external input to this
system so there is no transfer function.
(c) What are the poles of the denominator of your Laplace transform found in part b?
4.48
The equations for an inverted pendulum are shown below. The force Fi is used to move the cart
in order to keep the pendulum mass vertical. The pendulum angle ๐œƒ is continuously measured
and used to generate the force Fi on the cart. Assuming small angles, the differential equations
for the pendulum and cart are
๐œƒฬˆ + 0.5๐‘งฬˆ − 4.9๐œƒ = 0
๐‘งฬˆ + 0.18๐œƒฬˆ + 0.09๐น๐‘– = 0
And the differential equation for the force Fi is
๐น๐‘–ฬ‡ + 8๐น๐‘– = −149.6[๐œƒฬ‡ + 6๐œƒ]
24
Ms
๏ฑ
L
z
Mc
Fi
(a) What are the unknowns in these three equations?
(b) Find the Laplace transform for the pendulum angle assuming all initial conditions are
zero except the initial pendulum angle ๐œƒ(0− ) = 0.1 ๐‘Ÿ๐‘Ž๐‘‘. Note, there is no external input to
this system so there is no transfer function.
(c) What are the poles of the denominator of your Laplace transform found in part b?
4.49
The Laplace transform of an engineering system is found to be the following:
100(4๐‘  2 + 12๐‘  + 16)
๐‘Œ(๐‘ ) =
(๐‘  + 5)[(๐‘  + 2)2 + 32 ][(๐‘  + 15)2 + 82 ]
(a) Obtain an equation for y(t) by finding the inverse Laplace of Y(s). It is okay to use MATLAB to do
the complex arithmetic associated with the coefficients.
(b) Use the MATLAB command ‘impulse’ to generate values for y(t) and t. Then, use the values of t
in your equation from (a) and plot both solutions for y(t) on the same graph for comparison.
How do they compare?
4.50
This problem pertains to improving the performance of a pile driver by changing the frequency
of hitting the top of the pile (steel beam) with force Fi. The output of interest is the contact force
Fo with the ground at the bottom of the pile. By carefully selecting the input frequency to
approximately match one of the resonant frequencies of the beam, the pile is driven into the
ground faster and more efficiently.
The stress waves in the pile are defined by partial differential equations representing an infinite
number of modes. However, it is possible to approximate the stress waves using a lumped
parameter model such as shown below and obtain a finite order ordinary differential equation
represented by a transfer function.
25
Fi
Fo
A typical transfer function for a five-lumped model of a pile is the following:
๐น๐‘œ (๐‘ )
=[
3125๐‘  10
+
11250๐‘  9
+
126500๐‘  8
32๐‘  5 + 1600๐‘  4 + 32000๐‘  3 + 320000๐‘  2 + 1600000๐‘  + 3200000
] ๐น (๐‘ )
+ 287000๐‘  7 + 1611200๐‘  6 + 2148032๐‘  5 + 7721600๐‘  4 + 4832000๐‘  3 + 12320000๐‘  2 + 1600000๐‘  + 3200000 ๐‘–
(a) Use the DC gain of this transfer function to determine the force at the ground if the input
(b)
(c)
(d)
(e)
force is a constant of 1000 N. This is an input that could be generated by setting a 1000 N
weight on top of the pile. Does your answer using the DC gain to compute the ground force
make sense?
Use the ‘damp’ command with the lumped model transfer function to approximate the actual
resonant frequencies of this pile; the resonant frequencies are the damped natural
frequencies in the eigenvalues.
Suppose instead of a constant input, the input is sinusoidal with an amplitude of 1000 N.
Using the MATLAB command ‘bode’ to generate the frequency response of this transfer
function, determine the input frequency ๐œ”๐‘– that generates the greatest force amplitude Ag at
the ground. At this frequency, what is the corresponding amplitude of the force at the ground
in Newtons? Note, the frequency response plot magnitude is in dB where M (dB) =20Log10(
M). It suggested that you improve the resolution on your plot by limiting the frequency range
to a relatively small band of frequencies around the peak. How does this input frequency
from the frequency response compare with the damped natural frequency of the first mode?
Examine your frequency response plot in (b) and confirm that the DC gain is the same as the
low frequency magnitude of the transfer function. What is the low frequency gain of the
transfer function in dB? Note, the zero frequency gain is the same thing as the DC gain.
Realizing that it is not realistic for the input force from a pile driver to be a sinewave since that
would require a pushing and pulling action, generate a series of pulses for the force input
using the pulse generator M-file provided on Blackboard. The pulse period is 2๐œ‹/๐œ”๐‘– where ๐œ”๐‘–
is the frequency found in (c) in rad/s. The magnitude of each pulse should be 1000 N. The
width of each pulse should be less than or equal to 1/20 of the pulse period. Use the
command ‘lsim’ to generate and plot Fo(t) for the pulse input. Be sure to run your simulation
much longer than 5๐œ๐‘š๐‘Ž๐‘ฅ so you can see the peak amplitude of the steady state response of
the force at the ground.
26
(f) To investigate the significance of the input frequency on the output peak values, repeat (e)
but using input frequencies that are 20% greater and 20% less than the resonant frequency.
What is the significance of being as close as possible to the resonant frequency?
4.51
1. A spring-mass –damper system is shown below; the displacement of the mass is z.
z
spring
damper
mass
The differential equation for the position of the mass is as follows
๐‘งฬˆ + 0.1๐‘งฬ‡ + 0.01๐‘ง = 0 ๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 2 ๐‘š/๐‘ 
(a) Draw an best guess estimate of the plot of z(t). Be sure to show the initial and final values and
the approximate time to reach the final value. Do this before proceeding to the next parts of
the assignment.
(b) Express this differential equation in state variable format and then use ode45 in MATLAB to
generate a plot of z(t). Does this plot agree with your plot in (a)?
2. When a 2nd mass is added to the system, we now have two simultaneous equations for the
system. (a) Express this system of equations in state variable format and write the initial
conditions for the state variables. (b) Use ode45 to generate a plot of ๐‘งฬ‡ (๐‘ก).
๐‘š
๐‘ 
๐‘คฬˆ + 0.05๐‘คฬ‡ + 0.005๐‘ค = 0.05๐‘งฬ‡ + 0.005๐‘ง ๐‘ค(0− ) = 0 ๐‘คฬ‡ (0− ) = 0
๐‘งฬˆ + 0.15๐‘งฬ‡ + 0.015๐‘ง = 0.05๐‘คฬ‡ + 0.005๐‘ค
z
๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 2
w
27
4.52
The schematic of a vehicle suspension system is shown below. The vehicle is moving to the
right. At t = 0, the contact point at the ground encounters a step with magnitude 0.02 m. All
initial conditions are zero.
๐‘งฬˆ + 20๐‘งฬ‡ + 100๐‘ง = 20๐‘ขฬ‡ + 100๐‘ข
(a) Use ode45 to obtain a plot of ๐‘งฬ‡ (๐‘ก). Explain why ๐‘งฬ‡ (0+ ) is not equal to ๐‘งฬ‡ (0− ).
(b) Use SIMULINK to obtain a plot of ๐‘งฬ‡ (๐‘ก). Confirm that the (a) and (b) results are the same by
putting them on the same graph.
4.53
The equations for an inverted pendulum are shown below. The feedback force Ff is used to
move the cart in order to keep the pendulum mass vertical. The pendulum angle ๐œƒ is
continuously measured and used to generate the force Ff on the cart. Assuming small angles, the
differential equations for the pendulum and cart are listed below as well as the transfer function
for the feedback control force Ff.
Equation for summing the moments on the pendulum bar and mass: ๐œƒฬˆ + 0.5๐‘งฬˆ − 4.9๐œƒ = 0
Equation for the force balance on the cart:
๐‘งฬˆ + 0.18๐œƒฬˆ + 0.09๐น๐‘“ = 0
๐‘ +6
Transfer function from feedback control design theory: ๐น๐‘“ (๐‘ ) = −149.6 [๐‘ +8] ๐œƒ(๐‘ )
Ms
๏ฑ
L
z
Ff
Mc
(a) Assume that the initial conditions are
๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 0 ๐œƒ(0− ) = 0.1 ๐œƒฬ‡ (0− ) = 0.05 ๐‘Ÿ๐‘Ž๐‘‘/๐‘ 
(10%) Estimate the plots of ๐œƒ(๐‘ก) and ๐œƒฬ‡ (๐‘ก). Do this before running the next part.
28
(30%) Construct a SIMULINK diagram for this system and obtain plots of ๐œƒ(๐‘ก) and ๐œƒฬ‡ (๐‘ก).
(10%) Do the plots start and end at the correct values? ________________
(b) Express these equations in state variable format and then use ‘lsim’ with an initial
condition vector to generate plots of ๐œƒ(๐‘ก) and ๐œƒฬ‡(๐‘ก). Are the plots in (a) the same as those in (b)?
________________
Hint: Solve for ๐‘งฬˆ in the 2nd equation and substitute it into the 1st equation to get an equation for
๐œƒฬˆ which can then be substituted back into the original 2nd equation. Also, note there is no input
so B and D contain only zeros.
4.54
This assignment is a review of using symbolic math in MATLAB to get transfer functions, a
review of the phase variable method to get state variable equations for transfer functions with
equal order numerators and denominators, and a review of the use of ‘lsim’ to do time domain
simulations. Also, this assignment is an introduction to the use of ‘lsim’ for simulating systems
with random inputs.
Consider the schematic of a vehicle suspension shown below. It is of interest to determine the
levels of up and down acceleration in g’s that would be experienced by a passenger riding in this
vehicle over a typical country road at a speed of 30 m/s. The differential equations for this
suspension for road irregularities u(t) are also shown. The equation for the output of interest a(t)
is also shown. Note, ๐‘งฬˆ is the up and down acceleration; dividing ๐‘งฬˆ by 9.8 m/s2 gives the
acceleration in g’s.
29
(a) Use symbolic math to confirm the transfer function for a(s). What are the eigenvalues?
(b) Using the phase variables method, express this transfer function in state variable format
considering that ‘a’ is the output of interest.
(c) Use the two M-files ‘StochInput’ and ‘dpsd’ to generate values for the road profile irregularities
u(t), i.e.
>> [u,t]=StochInput(4096,0.005); % This command generates 4096 values for u(t) separated by a
time interval of 0.005 seconds. At 30 m/s, that is a value every 0.15 m. The M-file ‘dpsd’
defines the roughness of the road as a function of the wavelength of the irregularities.
Generate two plots of u(t); the first plot shows all of u(t) and the second plot goes out to only 1
second using the ‘axis’ command.
(d) Use ‘lsim’ and the state variable model to generate a plot of a(t). After the transients have died
out (5 times the largest time constant), what is the observed peak value of normalized
acceleration, a(t)? Do you think this value is small enough for passenger comfort?
function [G]=dpsd(f)
G=4e-6*30^1.1/f^2.1;
end
30
Solutions to Example Problems
5.1
A mass sits at equilibrium on top of a spring and damper as shown below.
Mass
Spring
x
Damper
It can be shown that the differential equation for the position of the mass ๐‘ฅ is given by
๐‘‘2๐‘ฅ
๐‘‘๐‘ฅ
10 2 + 60
+ 80๐‘ฅ = 160
๐‘‘๐‘ก
๐‘‘๐‘ก
(a) What is the dependent variable in the differential equation? x
(b) What is the independent variable in the differential equation? t
(c) What is the order of the differential equation? 2nd
(d) Is the differential equation linear or nonlinear? linear
(e) What is the equilibrium value of x? 160/80=2
(f) If the mass is disturbed, it will eventually return to the equilibrium position. Why? This a
passive system which means that energy is dissipated over time; there is no external energy
source.
5.2
Consider the following differential equation for a suspension system:
๐‘ฆฬˆ + 6.5๐‘ฆฬ‡ + 9,800๐‘ฆ 3 = 9.8
1. What is the order of the differential equation? ___2nd_________
2. Assuming ๐‘ฆ(๐‘ก) → ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก as ๐‘ก → ∞, what will be the value of this
constant?____0.1_______
0 + 0 + 9,800๐‘ฆ 3 = 9.8
๐‘กโ„Ž๐‘ข๐‘  ๐‘ฆ = 0.1
3. Assuming that the initial conditions for this differential equation are ๐‘ฆฬ‡ (0− ) =
0 ๐‘Ž๐‘›๐‘‘ ๐‘ฆ(0− ) = 0, draw a sketch of ๐‘ฆ(๐‘ก) starting at ๐‘ก = 0.
y(t)
0.1
0
time
31
4. Obtain a linear approximation for this differential equation by obtaining a straight line
approximation for ๐‘ฆ 3 using the two point method. Be sure to start by sketching ๐‘ฆ 3 and
noting the two points for your straight line.
y3
y 3 ๏‚ป .01 y + 0
0.001
0
0.1
y
5. After substituting your straight line into the original differential equation, check to see if
the new linearized differential equation gives the correct final value.
๐‘ฆฬˆ + 6.5๐‘ฆฬ‡ + 9,800(0.01๐‘ฆ) = 9.8
๐‘ฆ(∞) = 0.1
5.3
Consider the following spring-mass-damper system with input u(t).
z
M
k
b
k
b
u
The input (independent variable) to this system is the displacement u. The equations for this
suspension system are
10๐‘งฬˆ + ๐‘“1 + ๐‘“2 = 0
๐‘“1 = 100(๐‘ง − ๐‘ฃ)
๐‘“2 = 5(๐‘งฬ‡ − ๐‘ฃฬ‡ )
๐‘“3 = 100(๐‘ฃ − ๐‘ข)
๐‘“4 = 5(๐‘ฃฬ‡ − ๐‘ขฬ‡ )
๐‘“1 + ๐‘“2 − ๐‘“3 − ๐‘“4 = 0
(a) List the unknowns (dependent variables) and confirm that the number of equations matches
the number of unknowns. 6 equations with unknowns: ๐‘“1 , ๐‘“2 , ๐‘“3 , ๐‘“4 , ๐‘ง, ๐‘Ž๐‘›๐‘‘ ๐‘ฃ
32
(b) Use the "D" operator to convert the differential equations to algebraic equations.
10๐ท2 ๐‘ง + ๐‘“1 + ๐‘“2 = 0
๐‘“1 = 100(๐‘ง − ๐‘ฃ)
๐‘“2 = 5๐ท(๐‘ง − ๐‘ฃ)
๐‘“3 = 100(๐‘ฃ − ๐‘ข)
๐‘“4 = 5๐ท(๐‘ฃ − ๐‘ข)
๐‘“1 + ๐‘“2 − ๐‘“3 − ๐‘“4 = 0
(c) Eliminate ๐‘“1 , then eliminate ๐‘“2 , then eliminate ๐‘“3 , and then eliminate ๐‘“4 . How many
equations with which unknowns do you have left?
10๐ท2 ๐‘ง + 100(๐‘ง − ๐‘ฃ) + 5๐ท(๐‘ง − ๐‘ฃ) = 0
100(๐‘ง − ๐‘ฃ) + 5๐ท(๐‘ง − ๐‘ฃ) − 100(๐‘ฃ − ๐‘ข) − 5๐ท(๐‘ง − ๐‘ฃ) = 0
Two equations with unknowns z and v.
5.4
(a) Laplace transform the following differential equation and solve for the Laplace transform
Z(s).
2๐‘งฬˆ + 12๐‘งฬ‡ + 36๐‘ง = 24
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 4
Note, the answer should be in the format of a numerator polynomial over a denominator
polynomial. Your answer is not complete until it is in this format.
2(๐‘  2 ๐‘(๐‘ ) − 0๐‘  − 4) + 12(๐‘ ๐‘(๐‘ ) − 0)+36Z(s)=24/s
๐‘(๐‘ ) =
8๐‘  + 24
+ 12๐‘  + 36)
๐‘ (2๐‘  2
(b) The final value theorem is
๐‘ง(๐‘ก)๐‘ก→∞ = ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘(๐‘ )๐‘ →0
Apply the final value theorem to your Z(s) and see if it gives the correct final value.
0 + 24
= 0.666
0 + 0 + 36
Setting the derivatives of z in the original differential equation and solving for z gives
0.666 which checks.
๐‘ ๐‘(๐‘ )๐‘ →0 =
(c) The initial value theorem is ๐‘ง(๐‘ก)0+←๐‘ก = ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘(๐‘ )๐‘ →∞
Apply the initial value theorem and see if it gives ๐‘ง(0− ).
๐‘ ๐‘(๐‘ )๐‘ →∞ = 0 which is the initial value of z.
33
5.5
(a) Solve the following differential equation x(t) using separation of variables if x(0) =4.
2๐‘ฅฬ‡ + 6๐‘ฅ = 0
๐‘ฅ(๐‘ก) = 4๐‘’ −3๐‘ก
(b) Confirm that your solution is correct using the original differential equation.
2(−12)๐‘’ −3๐‘ก + 6(4๐‘’ −3๐‘ก ) = 0
5.6
1. The Laplace transform of z(t) is as follows:
๐‘(๐‘ ) =
6๐‘  2 + 12๐‘  + 5
๐‘ (๐‘  + 4)[(๐‘  + 2)2 + 82 ]
We know that the inverse Laplace of Z(s) will be of the following format:
๐‘ง(๐‘ก) = ๐‘Ž๐‘’ ๐‘๐‘ก + ๐‘๐‘’ ๐‘‘๐‘ก + ๐‘“๐‘’ ๐‘”๐‘ก sin (๐œ”๐‘ก + ๐œ‘)
5
๐‘Ž=
= 0.184
4 ∗ 68
๐‘=0
๐‘=
6(−4)2 + 12(−4) + 5
= −0.07
(−4)([(−4 + 2)2 + 82 ]
๐‘‘ = −4
๐‘” = −2
๐œ”=8
2.
The equation for Y(s) is written below in terms of the input U(s).
๐‘Œ(๐‘ ) = [
6๐‘  2 + 3๐‘  + 84
] ๐‘ˆ(๐‘ )
(๐‘  + 3)[(๐‘  + 5)2 + 92 ]
6๐‘ 2 +3๐‘ +84
(a) What is the transfer function? [(๐‘ +3)[(๐‘ +5)2+92]]
(b) What are the eigenvalues? ๐‘  = −3 ๐‘Ž๐‘›๐‘‘ − 5 ± ๐‘—9
34
(c) What are the time constants?
1
3
๐‘Ž๐‘›๐‘‘
1
5
(d) If u(t) is a unit impulse, what is U(s) and what is Y(s)?
๐‘ˆ(๐‘ ) = 1
6๐‘  2 + 3๐‘  + 84
๐‘Œ(๐‘ ) = [
]
(๐‘  + 3)[(๐‘  + 5)2 + 92 ]
5.7
Laplace transform the differential equation below and then solve for Z(s).
3๐‘งฬˆ + 6๐‘งฬ‡ + 12๐‘ง = 18
๐‘ง(0− ) = 2
๐‘งฬ‡ (0− ) = 4
๐‘งฬˆ + 2๐‘งฬ‡ + 4๐‘ง = 6
18
๐‘  2 ๐‘(๐‘ ) − 2๐‘  − 4 + 2(๐‘ ๐‘(๐‘ ) − 2) + 4๐‘(๐‘ ) =
๐‘ 
2๐‘  2 + 8๐‘  + 6
๐‘(๐‘ ) =
๐‘ (๐‘  2 + 2๐‘  + 4)
5.8
Consider the following Laplace transform:
๐‘(๐‘ ) =
15๐‘  3 + 2๐‘  2 + 640
๐‘ (5๐‘  4 + 162๐‘  3 + 1424๐‘  2 + 3744๐‘  + 1280)
What will be the final value of z(t) found using the final value theorem?
๐‘ง(∞) =
0 + 0 + 640
= 0.5
0 + 0 + 0 + 0 + 1280
What is the initial value of z(t) as determined from the initial value theorem?
๐‘ง(0+ ) = 0
What are the MATLAB commands for generating a plot of z(t) using the ‘impulse’ command.
>> num=[15 2 0 640];
>> den=[5 162 1424 3744 1280 0];
>> z=tf(num,den);
>> impulse(z)
35
5.9
Consider the two simultaneous equations below for a mechanical lift system with step input u(t)
with magnitude of 5.
10๐‘ฆฬˆ + 6๐‘ฆฬ‡ + 3๐‘ฆ = 2๐‘ฃ
๐‘ฆ(0− ) = 0 ๐‘ฆฬ‡ (0− ) = 5
2๐‘ฃฬ‡ + +10๐‘ฃ − 4๐‘ฆ = 2๐‘ข
๐‘ฃ(0− ) = 4
Convert these equations to the Laplace domain by Laplace transforming the equations.
๐‘ฆฬˆ + 0.6๐‘ฆฬ‡ + 0.3๐‘ฆ = 0.2๐‘ฃ
๐‘ฆ(0− ) = 0 ๐‘ฆฬ‡ (0− ) = 5
๐‘ฃฬ‡ + 5๐‘ฃ − 2๐‘ฆ = ๐‘ข
๐‘ฃ(0− ) = 4
Laplace transforming gives
๐‘ 2 ๐‘Œ(๐‘ ) − 5 + 0.6๐‘ ๐‘Œ(๐‘ ) + 0.3๐‘Œ(๐‘ ) = 0.2๐‘‰(๐‘ )
5
๐‘ ๐‘‰(๐‘ ) − 4 + 5๐‘‰(๐‘ ) − 2๐‘Œ(๐‘ ) =
๐‘ 
5.10
For the differential equation below, use Euler’s numerical integration to compute the first two
solution values of x(t) using a time step of 0.01.
๐’™(๐ŸŽ− ) = ๐Ÿ
๐’™ฬ‡ + ๐Ÿ๐ŸŽ๐’™ = ๐Ÿ๐ŸŽ
Time t x(t)
๐’™ฬ‡ (๐’•) = ๐Ÿ๐ŸŽ − ๐Ÿ๐ŸŽ๐’™(๐’•) x(t+T)=x(t)+T๐’™ฬ‡ (๐’•)
0
1
20-10*1=10
1+0.01*10=1.1
0.01
1.1
20-10*1.1=9
1.1+0.01*9=1.19
0.02
1.19 20-10*1.19=8.1
1.19+0.01*8.1=1.271
Use the inverse Laplace transform and solve for the exact solution of x(t) and compare the numerical
solution values with the exact solution values.
๐’”๐‘ฟ(๐’”) − ๐Ÿ + ๐Ÿ๐ŸŽ๐‘ฟ(๐’”) =
๐‘ฟ(๐’”) =
๐Ÿ๐ŸŽ
๐’”
๐Ÿ๐ŸŽ + ๐’”
๐’”(๐’” + ๐Ÿ๐ŸŽ)
๐’™(๐’•) = ๐Ÿ − ๐’†−๐Ÿ๐ŸŽ๐’•
t
Numerical x(t) ๐’™(๐’•) = ๐Ÿ − ๐’†−๐Ÿ๐ŸŽ๐’•
0
1
1
0.01 1.1
1.09516
0.02 1.19
1.18127
36
5.11
The differential equations for the suspension shown below with input displacement u(t) are
10๐‘งฬˆ + 100๐‘งฬ‡ + 1000๐‘ง = 100๐‘คฬ‡ + 1000๐‘ค
100๐‘คฬ‡ + 4000๐‘ค = 100๐‘งฬ‡ + 1000๐‘ง + 3000๐‘ข
(a) Assume all initial conditions are zero and convert the equations above to Laplace domain.
Z
W
U
๐‘งฬˆ + 10๐‘งฬ‡ + 100๐‘ง = 10๐‘คฬ‡ + 100๐‘ค
๐‘คฬ‡ + 40๐‘ค = ๐‘งฬ‡ + 10๐‘ง + 30๐‘ข
Laplace transforming gives
(๐‘  2 + 10๐‘  + 100)๐‘(๐‘ ) = (10๐‘  + 100)๐‘Š(๐‘ )
(๐‘  + 40)๐‘Š(๐‘ ) = (๐‘  + 10)๐‘(๐‘ ) + 30๐‘ˆ(๐‘ )
(b) Demonstrate that if you solve for W(s) in the first equation and then substitute this
expression for W(s) into the 2nd equation, when you solve for Z(s) you get
(๐‘  + 10)๐‘(๐‘ ) + 30๐‘ˆ(๐‘ )
(๐‘  + 40)
(๐‘  + 10)๐‘(๐‘ ) + 30๐‘ˆ(๐‘ )
(๐‘  2 + 10๐‘  + 100)๐‘(๐‘ ) = (10๐‘  + 100)
(๐‘  + 40)
๐‘Š(๐‘ ) =
๐‘(๐‘ ) = [
3000 + 300๐‘ 
] ๐‘ˆ(๐‘ )
๐‘  3 + 40๐‘  2 + 300๐‘  + 3000
5.12
Express the following differential equation with input u in state variable format. What are the initial
conditions for the state variables?
๐’—ฬˆ + ๐Ÿ“๐’—ฬ‡ + ๐Ÿ๐ŸŽ๐’— = ๐Ÿ๐ŸŽ๐’–ฬ‡ + ๐Ÿ’๐ŸŽ๐’–
๐’™๐Ÿ = ๐’—
๐’—(๐ŸŽ− ) = ๐Ÿ‘
๐’™๐Ÿ = ๐’—ฬ‡ − ๐Ÿ๐ŸŽ๐’–
๐’™ฬ‡ ๐Ÿ = ๐’™๐Ÿ + ๐Ÿ๐ŸŽ๐’–
๐’—ฬ‡ (๐ŸŽ− ) = ๐ŸŽ. ๐Ÿ“
๐’™๐Ÿ (๐ŸŽ− ) = ๐Ÿ‘
๐’–(๐ŸŽ− ) = ๐ŸŽ
๐’™๐Ÿ (๐ŸŽ− ) = ๐ŸŽ. ๐Ÿ“
๐’™ฬ‡ ๐Ÿ = −๐Ÿ๐ŸŽ๐’™๐Ÿ − ๐Ÿ“๐’™๐Ÿ − ๐Ÿ”๐ŸŽ๐’–
37
5.13
A dynamic system is represented by the differential equation shown below.
๐‘งฬˆ + 7๐‘งฬ‡ + 10๐‘ง = 14๐‘ขฬ‡ + 20๐‘ข
(a) What is the transfer function of this system?
14๐‘  + 20
2
๐‘  + 7๐‘  + 10
(b) What are the eigenvalues of this system?
Eigenvalues = -5 and -2
(c) What are the time constants for this system?
Time constants = 1/5 and 1/2
(d) Suppose the input u(t) is a unit step. What will be the final value of z(t)?
0 + 0 + 10๐‘ง(∞) = 0 + 20(1)
๐‘ง(∞) = 2
(e) How long will it take for z(t) to be within 1% of this final value?
It takes about five times the largest time constant = 5/2 = 2.5 seconds
5.14
Perform the following matrix operations:
1 2 3
1 4 7
๐‘Ž = [4 5 6]
๐‘Ž๐‘‡ = [2 5 8]
7 8 9
3 6 9
1 2 3
1
6
(2) ๐‘Ž = [4 5 6]
๐‘ = [ 1]
๐‘Ž๐‘ = [15]
7 8 9
1
24
๐‘ฅ1
(3) [−2 4 −1] [๐‘ฅ2 ] = −2๐‘ฅ1 + 4๐‘ฅ2 − ๐‘ฅ3
๐‘ฅ3
๐‘ข1 + 2๐‘ข2
1 2 ๐‘ข
1
(4) [3 4] [๐‘ข ] = [3๐‘ข1 + 4๐‘ข2 ]
2
5๐‘ข1 + 6๐‘ข2
5 6
1
4
5
5
(5) [2] [4 5 6] = [ 8 10 12]
3
12 15 18
1
1
1
(6) [2] .∗ [2] = [4]
3
3
9
(1)
Express the differential equation below in matrix state variable format, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
๐‘งโƒ› + 2๐‘งฬˆ + 3๐‘งฬ‡ + 8๐‘ง = 10๐‘ข
๐‘ฆ = 0.1๐‘งฬˆ
๐‘ฅ1 = ๐‘ง ๐‘ฅ2 = ๐‘งฬ‡ ๐‘ฅ3 = ๐‘งฬˆ
๐‘ฅฬ‡ 1
0
1
0 ๐‘ฅ1
0
[๐‘ฅฬ‡ 2 ] = [ 0
0
1 ] [๐‘ฅ2 ] + [ 0 ] ๐‘ข
๐‘ฅฬ‡ 3
−8 −3 −2 ๐‘ฅ3
10
๐‘ฆ = [0 0
๐‘ฅ1
๐‘ฅ
0.1] [ 2 ] + [0]๐‘ข
๐‘ฅ3
38
5.15
Solve the following differential equation using separation of variables.
20๐‘งฬ‡ + 60๐‘ง = 80
๐‘ง(0− ) = 2
๐‘ง(๐‘ก)
๐‘ก
1
∫
๐‘‘๐‘ง = − ∫ ๐‘‘๐‘ก = −๐‘ก
3๐‘ง − 4
2
0
Integrating gives
4 2
๐‘ง(๐‘ก) = + ๐‘’ −3๐‘ก
3 3
5.16
The differential equation for the suspension system shown below is
๐‘งฬˆ + 0.8๐‘งฬ‡ + ๐‘ง = 0.8๐‘ขฬ‡ + ๐‘ข
z
u
(a) Express this differential equation in state variable format assuming y = u -z is the output of
interest.
๐‘ฅ1 = ๐‘ง
๐‘ฅ2 = ๐‘งฬ‡ − 0.8๐‘ข
0
1
0.8
๐‘‹ฬ‡ = [
]๐‘‹ + [
]๐‘ข
−1 −0.8
0.36
๐‘ฆ = [−1 0]๐‘‹ + [1]๐‘ข
(b) Enter your state variable equations in MATLAB using the ‘ss’ command.
>> A=[0 1;-1 -0.8];
>> B=[0.8;0.36];
>> C=[-1 0];
>>D=[1];
>>G=ss(A,B,C,D);
(c) Use the ‘eig’ command to get the eigenvalues? Are these the correct values?
>> ev=eig(A)
Eigenvalues = -0.4 ± j0.8
(d) Use the command ‘step’ to get a plot of y(t) for u(t) a step with magnitude 0.1. Does the plot
start and end at the correct initial and final values?
>> step(G)
The value of y at t = 0+ is 1 and the final value is 0.
39
5.17 Obtain a straight line approximation for x3 in the neighborhood of x=2.
๐’™๐Ÿ‘ ≈ ๐Ÿ๐Ÿ‘ + ๐Ÿ‘(๐Ÿ)๐Ÿ (๐’™ − ๐Ÿ) = ๐Ÿ๐Ÿ๐’™ − ๐Ÿ๐Ÿ”
5.18
Two simultaneous differential equations are shown below.
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −100๐‘ฅ1 − 2๐‘ฅ2
What are the two unknowns?
๐‘ฅ1 ๐‘Ž๐‘›๐‘‘ ๐‘ฅ2 ๐‘Ž๐‘Ÿ๐‘’ ๐‘กโ„Ž๐‘’ ๐‘ข๐‘›๐‘˜๐‘›๐‘œ๐‘ค๐‘›๐‘ 
Eliminate ๐‘ฅ2 and find a single differential equation for ๐‘ฅ1 .
To eliminate ๐‘ฅ2 , we need to use the s or D operator:
−100
๐ท๐‘ฅ1 = ๐‘ฅ2 =
๐‘ฅ
๐ท+2 1
Which gives
๐‘ฅฬˆ 1 + 2๐‘ฅฬ‡ 1 + 100๐‘ฅ1 = 0
5.19
(a) Express the differential equation shown below in state variable format using matrices, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =?
The output of interest is ๐‘ฆ = ๐‘ง.
4๐‘งฬˆ + 24๐‘งฬ‡ + 40๐‘ง = 24๐‘ขฬ‡ + 40๐‘ข
๐‘ง(0− ) = 3
๐‘งฬ‡ (0− ) = 2 ๐‘ข(๐‘ก) = ๐‘ข๐‘›๐‘–๐‘ก ๐‘ ๐‘ก๐‘’๐‘
๐ด = [0 1; −10 − 6]; ๐ต = [6; −26]; ๐ถ = [1 0]; ๐ท = [0]
(b) What are the initial conditions for the state variables, i.e. ๐‘ฅ1 (0− ) =?, ๐‘ฅ2 (0− ) =?, ๐‘’๐‘ก๐‘.
๐‘ฅ1 (0− ) = 3 ๐‘ฅ2 (0− ) = 2
(c) For an ode45 numerical simulation, what would you specify for the final time (when to stop
the simulation)? Final time =5/3 sec.
5.20
1. For each differential equation below, answer the following questions:
(a) ๐‘ฃฬˆ + 16๐‘ฃฬ‡ + 12๐‘ฃ = 5
Is the equation linear?__yes___ What is the order? ___2nd_ What is the dependent
variable?_v_____
What is the independent variable? time
What is the final value of the dependent variable? 5/12=0.4166
(b) 2๐‘ฆโƒ› + 0.4๐‘ฆฬˆ + 0.1(๐‘ฆฬ‡ )5 + 10๐‘ฆ = 24
Is the equation linear?__no What is the order? ___3rd What is the dependent variable?_y____
What is the independent variable? time What is the final value of the dependent variable? 2.4
2. Before the valve on the water tank is opened, the height H of the water in the tank is 10 m.
Once the valve is opened, water flows out of the tank. The differential equation for H with water
flowing out is as follows
4๐ปฬ‡ + 0.8√๐ป = 0
(a) On the sketch below, draw a reasonable estimate of H as a function of time.
40
H
10
H
valve
flow
0
time
Use separation of variables to solve this differential equation for H(t).
๐ป(๐‘ก)
๐‘ก
๐‘‘๐ป
4∫
= − ∫ 0.8๐‘‘๐‘ก
๐ป(๐‘ก) = (√๐ป(0) − 0.1๐‘ก)2
√๐ป(๐‘ก) − √๐ป(0) = −0.1๐‘ก
๐ป(0) √๐ป
0
Does your equation for H(t) give the correct initial and final values for H?
Equation for H(t)
๐ป(๐‘ก) = (√10 − 0.1๐‘ก)2
Initial value of H from the equation ๐ป(0) = (√10 − 0.1 ∗ (0))2 = 10
√
2
Final value of H from the equation ๐ป(∞) = (√10 − 0.1๐‘ก) = 0
√๐ป cannot go negative
3. A pendulum is attached to a cart as shown below. The system is shown in equilibrium, that
is, nothing is moving.
cart
spring
pendulum
If the cart is rolled to the right or left and released or if the pendulum is raised to the right or left
and then released, the cart will start rolling back and forth compressing and extending the spring
while the pendulum swings back and forth.
z
๏ฑ
41
It can be shown, for small angles, the following two simultaneous equations with unknowns
๐‘ง ๐‘Ž๐‘›๐‘‘ ๐œƒ accurately model the dynamics of this system
๐œƒฬˆ + 3๐œƒฬ‡ + 9๐œƒ = −0.9๐‘งฬˆ
7๐‘งฬˆ + 175๐‘ง = −2๐œƒฬˆ
๐œƒ(0− ) = ๐œƒ0
๐‘ง(0− ) = 0
๐œƒฬ‡(0− ) = 0
๐‘งฬ‡ (0− ) = 0
Using the Laplace transform, convert these equations to algebraic equations, eliminate ๐œƒ, and
finally end up with an equation for ๐‘(๐‘ ).
(๐‘  2 + 3๐‘  + 9)๐œƒ(๐‘ ) − ๐‘ ๐œƒ0 − 3๐œƒ0 = −0.9๐‘  2 ๐‘(๐‘ )
(7๐‘  2 + 175)๐‘(๐‘ ) = −2๐‘  2 ๐œƒ(๐‘ ) + 2๐‘ ๐œƒ0
Which simplifies to
๐‘(๐‘ ) = [
90๐œƒ0
]
26๐‘  4 + 105๐‘  3 + 1190๐‘  2 + 2625๐‘  + 7875
5.21
1.
Obtain a linear approximation to the following differential equation using the initial and final
values of z.
๐‘งฬˆ + 3๐‘งฬ‡ + 6√๐‘ง = 12
๐‘ง(0− ) = 1
0 + 0 + 6√๐‘ง = 12 ๐‘กโ„Ž๐‘ข๐‘ ,
๐‘ง(∞) = 4
1
2
√๐‘ง ≅ ๐‘ง +
3
3
๐‘ง 2
๐‘งฬˆ + 3๐‘งฬ‡ + 6[ + ] = 12
3 3
๐‘งฬˆ + 3๐‘งฬ‡ + 2๐‘ง = 8
2.
Consider the following Laplace transform for Z(s):
๐‘(๐‘ ) =
6๐‘  2 + 20๐‘  + 80
๐‘ [๐‘  2 + 12๐‘  + 40]
(a) Use the final value theorem (FVT) to compute the final value of z(t).
80
๐‘ ๐‘(๐‘ )๐‘ =0 =
=2
40
(b) Use the initial value theorem (IVT) to compute the value of z(t) at t = 0+.
๐‘ ๐‘(๐‘ )๐‘ =∞ = 6
42
(c) What are the poles of Z(s) which are the roots of the denominator polynomial?
๐‘  = 0, − 6 + ๐‘—2, − 6 − ๐‘—2
3. The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐ป1 (0− ) = 3
๐‘„ − 40๐ปฬ‡2 = 0
๐ป2 (0− ) = 5
๐ป1 − ๐ป2 = 250๐‘„ฬ‡
๐‘„(0− ) = 0
H1
H2
Q
(a) Laplace transform each of these three equations.
−๐‘„ − 20[๐‘ ๐ป1 (๐‘ ) − 3] = 0
๐‘„ − 40[๐‘ ๐ป2 − 5] = 0
๐ป1 − ๐ป2 = 250[๐‘ ๐‘„(๐‘ ) − 0]
(b) Reduce the equations down to two equations with unknowns H1(s) and H2(s) .
๐ป1 − ๐ป2
๐‘„=
250๐‘ 
Thus,
−
๐ป1 − ๐ป2
− 20[๐‘ ๐ป1 (๐‘ ) − 3] = 0
250๐‘ 
๐ป1 − ๐ป2
− 40[๐‘ ๐ป2 − 5] = 0
250๐‘ 
(c) Reduce the equations down to one equation for the unknown H1(s).
๐ป2 = [5,000๐‘  2 + 1]๐ป1 + 15,000๐‘ 
Thus,
๐ป1 =
1.5๐‘ฅ108 ๐‘  2 + 65,000
๐‘ (5๐‘ฅ107 ๐‘  2 + 15,000)
(d) Use the final value theorem to determine the final value of H1. Does this value make sense?
65,000
๐‘ ๐ป1 (๐‘ )๐‘ =0 =
= 4.333
15,000
43
Since the initial water height in this tank was 3 and the other 5, a final value between 3 and 5 makes
sense. However, since the poles of H1(s) are complex with zero real part, the H 1 will not converge to a
constant but oscillate forever. You can’t use the final value theorem in such cases.
(e) Use the initial value theorem to check the initial value. Is it correct?
๐‘ ๐ป1 (๐‘ )๐‘ =∞ =
1.5๐‘ฅ108
5๐‘ฅ107
= 3 which is the correct value.
5.22
1. The differential equations for the suspension shown below with input displacement u(t) are
๐‘งฬˆ + 10๐‘งฬ‡ + 100๐‘ง = 10๐‘คฬ‡ + 100๐‘ค
๐‘คฬ‡ + 40๐‘ค = ๐‘งฬ‡ + 10๐‘ง + 30๐‘ข
(a) Assume all initial conditions are zero and convert the equations above to Laplace domain.
Z
W
U
(๐‘  2 + 10๐‘  + 100)๐‘ = (10๐‘  + 100)๐‘Š
(๐‘  + 40)๐‘Š = (๐‘  + 10)๐‘ + 30๐‘ˆ
(b) Demonstrate that if you solve for W(s) in the first equation and then substitute this expression
for W(s) into the 2nd equation, when you solve for Z(s) you get
๐‘(๐‘ ) = [
๐‘ 3
3000 + 300๐‘ 
] ๐‘ˆ(๐‘ )
+ 40๐‘  2 + 300๐‘  + 3000
๐‘  2 + 10๐‘  + 100
(๐‘  + 40) (
) ๐‘ = (๐‘  + 10)๐‘ + 30๐‘ˆ
10๐‘  + 100
(๐‘  + 40)(๐‘  2 + 10๐‘  + 100) = (10๐‘  + 100)(๐‘  + 10)๐‘ + 30(10๐‘  + 100)๐‘ˆ
(๐‘  3 + 50๐‘  2 + 500๐‘  + 4000 − 10๐‘  2 − 200๐‘  − 1000)๐‘ = (300๐‘  + 3000)๐‘ˆ
3000 + 300๐‘ 
๐‘(๐‘ ) = [ 3
] ๐‘ˆ(๐‘ )
๐‘  + 40๐‘  2 + 300๐‘  + 3000
(c) What is the transfer function for this system?
[
3000 + 300๐‘ 
]
๐‘  3 + 40๐‘  2 + 300๐‘  + 3000
(d) Consider the following MATLAB command and results:
>> roots([1 40 300 3000])
ans =
-33.7442
-3.1279 + 8.8950i
-3.1279 - 8.8950i
44
What are the eigenvalues of this system?
-33.7442
-3.1279 + 8.8950i
-3.1279 - 8.8950i
(e) (8%) What are the time constants of this system?
1/33.7442 = 0.0296 and 1/3.1279 = 0.3197
(f) If the input u(t) is a unit step, the general form of the equation for z(t) can be shown to be
๐‘ง(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘๐‘’ −๐‘‘๐‘ก + ๐‘“๐‘’ −๐‘”๐‘ก sin (โ„Ž๐‘ก + ∅)
๐‘(๐‘ ) = [
What are
b=0
d = 33.7442
๐‘ 3
3000 + 300๐‘ 
1
]
2
+ 40๐‘  + 300๐‘  + 3000 ๐‘ 
g = 3.1279
h = 8.8950
(g) What is the final value of z(t) and how long will it take to get within 1% of this value?
Final Value = sZ(s)s=0 = 3000/3000 = 1
Time required ≅ 5*0.3197 =1.6 sec
2. Use the residue theorem to solve the following differential equation for y(t).
22๐‘ฆฬ‡ + 44๐‘ฆ = 88
๐‘ฆ(0− ) = 5
22(๐‘ ๐‘Œ๐‘ ) − 5) + 44๐‘Œ(๐‘ ) = 88/๐‘ 
๐‘Œ(๐‘ ) =
5๐‘  + 4
๐‘ (๐‘  + 2)
๐‘ฆ(๐‘ก) = 2 + 3๐‘’ −2๐‘ก
3. Use separation of variables to solve the differential equation in problem 2.
๐‘ฆ(๐‘ก)
๐‘ก
๐‘‘๐‘ฆ
∫
= − ∫ ๐‘‘๐‘ก
๐‘ฆ(0) 2๐‘ฆ − 4
0
๐‘™๐‘› [
2๐‘ฆ(๐‘ก) − 4
] = −2๐‘ก
2๐‘ฆ(0) − 4
2๐‘ฆ(๐‘ก) − 4
= ๐‘’ −2๐‘ก
2๐‘ฆ(0) − 4
๐‘ฆ(๐‘ก) = 2 + 3๐‘’ −2๐‘ก
5.23
1. Find the magnitude and angle of the following complex numbers:
45
+4
+4
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐‘ก๐‘Ž๐‘›−1 ( ) =
(a) 4 + j4 Magnitue= √42 + 42 = √32 = 5.66
(b) -4 + j4 Magnitude= √42 + 42 = √32 = 5.66
(c)-4 – j4 Magnitude= √42 + 42 = √32 = 5.66
(d)4 - j4
+4
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐‘ก๐‘Ž๐‘›−1 (−4) =
−4
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐‘ก๐‘Ž๐‘›−1 (−4) =
Magnitude=√42 + 42 = √32 = 5.66
(4+๐‘—4)(−4+๐‘—4)
(๐‘’)
4−๐‘—4
๐œ‹
4
3๐œ‹
4
5๐œ‹
4
−4
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐‘ก๐‘Ž๐‘›−1 (+4) =
Magnitude= 5.66*5.66/5.66 = 5.66 ๐‘Ž๐‘›๐‘”๐‘™๐‘’ =
๐œ‹
4
3๐œ‹
+ 4
−
7๐œ‹
4
=
7๐œ‹
3๐œ‹
− 4
4
2. For the differential equation below,
2๐‘งฬˆ + 24๐‘งฬ‡ + 40๐‘ง = 20๐‘ข
๐‘ง(0− ) = 0.5
(a) Solve for the Laplace transform of z(t), Z(s).
๐‘งฬ‡ (0− ) = 3
2[๐‘  2 ๐‘(๐‘ ) − 0.5๐‘  − 3] + 24[๐‘ ๐‘(๐‘ ) − 0.5] + 40๐‘(๐‘ ) = 20
๐‘(๐‘ ) =
๐‘ข(๐‘ก) = 5
5
๐‘ 
0.5๐‘  2 + 9๐‘  + 50
๐‘ (๐‘  2 + 12๐‘  + 20)
(b)Check your Z(s) to see if it gives the correct initial value using the initial value theorem.
๐‘ ๐‘(๐‘ )๐‘ =∞ = 0.5 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘ 
(c)Check your Z(s) to see if it gives the correct final value using the final value theorem.
50
๐‘ ๐‘(๐‘ )๐‘ =0 =
= 2.5 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘  ๐‘ค๐‘–๐‘กโ„Ž ๐‘œ๐‘Ÿ๐‘–๐‘”๐‘–๐‘›๐‘Ž๐‘™ ๐‘‘๐‘–๐‘“๐‘“. ๐‘’๐‘ž๐‘› ๐‘ค๐‘–๐‘กโ„Ž ๐‘‘๐‘’๐‘Ÿ๐‘–๐‘ฃ๐‘Ž๐‘ก๐‘–๐‘ฃ๐‘’๐‘  = 0
20
IVT: limit sF(s)s=∞ FVT: limit sF(s)s=0
๐ฟ{๐‘“} = ๐น(๐‘ )
๐ฟ{๐‘“ฬ‡} = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ{๐‘“ฬˆ} = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡ (0− )
3. (a) Find the inverse Laplace transform of Y(s) below.
๐‘Œ(๐‘ ) =
32
๐‘ [(๐‘  + 4)2 + 42 ]
32๐‘’ ๐‘ ๐‘ก
1 32
32
+ | |
๐‘’ −4๐‘ก sin [4๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’( )๐‘ =−4+๐‘—4 ]
}
2
2
[(๐‘  + 4) + 4 ] ๐‘ =0 4 ๐‘  ๐‘ =−4+๐‘—4
๐‘ 
1 32 −4๐‘ก
3๐œ‹
3๐œ‹
=1+
๐‘’ sin (4๐‘ก − ) = 1 + √2๐‘’ −4๐‘ก sin (4๐‘ก − )
4 √32
4
4
(b) Plug t = 0 into your equation for y(t) and see if it gives the same value as the IVT.
๐‘ฆ(0) = 1 − 1 = 0 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘  ๐‘ค๐‘–๐‘กโ„Ž ๐ผ๐‘‰๐‘‡
Plug t=∞ into your equation for y(t) and see if it gives the same value as the FVT.
๐‘ฆ(∞) = 1 − 0 = 1 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘  ๐‘ค๐‘–๐‘กโ„Ž ๐น๐‘‰๐‘‡
๐‘ฆ(๐‘ก) = {
46
5.24
1. Parts (a) and (b) of this problem are the Key Assignment. Consider the following differential
equation for y(t).
2๐‘ฆฬ‡ + 5๐‘ฆ = 25
๐‘ฆ(0− ) = 6
(a) Use the Laplace transform and the residue theorem to solve this differential equation for y(t).
(b)
2(๐‘ ๐‘Œ − 6) + 5๐‘Œ = 25/๐‘ 
6๐‘  + 12.5
๐‘Œ(๐‘ ) =
๐‘ (๐‘  + 2.5)
๐‘ฆ(๐‘ก) = 5 + ๐‘’ −2.5๐‘ก
(c)
Check your equation for y(t) at t = 0 and at t = ∞. Does your equation give the correct values at
t = 0 and at t = ∞?
๐‘ฆ(๐‘ก)๐‘ก=0 = 6
๐‘ฆ(๐‘ก)๐‘ก=∞ = 5
Thus, the equation for y(t) gives the correct initial and final values.
(d) Perform two steps of Euler's integration to get y(T) and y(2T). Use 1/10 of the time constant
for T.
Time constant is 0.4 seconds so T=0.04.
t
y(t) ๐‘ฆฬ‡ (๐‘ก) = −2.5๐‘ฆ + 12.5 ๐‘ฆ(๐‘ก + ๐‘‡) = ๐‘‡๐‘ฆฬ‡ (๐‘ก) + ๐‘ฆ(๐‘ก)
0
6
12.5-2.5*6=-2.5
0.04*(-2.5)+6=5.9
0.04 5.9 12.5-2.5*5.9=-2.25
0.04*(-2.25)+5.9=5.81
0.08 5.81
47
2. Consider the hydraulic lift system shown below. Fluid flows, Q, into the bottom of the
hydraulic cylinder. The pressure, P, increases and pushes the mass upwards with velocity ๐‘ฃ.
The model for the system is represented by the following equations :
1000๐‘ฃฬ‡ + 0.05๐‘ƒ = 9800
๐‘ƒ = 100000๐‘„
๐‘„ = 0.05๐‘ฃ
Velocity
v
Pressure
P
Flow Rate
Q
(a) We have three equations. What are the three unknowns? v, P, and Q
(b) Assuming the initial velocity is zero, Laplace transform the equations and then find a single
equation for the Laplace transform of the pressure P(s).
9800
1000๐‘ ๐‘‰ + 0.05๐‘ƒ =
๐‘ 
๐‘ƒ = 100000๐‘„
๐‘„ = 0.05๐‘‰
Solving for P gives
49000
๐‘ƒ(๐‘ ) =
๐‘ (๐‘  + 0.25)
(c) What is the final value for P(t) and how long does it take for P(t) to reach this final value
within 1 %?
49000
๐‘ ๐‘ƒ(๐‘ )๐‘ =0 = (๐‘ +0.25) = 196000
It takes about 5 time constants which is 20 seconds.
๐‘ =0
3. Express the following 3rd order differential equation in a format of three simultaneous 1st
order differential equations. All initial conditions are zero.
2๐‘งโƒ› + 16๐‘งฬˆ + 8๐‘งฬ‡ + 5๐‘ง = 10
๐‘ฅ1 = ๐‘ง
๐‘ฅ2 = ๐‘งฬ‡
๐‘ฅ3 = ๐‘งฬˆ
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = ๐‘ฅ3
๐‘ฅฬ‡ 3 = 5 − 2.5๐‘ฅ1 − 4๐‘ฅ2 − 8๐‘ฅ3
4. Consider the Laplace transform W(s) shown below. Pretend that W(s) is a transfer function
with the input being a unit impulse. What are the MATLAB commands for getting a plot of
w(t) using the 'impulse' command in MATLAB?
2๐‘  + 4
๐‘Š(๐‘ ) = 2
3๐‘  + 20๐‘  + 5
48
>> w=tf([2 4],[3 20 5]);
>> impulse(w)
5.25
1. Use Laplace transform to solve the following differential equations for z(t):
๐‘ง(0− ) = 4
(a) ๐‘งฬ‡ + 25๐‘ง = 2๐‘ขฬ‡ + 15๐‘ข
The input u(t) is a step with magnitude 5.
๐‘ ๐‘(๐‘ ) − 4 + 25๐‘(๐‘ ) = (2๐‘  + 15)
๐‘(๐‘ ) =
๐Ÿ“
๐ฌ
14๐‘  + 75
๐‘ (๐‘  + 25)
๐‘ง(๐‘ก) = 3 + 11๐‘’ −25๐‘ก
(b) What are MATLAB commands to get a plot of z(t) in part (a) using the ‘impulse’ command.
>> z=tf([14 75],[1 25 0]);
>> impulse(z)
(c) ๐‘งฬˆ + 6๐‘งฬ‡ + 25๐‘ง = 50๐‘ข(๐‘ก) ๐‘ง(0− ) = 1 ๐‘งฬ‡ (0− ) = 0 The input u(t) is a unit impulse.
(๐‘  2 ๐‘(๐‘ ) − 1๐‘ ) + 6(๐‘ ๐‘(๐‘ ) − 1) + 25๐‘(๐‘ ) = 50(๐Ÿ)
๐‘(๐‘ ) =
๐‘  + 56
(๐‘  + 3)2 + 42
1
๐‘ง(๐‘ก) = |๐‘  + 56|๐‘ =−3+๐‘—4 ๐‘’ −3๐‘ก sin (4๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’(๐‘  + 56)๐‘ =−3+๐‘—4 )
4
๐‘ง(๐‘ก) = 13.29๐‘’ −3๐‘ก sin (4๐‘ก + 0.0753)
๐ฟ๐‘Ž๐‘. [๐‘“(๐‘ก)] = ๐น(๐‘ )
๐ฟ๐‘Ž๐‘. [ ๐‘“ฬ‡ (๐‘ก)] = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
1 ๐‘(๐‘ )
|
|
๐‘’ −๐‘Ÿ๐‘ก sin(๐œ”๐‘ก + ๐œ‘)
๐œ” ๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
๐ฟ๐‘Ž๐‘. [๐‘“ฬˆ (๐‘ก)] = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡(0− )
๐‘(๐‘ )
)
๐œ‘ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
2. A vehicle suspension system is defined by the following differential equations with input u(t):
100๐‘คฬˆ + 600๐‘คฬ‡ + 2500๐‘ค = 600๐‘ฃฬ‡ + 2500๐‘ฃ
200๐‘ฃฬˆ + 900๐‘ฃฬ‡ + 5000๐‘ฃ = 600๐‘คฬ‡ + 2500๐‘ค + 300๐‘ขฬ‡ + 2500๐‘ข
๐‘คฬˆ + 6๐‘คฬ‡ + 25๐‘ค = 6๐‘ฃฬ‡ + 25๐‘ฃ
๐‘ฃฬˆ + 4.5๐‘ฃฬ‡ + 25๐‘ฃ = 3๐‘คฬ‡ + 12.5๐‘ค + 1.5๐‘ขฬ‡ + 12.5๐‘ข
(a) Define state variables and then find the equations for the derivatives of the state variables.
๐‘ฅ1 = ๐‘ค
๐‘ฅ2 = ๐‘คฬ‡
๐‘ฅ3 = ๐‘ฃ
๐‘ฅ4 = ๐‘ฃฬ‡ − 1.5๐‘ข
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −25๐‘ฅ1 − 6๐‘ฅ2 + 25๐‘ฅ3 + 6๐‘ฅ4 + 9๐‘ข
49
๐‘ฅฬ‡ 3 = ๐‘ฅ4 + 1.5๐‘ข
๐‘ฅฬ‡ 4 = 12.5๐‘ฅ1 + 3๐‘ฅ2 − 25๐‘ฅ3 − 4.5๐‘ฅ4 + 5.75๐‘ข
(b) Express your state variable derivative equations from (a) in state variable matrix format
assuming the output of interest is y = u - v, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
๐ด =?
๐ต =?
๐ถ =?
๐ท =?
0
0
1
0 0
−25
−6
25
6
๐ด=[
] ๐ต = [ 9 ] ๐ถ = [0 0
0
0
0
1
1.5
12.5 3 −25 −4.5
5.75
3. Consider the following non-linear differential equation for v(t):
๐‘ฃฬˆ + 84๐‘ฃฬ‡ + 300๐‘ฃ 3 = 2400
−1 0] ๐ท = [1]
๐‘ฃ(0− ) = 1.9 ๐‘ฃฬ‡ (0− ) = 2
(a) What is the equilibrium (final value) of v(t)?
0 + 0 + 300๐‘ฃ 3 = 2400 ๐‘กโ„Ž๐‘ข๐‘  ๐‘ฃ(∞) = 2
(b) Find a straight line approximation for ๐‘ฃ 3 for values of ๐‘ฃ in the neighborhood of the
equilibrium value.
๐‘ฃ 3 ≈ 23 + 3(2)2 (๐‘ฃ − 2) = 12๐‘ฃ − 16
(c) Substitute you straight line equation for ๐‘ฃ 3 in the original differential equation to obtain a
linear differential equation.
๐‘ฃฬˆ + 84๐‘ฃฬ‡ + 300(12๐‘ฃ − 16) = 2400
๐‘ฃฬˆ + 84๐‘ฃฬ‡ + 3600๐‘ฃ = 7200
(d) The equilibrium value of your linear differential equation should be the same as the
equilibrium value for the original differential equation. Is this the case?
7200
= 2 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘ 
3600
(e) What are the eigenvalues of your linearized differential equation? Time constants?
๐‘ฃ=
๐‘  2 + 84๐‘  + 3600 = (๐‘  + 42 + ๐‘—42.85)(๐‘  + 42 − ๐‘—42.85)
๐‘’๐‘–๐‘”๐‘’๐‘›๐‘ฃ๐‘Ž๐‘™๐‘ข๐‘’๐‘  = −42 ± ๐‘—42.85
๐‘ก๐‘–๐‘š๐‘’ ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก =
1
= 0.0238 ๐‘ ๐‘’๐‘๐‘œ๐‘›๐‘‘๐‘ 
42
5.26
1. Use Laplace transform to solve the following differential equations for z(t):
(a) 2๐‘งฬ‡ + 10๐‘ง = 4๐‘ขฬ‡ + 20๐‘ข ๐‘ง(0− ) = 3
The input u(t) is a step with magnitude 2.
2[๐‘ ๐‘ − 3] + 10๐‘ = [4๐‘  + 20]๐‘ˆ
50
2
14๐‘  + 40
(2๐‘  + 10)๐‘ = (4๐‘  + 20) + 6 =
๐‘ 
๐‘ 
7๐‘  + 20
๐‘(๐‘ ) =
๐‘ (๐‘  + 5)
๐‘ง(๐‘ก) = ๐‘…๐‘’๐‘ ๐‘–๐‘‘๐‘ข๐‘’ ๐‘“๐‘œ๐‘Ÿ ๐‘  = 0 + ๐‘…๐‘’๐‘ ๐‘–๐‘‘๐‘ข๐‘’ ๐‘“๐‘œ๐‘Ÿ ๐‘  = −5
๐‘ง(๐‘ก) = 4 + 3๐‘’ −5๐‘ก
Checking z(t) at t = ∞ gives the correct value of 4.
However, the t = 0+ value of z is different
from the t = 0- value due to the impulse created by ๐‘ขฬ‡ .
(b) 10๐‘งฬˆ + 60๐‘งฬ‡ + 250๐‘ง = 24๐‘ข(๐‘ก) ๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 0 The input u(t) is a unit impulse.
(10๐‘  2 + 60๐‘  + 250)๐‘ = 24
2.4
๐‘(๐‘ ) =
(๐‘  + 3)2 + 42
1
๐‘ง(๐‘ก) = |2.4 + ๐‘—0|๐‘’ −3๐‘ก sin[4๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’(2.4 + ๐‘—0)] = 0.6๐‘’ −3๐‘ก sin (4๐‘ก)
4
The t = ∞ value of z and the t = 0- value check; note, we have the impulse input in the equation
for ๐‘งฬˆ which changes the initial value of ๐‘งฬ‡ but not the initial value of ๐‘ง.
2. A vehicle suspension system is defined by the following differential equations with input u(t):
100๐‘คฬˆ + 600๐‘คฬ‡ + 2500๐‘ค = 600๐‘ฃฬ‡ + 2500๐‘ฃ
200๐‘ฃฬˆ + 900๐‘ฃฬ‡ + 5000๐‘ฃ = 600๐‘คฬ‡ + 2500๐‘ค + 300๐‘ขฬ‡ + 2500๐‘ข
(a) Express this system of equations in state variable format.
๐‘คฬˆ + 6๐‘คฬ‡ + 25๐‘ค = 6๐‘ฃฬ‡ + 25๐‘ฃ
๐‘ฃฬˆ + 4.5๐‘ฃฬ‡ + 25๐‘ฃ = 3๐‘คฬ‡ + 12.5๐‘ค + 1.5๐‘ขฬ‡ + 12.5๐‘ข
๐‘ฅ1 = ๐‘ค ๐‘ฅ2 = ๐‘คฬ‡
๐‘ฅ3 = ๐‘ฃ
๐‘ฅ4 = ๐‘ฃฬ‡ − 1.5๐‘ข
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −25๐‘ฅ1 − 6 ๐‘ฅ2 + 25๐‘ฅ3 + 6๐‘ฅ4 + 9๐‘ข
๐‘ฅฬ‡ 3 = ๐‘ฅ4 + 1.5๐‘ข
๐‘ฅฬ‡ 4 = 12.5๐‘ฅ1 + 3๐‘ฅ2 − 25๐‘ฅ3 − 4.5๐‘ฅ4 + 5.75๐‘ข
(b) Express your state variable equations from (a) in state variable matrix format assuming the
output of interest is y = v - w, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =?
0
0
1
0 0
25 6 ]
๐ด = [−25 −6
๐ต=[ 9 ]
๐ถ = [−1 0 1 0]
๐ท = [0]
0
0
0
1
1.5
12.5 3 −25 −4.5
5.75
3. Consider the following non-linear differential equation for v(t):
๐‘ฃฬˆ + 2.4๐‘ฃฬ‡ + 3๐‘ฃ 3 = 3000
๐‘ฃ(0− ) = 10.01 ๐‘ฃฬ‡ (0− ) = 2
(a) What is the equilibrium (final value) of v(t)?
0 + 0 + 3๐‘ฃ 3 = 1000
๐‘ฃ(∞) = 10
(b) Find a straight line approximation for ๐‘ฃ 3 for values of ๐‘ฃ in the neighborhood of the
equilibrium value.
๐‘ฃ 3 ≈ 103 + 3(102 )(๐‘ฃ − 10) = 300๐‘ฃ − 2000
51
(c) Substitute you straight line equation for ๐‘ฃ 3 in the original differential equation to obtain a
linear differential equation.
๐‘ฃฬˆ + 2.4๐‘ฃฬ‡ + 3(300๐‘ฃ − 2000) = 3000
๐‘ฃฬˆ + 2.4๐‘ฃฬ‡ + 900๐‘ฃ = 9000
(d) The equilibrium value of your linear differential equation should be the same as the
equilibrium value for the original differential equation. Is this the case?
0 + 0 + 900๐‘ฃ = 9000
๐‘ฃ(∞) = 10
๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘ 
(e) What are the eigenvalues of your linearized differential equation? Time constants?
๐‘’๐‘–๐‘”๐‘’๐‘›๐‘ฃ๐‘Ž๐‘™๐‘ข๐‘’๐‘  = −1.2 ± ๐‘—29.98
1
๐‘ก๐‘–๐‘š๐‘’ ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก =
= 0.833
1.2
5.27 After Laplace transforming a differential equation for y(t) with input u(t), the following
result was achieved:
๐‘ 2 +11๐‘ +30
๐‘Œ(๐‘ ) = [(๐‘ +2)[(๐‘ +3)2+42 ]] ๐‘ˆ(๐‘ )
๐‘ 2 +11๐‘ +30
(a) What is the transfer function for this system? [(๐‘ +2)[(๐‘ +3)2+42 ]]
(b) What are the eigenvalues of this system? -2, -3-j4, -3+j4
(c) What are the time constants for this system? ½ and 1/3
(d)What is the damping ratio of this system? 0.6
(e) What is the damped natural frequency of this system? 4
(f) What is the undamped natural frequency of this system? 5
(g) Suppose u(t) is a unit step input. It can be shown that y(t) will be of the form
๐‘ฆ(๐‘ก) = ๐ถ1 ๐‘’ −๐‘Ÿ1๐‘ก + ๐ถ2 ๐‘’ −๐‘Ÿ2๐‘ก + ๐ถ3 ๐‘’ −๐‘Ÿ3๐‘ก ๐‘ ๐‘–๐‘›( ๐œ”๐‘ก + ๐œ‘)
What are the following:
๐‘Ÿ1 =? 0 ๐‘Ÿ2 =? 2
๐‘Ÿ3 =? 3 ๐œ” =? 4
(h) What will be the final value of y(t), i.e. y(∞)? 0.6
5.28 For the differential equation given below, obtain a straight line approximation for ๐‘ฅ 3 and
use it to obtain an approximation for the eigenvalues.
2๐‘ฅฬˆ + 8๐‘ฅฬ‡ + 20๐‘ฅ 3 = 160
๐‘ฅ(0− ) = 1 ๐‘ฅฬ‡ (0− ) = 0
The initial condition is 1 and the final value is 2. So we need a straight line approximation for
๐‘ฅ 3 using the two points x = 1 and x = 2. ๐‘ฅ 3 ≈ 7๐‘ฅ − 6
Using this approximation for ๐‘ฅ 3 in the differential equation gives
๐‘ฅฬˆ + 4๐‘ฅฬ‡ + 70๐‘ฅ = 140
52
The eigenvalues are −2 ± ๐‘—8.12
5.29 (a) What are the eigenvalues of the suspension system shown below? What is the damping
ratio? What is the undamped natural frequency?
z
M=10
K=90
y
10๐‘งฬˆ + 90๐‘ง = 90๐‘ฆ
Eigenvalues = 0 ± ๐‘—3, damping ratio = 0, undamped natural frequency = 3
(b) It is desired to add a shock absorber (or viscous damper) as shown below so as to improve
the ride quality of the suspension for bumps in the road. Derive a value for the damping
coefficient b that will give an eigenvalue damping ratio of 0.707.
10๐‘งฬˆ + ๐‘๐‘งฬ‡ + 90๐‘ง = ๐‘๐‘ฆฬ‡ + 90๐‘ฆ
M=10
K=90
b=?
Bump
b= 50.904 gives a damping ratio of 0.707.
5.30 A system is expressed in the following transfer function format:
2(๐‘  + 2)(๐‘  + 8)
]๐‘ˆ(๐‘ )
(๐‘  + 10)(๐‘  + 20)(๐‘  2 + 10๐‘  + 925)(๐‘  2 + 24๐‘  + 2644)
๐‘(๐‘ ) = [
(a) What are the eigenvalues of this system? Note, check you work since the rest of this
problem depends on you getting this part correct! -10, -20, -5-j30, -5+j30, -12+j50,-12-j50
(b) Is this system stable? Explain how you know? Yes, all eigenvalues have negative real
parts.
53
(c)What are the time constants of this system? 1/10, 1/20, 1/5, and 1/12
(d)What are the damping ratios, damped natural frequencies, and undamped natural frequencies
of this system? Damping ratios 0.164 and 0.233
Damped natural frequencies = 30 and 50. Undamped natural frequencies = 30.41 and 51.42.
(e) We know that if the input u(t) is a step input at time t=0, then z(t) will be of the following
form:
๐‘ง(๐‘ก) = ๐ถ1 ๐‘’ −๐‘Ÿ1๐‘ก + ๐ถ2 ๐‘’ −๐‘Ÿ2๐‘ก + ๐ถ3 ๐‘’ −๐‘Ÿ3๐‘ก + ๐ถ4 ๐‘’ −๐‘Ÿ4๐‘ก ๐‘ ๐‘–๐‘›( ๐œ”1 ๐‘ก + ๐œ‘1 ) + ๐ถ5 ๐‘’ −๐‘Ÿ5๐‘ก ๐‘ ๐‘–๐‘›( ๐œ”2 ๐‘ก + ๐œ‘2 )
What are each of the following:
๐‘Ÿ1 = 0
๐‘Ÿ2 = 10
๐‘Ÿ3 = 20
๐‘Ÿ4 = 5
๐‘Ÿ5 = 12
๐œ”1 = 30
๐œ”2 = 50
54
5.31 The equations for a water tank are as follows:
๐‘„๐‘– − ๐‘„๐‘œ − 5๐ปฬ‡ = 0
๐‘„๐‘œ = 10√๐ป
−
Assume ๐‘„๐‘– = 0 and ๐ป(0 ) = 4.
Estimate how long it will take for the tank to drain by obtaining a straight line approximation for
√๐ป and then getting an estimate for the time constant of the draining tank.
Qi
H
Qo
The water height goes from 4 to 0; so, we need a straight line approximation based on two
points. √๐ป ≈ 0.5๐ป + 0. Using this approximation and combining the equations gives
๐ปฬ‡ + ๐ป = 0 Thus, the time constant is 1 sec. So, it will take approximately 5 seconds to drain
the tank.
5.32 Express the following differential equation in state variable matrix form; the output of
interest is y=z-u.
๐‘งฬˆ + 8๐‘งฬ‡ + 16๐‘ง = 25๐‘ขฬ‡ + 32๐‘ข
Using the phase variable method:
๐‘ฅฬ‡
0
1 ๐‘ฅ1
0
[ 1] = [
][ ] + [ ]๐‘ข
๐‘ฅฬ‡ 2
−16 −8 ๐‘ฅ2
1
๐‘ฅ1
๐‘ฆ = [32 8] [๐‘ฅ ] + [−1]๐‘ข
2
55
5.33 The equations for an inverted pendulum are shown below. The force Fi is used to stabilize
the mass Ms in the vertical position. Assuming small angles, the differential equations for this
system are
๐œƒฬˆ + 0.5๐‘งฬˆ − 4.9๐œƒ = 0
๐‘งฬˆ + 0.18๐œƒฬˆ + 0.09๐น๐‘– = 0
And the differential equation for the feedback controller is
๐น๐‘–ฬ‡ + 8๐น๐‘– = −149.6[๐œƒฬ‡ + 6๐œƒ]
Ms
๏ฑ
L
z
Mc
Fi
Prove mathematically that without the controller, this system is unstable.
Setting Fi to zero and introducing the D operator and combining the equations gives the
following characteristic equation:
๐ท2 − 0.09๐ท − 4.9 = 0
Thus, without Fi, the eigenvalues are +0.045±๐‘—2.2. Since the real part is positive, the system is
unstable which means the pendulum will fall from a vertical position without the control Fi.
56
5.34 The differential equation for the roll angle,๐œƒ, of a ship resulting from wave and wind
disturbances, Td, is shown below
๏ฑ
๐œƒฬˆ + 1.8๐œƒฬ‡ + 9๐œƒ = 10−6 ๐‘‡๐‘‘
(a) Assume that the torque disturbance ๐‘‡๐‘‘ is a sine wave, i.e.
๐‘‡๐‘‘ = 5000 ๐‘ ๐‘–๐‘›( 1.5๐‘ก)
The roll angle ๐œƒ of the ship will also be a sine wave. What will be the steady state amplitude and
frequency of ๐œƒ(๐‘ก)? Amplitude = 0.0006877 and frequency = 1.5 rad/sec
10−6
The transfer function for ๐œƒ is defined by ๐œƒ(๐‘ ) = [๐‘ 2 +1.8๐‘ +9] ๐‘‡๐‘‘ (s). At steady state
10−6
๐œƒ(๐‘ก) = 5000 |๐‘ 2 +1.8๐‘ +9|
๐‘ =๐‘—1.5
sin(1.5๐‘ก + ∅) = 0.00068776sin (1.5๐‘ก − 0.38051)
5.35 The transfer function relating ๐‘(๐‘ ) to the input ๐‘ˆ(๐‘ ) is given below.
๐‘ +5
๐‘ +5
9
๐‘(๐‘ ) = [๐‘ 2 +30๐‘ +200] ๐‘ˆ(๐‘ ) = [(๐‘ +10)(๐‘ +20)] ๐‘ 2 +0๐‘ +9
9
Assume that the input u(t) is a sine wave, that is ๐‘ˆ(๐‘ ) = ๐‘ 2 +9.
It can be shown that the inverse Laplace transform of ๐‘(๐‘ ) is of the form
๐‘ง(๐‘ก) = ๐ถ1 ๐‘’ −๐‘Ÿ1๐‘ก + ๐ถ2 ๐‘’ −๐‘Ÿ2๐‘ก + ๐ถ3 ๐‘’ −๐‘Ÿ3๐‘ก ๐‘ ๐‘–๐‘›( ๐œ”๐‘ก + ๐œ‘)
Fill in the following table:
๐ถ1
r1
(−10 + 5)9
(−10 + 20)(100 + 9)
= −0.04128
10
๐‘Ÿ2
(−20 + 5)9
(−20 + 10)(400 + 9)
= 0.033
20
๐‘Ÿ3
0
๐œ”
3
๐ถ2
5.36 The transfer function for the output of a system is shown below; R is the input and N(s) is a
rational polynomial such as as2+bs+c, etc.
57
๐‘Œ(๐‘ ) = [
(๐‘  + 2)[(๐‘  +
4)2
๐‘(๐‘ )
] ๐‘…(๐‘ )
+ 32 ][(๐‘  + 100)2 + 1002 ]
(a)What are the eigenvalues? -2, -4+j3, -4-j3, -100+j100, -100-j100
(b)What are the time constants? ½, ¼, and 1/100
(c) What are the damping ratios? 0.8 and 0.707
(d)What are the damped natural frequencies? 3 and 100
(e) If the input is a step, write the general form of the inverse Laplace of Y(s). Be as specific as
possible.
๐‘ฆ(๐‘ก) = [
N ( s )e st
]
( s + 2)[( s + 4) 2 + 3 2 ][( s + 100 ) 2 + 100 2 ]
๐‘ =0
st
+[
N ( s )e
]๐‘ =−2
s[( s + 4) + 3 2 ][(s + 100 ) 2 + 100 2 ]
2
1
N ( s)
+ |
|
4 s( s + 2)[(s + 100 ) 2 + 100 2 ]
๐‘’ −3๐‘ก sin(3๐‘ก + ∅)
๐‘ =−4+๐‘—3
+
1
N ( s)
|
|
100 s(s + 2)[(s + 4) 2 + 32 ]
๐‘’ −100๐‘ก sin (100๐‘ก + ๐œƒ)
๐‘ =−100+๐‘—100
5.37 After Laplace transforming a differential equation for z(t) with input r(t), the following
result was achieved:
15๐‘ +680
๐‘(๐‘ ) = [(๐‘ +4)[(๐‘ +2)2+82]] ๐‘…(๐‘ )
15๐‘ +680
(a) What is the transfer function for this system? [(๐‘ +4)[(๐‘ +2)2+82]]
(b) What are the eigenvalues of this system? -4, -2-j8, -2+j8
(c) What are the time constants for this system? ¼ and ½
(d) What is the damping ratio of this system? 0.2425
(e) What is the damped natural frequency of this system? 8
(f) What is the undamped natural frequency, ๐œ”๐‘› , of this system? √68 = 8.2462
(g) (Suppose r(t) is a unit step input. It can be shown that z(t) will be of the form
๐‘ง(๐‘ก) = ๐ถ1 ๐‘’ −๐‘Ÿ1๐‘ก + ๐ถ2 ๐‘’ −๐‘Ÿ2๐‘ก + ๐ถ3 ๐‘’ −๐‘Ÿ3๐‘ก ๐‘ ๐‘–๐‘›( ๐œ”๐‘ก + ๐œ‘)
What are the following: ๐‘Ÿ1 =? 0 ๐‘Ÿ2 =? 4 ๐‘Ÿ3 =? 2 ๐œ” =? 8
(h)What will be the final value of z(t), i.e. z(∞)? 2.5
5.38 For the differential equation given below, obtain a straight line approximation for ๐‘ง 3 and
use it to obtain an estimate of the damping ratio and time constant of the system.
2๐‘งฬˆ + 3๐‘งฬ‡ + 5๐‘ง 3 = 40 ๐‘ง(0− ) = 2.001
๐‘งฬ‡ (0− ) = 0.1
๐‘ง 3 ≈ 8 + 12(๐‘ง − 2) = 12๐‘ง − 16
Thus, 2๐‘งฬˆ + 3๐‘งฬ‡ + 5(12๐‘ง − 16) = 40
๐‘งฬˆ + 1.5๐‘งฬ‡ + 30๐‘ง = 60 Thus, damping ratio = 0.1369
and time constant = 1/0.75 = 1.333
58
5.39
An analog controller Gc has been converted to z-transform format using the MATLAB
10๐‘ +1
commands shown below.
๐‘ˆ(๐‘ ) = ๐บ๐‘ (๐‘ )๐ธ(๐‘ ) = 100๐‘†+1 ๐ธ(๐‘ )
>> Gc=tf([10 1],[100 1]);
>> Gcd=c2d(Gc,0.001)
๐บ๐‘๐‘‘ =
Thus,
0.1๐‘ง−0.0999
๐‘ง−1
๐‘ˆ(๐‘ง) = [
0.1๐‘ง−0.0999
๐‘ง−1
] ๐ธ(๐‘ง)
What is the digital code for this controller to be used in a digital computer program?
๐‘ˆ(๐‘ง) = ๐‘ง −1 ๐‘ˆ(๐‘ง) + 0.1๐ธ(๐‘ง) − 0.0999๐‘ง −1 ๐ธ(๐‘ง)
Or,
๐‘ข๐‘˜ = ๐‘ข๐‘˜−1 + 0.1๐‘’๐‘˜ − 0.0999๐‘’๐‘˜−1
5.40 Consider the following differential equation for z:
๐‘งโƒ› + 12๐‘งฬˆ + 189๐‘งฬ‡ + 338๐‘ง = 16๐‘ขฬˆ + 32๐‘ขฬ‡ + 169๐‘ข
(a)What is the transfer function for z?
16๐‘  2 + 32๐‘  + 169
๐‘  3 + 12๐‘  2 + 189๐‘  + 338
(b)If ๐‘  3 + 12๐‘  2 + 189๐‘  + 338 = (๐‘  + 2)[(๐‘  + 5)2 + 122 ]
(b.1) What are the eigenvalues of this system? -2, -5+j12, -5-j12
(b.2) What are the time constants of this system? 1/2 and 1/5
(b.3) What is the damping ratio? 0.3846
(b.4) How long will it take for z(t) to reach its final value within 1%? 2.5 sec
(b.5) What are MATLAB commands for entering this transfer function into MATLAB?
>> G=tf([16 32 169],[1 12 189 338])
(b.6) If the input u is a unit step and all initial conditions are zero,
(b.6.1) What is Z(s)?
16๐‘  2 + 32๐‘  + 169
๐‘ (๐‘  3 + 12๐‘  2 + 189๐‘  + 338)
(b.6.2) What is the general format equation for z(t)? If you don’t know what ‘general format’
means, find z(t).
๐‘ง(๐‘ก) = 0.5 + ๐‘๐‘’ −2๐‘ก + ๐‘‘๐‘’ −5๐‘ก sin (12๐‘ก + ∅)
(b.6.3) What is the final value of z(t)? 0.5
59
5.41
(a) Use Laplace transform and the residue theorem to solve the following differential equation
for v(t); the input u is a unit step.
๐‘ฃ(0− ) = 3
2๐‘ฃฬˆ + 24๐‘ฃฬ‡ + 40๐‘ฃ = 16๐‘ขฬ‡ + 80๐‘ข
๐‘ฃฬ‡ (0− ) = 0
(b) What is the final value of v? Check your answer using the final value theorem.
(c) What are the MATLAB commands to get a plot of v(t) using the command ‘impulse’?
(d) Express this differential equation in state variable format; assume z is the output of
interest denoted by y below. A=? B=? C=? D=?
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
5.42
Express the following system in state variable format assuming E is the output of interest, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘…
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘…
E
R
u
4
s
+
-
s+2
s+5
w
v
+
-
z
1
s
6
The equations are:
๐‘งฬ‡ = ๐‘ฃ
๐‘ ๐‘œ ๐‘™๐‘’๐‘ก
๐‘ฅ1 = ๐‘ง
๐‘ฃ = ๐‘ค − 6๐‘ง
๐‘คฬ‡ + 5๐‘ค = ๐‘ขฬ‡ + 2๐‘ข ๐‘ ๐‘œ ๐‘™๐‘’๐‘ก ๐‘ฅ2 = ๐‘ค − ๐‘ข
๐‘ขฬ‡ = 4๐ธ
๐‘ ๐‘œ ๐‘™๐‘’๐‘ก ๐‘ฅ3 = ๐‘ข
๐ธ =๐‘…−๐‘ง
−6 1
1
๐ด = [ 0 −5 −3]
−4 0
0
0
๐ต = [0 ]
4
๐ถ = [−1 0 0]
๐ท = [1]
5.43 Consider the differential equation below.
2๐‘ฆฬˆ + 48๐‘ฆฬ‡ + 800๐‘ฆ = 60๐‘Ÿฬ‡ + 1600๐‘Ÿ
(a) If r(t) is the input, what is the transfer function for y?
(b) What is the d.c. gain of this system? ____________________
(c) What is the characteristic equation? ______________________
(d) What are the eigenvalues? ___________________________________
(e) What is the time constant? __________
60
What is the damping ratio? _____________
What is the undamped natural frequency?______________
What is the damped natural frequency? _____________
(f) If r is a step input, we know that the general form of y(t) will be
๐‘ฆ(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘“๐‘’ −๐‘‘๐‘ก sin(๐œ”๐‘ก + ๐œ‘)
b= _________
d=__________
๐œ” = __________
5.44 Consider the block diagram shown below.
(a) Express ๐บ๐‘ (๐‘ ) in state variable format (note, in this case E is the input).
(b) Express G(s) in state variable format (note, in this case U is the input).
(c) Using the results of (a) and (b) above, express the total system in matrix state
variable format; assume u(t) is the output of interest in the equation for y, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘…
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘…
A=? B=? C=? D=?
Gc (s )
R
+-
E
0.2 s + 1 U
0.02 s + 1
G (s )
2s + 3
s + 4 s + 12
V
2
61
5.45
As shown below, two water tanks with the same diameter are connected by a long pipe. Initially, before
the water is allowed to flow through the pipe, the height H1 of the water in tank #1 is greater than the
height H2 of the water in tank #2. The volume of the water in the pipe is significantly larger than the
tank volumes; thus, the inertia of the moving water in the pipe is significant.
H1
H2
d
L
Q
The equations for this system are as follows:
Equation for height of water in tank #1: −๐‘„ − 10๐ปฬ‡1 = 0
Equation for height of water in tank #2: ๐‘„ − 10๐ปฬ‡2 = 0
๐ป1 (0− ) = 10 ๐‘š
๐ป2 (0− ) = 5 ๐‘š
Equation for turbulent flow ๐‘„ through pipe: (๐ป1 − ๐ป2 ) = 50๐‘„ฬ‡ + 2๐‘„
๐‘„(0− ) = 0
๐‘š3
๐‘ 
1. (25%) Knowing the initial and final values and given that the time constant for this system is 50
seconds, draw an estimate of the graph of H1(t).
H1(t)
10
7.5
0
250
t
2. (45%) Laplace transform the equations and solve for H1(s).
−๐‘„ − 10(๐‘ ๐ป1 − 10) = 0
๐‘„ − 10(๐‘ ๐ป2 − 5) = 0
๐ป1 (๐‘ ) =
๐ป1 − ๐ป2 = 50๐‘ ๐‘„ + 2๐‘„
2500๐‘  2 + 100๐‘  + 7.5
๐‘ (250๐‘  2 + 10๐‘  + 1)
>> syms s Q H1 H2
>> Y=solve(-Q-10*(s*H1-10)==0, Q-10*(s*H2-5)==0,H1-H2==50*s*Q+2*Q ,H1,H2,Q);
>> pretty(Y.H1)
2
(1000 s + 40 s + 3) 5
----------------------2
s (250 s + 10 s + 1) 2
62
3. (30%) It can be shown that the inverse Laplace transform of the correct H1(s) is as follows
๐ป1 (๐‘ก) = 7.5 + 2.638๐‘’ −0.02๐‘ก sin (0.06๐‘ก + 1.2483)
As demonstrated in the 2nd lecture, use MATLAB to plot H1(t). What aspects of your estimated
plot and the MATLAB plot agree? What aspects do they not agree? Starting and ending values
and final time.
>> t=0:0.01:250;
>> plot(t,7.5+2.638*exp(-0.02*t).*sin(0.06*t+1.2483),'r','Linewidth',2)
>> xlabel('time, sec')
>> ylabel('height of water in tank #1, m')
>> title('homework #1 MAE3360')
Since the time constant is 50 sec., the time to equilibrium agrees with 5*50 = 250 sec. The
oscillation is caused by the inertia of the moving water in the pipe.
homework #1 MAE3360
10.5
10
height of water in tank #1, m
9.5
9
8.5
8
7.5
7
6.5
0
50
100
150
200
250
time, sec
Note, in MATLAB when multiplying two functions of time, you must use .* instead of just *
since t is a vector of time values. This is equivalent to a dot product.
63
5.46
1. Show the 4-quadrant position and then find the magnitude and angle of each of the
following complex numbers:
(a) 3+j4
๐‘€ = √32 + 42 = 5
4
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐‘ก๐‘Ž๐‘›−1 (3) = 0.9273
4
(b) -3+j4 ๐‘€ = √32 + 42 = 5
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐œ‹ − ๐‘ก๐‘Ž๐‘›−1 (3) = 2.2143
(c) -3-j4
๐‘€ = √32 + 42 = 5
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐œ‹ + ๐‘ก๐‘Ž๐‘›−1 (3) = 4.0689
(d) 3-j4
๐‘€ = √32 + 42 = 5
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = 2๐œ‹ − ๐‘ก๐‘Ž๐‘›−1 (3) = 5.3559
3+j4
x
4
4
4
-3+j4
x
3
x
-3-j4
x
3-j4
Find the magnitude and angle of the complex number A below:
(3 + ๐‘—4)(−3 + ๐‘—4)
5∗5
๐‘€=
=5
−3 − ๐‘—4
5
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = 0.9273 + 2.2143 − 4.0689 = −0.9273
2. Repeat calculations above but this time use MATLAB to do the calculations to confirm
your answers. In MATLAB, to compute the magnitude use command ‘abs’; to compute the
4-quadrant angle, use the command ‘angle’.
>> a=-3-j*4;
>> a=3-j*4;
>> a=3+j*4;
>> a=-3+j*4;
๐ด=
>> M=abs(a)
>> M=abs(a)
>> M=abs(a)
>> M=abs(a)
M=
M=
M=
M= 5
5
5
5
>> angle(a)
>> angle(a)
>> angle(a)
>> angle(a)
ans = 0.9273
ans = 2.2143
ans = -2.2143 = 4.0689
ans = -0.9273 = 5.3559
>> A=(3+j*4)*(-3+j*4)/(-3-j*4);
>> M=abs(A)
M= 5
>> angle(A)
ans = -0.9273
64
3. The 2-mass system shown below with force input Fi is defined by the following two
simultaneous differential equations:
5๐‘ฆฬˆ + 42๐‘ฆฬ‡ + 500๐‘ฆ = 90๐‘ง + 6๐‘งฬ‡
10๐‘งฬˆ + 6๐‘งฬ‡ + 90๐‘ง = 90๐‘ฆ + 6๐‘ฆฬ‡ + ๐น๐‘–
y
z
force
input
Fi
Use MATLAB to find the following:
(a) Find the transfer function relating Y(s) to the input Fi(s).
First doing it manually by Laplace transforming both equations without IC terms
since they don’t change the transfer function gives:
(5๐‘  2 + 42๐‘  + 500)๐‘Œ = (90 + 6๐‘ )๐‘
(10๐‘  2 + 6๐‘  + 90)๐‘ = (90 + 6๐‘ )๐‘Œ + ๐น๐‘–
Solving the first equation for Z
(5๐‘  2 + 42๐‘  + 500)
๐‘Œ
(90 + 6๐‘ )
and substituting the result into the 2nd equation gives
(5๐‘  2 + 42๐‘  + 500)
2
(10๐‘  + 6๐‘  + 90)
๐‘Œ = (90 + 6๐‘ )๐‘Œ + ๐น๐‘–
(90 + 6๐‘ )
Solving for Y gives
๐‘=
๐‘Œ(๐‘ ) = [
25๐‘  4
+ 225๐‘  3
3๐‘  + 45
] ๐น (๐‘ )
+ 2833๐‘  2 + 2850๐‘  + 18450 ๐‘–
Using MATLAB to check the results
>> syms s y z Fi
>> H=solve((5*s^2+42*s+500)*y==(90+6*s)*z, (10*s^2+6*s+90)*z==(90+6*s)*y+Fi, y,z);
>> pretty(H.y)
3 Fi (s + 15)
----------------------------------------4
3
2
25 s + 225 s + 2833 s + 2850 s + 18450
(b) What are the eigenvalues?
(c) What are the damped natural frequencies? Imaginary part of eigenvalue
65
(d) What are the time constants?
(e) What are the undamped natural frequencies? Magnitude of eigenvalues
(f) What is the DC gain of the transfer function? What is the meaning of the DC gain?
>> G=tf([3 45],[25 225 2833 2850 18450])
>> damp(G)
eigenvalues
Damping
Frequency
Time Constant
(rad/seconds)
(seconds)
-2.58e-01 + 2.68e+00i 9.57e-02
2.69e+00
3.88e+00
-2.58e-01 - 2.68e+00i 9.57e-02
2.69e+00
3.88e+00
-4.24e+00 + 9.15e+00i 4.21e-01
1.01e+01
2.36e-01
-4.24e+00 - 9.15e+00i 4.21e-01
1.01e+01
2.36e-01
>> dcgain(G)
ans = 0.0024
If the input is a constant C, then the final value of the output will be (DC gain)*C.
5.47
The equations for an inverted pendulum are shown below. The force Fi is used to move the cart
in order to keep the pendulum mass vertical. The pendulum angle ๐œƒ is continuously measured
and used to generate the force Fi on the cart. Assuming small angles, the differential equations
for the pendulum and cart are
๐œƒฬˆ + 0.5๐‘งฬˆ − 4.9๐œƒ = 0
๐‘งฬˆ + 0.18๐œƒฬˆ + 0.09๐น๐‘– = 0
And the differential equation for the force Fi is
๐น๐‘–ฬ‡ + 8๐น๐‘– = −149.6[๐œƒฬ‡ + 6๐œƒ]
Ms
๏ฑ
L
z
Mc
Fi
(a) What are the unknowns in these three equations? ๐œƒ, ๐‘ง, ๐น๐‘–
66
(b) Find the Laplace transform for the pendulum angle assuming all initial conditions are
zero except the initial pendulum angle ๐œƒ(0− ) = 0.1 ๐‘Ÿ๐‘Ž๐‘‘. Note, there is no external input
to this system so there is no transfer function.
>> syms s T z Fi
>> H=solve((s^2-4.9)*T-0.1*s+0.5*s^2*z==0, s^2*z+0.18*(s^2*T-0.1*s)+0.09*Fi==0,…
(s+8)*Fi==-149.6*(s*T-0.1+6*T),Fi,T,z)
>> pretty(H.T)
2
(455.0 s + 3640.0 s + 3366.0) 0.1
-------------------------------------3
2
455.0 s + 3640.0 s + 916.0 s + 596.0
(c) What are the poles of the denominator of your Laplace transform found in part b?
โ‰ซ ๐‘Ÿ๐‘œ๐‘œ๐‘ก๐‘ ([455 3640 916 596])
− 0.119 ± ๐‘—0.393 ๐‘Ž๐‘›๐‘‘ − 7.76
5.48
The Laplace transform of an engineering system is found to be the following:
๐‘Œ(๐‘ ) =
100(4๐‘  2 + 12๐‘  + 16)
(๐‘  + 5)[(๐‘  + 2)2 + 32 ][(๐‘  + 15)2 + 82 ]
(a) (50%) Obtain an equation for y(t) by finding the inverse Laplace of Y(s). It is okay to use
MATLAB to do the complex arithmetic associated with the coefficients.
>> s=-5;a=100*(4*s^2+12*s+16)/(((s+2)^2+9)*((s+15)^2+64))
a = 1.8970
>> s=-2+j*3;N=100*(4*s^2+12*s+16);D=(s+5)*((s+15)^2+64);
>> abs(N/D)/3
ans = 1.0091
>> angle(N/D)
ans = 2.4260
>> s=-15+j*8;N=100*(4*s^2+12*s+16);D=(s+5)*((s+2)^2+9);
>> abs(N/D)/8
ans = 4.0674
>> angle(N/D)
ans = -2.4611
Thus
๐‘ฆ(๐‘ก) = 1.8970๐‘’ −5๐‘ก + 1.0091๐‘’ −2๐‘ก sin(3๐‘ก + 2.4260) + 4.0674๐‘’ −15๐‘ก sin (8๐‘ก − 2.4611)
(b) (50%) Use the MATLAB command ‘impulse’ to generate values for y(t) and t. Then, use
the values of t in your equation from (a) and plot both solutions for y(t) on the same graph for
comparison. How do they compare? Perfect match.
67
>> G=zpk(roots([1 3 4]),[-5 -2+j*3 -2-j*3 -15+j*8 -15-j*8],400)
G=
400 (s^2 + 3s + 4)
--------------------------------------(s+5) (s^2 + 4s + 13) (s^2 + 30s + 289)
>> [Y,t]=impulse(G);
>> y=1.897*exp(-5*t)+1.0091*exp(-2*t).*sin(3*t+2.426)+4.0674*exp(-15*t).*sin(8*t-2.4611);
>> plot(t,y,'r',t,Y,'k:','linewidth',2)
>> xlabel('time, s')
>> ylabel('y(t)')
>> legend('inverse Laplace','impulse command','location','Best')
0.7
0.6
0.5
inverse Laplace
impulse command
0.4
y(t)
0.3
0.2
0.1
0
-0.1
-0.2
0
0.5
1
1.5
time, s
2
2.5
3
68
5.49
This problem pertains to improving the performance of a pile driver by changing the frequency of hitting
the top of the pile (steel beam) with force Fi. The output of interest is the contact force Fo with the
ground at the bottom of the pile. By carefully selecting the input frequency to approximately match one
of the resonant frequencies of the beam, the pile is driven into the ground faster and more efficiently.
The stress waves in the pile are defined by partial differential equations representing an infinite number
of modes. However, it is possible to approximate the stress waves using a lumped parameter model
such as shown below and obtain a finite order ordinary differential equation represented by a transfer
function.
Fi
Fo
A typical transfer function for a five-lumped model of a pile is the following:
๐น๐‘œ (๐‘ )
=[
32๐‘  5 + 1600๐‘  4 + 32000๐‘  3 + 320000๐‘  2 + 1600000๐‘  + 3200000
] ๐น (๐‘ )
3125๐‘  10 + 11250๐‘  9 + 126500๐‘  8 + 287000๐‘  7 + 1611200๐‘  6 + 2148032๐‘  5 + 7721600๐‘  4 + 4832000๐‘  3 + 12320000๐‘  2 + 1600000๐‘  + 3200000 ๐‘–
(a) Use the DC gain of this transfer function to determine the force at the ground if the input force is
a constant of 1000 N. This is an input that could be generated by setting a 1000 N weight on top of
the pile. Does your answer using the DC gain to compute the ground force make sense?
DC gain = 3200000/3200000 = 1 Thus, if the input is 1000, then the output at steady state will
also be 1000. Yes, this makes sense.
(b) Use the ‘damp’ command with the lumped model transfer function to approximate the actual
resonant frequencies of this pile; the resonant frequencies are the damped natural frequencies in
the eigenvalues. Note, there are 5 complex modes to this lumped model with the following
eigenvalues and frequencies. The damping ratios are so small for the first modes, the damped
and undamped natural frequencies are essentially the same.
Eigenvalue
Damping ratio
Frequency rad/s
69
-1.62e-02 + 5.69e-01i
2.85e-02
5.69e-01
-1.62e-02 - 5.69e-01i
2.85e-02
5.69e-01
-1.38e-01 + 1.66e+00i
8.31e-02
1.66e+00
-1.38e-01 - 1.66e+00i
8.31e-02
1.66e+00
-3.43e-01 + 2.60e+00i
1.31e-01
2.62e+00
-3.43e-01 - 2.60e+00i
1.31e-01
2.62e+00
-5.66e-01 + 3.32e+00i
1.68e-01
3.37e+00
-5.66e-01 - 3.32e+00i
1.68e-01
3.37e+00
-7.37e-01 + 3.77e+00i
1.92e-01
3.84e+00
-7.37e-01 - 3.77e+00i
1.92e-01
3.84e+00
(c) Suppose instead of a constant input, the input is sinusoidal with an amplitude of 1000 N. Using
the MATLAB command ‘bode’ to generate the frequency response of this transfer function,
determine the input frequency ๐œ”๐‘– that generates the greatest force amplitude Ag at the ground.
The frequency response first peak occurs at 0.569 rad/s which is identical to the first mode
undamped natural frequency.
Bode Diagram
Magnitude (dB)
30
System: G
Frequency (rad/s): 0.569
Magnitude (dB): 26.9
20
10
0
-10
0
Phase (deg)
-90
-180
-270
-360
-0.6
10
-0.4
10
-0.2
10
0
10
0.2
10
Frequency (rad/s)
At this frequency, what is the corresponding amplitude of the force at the ground in Newtons?
Note, the frequency response plot magnitude is in dB where M (dB) =20Log10( M). It suggested
that you improve the resolution on your plot by limiting the frequency range to a relatively small
band of frequencies around the peak.
The peak gain is 26.9 dB which is a gain of 10^(26.9/20) = 22.131 gives a peak output force of
22.131*1000 = 22,131 N. This is a huge amplification of the input force.
70
How does this input frequency from the frequency response compare with the damped natural
frequency of the first mode? identical
(d) Examine your frequency response plot in (b) and confirm that the DC gain is the same as the
low frequency magnitude of the transfer function. What is the low frequency gain of the transfer
function in dB? Note, the zero frequency gain is the same thing as the DC gain. The low frequency
gain on the frequency response approaches the 0 dB which corresponds to a gain of 1 which is
the DC gain of the transfer function. Note, DC means constant which has a frequency of zero.
(e) Realizing that it is not realistic for the input force from a pile driver to be a sinewave since that
would require a pushing and pulling action, generate a series of pulses for the force input using
the pulse generator M-file provided on Blackboard. The pulse period is 2๐œ‹/๐œ”๐‘– where ๐œ”๐‘– is the
frequency found in (c) in rad/s. The magnitude of each pulse should be 1000 N. The width of each
pulse should be less than or equal to 1/20 of the pulse period.
input frequency = 0.569 rad/s
1100
1000
900
pulse function amplitude
800
700
600
500
400
300
200
100
0
0
50
100
150
200
time, sec.
250
300
Use the command ‘lsim’ to generate and plot Fo(t) for the pulse input. Be sure to run your
simulation much longer than 5๐œ๐‘š๐‘Ž๐‘ฅ so you can see the peak amplitude of the steady state
response of the force at the ground. For the first mode frequency, the gain is 2.850 which is
significantly less than 22.131; the peak output force is 2,850 N.
71
first mode resonant frequency
3000
X: 279.1
Y: 2850
Force at Ground, Fo
2000
1000
0
-1000
-2000
-3000
0
50
100
150
200
time, s
250
300
350
(f) To investigate the significance of the input frequency on the output peak values, repeat (e) but
using input frequencies that are 20% greater and 20% less than the resonant frequency. What is
the significance of being as close as possible to the resonant frequency? Note on the figures
below, the gain drops to 0.6508 for 0.8*0.569 rad/s input frequency and 0.4962 for 1.2*0.569
rad/s. For lightly damped systems, the accuracy of matching the first mode frequency to
achieve maximum amplification is critical.
0.8*first mode resonant frequency
1000
800
X: 375.8
Y: 650.8
Force at Ground, Fo
600
400
200
0
-200
-400
-600
0
50
100
150
200
250
time, s
300
350
400
450
72
1.2*first mode resonant frequency
800
X: 233.3
Y: 496.2
600
Force at Ground, Fo
400
200
0
-200
-400
-600
0
50
100
150
time, s
200
250
300
clear all
format shortg
Num=[32 1600 32000 320000 1.6e6 3.2e6];
Den=[3125 11250 126500 287000 1611200 2148032 7721600 4.832e6 1.232e7 1.6e6 3.2e6];
G=tf(Num,Den);
damp(G)
figure(1)
bode(G,{.2 2})
figure(2)
m=20;period=2*pi/0.569;T=period/m;F=1000;N=30;np=10;
[Fi,t]=PulseSeries(T,m,F,N,np);
title('input frequency = 0.569 rad/s')
[Fo,t]=lsim(G,Fi,t);
figure(3)
plot(t,Fo,'r')
xlabel('time, s')
ylabel('Force at Ground, Fo')
title('first mode resonant frequency')
figure(4)
m=20;period=2*pi/(.8*0.569);T=period/m;F=1000;N=30;np=10;
[Fi,t]=PulseSeries(T,m,F,N,np);
title('input frequency = 0.8*0.569 rad/s')
[Fo,t]=lsim(G,Fi,t);
figure(5)
plot(t,Fo,'r')
xlabel('time, s')
ylabel('Force at Ground, Fo')
title('0.8*first mode resonant frequency')
m=20;period=2*pi/(1.2*0.569);T=period/m;F=1000;N=30;np=10;
figure(6)
[Fi,t]=PulseSeries(T,m,F,N,np);
title('input frequency = 1.2*0.569 rad/s')
[Fo,t]=lsim(G,Fi,t);
figure(7)
plot(t,Fo,'r')
xlabel('time, s')
ylabel('Force at Ground, Fo')
title('1.2*first mode resonant frequency')
73
5.50
1. A spring-mass –damper system is shown below; the displacement of the mass is z.
z
spring
damper
mass
The differential equation for the position of the mass is as follows
๐‘งฬˆ + 0.1๐‘งฬ‡ + 0.01๐‘ง = 0
๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 2 ๐‘š/๐‘ 
(a) Draw an best guess estimate of the plot of z(t). Be sure to show the initial and final
values and the approximate time to reach the final value. Do this before proceeding to the
next parts of the assignment. The time constant is 20 and the damping ratio is 0.5. So the
plot will start at zero, be slightly oscillatory, and end at zero after about 100 sec.
(b) Express this differential equation in state variable format and then use ode45 in
MATLAB to generate a plot of z(t). Does this plot agree with your plot in (a)? yes
๐‘ฅ1 = ๐‘ง ๐‘ฅ2 = ๐‘งฬ‡ ๐‘ฅฬ‡ 1 = ๐‘ฅ2 ๐‘ฅฬ‡ 2 = −0.1๐‘ฅ2 − 0.01๐‘ฅ1 ๐‘ฅ1 (0− ) = 0 ๐‘ฅ2 (0− ) = 2
clear all
[t,x]=ode45(@hmwk6_2016,[0 100],[0 2]);
plot(t,x(:,1),'r','linewidth',2)
title('Homework 6.1');ylabel('z(t) m');xlabel('time, s')
function dx=hmwk6_2016(t,x)
dx=zeros(2,1);
dx(1)=x(2);
dx(2)=-0.1*x(2)-0.01*x(1);
end
74
Homework 6.1
12
10
8
z(t) m
6
4
2
0
-2
0
10
20
30
40
50
time, s
60
70
80
90
100
2. When a 2nd mass is added to the system, we now have two simultaneous equations for the
system. (a) Express this system of equations in state variable format and write the initial
conditions for the state variables. (b) Use ode45 to generate a plot of ๐‘งฬ‡ (๐‘ก).
๐‘งฬˆ + 0.15๐‘งฬ‡ + 0.015๐‘ง = 0.05๐‘คฬ‡ + 0.005๐‘ค
๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 2
๐‘š
๐‘ 
๐‘คฬˆ + 0.05๐‘คฬ‡ + 0.005๐‘ค = 0.05๐‘งฬ‡ + 0.005๐‘ง ๐‘ค(0− ) = 0 ๐‘คฬ‡ (0− ) = 0
z
w
๐‘ฅ1 = ๐‘ง ๐‘ฅ2 = ๐‘งฬ‡ ๐‘ฅ3 = ๐‘ค ๐‘ฅ4 = ๐‘คฬ‡ ๐‘ฅ1 (0− ) = 0 ๐‘ฅ2 (0− ) = 2 ๐‘ฅ3 (0− ) = 0 ๐‘ฅ4 (0− ) = 0
75
clear all
[t,x]=ode45(@hmwk6_2_2016,[0 100],[0 2 0 0]);
plot(t,x(:,2),'r','linewidth',2)
title('Homework 6.2');ylabel('dz/dt m/s');xlabel('time, s')
function dx=hmwk6_2_2016(t,x)
dx=zeros(4,1);
dx(1)=x(2);
dx(2)=-0.15*x(2)-0.015*x(1)+0.05*x(4)+0.005*x(3);
dx(3)=x(4);
dx(4)=-0.005*x(3)-0.05*x(4)+0.05*x(2)+0.005*x(1);
end
Homework 6.2
2
1.5
dz/dt m/s
1
0.5
0
-0.5
0
10
20
30
40
50
time, s
60
70
80
90
100
76
5.51
The schematic of a vehicle suspension system is shown below. The vehicle is moving to the
right. At t = 0, the contact point at the ground encounters a step with magnitude 0.02 m.
(a) Use ode45 to obtain a plot of ๐‘งฬ‡ (๐‘ก). Explain why ๐‘งฬ‡ (0+ ) is not equal to ๐‘งฬ‡ (0− ).
๐’›ฬ‡ (๐ŸŽ+ ) is not equal to ๐’›ฬ‡ (๐ŸŽ− ) because the input is a step which means at time zero there
is an impulse force (due to ๐’–ฬ‡ ) from the damper on the mass instantaneously changing ๐’›ฬ‡
from zero to a positive value.
function dx = Eqns7_2016( t,x)
dx=zeros(2,1);
dx(1)=x(2)+20*0.02;
dx(2)=-100*x(1)-20*x(2)-300*0.02;
end
(b) Use SIMULINK to obtain a plot of ๐‘งฬ‡ (๐‘ก). Confirm that the (a) and (b) results are the
same by putting them on the same graph.
After running the SIMULINK model, the following commands are executed in the Command
Window:
77
>> [t,x]=ode45(@Eqns7_2016,[0 0.6],[0 0]);
>> plot(t,x(:,2)+20*0.02,'r',y(:,1),y(:,2),'k*','LineWidth',2)
>> title('homework 7 comparing ode45 and simulink simulations')
>> xlabel('time, s')
>> ylabel('velocity of mass, m/s')
>> legend('ode45','SIMULINK')
homework 7 comparing ode45 and simulink simulations
0.4
ode45
SIMULINK
0.35
0.3
velocity of mass, m/s
0.25
0.2
0.15
0.1
0.05
0
-0.05
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
time, s
78
5.52
The equations for an inverted pendulum are shown below. The feedback force Ff is used to
move the cart in order to keep the pendulum mass vertical. The pendulum angle ๐œƒ is
continuously measured and used to generate the force Ff on the cart. Assuming small angles, the
differential equations for the pendulum and cart are listed below as well as the transfer function
for the feedback control force Ff.
Equation for summing the moments on the pendulum bar and mass:
๐œƒฬˆ + 0.5๐‘งฬˆ − 4.9๐œƒ = 0
๐‘งฬˆ + 0.18๐œƒฬˆ + 0.09๐น๐‘“ = 0
Equation for the force balance on the cart:
๐‘ +6
Transfer function from feedback control design theory: ๐น๐‘“ (๐‘ ) = −149.6 [๐‘ +8] ๐œƒ(๐‘ )
Ms
๏ฑ
L
z
Ff
Mc
(a) Assume that the initial conditions are
๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 0 ๐œƒ(0− ) = 0.1 ๐œƒฬ‡(0− ) = 0.05 ๐‘Ÿ๐‘Ž๐‘‘/๐‘ 
Estimate the plots of ๐œƒ(๐‘ก) and ๐œƒฬ‡ (๐‘ก). Do this before running the next part.
Construct a SIMULINK diagram for this system and obtain plots of ๐œƒ(๐‘ก) and ๐œƒฬ‡(๐‘ก).
79
80
Simulink solution homework 8
0.12
0.1
0.08
๏ฑ rad
0.06
0.04
0.02
0
-0.02
-0.04
-0.06
0
5
10
15
20
25
30
35
40
45
time, s
Simulink solution homework 8
0.05
0.04
0.03
d๏ฑ/dt rad/s
0.02
0.01
0
-0.01
-0.02
-0.03
-0.04
0
5
10
15
20
25
30
35
40
45
time, s
Do the plots start and end at the correct values? ___yes
(b) Express these equations in state variable format and then use ‘lsim’ with an initial
condition vector to generate plots of ๐œƒ(๐‘ก) and ๐œƒฬ‡(๐‘ก). Are the plots in (a) the same as those in
81
(c) Yes but it required calculating SIMILINK Ff(0+) to use for Ff(0-) in the state
variable formulation.
Hint: Solve for ๐‘งฬˆ in the 2nd equation and substitute it into the 1st equation to get an
equation for ๐œƒฬˆ which can then be substituted back into the original 2nd equation. Also,
note there is no input so B and D contain only zeros.
๐œƒฬˆ − 0.04945๐น๐‘“ − 5.3846๐œƒ = 0
๐‘งฬˆ + 0.9692๐œƒ + 0.0989๐น๐‘“ = 0
From the transfer function, we get
๐น๐‘“ฬ‡ + 8๐น๐‘“ = −149.6๐œƒฬ‡ − 897.6๐œƒ
So, the choices for the state variables are
๐‘ฅ1 = ๐œƒ
๐‘ฅ2 = ๐œƒฬ‡
๐‘ฅ3 = ๐‘ง
๐‘ฅ4 = ๐‘งฬ‡ ๐‘ฅ5 = ๐น๐‘“
Note, in the SIMULINK simulation, the input at t = 0+ to the transfer function will be a constant
of 0.1 which is the initial condition of ๐œƒ. Using the initial value theorem, we calculate
๐น๐‘“ (0+ ) = ๐‘  (−149.6 [
๐‘  + 6 0.1
] )
= −14.96
๐‘  + 8 ๐‘  ๐‘ =∞
>> A=[0 1 0 0 0;5.3846 0 0 0 0.04945;0 0 0 1 0;-0.9692 0 0 0 -0.0989;-897.6 -149.6 0 0 -8];
>> B=[0;0;0;0;0];C=[1 0 0 0 0;0 1 0 0 0];D=[0;0];
>> G=ss(A,B,C,D);
>> Xo=[0.1;0.05;0;0;-14.96];
>> t=0:0.01:42;
>> u=0*t; % we need a value for u at each value of t but it doesn’t matter what it is since B and D are zero.
>> [y,t]=lsim(G,u,t,Xo);
Note, we could have used the command >> [y,t]=initial(G,Xo);
Rum the SIMULINK model with output Y at this time
>> plot(t,Y(:,1),'r','Linewidth',2)
>> xlabel('time, s')
>> ylabel('\theta, rad')
>> title('inverted pendulum simulation using state variables')
>> plot(t,Y(:,2),'r','Linewidth',2)
>> title('inverted pendulum simulation using state variables')
>> ylabel('d\theta/dt, rad/s')
>> xlabel('time, s')
82
As shown below, the SIMULINK and state variable simulation results are identical. Note, since z
was not an output of interest, the state variable model in this case does not really need the state
variables of z and ๐‘งฬ‡ to simulate the pendulum angle.
inverted pendulum simulation
0.12
SIMULINK
State Variables
0.1
0.08
0.06
๏ฑ, rad
0.04
0.02
0
-0.02
-0.04
-0.06
0
5
10
15
20
25
30
35
40
45
time, s
5.53
This assignment is a review of using symbolic math in MATLAB to get transfer functions, a
review of the phase variable method to get state variable equations for transfer functions with
equal order numerators and denominators, and a review of the use of ‘lsim’ to do time domain
simulations. Also, this assignment is an introduction to the use of ‘lsim’ for simulating systems
with random inputs.
Consider the schematic of a vehicle suspension shown below. It is of interest to determine the
levels of up and down acceleration in g’s that would be experienced by a passenger riding in this
vehicle over a typical country road at a speed of 30 m/s. The differential equations for this
suspension for road irregularities u(t) are also shown. The equation for the output of interest a(t)
is also shown. Note, ๐‘งฬˆ is the up and down acceleration; dividing ๐‘งฬˆ by 9.8 m/s2 gives the
acceleration in g’s.
z
w
5๏€ฆ
z๏€ฆ+ 30 z๏€ฆ+ 200 z = 30 w๏€ฆ+ 200w
๏€ฆ
๏€ฆ+ 230w๏€ฆ+ 10200 w = 30 z๏€ฆ+ 200 z + 200u๏€ฆ+ 10000u
2.5w
a=๏€ฆ
z๏€ฆ/ 9.8
a( s) =
๏ƒน
1 ๏ƒฉ
480s 4 + 27,200s 3 + 160,000s 2
u( s )
9.8 ๏ƒช๏ƒซ s 4 + 98s 3 + 4,600s 2 + 27,200s + 160,000 ๏ƒบ๏ƒป
u
83
z
w
5๏€ฆ
z๏€ฆ+ 30 z๏€ฆ+ 200 z = 30w๏€ฆ+ 200 w
๏€ฆ
๏€ฆ+ 230 w๏€ฆ+ 10200 w = 30 z๏€ฆ+ 200 z + 200u๏€ฆ+ 10000u
2.5w
a=๏€ฆ
z๏€ฆ/ 9.8
a( s) =
u
๏ƒน
1 ๏ƒฉ
480 s 4 + 27,200 s 3 + 160,000 s 2
u( s)
๏ƒช
4
3
2
9.8 ๏ƒซ s + 98s + 4,600 s + 27,200s + 160,000 ๏ƒบ๏ƒป
(a) Use symbolic math to confirm the transfer function for a(s). What are the eigenvalues?
Syms s z w u a
>> H=solve((5*s^2+30*s+200)*z==(30*s+200)*w,…
(2.5*s^2+230*s+10200)*w==(30*s+200)*z+(200*s+10000)*u, a==s^2*z/9.8, a,z,w)
>> digits(5)
>> a=vpa(H.a)
>> a=collect(a,s)
Or, you can get the transfer function for z(s) and then multiply by s^2/9.8.
>> syms s z w u
>> G=solve((5*s^2+30*s+200)*z==(30*s+200)*w,…
(2.5*s^2+230*s+10200)*w==(30*s+200)*z+(200*s+10000)*u,z,w)
>> z=collect(G.z)
Using ‘damp’ to get the eigenvalues:
Pole
Damping
Frequency Time Constant
(rad/seconds) (seconds)
-2.93e+00 + 5.59e+00i 4.64e-01
-2.93e+00 - 5.59e+00i 4.64e-01
-4.61e+01 + 4.36e+01i 7.27e-01
-4.61e+01 - 4.36e+01i 7.27e-01
6.31e+00
6.31e+00
6.34e+01
6.34e+01
3.42e-01
3.42e-01
2.17e-02
2.17e-02
(b) Using the phase variables method, express this transfer function in state variable format
considering that ‘a’ is the output of interest.
1
480๐‘ 4 + 27,200๐‘ 3 + 160,000๐‘ 2
[ 4
]=
9.8 ๐‘  + 98๐‘ 3 + 4600๐‘ 2 + 27,200๐‘  + 160,000
1
9.8
[480 +
−1.984๐‘’4๐‘ 3 − 2.048๐‘’6๐‘ 2 − 1.296๐‘’7๐‘  − 7.68๐‘’7
๐‘ 4 + 98๐‘ 3 + 4600๐‘ 2 + 27,200๐‘  + 160,000
]
Thus
0
1
0
0
0
0
1
0
๐ด=[
]
0
0
0
1
−160,000 −27,200 −4600 −98
๐ถ=
0
๐ต = [0]
0
1
1
[−7.68๐‘’7 −1.296๐‘’7 −2.048๐‘’6 −1.984๐‘’4] ๐ท = [480/9.8]
9.8
84
Or, since this was generated in MATLAB and we have the transfer function for the output of
interest, we could use ‘tf2ss’ to get the state variable equations, i.e.
>> [A,B,C,D]=tf2ss([480 27200 160000 0 0]/9.8, [1 98 4600 27200 160000]);
>> h=ss(A,B,C,D);
(c) Use the two M-files ‘rinput’ and ‘dpsd’ to generate values for the road profile irregularities u(t),
i.e.
>> [u,t]=StochInput(4096,0.005); % This command generates 4096 values for u(t) separated by a
time interval of 0.005 seconds. At 30 m/s, that is a value every 0.15 m. The M-file ‘dpsd’
defines the roughness of the road as a function of the wavelength of the irregularities. These Mfiles are provided on Blackboard.
(d) Generate two plots of u(t); the first plot shows all of u(t) and the second plot goes out to only 1
second using the ‘axis’ command.
Homework 9 - suspension simulation input
0.03
0.02
road profile, u(t) m
0.01
0
-0.01
-0.02
-0.03
0
5
10
15
20
25
time, s
>> axis([0 1 -0.01 0.01])
85
Homework 9 - suspension simulation input
0.01
0.008
0.006
road profile, u(t) m
0.004
0.002
0
-0.002
-0.004
-0.006
-0.008
-0.01
0
0.1
0.2
0.3
0.4
0.5
time, s
0.6
0.7
0.8
0.9
1
(e) Use ‘lsim’ and the state variable model to generate a plot of a(t). After the transients have died
out (5 times the largest time constant), what is the observed peak value of normalized
acceleration, a(t)? Do you think this value is small enough for passenger comfort? The vertical
acceleration is typically between -0.1 and 0.1 g’s; however, peak values of -0.18 are seen to
occur. It is desirable to keep the acceleration levels less than 0.1 g.
>> h=ss(A,B,C,D);
>> [a,t]=lsim(h,u,t);
>> plot(t,a)
>> xlabel('time, s')
>> ylabel('vertical acceleration, g')
>> title('homeowrk 9 - suspendion ride quality')
86
>> title('homeowrk 9 - suspension ride quality')
homeowrk 9 - suspension ride quality
0.2
0.15
vertical acceleration, g
0.1
0.05
0
-0.05
-0.1
-0.15
-0.2
X: 12.33
Y: -0.1797
0
5
10
15
20
25
time, s
inverted pendulum simulation
0.05
SIMULINK
State Variables
0.04
0.03
d๏ฑ/dt, rad/s
0.02
0.01
0
-0.01
-0.02
-0.03
-0.04
0
5
10
15
20
25
30
35
40
45
time, s
87
Previous Quiz Problems and Solutions
Quiz 1
A mass sits on top of a spring and damper as shown below.
Mass
Spring
x
Damper
It can be shown that the differential equation for the position of the mass ๐‘ฅ is given by
๐‘‘2๐‘ฅ
๐‘‘๐‘ฅ
10 2 + 60
+ 80๐‘ฅ = 160
๐‘‘๐‘ก
๐‘‘๐‘ก
(a) What is the dependent variable in the differential equation?_________
(b) What is the independent variable in the differential equation?__________
(c) What is the order of the differential equation?________
(d) Is the differential equation linear or nonlinear? ________
(e) If the mass is disturbed, it will bounce up and down for a while. Eventually, it will return to
an equilibrium position which means ๐‘ฅ will become a constant. What will be this final value of
?_______
Quiz 1 Solution:
A mass sits on top of a spring and damper as shown below.
Mass
Spring
x
Damper
It can be shown that the differential equation for the position of the mass ๐‘ฅ is given by
๐‘‘2๐‘ฅ
๐‘‘๐‘ฅ
10 2 + 60
+ 80๐‘ฅ = 160
๐‘‘๐‘ก
๐‘‘๐‘ก
(a) What is the dependent variable in the differential equation? x
(b) What is the independent variable in the differential equation? t
(c) What is the order of the differential equation? 2nd
88
(d) Is the differential equation linear or nonlinear? linear
(e) If the mass is disturbed, it will bounce up and down for a while. Eventually, it will return to
an equilibrium position which means ๐‘ฅ will become a constant. What will be this final value? 2
Quiz 2
Consider the following differential equation for a suspension system:
๐‘ฆฬˆ + 6.5๐‘ฆฬ‡ + 9,800๐‘ฆ 3 = 9.8
(a) What is the order of the differential equation? ____________
(b) Assuming ๐‘ฆ(๐‘ก) → ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก as ๐‘ก → ∞, what will be the value of this constant?_____________
(c) Assuming that the initial conditions for this differential equation are ๐‘ฆฬ‡ (0− ) = 0 ๐‘Ž๐‘›๐‘‘ ๐‘ฆ(0− ) = 0,
draw a sketch of ๐‘ฆ(๐‘ก) starting at ๐‘ก = 0.
(d) Obtain a linear approximation for this differential equation by obtaining a straight line
approximation for ๐‘ฆ 3 using the two point method. Be sure to start by sketching ๐‘ฆ 3 and noting
the two points for your straight line.
(e) After substituting your straight line into the original differential equation, check to see if the
new linearized differential equation gives the correct final value.
Quiz 2 Solution:
Consider the following differential equation for a suspension system:
๐‘ฆฬˆ + 6.5๐‘ฆฬ‡ + 9,800๐‘ฆ 3 = 9.8
1. What is the order of the differential equation? ___2nd_________
2. Assuming ๐‘ฆ(๐‘ก) → ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก as ๐‘ก → ∞, what will be the value of this constant?____0.1_______
0 + 0 + 9,800๐‘ฆ 3 = 9.8
๐‘กโ„Ž๐‘ข๐‘  ๐‘ฆ = 0.1
3.
Assuming that the initial conditions for this differential equation are ๐‘ฆฬ‡ (0− ) = 0 ๐‘Ž๐‘›๐‘‘ ๐‘ฆ(0− ) = 0,
draw a sketch of ๐‘ฆ(๐‘ก) starting at ๐‘ก = 0.
y(t)
0.1
0
time
89
4.
Obtain a linear approximation for this differential equation by obtaining a straight line
approximation for ๐‘ฆ 3 using the two point method. Be sure to start by sketching ๐‘ฆ 3 and noting
the two points for your straight line.
y3
y 3 ๏‚ป .01 y + 0
0.001
0
5.
0.1
y
After substituting your straight line into the original differential equation, check to see if the
new linearized differential equation gives the correct final value.
๐‘ฆฬˆ + 6.5๐‘ฆฬ‡ + 9,800(0.01๐‘ฆ) = 9.8
๐‘ฆ(∞) = 0.1
Quiz 3
Consider the following spring-mass-damper system with input u(t).
z
M
k
b
k
b
u
The input (independent variable) to this system is the displacement u. The equations for this
suspension system are
10๐‘งฬˆ + ๐‘“1 + ๐‘“2 = 0
๐‘“1 = 100(๐‘ง − ๐‘ฃ)
๐‘“2 = 5(๐‘งฬ‡ − ๐‘ฃฬ‡ )
๐‘“3 = 100(๐‘ฃ − ๐‘ข)
๐‘“4 = 5(๐‘ฃฬ‡ − ๐‘ขฬ‡ )
๐‘“1 + ๐‘“2 − ๐‘“3 − ๐‘“4 = 0
(a) List the unknowns (dependent variables) and confirm that the number of equations matches
the number of unknowns.
90
(b) Use the "D" operator to convert the differential equations to algebraic equations.
(c) Eliminate ๐‘“1 , then eliminate ๐‘“2 , then eliminate ๐‘“3 , and then eliminate ๐‘“4 . How many
equations with which unknowns do you have left?
Quiz 3 Solution:
Consider the following spring-mass-damper system with input u(t).
z
M
k
b
k
b
u
The input (independent variable) to this system is the displacement u. The equations for this
suspension system are
10๐‘งฬˆ + ๐‘“1 + ๐‘“2 = 0
๐‘“1 = 100(๐‘ง − ๐‘ฃ)
๐‘“2 = 5(๐‘งฬ‡ − ๐‘ฃฬ‡ )
๐‘“3 = 100(๐‘ฃ − ๐‘ข)
๐‘“4 = 5(๐‘ฃฬ‡ − ๐‘ขฬ‡ )
๐‘“1 + ๐‘“2 − ๐‘“3 − ๐‘“4 = 0
(a) List the unknowns (dependent variables) and confirm that the number of equations matches
the number of unknowns. 6 equations with unknowns: ๐‘“1 , ๐‘“2 , ๐‘“3 , ๐‘“4 , ๐‘ง, ๐‘Ž๐‘›๐‘‘ ๐‘ฃ
(b) Use the "D" operator to convert the differential equations to algebraic equations.
10๐ท2 ๐‘ง + ๐‘“1 + ๐‘“2 = 0
๐‘“1 = 100(๐‘ง − ๐‘ฃ)
๐‘“2 = 5๐ท(๐‘ง − ๐‘ฃ)
๐‘“3 = 100(๐‘ฃ − ๐‘ข)
๐‘“4 = 5๐ท(๐‘ฃ − ๐‘ข)
๐‘“1 + ๐‘“2 − ๐‘“3 − ๐‘“4 = 0
(c) Eliminate ๐‘“1 , then eliminate ๐‘“2 , then eliminate ๐‘“3 , and then eliminate ๐‘“4 . How many
equations with which unknowns do you have left?
10๐ท2 ๐‘ง + 100(๐‘ง − ๐‘ฃ) + 5๐ท(๐‘ง − ๐‘ฃ) = 0
100(๐‘ง − ๐‘ฃ)5๐ท(๐‘ง − ๐‘ฃ) − 100(๐‘ฃ − ๐‘ข) − 5๐ท(๐‘ง − ๐‘ฃ) = 0
Two equations with unknowns z and v.
91
Quiz 4
(a) Laplace transform the following differential equation and solve for the Laplace transform
Z(s).
2๐‘งฬˆ + 12๐‘งฬ‡ + 36๐‘ง = 24
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 4
Note, the answer should be in the format of a numerator polynomial over a denominator
polynomial. Your answer is not complete until it is in this format.
(b) The final value theorem is
๐‘ง(๐‘ก)๐‘ก→∞ = ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘(๐‘ )๐‘ →0
Apply the final value theorem to your Z(s) and see if it gives the correct final value.
(c) The initial value theorem is ๐‘ง(๐‘ก)0+←๐‘ก = ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘(๐‘ )๐‘ →∞
Apply the initial value theorem and see if it gives ๐‘ง(0− ).
Quiz 4 Solution
Laplace transform the following differential equation and solve for the Laplace transform Z(s).
2๐‘งฬˆ + 12๐‘งฬ‡ + 36๐‘ง = 24
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 4
Note, the answer should be in the format of a numerator polynomial over a denominator
polynomial. Your answer is not complete until it is in this format.
2(๐‘  2 ๐‘(๐‘ ) − 0๐‘  − 4) + 12(๐‘ ๐‘(๐‘ ) − 0)+36Z(s)=24/s
๐‘(๐‘ ) =
8๐‘  + 24
๐‘ (2๐‘  2 + 12๐‘  + 36)
(a) The final value theorem is
๐‘ง(๐‘ก)๐‘ก→∞ = ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘(๐‘ )๐‘ →0
Apply the final value theorem to your Z(s) and see if it gives the correct final value.
๐‘ ๐‘(๐‘ )๐‘ →0 =
0 + 24
= 0.666
0 + 0 + 36
Setting the derivatives of z in the original differential equation and solving for z gives
0.666 which checks.
(b) The initial value theorem is ๐‘ง(๐‘ก)0+←๐‘ก = ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘(๐‘ )๐‘ →∞
Apply the initial value theorem and see if it gives ๐‘ง(0− ).
๐‘ ๐‘(๐‘ )๐‘ →∞ = 0 which is the initial value of z.
92
Quiz 5
(a) Solve the following differential equation x(t) using separation of variables if x(0) =4.
2๐‘ฅฬ‡ + 6๐‘ฅ = 0
(b) Confirm that your solution is correct using the original differential equation.
Quiz 5 Solution
(h) Solve the following differential equation x(t) using separation of variables if x(0) =4.
2๐‘ฅฬ‡ + 6๐‘ฅ = 0
๐‘ฅ(๐‘ก) = 4๐‘’ −3๐‘ก
(b)Confirm that your solution is correct using the original differential equation.
2(−12)๐‘’ −3๐‘ก + 6(4๐‘’ −3๐‘ก ) = 0
Quiz 6
The Laplace transform of z(t) is as follows:
6๐‘  2 + 12๐‘  + 5
๐‘(๐‘ ) =
๐‘ (๐‘  + 4)[(๐‘  + 2)2 + 82 ]
We know that the inverse Laplace of Z(s) will be of the following format:
๐‘ง(๐‘ก) = ๐‘Ž๐‘’ ๐‘๐‘ก + ๐‘๐‘’ ๐‘‘๐‘ก + ๐‘“๐‘’ ๐‘”๐‘ก sin (๐œ”๐‘ก + ๐œ‘)
๐‘Ž =?
๐‘ =?
๐‘ =?
๐‘‘ =?
๐‘” =?
๐œ” =?
Quiz 6 Solution
5
๐‘Ž = 4∗(4+64) = 0.01838
๐‘=
๐‘=0
6(−4)2 + 12(−4) + 5 96 − 48 + 5
=
= −0.19485
(−4)[(−4 + 2)2 + 64]
−4(68)
๐‘” = −2
๐œ”=8
๐‘‘ = −4
Quiz 7
The equation for Y(s) is written below in terms of the input U(s).
6๐‘  2 + 3๐‘  + 84
๐‘Œ(๐‘ ) = [
] ๐‘ˆ(๐‘ )
(๐‘  + 3)[(๐‘  + 5)2 + 92 ]
93
(a)What is the transfer function?
(b)What are the eigenvalues?
(c)What are the time constants?
(d)If u(t) is a unit impulse, what is U(s) and what is Y(s)?
Quiz 7 Solution
The equation for Y(s) is written below in terms of the input U(s).
6๐‘  2 + 3๐‘  + 84
๐‘Œ(๐‘ ) = [
] ๐‘ˆ(๐‘ )
(๐‘  + 3)[(๐‘  + 5)2 + 92 ]
6๐‘ 2 +3๐‘ +84
(a)What is the transfer function? [(๐‘ +3)[(๐‘ +5)2 +92]]
(b)What are the eigenvalues? −3, −5 ± ๐‘—9
(c)What are the time constants? 1/3 and 1/5
(d)If u(t) is a unit impulse, what is U(s) and what is Y(s)? Since U(s)=1
6๐‘ 2 +3๐‘ +84
๐‘Œ(๐‘ ) = [(๐‘ +3)[(๐‘ +5)2+92]]
Quiz 8
The Laplace transform of z(t) is as follows:
6๐‘  2 + 12๐‘  + 5
๐‘(๐‘ ) =
๐‘ (๐‘  + 4)[(๐‘  + 2)2 + 82 ]
We know that the inverse Laplace of Z(s) will be of the following format:
๐‘ง(๐‘ก) = ๐‘Ž๐‘’ ๐‘๐‘ก + ๐‘๐‘’ ๐‘‘๐‘ก + ๐‘“๐‘’ ๐‘”๐‘ก sin (๐œ”๐‘ก + ๐œ‘)
๐‘Ž =?
๐‘ =?
๐‘ =?
๐‘‘ =?
๐‘” =?
๐œ” =?
Quiz 8 Solution
The Laplace transform of z(t) is as follows:
๐‘(๐‘ ) =
6๐‘  2 + 12๐‘  + 5
๐‘ (๐‘  + 4)[(๐‘  + 2)2 + 82 ]
94
We know that the inverse Laplace of Z(s) will be of the following format:
๐‘ง(๐‘ก) = ๐‘Ž๐‘’ ๐‘๐‘ก + ๐‘๐‘’ ๐‘‘๐‘ก + ๐‘“๐‘’ ๐‘”๐‘ก sin (๐œ”๐‘ก + ๐œ‘)
5
๐‘Ž=
4 ∗ 68
๐‘=0
๐‘=
6(−4)2 + 12(−4) + 5
= −0.07
(−4)([(−4 + 2)2 + 82 ]
๐‘‘ = −4
๐‘” = −2
๐œ”=8
Quiz 9
Laplace transform the differential equation below and then solve for Z(s).
3๐‘งฬˆ + 6๐‘งฬ‡ + 12๐‘ง = 18
๐‘ง(0− ) = 2
๐‘งฬ‡ (0− ) = 4
Quiz 9 Solution
Laplace transform the differential equation below and then solve for Z(s).
3๐‘งฬˆ + 6๐‘งฬ‡ + 12๐‘ง = 18
๐‘ง(0− ) = 2
๐‘งฬ‡ (0− ) = 4
๐‘งฬˆ + 2๐‘งฬ‡ + 4๐‘ง = 6
18
๐‘  2 ๐‘(๐‘ ) − 2๐‘  − 4 + 2(๐‘ ๐‘(๐‘ ) − 2) + 4๐‘(๐‘ ) =
๐‘ 
2๐‘  2 + 8๐‘  + 6
๐‘(๐‘ ) =
๐‘ (๐‘  2 + 2๐‘  + 4)
Quiz 10
Consider the following Laplace transform:
15๐‘  3 + 2๐‘  2 + 640
๐‘(๐‘ ) =
๐‘ (5๐‘  4 + 162๐‘  3 + 1424๐‘  2 + 3744๐‘  + 1280)
What will be the final value of z(t) found using the final value theorem?
What is the initial value of z(t) as determined from the initial value theorem?
What are the MATLAB commands for generating a plot of z(t) using the ‘impulse’ command.
95
Quiz 10
Solution
Consider the following Laplace transform:
๐‘(๐‘ ) =
15๐‘  3 + 2๐‘  2 + 640
๐‘ (5๐‘  4 + 162๐‘  3 + 1424๐‘  2 + 3744๐‘  + 1280)
What will be the final value of z(t) found using the final value theorem?
๐‘ง(∞) =
0 + 0 + 640
= 0.5
0 + 0 + 0 + 0 + 1280
What is the initial value of z(t) as determined from the initial value theorem?
๐‘ง(0+ ) = 0
What are the MATLAB commands for generating a plot of z(t) using the ‘impulse’ command.
>> num=[15 2 0 640];
>> den=[5 162 1424 3744 1280 0];
>> z=tf(num,den);
>> impulse(z)
Quiz 11
Consider the two simultaneous equations below for a mechanical lift system with step input u(t)
with magnitude of 5.
10๐‘ฆฬˆ + 6๐‘ฆฬ‡ + 3๐‘ฆ = 2๐‘ฃ
2๐‘ฃฬ‡ + +10๐‘ฃ − 4๐‘ฆ = 2๐‘ข
๐‘ฆ(0− ) = 0
๐‘ฆฬ‡ (0− ) = 5
๐‘ฃ(0− ) = 4
Convert these equations to algebraic equations using the Laplace transform.
Quiz 11
Solution
Consider the two simultaneous equations below for a mechanical lift system with step input u(t)
with magnitude of 5.
10๐‘ฆฬˆ + 6๐‘ฆฬ‡ + 3๐‘ฆ = 2๐‘ฃ
๐‘ฆ(0− ) = 0 ๐‘ฆฬ‡ (0− ) = 5
2๐‘ฃฬ‡ + +10๐‘ฃ − 4๐‘ฆ = 2๐‘ข
๐‘ฃ(0− ) = 4
Convert these equations to algebraic equations using the Laplace transform.
๐‘ฆฬˆ + 0.6๐‘ฆฬ‡ + 0.3๐‘ฆ = 0.2๐‘ฃ
๐‘ฆ(0− ) = 0 ๐‘ฆฬ‡ (0− ) = 5
๐‘ฃฬ‡ + 5๐‘ฃ − 2๐‘ฆ = ๐‘ข
๐‘ฃ(0− ) = 4
Laplace transforming gives
๐‘  2 ๐‘Œ(๐‘ ) − 5 + 0.6๐‘ ๐‘Œ(๐‘ ) + 0.3๐‘Œ(๐‘ ) = 0.2๐‘‰(๐‘ )
5
๐‘ ๐‘‰(๐‘ ) − 4 + 5๐‘‰(๐‘ ) − 2๐‘Œ(๐‘ ) =
๐‘ 
96
Quiz 12
For the differential equation below, use Euler’s numerical integration to compute the first two solution
values of x(t) using a time step of 0.01.
๐‘ฅฬ‡ + 10๐‘ฅ = 20
๐‘ฅ(0− ) = 1
Use the inverse Laplace transform and solve for the exact solution of x(t) and compare the numerical
solution values with the exact solution values.
Quiz 12 Solution
For the differential equation below, use Euler’s numerical integration to compute the first two solution
values of x(t) using a time step of 0.01.
๐‘ฅฬ‡ + 10๐‘ฅ = 20
๐‘ฅ(0− ) = 1
Time t x(t) ๐‘ฅฬ‡ (๐‘ก) = 20 − 10๐‘ฅ(๐‘ก) x(t+T)=x(t)+T๐‘ฅฬ‡ (๐‘ก)
0
1
20-10*1=10
1+0.01*10=1.1
0.01
1.1 20-10*1.1=9
1.1+0.01*9=1.19
0.02
1.19 20-10*1.19=8.1
1.19+0.01*8.1=1.271
Use the inverse Laplace transform and solve for the exact solution of x(t) and compare the numerical
solution values with the exact solution values.
๐‘ ๐‘‹(๐‘ ) − 1 + 10๐‘‹(๐‘ ) =
๐‘‹(๐‘ ) =
20
๐‘ 
20 + ๐‘ 
๐‘ (๐‘  + 10)
๐‘ฅ(๐‘ก) = 2 − ๐‘’ −10๐‘ก
t
0
0.01
0.02
Numerical x(t)
1
1.1
1.19
๐‘ฅ(๐‘ก) = 2 − ๐‘’ −10๐‘ก
1
1.09516
1.18127
Quiz 13
The differential equations for the suspension shown below with input displacement u(t) are
10๐‘งฬˆ + 100๐‘งฬ‡ + 1000๐‘ง = 100๐‘คฬ‡ + 1000๐‘ค
100๐‘คฬ‡ + 4000๐‘ค = 100๐‘งฬ‡ + 1000๐‘ง + 3000๐‘ข
(a) Assume all initial conditions are zero and convert the equations above to Laplace domain.
97
Z
W
U
(b) Demonstrate that if you solve for W(s) in the first equation and then substitute this
expression for W(s) into the 2nd equation, when you solve for Z(s) you get
3000 + 300๐‘ 
๐‘(๐‘ ) = [ 3
] ๐‘ˆ(๐‘ )
๐‘  + 40๐‘  2 + 300๐‘  + 3000
Quiz 13 Solution
The differential equations for the suspension shown below with input displacement u(t) are
10๐‘งฬˆ + 100๐‘งฬ‡ + 1000๐‘ง = 100๐‘คฬ‡ + 1000๐‘ค
100๐‘คฬ‡ + 4000๐‘ค = 100๐‘งฬ‡ + 1000๐‘ง + 3000๐‘ข
(a) Assume all initial conditions are zero and convert the equations above to Laplace domain.
Z
W
U
๐‘งฬˆ + 10๐‘งฬ‡ + 100๐‘ง = 10๐‘คฬ‡ + 100๐‘ค
๐‘คฬ‡ + 40๐‘ค = ๐‘งฬ‡ + 10๐‘ง + 30๐‘ข
Laplace transforming gives
(๐‘  2 + 10๐‘  + 100)๐‘(๐‘ ) = (10๐‘  + 100)๐‘Š(๐‘ )
(๐‘  + 40)๐‘Š(๐‘ ) = (๐‘  + 10)๐‘(๐‘ ) + 30๐‘ˆ(๐‘ )
(b) Demonstrate that if you solve for W(s) in the first equation and then substitute this
expression for W(s) into the 2nd equation, when you solve for Z(s) you get
(๐‘  + 10)๐‘(๐‘ ) + 30๐‘ˆ(๐‘ )
๐‘Š(๐‘ ) =
(๐‘  + 40)
(๐‘  + 10)๐‘(๐‘ ) + 30๐‘ˆ(๐‘ )
(๐‘  2 + 10๐‘  + 100)๐‘(๐‘ ) = (10๐‘  + 100)
(๐‘  + 40)
98
๐‘(๐‘ ) = [
๐‘ 3
3000 + 300๐‘ 
] ๐‘ˆ(๐‘ )
+ 40๐‘  2 + 300๐‘  + 3000
Quiz 14
Express the following differential equation with input u in state variable format. What are the initial
conditions for the state variables?
๐‘ฃฬˆ + 5๐‘ฃฬ‡ + 10๐‘ฃ = 20๐‘ขฬ‡ + 40๐‘ข
๐‘ฃ(0− ) = 3
๐‘ฃฬ‡ (0− ) = 0.5
๐‘ข(0− ) = 0
Quiz 14 solution
Express the following differential equation with input u in state variable format. What are the initial
conditions for the state variables?
๐‘ฃฬˆ + 5๐‘ฃฬ‡ + 10๐‘ฃ = 20๐‘ขฬ‡ + 40๐‘ข
๐‘ฅ1 = ๐‘ฃ
๐‘ฃ(0− ) = 3
๐‘ฅ1 (0− ) = 3
๐‘ฅ2 = ๐‘ฃฬ‡ − 20๐‘ข
๐‘ฅฬ‡ 1 = ๐‘ฅ2 + 20๐‘ข
๐‘ฃฬ‡ (0− ) = 0.5
๐‘ข(0− ) = 0
๐‘ฅ2 (0− ) = 0.5
๐‘ฅฬ‡ 2 = −10๐‘ฅ1 − 5๐‘ฅ2 − 60๐‘ข
Quiz 15
A dynamic system is represented by the differential equation shown below.
๐‘งฬˆ + 7๐‘งฬ‡ + 10๐‘ง = 14๐‘ขฬ‡ + 20๐‘ข
(a) What is the transfer function of this system?
(b) What are the eigenvalues of this system?
(c) What are the time constants for this system?
(d) Suppose the input u(t) is a unit step. What will be the final value of z(t)?
(e) How long will it take for z(t) to be within 1% of this final value?
Quiz 15 Solution
A dynamic system is represented by the differential equation shown below.
๐‘งฬˆ + 7๐‘งฬ‡ + 10๐‘ง = 14๐‘ขฬ‡ + 20๐‘ข
(a) What is the transfer function of this system?
14๐‘  + 20
2
๐‘  + 7๐‘  + 10
(b) What are the eigenvalues of this system?
Eigenvalues = -5 and -2
(c) What are the time constants for this system?
99
Time constants = 1/5 and ½
(d) Suppose the input u(t) is a unit step. What will be the final value of z(t)?
0 + 0 + 10๐‘ง(∞) = 0 + 20(1)
๐‘ง(∞) = 2
(e) How long will it take for z(t) to be within 1% of this final value?
It takes about five times the largest time constant = 5/2 = 2.5 seconds
Quiz 16
Perform the following matrix operations:
(1)
1
๐‘Ž = [4
7
1
(2) ๐‘Ž = [4
7
2 3
5 6]
8 9
2 3
5 6]
8 9
๐‘Ž๐‘‡ =
1
๐‘ = [ 1]
1
๐‘Ž๐‘ =
๐‘ฅ1
(3) [−2 4 −1] [๐‘ฅ2 ] =
๐‘ฅ3
1 2 ๐‘ข
1
(4) [3 4] [๐‘ข ] =
2
5 6
1
(5) [2] [4
3
5 6] =
1
1
(6) [2] .∗ [2]
3
3
Express the differential equation below in matrix state variable format, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘งโƒ› + 2๐‘งฬˆ + 3๐‘งฬ‡ + 8๐‘ง = 10๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
๐‘ฆ = 0.1๐‘งฬˆ
100
Quiz 16 Solution
Perform the following matrix operations:
(1)
1
๐‘Ž = [4
7
1
(2) ๐‘Ž = [4
7
2 3
5 6]
8 9
2 3
5 6]
8 9
1
๐‘Ž = [2
3
๐‘‡
1
๐‘ = [ 1]
1
4 7
5 8]
6 9
6
๐‘Ž๐‘ = [15]
24
๐‘ฅ1
(3) [−2 4 −1] [๐‘ฅ2 ] = −2๐‘ฅ1 + 4๐‘ฅ2 − ๐‘ฅ3
๐‘ฅ3
๐‘ข1 + 2๐‘ข2
1 2 ๐‘ข
1
(4) [3 4] [๐‘ข ] = [3๐‘ข1 + 4๐‘ข2 ]
2
5๐‘ข1 + 6๐‘ข2
5 6
1
(5) [2] [4
3
4
5
5
5 6] = [ 8 10 12]
12 15 18
1
1
1
(6) [2] .∗ [2] = [4]
3
3
9
Express the differential equation below in matrix state variable format, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
๐‘งโƒ› + 2๐‘งฬˆ + 3๐‘งฬ‡ + 8๐‘ง = 10๐‘ข
๐‘ฅ1 = ๐‘ง
๐‘ฅ2 = ๐‘งฬ‡
๐‘ฆ = 0.1๐‘งฬˆ
๐‘ฅ3 = ๐‘งฬˆ
๐‘ฅฬ‡ 1
0
1
0 ๐‘ฅ1
0
๐‘ฅ
+
[๐‘ฅฬ‡ 2 ] = [ 0
]
[
]
[
0
1
0 ]๐‘ข
2
๐‘ฅ
๐‘ฅฬ‡ 3
−8 −3 −2 3
10
๐‘ฆ = [0 0
๐‘ฅ1
๐‘ฅ
0.1] [ 2 ] + [0]๐‘ข
๐‘ฅ3
101
Quiz 17
Solve the following differential equation using separation of variables.
20๐‘งฬ‡ + 60๐‘ง = 80
๐‘ง(0− ) = 2
Quiz 17
Solution
Solve the following differential equation using separation of variables.
20๐‘งฬ‡ + 60๐‘ง = 80
๐‘ง(0− ) = 2
๐‘ง(๐‘ก)
๐‘ก
1
∫
๐‘‘๐‘ง = − ∫ ๐‘‘๐‘ก = −๐‘ก
3๐‘ง − 4
2
0
Integrating gives
4 2
๐‘ง(๐‘ก) = + ๐‘’ −3๐‘ก
3 3
Quiz 18
The differential equation for the suspension system shown below is
๐‘งฬˆ + 0.8๐‘งฬ‡ + ๐‘ง = 0.8๐‘ขฬ‡ + ๐‘ข
z
u
(a) Express this differential equation in state variable format assuming y = u -z is the output of
interest.
(b) Enter your state variable equations in MATLAB using the ‘ss’ command.
(c) Use the ‘eig’ command to get the eigenvalues? Are these the correct values?
(d) Use the command ‘step’ to get a plot of y(t) for u(t) a step with magnitude 0.1. Does the plot
start and end at the correct initial and final values?
Get one of the instructors to confirm your graph _________________
102
Quiz 18 Solution
The differential equation for the suspension system shown below is
๐‘งฬˆ + 0.8๐‘งฬ‡ + ๐‘ง = 0.8๐‘ขฬ‡ + ๐‘ข
z
u
(a) Express this differential equation in state variable format assuming y = u -z is the output of
interest.
๐‘ฅ1 = ๐‘ง
๐‘ฅ2 = ๐‘งฬ‡ − 0.8๐‘ข
0
1
0.8
๐‘‹ฬ‡ = [
]๐‘‹ + [
]๐‘ข
−1 −0.8
0.36
๐‘ฆ = [−1 0]๐‘‹ + [1]๐‘ข
(b) Enter your state variable equations in MATLAB using the ‘ss’ command.
>> A=[0 1;-1 -0.8];
>> B=[0.8;0.36];
>> C=[-1 0];
>>D=[1];
>>G=ss(A,B,C,D);
(c) Use the ‘eig’ command to get the eigenvalues? Are these the correct values?
>> ev=eig(A)
Eigenvalues = -0.4 ± j0.8
(d) Use the command ‘step’ to get a plot of y(t) for u(t) a step with magnitude 0.1. Does the plot
start and end at the correct initial and final values?
>> step(G)
The value of y at t = 0+ is 1 and the final value is 0.
Quiz 19
Obtain a straight line approximation for x3 in the neighborhood of x = 2.
Quiz 19 Solution
Obtain a straight line approximation for x3 in the neighborhood of x = 2.
๐‘ฅ 3 ≈ 23 + 12(๐‘ฅ − 2) = 12๐‘ฅ − 16
103
Quiz 20
Two simultaneous differential equations are shown below.
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −100๐‘ฅ1 − 2๐‘ฅ2
What are the two unknowns? _______________________
Eliminate ๐‘ฅ2 and get a single differential equation for ๐‘ฅ1 .
Quiz 20 Solution
The two unknowns are ๐‘ฅ1 ๐‘Ž๐‘›๐‘‘ ๐‘ฅ2 .
๐‘ฅฬˆ 1 + 2๐‘ฅฬ‡ 1 + 100๐‘ฅ1 = 0
Quiz 21
(a) Express the differential equation shown below in state variable format using matrices, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =?
The output of interest is ๐‘ฆ = ๐‘ง.
4๐‘งฬˆ + 24๐‘งฬ‡ + 40๐‘ง = 24๐‘ขฬ‡ + 40๐‘ข
๐‘ง(0− ) = 3
๐‘งฬ‡ (0− ) = 2 ๐‘ข(๐‘ก) = ๐‘ข๐‘›๐‘–๐‘ก ๐‘ ๐‘ก๐‘’๐‘
(b) What are the initial conditions for the state variables, i.e. ๐‘ฅ1 (0− ) =?, ๐‘ฅ2 (0− ) =?, ๐‘’๐‘ก๐‘.
(c) For an ode45 numerical simulation, what would you specify for the final time (when to stop
the simulation)?
Quiz 21 Solution
0
1
6
(a) ๐ด = [
]
๐ต=[
]
๐ถ = [1 0 ] ๐ท = [0]
−10 −6
−26
(b) ๐‘ฅ1 (0− ) = 3 ๐‘ฅ2 (0− ) = 2 Note, a unit step is zero at t = 0(c) Final time 5/3 sec.
Quiz 22
As shown below, two water tanks with the same diameter are connected by a long pipe. At time zero,
water starts to flow between the tanks.
H1
H2
Q
The equations for this system are as follows:
(1) Equation for height of water in tank #1: −๐‘„ − 10๐ปฬ‡1 = 0
(2) Equation for height of water in tank #2: ๐‘„ − 10๐ปฬ‡2 = 0
(3) Equation for flow through pipe:
๐‘„ = 0.5(๐ป1 − ๐ป2 )
๐ป1 (0− ) = 10 ๐‘š
๐ป2 (0− ) = 5 ๐‘š
๐‘š3
๐‘ 
104
(a) (30%) List the unknowns in these equations. Do we have enough equations to solve for all of the
unknowns?
(b) (60%) Considering the common sense aspects of this system, estimate the graphs below that we
would get by simulating these equations.
H1
Q
H2
0
t 0
0
t
t
(c) (10%) If the time constant for this system is 10 sec, approximately how long will it take for
the water in the tanks to reach equilibrium (heights quit changing)?
Quiz 23
A spring-mass –damper system is shown below; the displacement of the mass is x.
x
spring
damper
mass
Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this
system are as follows:
(1) Force balance on mass equation:
(2) Spring force equation:
(3) Damper force equation:
(a) List the unknowns.
10๐‘ฅฬˆ + ๐น๐‘  + ๐น๐‘‘ = 0 ๐‘ฅ(0− ) = 0 ๐‘ฅฬ‡ (0− ) = 2 ๐‘š/๐‘ 
๐น๐‘  = 1000๐‘ฅ
๐น๐‘‘ = 100๐‘ฅฬ‡
(b) Are any of the equations nonlinear?
(c) State for each equation if algebraic or differential.
(d) Laplace transform each of the equations.
๐ฟ{๐‘“} = ๐น(๐‘ )
๐ฟ{๐‘“ฬ‡ } = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ{๐‘“ฬˆ} = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡(0− )
105
Quiz 24
A spring-mass –damper system is shown below; the displacement of the mass is x.
x
input
force
Fi
spring
damper
mass
Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this
system are as follows:
(1) Force balance on mass equation:
(2) Spring force equation:
(3) Damper force equation:
10๐‘ฅฬˆ + ๐น๐‘  + ๐น๐‘‘ − ๐น๐‘– = 0 ๐‘ฅ(0− ) = 0 ๐‘ฅฬ‡ (0− ) = 2 ๐‘š/๐‘ 
๐น๐‘  = 1000๐‘ฅ
๐น๐‘‘ = 100๐‘ฅฬ‡
(a) (70%) Solve for the transfer function relating X(s) to Fi(s), i.e. ๐‘‹(๐‘ ) = [? ]๐น๐‘– (๐‘ )
Note, the initial conditions do not affect the transfer function
(b) (30%) What are the eigenvalues of this system?
๐ฟ{๐‘“} = ๐น(๐‘ )
๐ฟ{๐‘“ฬ‡ } = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ{๐‘“ฬˆ} = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡(0− )
Quiz 25
Obtain a linear approximation for the following differential equation by obtaining a straight line
approximation for x3. Note, realizing that x will become a constant as t→ ∞, what is final value
of x?
2๐‘ฅฬˆ + 4๐‘ฅฬ‡ + 2๐‘ฅ 3 = 54
๐‘ฅ(0− ) = 1
๐‘ฅฬ‡ (0− ) = 0
106
Quiz 26
A spring-mass –damper system is shown below; the displacement of the mass is x.
x
input
force
Fi
spring
damper
mass
Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this
system are as follows:
(1) Force balance on mass equation:
(2) Spring force equation:
(3) Damper force equation:
10๐‘ฅฬˆ + ๐น๐‘  + ๐น๐‘‘ − ๐น๐‘– = 0 ๐‘ฅ(0− ) = 0 ๐‘ฅฬ‡ (0− ) = 2 ๐‘š/๐‘ 
๐น๐‘  = 1000๐‘ฅ
๐น๐‘‘ = 100๐‘ฅฬ‡
Assume ๐น๐‘– (๐‘ ) = 10/๐‘  and then Laplace transform these equations and then solve for
X(s). The answer should be the ratio of two polynomials, i.e.
๐‘‹(๐‘ ) =
๐ฟ{๐‘“} = ๐น(๐‘ )
๐‘Ž๐‘  ๐‘š + ๐‘๐‘  ๐‘š−1 + โ‹ฏ
๐‘๐‘  ๐‘› + ๐‘๐‘  ๐‘›−1 + โ‹ฏ . .
๐ฟ{๐‘“ฬ‡ } = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ{๐‘“ฬˆ} = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡(0− )
Quiz 27
It has been demonstrated that the Laplace transform of a unit impulse function is 1. Prove this
by using the integral definition of the Laplace transform of a unit pulse shown below and then
taking the limit as b goes to zero.
f(t)
f(t)
1
b
0
limit as b → 0
0
t
b
unit pulse
t
unit impulse
∞
๐น(๐‘ ) = ∫ ๐‘“(๐‘ก)๐‘’ −๐‘ ๐‘ก ๐‘‘๐‘ก
0
107
Quiz 28
The input ๐‘“(๐‘ก) to the following differential equation is shown below
๐‘ฆ(0− ) = 1 ๐‘ฆฬ‡ (0− ) = 0
4๐‘ฆฬˆ + 8๐‘ฆฬ‡ + 24๐‘ฆ = 12๐‘“(๐‘ก)
f(t)
4
2
t
0
Find the equation for the Laplace of the input, F(s), using the integral definition given below.
Show all steps even if you know the answer!
∞
๐น(๐‘ ) = ∫ ๐‘“(๐‘ก)๐‘’ −๐‘ ๐‘ก ๐‘‘๐‘ก
0
Quiz 29
The differential equation for the downward speed ๐‘ฃ of a sphere assuming a linear drag force and
assuming that the speed is zero when it is released is as follows
๐‘ฃฬ‡ + 20๐‘ฃ = 1000
๐‘ฃ(0− ) = 0 ๐‘š/๐‘ 
(a) Draw a picture of what you think the speed will look like as a function of time. Note, be
sure to show initial and final values and approximate time.
v (t )
0
t
(b) Laplace transform the differential equation and solve for V(s). Be sure to check your
V(s) using the initial and final value theorems.
(c) Use the Residue theorem to find the inverse Laplace transform of your V(s) which will be
an equation for v(t). Plug in t = 0 and t = ∞ to check your equation for v(t).
108
Quiz 30
A simple approximation for the transfer function equation relating a vertical force Fi generated
on the axle by an out of balance tire on a car to the force Fo transmitted through the suspension is
given by
๐น๐‘œ (๐‘ ) = [
๐‘ 2
6๐‘  + 3600
] ๐น (๐‘ )
+ 6๐‘  + 3600 ๐‘–
(a) What is the approximate resonant frequency for this transfer function? _______ Note, the
resonant frequency for a mode is the damped natural frequency.
(b) The frequency response for this transfer function has been generated in MATLAB using
the command ‘bode’ and is shown below. At what frequency does the gain of the
transfer function peak? __________ What is the gain of the transfer function at this
frequency? _______ Note, the gain is the magnitude of the transfer function. So if the
peak of the input force is 1 N, what will be the peak of the output force _______?
System: G
25
Bode Diagram
Frequency (rad/s): 60
Magnitude (dB): 20
20
Magnitude (dB)
15
10
5
0
-5
-10
-15
-20
0
Phase (deg)
-45
-90
-135
-180
10
2
Frequency (rad/s)
(c) If the radius of the tire is 0.3 m, what is the approximate speed of the car that generates
this peak?__________
109
Quiz 31
A spring-mass –damper system is shown below; the displacement of the mass is z.
z
spring
damper
mass
The differential equation for the position of the mass is as follows
๐‘งฬˆ + 0.1๐‘งฬ‡ + 0.01๐‘ง = 0
๐‘ง(0− ) = 0 ๐‘š ๐‘งฬ‡ (0− ) = 2 ๐‘š/๐‘ 
(a) Define state variables for this 2nd order differential equation and then write the derivative
equations for the state variables, i.e.
๐‘ฅ1 =?
๐‘ฅ2 =?
๐‘ฅฬ‡ 1 =?
๐‘ฅฬ‡ 2 =?
(b) Complete the first step of the Euler numerical integration solution of these state variable
equations to get values of the state variables after one time step of โˆ†๐‘ก = 1 sec.
t
๐‘ฅ1 (๐‘ก)
๐‘ฅ2 (๐‘ก)
๐‘ฅฬ‡ 1 (๐‘ก)
๐‘ฅฬ‡ 2 (๐‘ก)
๐‘ฅ1 (๐‘ก + โˆ†๐‘ก)
๐‘ฅ2 (๐‘ก + โˆ†๐‘ก)
0
1
110
Quiz 32
An object is released from an airplane at an altitude of 500 meters with an initial horizontal
velocity of 200 m/s and an initial vertical velocity of zero.
z
y
The differential equations for the horizontal displacement z and the downward displacement y of
the falling object considering gravity and aerodynamic drag are
๐‘งฬˆ + 0.005๐‘‰๐‘งฬ‡ = 0
๐‘ฆฬˆ + 0.005๐‘‰๐‘ฆฬ‡ = 9.8
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 200
๐‘ฆ(0− ) = 0
๐‘ฆฬ‡ (0− ) = 0
Where V is the magnitude of the velocity vector, i.e. ๐‘‰ = √๐‘งฬ‡ 2 + ๐‘ฆฬ‡ 2
(a) Are these equations linear or nonlinear? ___________
(b) How many state variables are needed to simulate the trajectory of the falling object? ___
(c) What would you choose for the state variables?
(d) What are the initial conditions for your state variables?
(e) What are the derivative equations for the state variables
111
Quiz 33
Initially a baseball is moving to the right at 50 m/s. At t = 0, a bat strikes the ball with an
impulse force with area 1500. The differential equation for the velocity of the ball is
10๐‘ฃฬ‡ + 1500๐›ฟ(๐‘ก) = 0
Use Laplace transform to get an equation for v(t). Plot v(t) below.
v(t)
0
t
It is impossible to include an impulse which has an infinite amplitude in a simulation. However,
realizing that the derivative of a unit step u(t) is a unit impulse ๐›ฟ(๐‘ก), we can rewrite the
differential equation above as
10๐‘ฃฬ‡ + 1500๐‘ขฬ‡ = 0
where u(t) is a unit step.
Complete the MATLAB code below for an ode45 simulation to get a plot of v(t).
[t,x] = ode45(@Qeqns,( ? ),( );
plot(
? )
% M-file Qeqns
function dx = Qeqns(t,x)
dx = zeros( ? );
dx = ?
end
๐ฟ{๐‘“ฬ‡ } = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
112
Quiz 34
We know that a transfer function of s means that we are differentiating the input to the that
transfer function. As we have discussed in class, differentiating any signal with high frequency
noise is a disaster. Consequently, it is desirable to filter out the noise before taking the
derivative. The way to do this is with a band limited differentiator such as the one shown below.
๐‘Œ(๐‘ ) = [
๐‘ 
] ๐‘ˆ(๐‘ )
10๐‘  + 1
Suppose we want the digital version of the band limited differentiator assuming a zero order hold
digital to analog convertor is to be used. Suggest a sample time T that would be appropriate?
T = _____ Explain how you got this value.
Using ‘c2d’ in MATLAB
>> T =
>> G = tf([1 0],[10 0]);
>> Gd = c2d(G,T)
For a certain value of T we get
๐‘Œ(๐‘ง) = [
0.1๐‘ง − 0.1
] ๐‘ˆ(๐‘ง)
๐‘ง − 0.9048
What is the line of code in a digital computer program to calculate Yk?
Quiz 35
The schematic of a vehicle suspension system is shown below. The vehicle is moving to the
right. At t = 0, the contact point at the ground encounters a step with magnitude 0.02 m.
Complete the MATLAB ode45 commands below for a numerical simulation that generates a plot
of z(t).
[t,x]=ode45(@QE,[0
plot(
?],[
?
? ])
)
function dx=QE(t,x)
dx=zeros(
?
);
end
z
๏€ฆ
z๏€ฆ+ 20 z๏€ฆ+ 100 z = 20u๏€ฆ+ 100u
z (0 − ) = 0
u
0.02 m
z๏€ฆ(0 − ) = 0
113
Previous Homework and Solutions
Homework 1
For each of the differential equations below, solve for the Laplace transform of y(t) which is
denoted by Y(s). In every case, the answer should be the ratio of two polynomials; no other form
is acceptable. For example
2๐‘  2 + 4๐‘  + 5
๐‘Œ(๐‘ ) = 3
8๐‘  + 7๐‘  2 + 3๐‘  + 4
1. ๐‘ฆฬ‡ + 3๐‘ฆ = 0
๐‘ฆ(0− ) = 4
2. ๐‘ฆฬ‡ + 3๐‘ฆ = 2
๐‘ฆ(0− ) = 4
3. ๐‘ฆฬ‡ + 3๐‘ฆ = 10๐›ฟ(๐‘ก)
๐‘ฆ(0− ) = 4
4. 5๐‘ฆฬˆ + 2๐‘ฆฬ‡ + 3๐‘ฆ = 0
๐‘ฆ(0− ) = 4
๐‘ฆฬ‡ (0− ) = 8
−)
5. 5๐‘ฆฬˆ + 2๐‘ฆฬ‡ + 3๐‘ฆ = 10
๐‘ฆ(0 = 4
๐‘ฆฬ‡ (0− ) = 8
Homework 1 Solution
1.
2.
3.
4.
5.
4
๐‘ +3
4๐‘ +2
๐‘ (๐‘ +3)
14
๐‘ +3
20๐‘ +48
5๐‘ 2 +2๐‘ +3
20๐‘ 2 +48๐‘ +10
๐‘ (5๐‘ 2 +2๐‘ +3)
Homework 2
Use the residue theorem to find the inverse Laplace transform y(t) for each of the following Y(s):
1
1. ๐‘Œ(๐‘ ) = ๐‘ +4
๐‘ +2
2. ๐‘Œ(๐‘ ) = (๐‘ +5)(๐‘ +10)
๐‘ 2 +2๐‘ +10
3. ๐‘Œ(๐‘ ) = ๐‘ (๐‘ +2)(๐‘ +10)
๐‘ +4
4. ๐‘Œ(๐‘ ) = (๐‘ +2+๐‘—5)(๐‘ +2−๐‘—5)
Homework 2 Solution
Use the residue theorem to find the inverse Laplace transform y(t) for each of the following Y(s):
1
1. ๐‘Œ(๐‘ ) = ๐‘ +4
๐‘ฆ(๐‘ก) = ๐‘’ −4๐‘ก
๐‘ +2
2. ๐‘Œ(๐‘ ) = (๐‘ +5)(๐‘ +10)
3
8
๐‘ฆ(๐‘ก) = − 5 ๐‘’ −5๐‘ก + 5 ๐‘’ −10๐‘ก
114
๐‘ 2 +2๐‘ +10
5
๐‘ +4
4. ๐‘Œ(๐‘ ) = (๐‘ +2+๐‘—5)(๐‘ +2−๐‘—5)
−2−๐‘—5+4 −(2+๐‘—5)๐‘ก
−2+๐‘—5+4 −(2−๐‘—5)๐‘ก
๐‘’
+
๐‘’
−10๐‘—
๐‘—10
5
∅ = ๐‘ก๐‘Ž๐‘›−1 2 = 1.19 ๐‘Ÿ๐‘Ž๐‘‘
√29๐‘’ ๐‘—∅
−๐‘—∅
๐‘ฆ(๐‘ก) =
But,
−2 + ๐‘—5 + 4 = 2 + ๐‘—5 =
and
−2 − ๐‘—5 + 4 = 2 − ๐‘—5 = √29๐‘’
−√29๐‘’ −๐‘—∅ ๐‘’ −(2+๐‘—5)๐‘ก +√29๐‘’ ๐‘—∅ ๐‘’ −(2−๐‘—5)๐‘ก
So, y(t)=
9
๐‘ฆ(๐‘ก) = 0.5๐‘’ −0๐‘ก − 8 ๐‘’ −2๐‘ก + 8 ๐‘’ −10๐‘ก
3. ๐‘Œ(๐‘ ) = ๐‘ (๐‘ +2)(๐‘ +10)
๐‘—10
=
√29 −2๐‘ก ๐‘’ ๐‘—(5๐‘ก+∅) −๐‘’ −๐‘—(5๐‘ก+∅)
๐‘’
[
]
5
๐‘—2
=
√29 −2๐‘ก
๐‘’ sin
5
(5๐‘ก + ∅)
1
= √29e−2t sin (5๐‘ก + 1.19)
5
Note general formula for getting the sum of the two residues for a pair of complex poles:
๐‘(๐‘ )
๐‘Œ(๐‘ ) =
๐ท(๐‘ )(๐‘  + ๐‘Ÿ + ๐‘—๐œ”)(๐‘  + ๐‘“ − ๐‘—๐œ”)
๐‘€ −๐‘Ÿ๐‘ก
๐‘ฆ(๐‘ก) = ๐‘’ sin(๐œ”๐‘ก + ∅) + ∑ ๐‘Ÿ๐‘’๐‘ ๐‘–๐‘‘๐‘ข๐‘’๐‘  ๐‘“๐‘œ๐‘Ÿ ๐‘Ÿ๐‘œ๐‘œ๐‘ก๐‘  ๐‘œ๐‘“ ๐ท(๐‘ )
๐œ”
๐‘(๐‘ )
๐‘(๐‘ )
where ∅ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’ [๐ท(๐‘ )]
and
๐‘€ = |๐ท(๐‘ )|
๐‘ =−๐‘Ÿ+๐‘—๐œ”
๐‘ =−๐‘Ÿ+๐‘—๐œ”
Homework #3
(a) For each of the differential equations below, solve for the Laplace transform of y(t) which is
denoted by Y(s). In every case, the answer should be the ratio of two polynomials with the
denominator factored; no other form is acceptable. For example
2๐‘  2 + 4๐‘  + 5
๐‘Œ(๐‘ ) =
(๐‘  + 2)(๐‘  + 10)[(๐‘  + .2)2 + 0. 52 ]
Then find the inverse Laplace transform of each Y(s) to get y(t) using the residue method for the
real poles and the short cut method (combined residues) for the complex poles.
1. ๐‘ฆฬ‡ + 3๐‘ฆ = 0
๐‘ฆ(0− ) = 4
2. ๐‘ฆฬ‡ + 3๐‘ฆ = 2
๐‘ฆ(0− ) = 4
3. ๐‘ฆฬ‡ + 3๐‘ฆ = 10๐›ฟ(๐‘ก)
๐‘ฆ(0− ) = 4
4. ๐‘ฆฬˆ + 5๐‘ฆฬ‡ + 6๐‘ฆ = 10๐›ฟ(๐‘ก) ๐‘ฆ(0− ) = 4
๐‘ฆฬ‡ (0− ) = 8
−)
5. 2๐‘ฆฬˆ + 0.8๐‘ฆฬ‡ + 0.58๐‘ฆ = 0
๐‘ฆ(0 = 4
๐‘ฆฬ‡ (0− ) = 8
6. 2๐‘ฆฬˆ + 0.8๐‘ฆฬ‡ + 0.58๐‘ฆ = 10
๐‘ฆ(0− ) = 4
๐‘ฆฬ‡ (0− ) = 8
(b) For 1. and 2. in part (a), solve these differential equations using the separation of variables
method and confirm that you got the same answers as found in part (a).
(c) For the following differential equations with input u(t), find the transfer functions and
eigenvalues.
1. ๐‘ฆโƒ› + 3๐‘ฆฬˆ + 11.25๐‘ฆฬ‡ + 18.5๐‘ฆ = 10๐‘ข
2. ๐‘ฆโƒ› + 3๐‘ฆฬˆ + 11.25๐‘ฆฬ‡ + 18.5๐‘ฆ = 10๐‘ข + 5๐‘ขฬ‡
3. 4๐‘ฆโƒ› + 12๐‘ฆฬˆ + 45๐‘ฆฬ‡ + 74๐‘ฆ = 12๐‘ข + 8๐‘ขฬ‡ + 4๐‘ขฬˆ
Homework 3 Solution
115
Homework 4
A cart with the ring attached to it moves latterly with displacement z and the ball rolls without
slip with angle ๐œƒ inside the ring.
๏ฑ
Z
The differential equations for this system assuming small angles can be shown to be
2.45๐œƒฬˆ + 0.98๐œƒฬ‡ + 9.8๐œƒ + ๐‘งฬˆ = 0
12๐‘งฬˆ + 720๐‘งฬ‡ + 1200๐‘ง + 3.5๐œƒฬˆ = 0
๐œƒ(0− ) = 0.5
๐‘ง(0− ) = 0
๐œƒฬ‡(0− ) = 0
๐‘งฬ‡ (0− ) = 0
1. Use symbolic math and the 'solve' command in MATLAB and solve for the Laplace
transform of ๐œƒ(๐‘ก), which is denoted by๐œƒ(๐‘ ). Use the initial value theorem to see if it is
correct.
2. Perform the inverse Laplace transform and get an equation for ๐œƒ(๐‘ก). Use 'pfract' to
simplify getting the inverse Laplace transform. Check the equation at t = 0; does it give
the initial value?
3. Using the ‘impulse’ command get values of ๐œƒ(๐‘ก). Use the output bracket format so you
will have values of ๐œƒ and t to use in the ๐œƒ(๐‘ก) equation and in the plot command.
[Th,t]=impulse( )
4. Using the plot command in MATLAB plot ๐œƒ(๐‘ก) as a function of time using values from
your equation and values from the impulse command (t and ๐œƒ). Both plots should be on
the same graph; use the xlabel, ylabel, title, and legend commands with your plots. Are
your plots identical? If not, find your error and get them to be identical.
116
Homework 4 Solution
A cart with the ring attached to it moves latterly with displacement z and the ball rolls without
slip with angle ๐œƒ inside the ring.
๏ฑ
Z
The differential equations for this system assuming small angles can be shown to be
2.45๐œƒฬˆ + 0.98๐œƒฬ‡ + 9.8๐œƒ + ๐‘งฬˆ = 0
12๐‘งฬˆ + 720๐‘งฬ‡ + 1200๐‘ง + 3.5๐œƒฬˆ = 0
๐œƒ(0− ) = 0.5
๐‘ง(0− ) = 0
๐œƒฬ‡(0− ) = 0
๐‘งฬ‡ (0− ) = 0
1. Use symbolic math in MATLAB and solve for the Laplace transform of ๐œƒ(๐‘ก), ๐œƒ(๐‘ ).
>> syms s Th Z
>> H=solve(2.45*(s^2*Th-0.5*s)+0.98*(s*Th-0.5)+9.8*Th+s^2*Z==0,...
(12*s^2+720*s+1200)*Z+3.5*(s^2*Th-0.5*s)==0,Z,Th);
>> TH=collect(H.Th,s);
>> pretty(TH)
3
2
185.0 s + 12684.0 s + 26040.0 s + 8400.0
---------------------------------------------------------4
3
2
370.0 s + 25368.0 s + 53760.0 s + 117600.0 s + 168000.0
This is the Laplace transform ๐œƒ(๐‘ ). Checking the initial value theorem to see if it is
correct:
185
๐œƒ(0+ ) = ๐‘ ๐œƒ(๐‘ )๐‘ →∞ = 370 = 0.5 which is correct since the initial value is 0.5.
2. Perform the inverse Laplace transform and get an equation for ๐œƒ(๐‘ก).
>> pfract([185 12684 26040 8400],[370 25368 53760 117600 168000])
Transfer function from input 1 to output:
-6.349e-005
----------s + 66.45
117
Tran10sfer function from input 2 to output:
0.4995 s + 0.1982
--------------------s^2 + 0.4034 s + 3.99
Transfer function from input 3 to output:
0.0005387
--------s + 1.713
>> roots([1 0.4034 3.99])
ans =
-0.2017 + 1.9873i
-0.2017 - 1.9873i
>> n=0.4995*(-0.2017+j*1.9873)+0.1982;
>> C=abs(n)/1.9873
C = 0.5019
>> phi=angle(n)
phi = 1.4729
Thus, the inverse Laplace transform of ๐œƒ(๐‘ ) is
๐œƒ(๐‘ก) = −0.00006349๐‘’ −66.45๐‘ก + 0.0005387๐‘’ −1.713๐‘ก + 0.5019๐‘’ −0.2017๐‘ก ๐‘ ๐‘–๐‘›( 1.9873๐‘ก
+ 1.4729)
Checking the answer at t = 0 gives ๐œƒ(0) = 0.5 which is the correct value.
3. Using the ‘impulse’ command get values of ๐œƒ(๐‘ก).
>> THtf=tf([185 12684 26040 8400],[370 25368 53760 117600 168000]);
>> [THt,t]=impulse(THtf); % Note, the output brackets give numerical values for theta and time
to be used in the equation for theta and in the plot command.
4. Using the plot command in MATLAB plot ๐œƒ(๐‘ก) as a function of time using values from your
equation and values from the impulse command (t and ๐œƒ). Both plots should be on the same
graph. Are your plots identical? If not, find your error and get them to be identical.
>> THfun=-0.00006349*exp(-66.45*t)+0.0005387*exp(-1.713*t)+ 0.5019*exp(-0.2017*t).*sin(1.9873*t+1.4729);
>> plot(t,THfun,'r.',t,THt,'b-')
>> ylabel('Theta, radians')
>> xlabel('Time, sec.')
>> legend('using inverse Laplace','using impulse command')
>> title('Homework 6 Solution')
118
Homework 6 Solution
0.5
using inverse Laplace
using impulse command
0.4
0.3
Theta, radians
0.2
0.1
0
-0.1
-0.2
-0.3
-0.4
0
5
10
15
Time, sec.
20
25
30
The two different approaches give identical results for the simulation of the angular position of
the ball in the ring. Note that it does start at 0.5 and ends at zero which are correct.
Homework 5
A cart with the ring attached to it moves latterly with displacement z and the ball rolls without slip with
angle ๐œƒ inside the ring. The force F is the input to the system.
๏ฑ
Z
F
The differential equations for this system assuming small angles can be shown to be
2.45๐œƒฬˆ + 0.98๐œƒฬ‡ + 9.8๐œƒ + ๐‘งฬˆ = 0
12๐‘งฬˆ + 720๐‘งฬ‡ + 1200๐‘ง + 3.5๐œƒฬˆ = ๐น
๐œƒ(0− ) = 0
๐‘ง(0− ) = 0
๐œƒฬ‡ (0− ) = 0
๐‘งฬ‡ (0− ) = 0
119
1. Use symbolic math in MATLAB and the ‘solve’ command to get the transfer function for ๐œƒ(๐‘ ).
2. What is the DC gain for this transfer function? What does this DC gain mean if F is a step input?
Explain why this makes sense.
3. Use the ‘damp’ command to get the eigenvalues, damping ratios, undamped natural
frequencies, and time constants.
4. Use ‘pfract’ to determine the modes of this system. This system consists of two basic
components, the cart and the ball. See if you can determine by common sense which modes are
associated with each component.
5. Assume that F is a step with magnitude of 1000 and use the ‘step’ command to get a plot of
๐œƒ(๐‘ก). Is the time required to reach steady state approximately 5 times the largest time
constant? Is the oscillatory nature of the response consistent with the magnitude of the
damping ratio?
6. Assume that F = 1000e-5t and use the ‘impulse’ command to get a plot of ๐œƒ(๐‘ก).
Homework 5
Solution
A cart with the ring attached to it moves latterly with displacement z and the ball rolls without slip with
angle ๐œƒ inside the ring. The force F is the input to the system.
๏ฑ
Z
F
The differential equations for this system assuming small angles can be shown to be
2.45๐œƒฬˆ + 0.98๐œƒฬ‡ + 9.8๐œƒ + ๐‘งฬˆ = 0
12๐‘งฬˆ + 720๐‘งฬ‡ + 1200๐‘ง + 3.5๐œƒฬˆ = ๐น
๐œƒ(0− ) = 0
๐‘ง(0− ) = 0
๐œƒฬ‡ (0− ) = 0
๐‘งฬ‡ (0− ) = 0
1. Use symbolic math in MATLAB and the ‘solve’ command to get the transfer function for ๐œƒ(๐‘ ).
>> syms s F Th Z
>> H=solve((2.45*s^2+0.98*s+9.8)*Th+s^2*Z==0,...
(12*s^2+720*s+1200)*Z+3.5*s^2*Th==F,Z,Th);
>> h=collect(H.Th,s);
>> h=collect(h,F);
>> pretty(h)
-50 s^2
--------------------------------------------------------------------------- F
1295 s^4 + 88788 s^3 + 188160 s^2 + 411600 s + 588000
120
2. What is the DC gain for this transfer function? What does this DC gain mean if F is a step input?
Explain why this makes sense.
>> G=tf([-50 0 0],[1295 88788 188160 411600 588000]);
>> dcgain(G)
ans = 0
A DC gain of zero means that the final value of ๐œƒ will be zero if F is a constant input. This makes
sense since a constant positive input will move the cart to the left a fixed distance and even
though the cart has changed positions, the ball will end up at the bottom of the ring (๐œƒ = 0).
3. Use the ‘damp’ command to get the eigenvalues, damping ratios, undamped natural
frequencies, and time constants.
>> damp(G)
Eigenvalue
Damping
Undamped natural frequency (rad/s)
-1.71e+000
-2.02e-001 + 1.99e+000i
1.01e-001
2.00e+000
-2.02e-001 - 1.99e+000i
1.01e-001
2.00e+000
-6.64e+001
Time constants = 1/1.71, 1/0.202, and 1/66.4 seconds
4. Use ‘pfract’ to determine the modes of this system. This system consists of two basic
components, the cart and the ball. See if you can determine by common sense which modes are
associated with each component.
>> pfract([-50 0 0],[1295 88788 188160 411600 588000])
Mode #1
0.0005995
--------s + 66.45
Mode#2
-0.0003188 s + 0.000618
----------------------s^2 + 0.4034 s + 3.99
Mode #3
-0.0002808
---------s + 1.713
Mode 2 is an oscillatory mode which is associated with the ball rolling back and forth inside the
ring. Modes 1 and 3 by default have to be associated with the movement of the cart.
121
5. Assume that F is a step with magnitude of 1000 and use the ‘step’ command to get a plot of
๐œƒ(๐‘ก). Is the time required to reach steady state approximately 5 times the largest time
constant? Is the oscillatory nature of the response consistent with the magnitude of the
damping ratio?
>> step(1000*G)
Step Response
0.2
0.15
Amplitude
0.1
0.05
0
-0.05
-0.1
-0.15
0
5
10
15
20
25
30
Time (sec)
Note that the ball initially rolls up the right side of the ring which is consistent with the cart
suddenly being pushed to the left. Five times the time constant of the oscillatory mode is about
25 seconds which is approximately how long it takes for the ball to quit moving around and end
up at ๐œƒ = 0 . The smaller the damping ratio, the more oscillatory the response. The response is
consistent with a damping ratio of 0.1.
6. Assume that F = 1000e-5t and use the ‘impulse’ command to get a plot of ๐œƒ(๐‘ก).
For this F(t), ๐น(๐‘ ) =
๐œƒ(๐‘ ) =
1000
.
๐‘ +5
Thus,
−50๐‘  2
1000
[
]
4
3
2
1295๐‘  + 88788๐‘  + 188160๐‘  + 411600๐‘  + 588000 ๐‘  + 5
In MATLAB, the best way to multiply two transfer functions is with the 'series' command, i.e.
>> GF=series(G,tf(1000,[1 5]))
Transfer function:
-50000 s^2
-------------------------------------------------------------------------1295 s^5 + 95263 s^4 + 632100 s^3 + 1.352e006 s^2 + 2.646e006 s + 2.94e006
122
Pretending that GF is a transfer function with a unit impulse input allows us to get a plot of ๐œƒ(๐‘ก)
using the impulse command, i.e.
>> impulse(GF)
>> title('Response of ball for exponential force input')
>> ylabel('Ball angle, radians')
Response of ball for exponential force input
0.08
0.06
Ball angle, radians
0.04
0.02
0
-0.02
-0.04
-0.06
0
5
10
15
20
25
30
Time (sec)
Homework 6
Consider the following differential equation with input u(t) which is a unit step function.
๐‘งฬ‡ + 2๐‘ง = ๐‘ขฬ‡ + 6๐‘ข
๐‘ง(0− ) = 1
(a) Using Laplace transform and the residue theorem, find an equation for z(t).
(b) Express the original differential equation in the format required for numerical analysis.
1
Using 10 of the time constant for T, use Euler's integration to compute z(T) and z(2T).
(c) Compare the values of z(T) and z(2T) obtained in part (b) with values of z(t) at t=T and t=2T
using your equation obtained in part (a). They should be very close for this small value of T. If
they are not close, then figure out which one you are doing incorrectly.
Homework 6
Solution
Consider the following differential equation with input u(t) which is a unit step function.
๐‘งฬ‡ + 2๐‘ง = ๐‘ขฬ‡ + 6๐‘ข
๐‘ง(0− ) = 1
(a) Using Laplace transform and the residue theorem, find an equation for z(t).
๐‘ ๐‘(๐‘ ) − 1 + 2๐‘(๐‘ ) = ๐‘ ๐‘ˆ(๐‘ ) − 0 + 6๐‘ˆ(๐‘ )
๐‘ˆ(๐‘ ) =
1
๐‘ 
Thus,
๐‘(๐‘ ) =
2๐‘  + 6
๐‘ (๐‘  + 2)
123
Using the residue theorem to find the inverse Laplace transform gives
๐‘ง(๐‘ก) = 3 − ๐‘’ −2๐‘ก
(b) Express the original differential equation in the format required for numerical analysis.
1
Using 10 of the time constant for T, use Euler's integration to compute z(T) and z(2T).
๐‘งฬ‡ − ๐‘ขฬ‡ = 6๐‘ข − 2๐‘ง
Thus,
๐‘ฅ =๐‘ง−๐‘ข
and ๐‘ฅฬ‡ = 6๐‘ข − 2๐‘ง = 6๐‘ข − 2(๐‘ฅ + ๐‘ข) = −2๐‘ฅ + 4๐‘ข
Time constant =1/2 = 0.5. Thus, T = 0.05
(c) Compare the values of z(T) and z(2T) obtained in part (b) with values of z(t) at t=T and t=2T
using your equation obtained in part (a). They should be very close for this small value of T. If
they are not close, then figure out which one you are doing incorrectly.
t
x(t)
0-
1
0.05 1.1
x(t+T)=
๐‘ฅฬ‡ (๐‘ก) =
−2๐‘ฅ(๐‘ก) + 4๐‘ข(๐‘ก) T๐‘ฅฬ‡ (๐‘ก) + ๐‘ฅ(๐‘ก)
-2 + 4 = 2
0.05*2 + 1=1.1
-2*1.1 + 4= 1.8
0.10 1.19 -2*1.19+4=1.62
z(t+T)=
Analytical Sol.
x(t+T)+u(t+T) 3 − ๐‘’ −2(๐‘ก+๐‘‡)
1.1+1=2.1
3 − ๐‘’ −2(.05) =
2.095
0.05*1.8+1.1=
1.19+1=2.19
3 − ๐‘’ −2(0.1) =
1.19
2.181
0.05*1.62+1.19= 1.271+1=
3 − ๐‘’ −2(0.15) =
1.271
2.271
2.259
Because of the ๐‘ขฬ‡ term in the original differential equation which is an impulse for ๐‘ข a step, the
๐‘ง(0− ) ≠ ๐‘ง(0+ ) = 2. Regardless, z(0.05) and z(0.1) from both methods of solution are very
close, i.e.
2.1 compared to 2.095 and 2.19 compared to 2.181
124
Homework 7
Use 'ode45' in MATLAB and generate a plot of ๐‘ฃฬ‡ (๐‘ก) for the following differential equation. The
input u(t) is a step with magnitude of 0.5.
2๐‘ฃโƒ› + 18๐‘ฃฬˆ + 6.6๐‘ฃฬ‡ 3 + 130๐‘ฃ = 22๐‘ขฬ‡ + 260๐‘ข
๐‘ฃ(0− ) = 0
๐‘ฃฬ‡ (0− ) = 0.5
๐‘ฃฬˆ (0− ) = 0.2
Homework 7 Solution
Homework 8
Consider the following differential equation for a suspension system:
๐‘ฆฬˆ + 6.5๐‘ฆฬ‡ + 9,800๐‘ฆ 3 = 9.8
1. What is the order of the differential equation? ____________
2. Assuming ๐‘ฆ(๐‘ก) → ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก as ๐‘ก → ∞, what will be the value of this constant?_____________
3. Assuming that the initial conditions for this differential equation are ๐‘ฆฬ‡ (0− ) = 0 ๐‘Ž๐‘›๐‘‘ ๐‘ฆ(0− ) =
0.11 , draw a sketch of ๐‘ฆ(๐‘ก) starting at ๐‘ก = 0.
4. Obtain a linear approximation for this differential equation by obtaining a straight line
approximation for ๐‘ฆ 3 using the point and slope method. Be sure to start by sketching ๐‘ฆ 3 and
noting the location of your straight line.
5. After substituting your straight line into the original differential equation, check to see if the
new linearized differential equation gives the correct final value.
Homework 8
Solution
Consider the following differential equation for a suspension system:
๐‘ฆฬˆ + 6.5๐‘ฆฬ‡ + 9,800๐‘ฆ 3 = 9.8
1. What is the order of the differential equation? ____________2
2. Assuming ๐‘ฆ(๐‘ก) → ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก as ๐‘ก → ∞, what will be the value of this constant?_____0.1
3. Assuming that the initial conditions for this differential equation are ๐‘ฆฬ‡ (0− ) = 0 ๐‘Ž๐‘›๐‘‘ ๐‘ฆ(0− ) =
0.11 , draw a sketch of ๐‘ฆ(๐‘ก) starting at ๐‘ก = 0.
Starts at 0.11 and t=0 and ends at 0.1 as t approaches infinity.
125
4.
Obtain a linear approximation for this differential equation by obtaining a straight line
approximation for ๐‘ฆ 3 using the point and slope method. Be sure to start by sketching ๐‘ฆ 3 and
noting the location of your straight line.
Y3=0.13+3(.1)2(y-0.1)=0.001+0.03(y-0.1)=0.03y-0.002
5.
After substituting your straight line into the original differential equation, check to see if the
new linearized differential equation gives the correct final value.
y’’+6.5y’+9800[.03y-0.002]=9.8
Or
y’’+6.5y’+294y=29.4
The final value is 29.4/294 = 0.1 which checks.
Homework 9
The equations for a spring/mass/damper system are shown below.
(a) Laplace transform the three equations to get three algebraic equations in terms of the three
unknowns Y(s), ๐น๐‘  (๐‘ ), ๐‘Ž๐‘›๐‘‘ ๐น๐‘‘ (๐‘ ) and in terms of the ground input U(s).
Assume ๐‘ข(0− ) = 0
๐‘ฆ(0− ) = 0
๐‘ฆฬ‡ (0− ) = 2
(b) Since you now have three algebraic equations and three unknowns, you can eliminate the
unknowns ๐น๐‘  (๐‘ ) ๐‘Ž๐‘›๐‘‘ ๐น๐‘‘ (๐‘ ) and simplify the three equations down to one equation for the
unknown ๐‘Œ(๐‘ ). Do this to get an expression for ๐‘Œ(๐‘ ).
(c) What is the transfer function for this suspension system? What are the eigenvalues? What is
the time constant? What is the damping ratio? What is the undamped natural frequency?
(d) Assume u(t) is a step input with magnitude 0.2. Find an expression for Y(s); the answer will be a
numerator polynomial over a denominator polynomial. Check the accuracy of your Y(s) using
the initial and final value theorems.
126
Homework 9
Solution
The equations for a spring/mass/damper system are shown below.
(a) Laplace transform the three equations to get three algebraic equations in terms of the three
unknowns Y(s), ๐น๐‘  (๐‘ ), ๐‘Ž๐‘›๐‘‘ ๐น๐‘‘ (๐‘ ) and in terms of the ground input U(s).
Assume ๐‘ข(0− ) = 0
๐‘ฆ(0− ) = 0
๐‘ฆฬ‡ (0− ) = 2
100
10[๐‘  2 ๐‘Œ(๐‘ ) − 2] + ๐น๐‘  (๐‘ ) + ๐น๐‘‘ (๐‘ ) = −
๐‘ 
๐น๐‘  (๐‘ ) = 1000[๐‘Œ(๐‘ ) − ๐‘ˆ(๐‘ )]
๐น๐‘‘ (๐‘ ) = 40๐‘ [๐‘Œ(๐‘ ) − ๐‘ˆ(๐‘ )]
(b) Since you now have three algebraic equations and three unknowns, you can eliminate the
unknowns ๐น๐‘  (๐‘ ) ๐‘Ž๐‘›๐‘‘ ๐น๐‘‘ (๐‘ ) and simplify the three equations down to one equation for the
unknown ๐‘Œ(๐‘ ). Do this to get an expression for ๐‘Œ(๐‘ ).
10[๐‘  2 ๐‘Œ(๐‘ ) − 2] + 40๐‘ ๐‘Œ(๐‘ ) + 1000๐‘Œ(๐‘ ) = [40๐‘  + 1000]๐‘ˆ(๐‘ ) −
100
๐‘ 
40๐‘  + 1000
20๐‘  − 100
] ๐‘ˆ(๐‘ ) +
2
+ 40๐‘  + 1000
๐‘ (10๐‘  + 40๐‘  + 1000)
(c) What is the transfer function for this suspension system? What are the eigenvalues? What is
the time constant? What is the damping ratio? What is the undamped natural frequency?
๐‘Œ(๐‘ ) = [
Transfer function:
10๐‘  2
40๐‘ +1000
10๐‘ 2 +40๐‘ +1000
Eigenvalues: −2 + ๐‘—9.798 ๐‘Ž๐‘›๐‘‘ − 2 − ๐‘—9.798
Time constant: 0.5 sec
Damping ratio: 0.2
Undamped natural frequency: 10 rad/sec
127
(d) Assume u(t) is a step input with magnitude 0.2. Find an expression for Y(s); the answer will be a
numerator polynomial over a denominator polynomial. Check the accuracy of your Y(s) using
the initial and final value theorems.
๐‘Œ(๐‘ ) = [
40๐‘  + 1000
0.2
20๐‘  − 100
+
]
2
+ 40๐‘  + 1000 ๐‘ 
๐‘ (10๐‘  + 40๐‘  + 1000)
10๐‘  2
which simplifies to
๐‘Œ(๐‘ ) = [
28๐‘  + 100
]
+ 40๐‘  + 1000]
๐‘ [10๐‘  2
100
Final value theorem: ๐‘ฆ(∞) = 1000 = 0.1 which checks since when you plug u=0.2 and all
derivatives equal to zero into the original three equations and solve for y, you get 0.1.
Initial value theorem: ๐‘ฆ(0+ ) = 0 which matches the initial condition on ๐‘ฆ(๐‘ก), ๐‘ฆ(0− ) = 0.
Note, if you multiply Y(s) by s, you get the Laplace transform for ๐‘ฆฬ‡ (๐‘ก), i.e.
28๐‘  + 100
]
[10๐‘  2 + 40๐‘  + 1000]
Applying the initial value theorem gives ๐‘ฆฬ‡ (0+ ) = 2.8 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘–๐‘  ๐‘”๐‘Ÿ๐‘’๐‘Ž๐‘ก๐‘’๐‘Ÿ ๐‘กโ„Ž๐‘Ž๐‘› ๐‘ฆฬ‡ (0− ) = 2.
๐‘Œฬ‡(๐‘ ) = [
This difference is due to the ๐‘ขฬ‡ term in the equations which is an impulse when ๐‘ข is a step; that
is, an impulse force acting on the mass causes the velocity of the mass to instantly change.
Homework 10
The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 − ๐ป2 = 250๐‘„ฬ‡
H1
๐ป1 (0− ) = 3
๐ป2 (0− ) = 5
๐‘„(0− ) = 0
H2
Q
128
(a) If you Laplace transform each of these three equations you get
−๐‘„ − 20[๐‘ ๐ป1 (๐‘ ) − 3] = 0
๐‘„ − 40[๐‘ ๐ป2 − 5] = 0
๐ป1 − ๐ป2 = 250[๐‘ ๐‘„(๐‘ ) − 0]
(b) Use symbolic math in MATLAB to get
๐ป1 =
1.5๐‘ฅ108 ๐‘  2 + 65,000
๐‘ (5๐‘ฅ107 ๐‘  2 + 15,000)
(c) Use the residue theorem and shortcut for complex poles to get an equation for H1(t).
(d) Use the ‘impulse’ command in MATLAB to get a plot of H1(t) and plot the equation found in
part (c) on the same graph with red dots for comparison.
Homework 10
Solution
The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 − ๐ป2 = 250๐‘„ฬ‡
๐ป1 (0− ) = 3
๐ป2 (0− ) = 5
๐‘„(0− ) = 0
H1
H2
Q
(a) If you Laplace transform each of these three equations you get
−๐‘„ − 20[๐‘ ๐ป1 (๐‘ ) − 3] = 0
๐‘„ − 40[๐‘ ๐ป2 − 5] = 0
๐ป1 − ๐ป2 = 250[๐‘ ๐‘„(๐‘ ) − 0]
(b) Use symbolic math in MATLAB to get
๐ป1 =
1.5๐‘ฅ108 ๐‘  2 + 65,000
๐‘ (5๐‘ฅ107 ๐‘  2 + 15,000)
syms s H1 Q H2
H=solve(-Q-20*(s*H1-3)==0,Q-40*(s*H2-5)==0,H1-H2==250*s*Q,H1,H2,Q);
H1=H.H1;
pretty(H1)
129
30000 s^2 + 13
H1(s) =
---------------------
3๐‘ 2 +13๐‘ฅ10−4
3๐‘ 2 +13๐‘ฅ10−4
= ๐‘ (๐‘ 2 +3๐‘ฅ10−4 ) = ๐‘ (๐‘ 2 +0๐‘ +0.017322 )
s (10000 s^2 + 3)
(c) Use the residue theorem and shortcut for complex poles to get an equation for H1(t).
13๐‘ฅ10−4 0๐‘ก
๐‘’ 0๐‘ก
3๐‘  2 + 13๐‘ฅ10−4
๐ป1 (๐‘ก) =
๐‘’
+
|
|
sin (0.01732๐‘ก + ∅)
3๐‘ฅ10−4
0.01732
๐‘ 
๐‘ =0+๐‘—0.01732
|
3๐‘  2 + 13๐‘ฅ10−4
3(๐‘—0.01732)2 + 13๐‘ฅ10−4
|
=|
| = 0.023098
๐‘ 
๐‘—0.01732
๐‘ =0+๐‘—0.01732
∅ = −1.5708
Thus
๐ป1 (๐‘ก) = 4.333 + 1.333sin (0.01732๐‘ก − 1.5708)
Checking at t = 0
๐ป1 (0) = 4.333 + 1.333(−1) = 3 which is correct!
(d) Use the ‘impulse’ command in MATLAB to get a plot of H1(t) and plot the equation found in
part (c) on the same graph with red dots for comparison.
>> [h1m,t]=impulse(h1,2000);
>> plot(t,h1m,'k',t,4.333+1.333*sin(0.01732*t-1.5708),'r.')
>> xlabel('time, sec.')
>> ylabel('H1')
>> title('Homework 5 comparing solutions to water tanks problem')
>> legend('solution from impulse command','inverse Laplace solution','location',’best’)
Homework 5 comparing solutions to water tanks problem
6
5.5
5
H1
solution from impulse command
inverse Laplace solution
4.5
4
3.5
3
0
500
1000
1500
time, sec.
2000
2500
130
Homework 11
The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 − ๐ป2 = 250๐‘„ฬ‡ + ๐‘…๐‘„
๐ป1 (0− ) = 3
๐ป2 (0− ) = 5
๐‘„(0− ) = 0
H1
H2
Q
(a) Laplace transform each of these three equations and solve for the Laplace transform for H1
by hand; that is, you do the algebra. The answer will be in terms of R.
(b) Repeat (a) only this time use symbolic math in MATLAB; confirm that you get the same
equation for H1(s).
(c) Determine the value of R that results in a damping ratio of 0.5 (or whatever I told you in
class). Once you have determined the necessary value for R, use the ‘subs’ command to get
the transfer function with the value of R needed for the desired damping ratio.
(d) Use the impulse command in MATLAB to get plots of H1(t) using the value of R found in part (c); plot
on the same graph, H1(t) for two other values of R, one 20% greater and one 20% smaller than
the R that gives your desired damping ratio. In what ways are these plots of H1 the same?
Different?
Homework 11 Solution
The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 − ๐ป2 = 250๐‘„ฬ‡ + ๐‘…๐‘„
๐ป1 (0− ) = 3
๐ป2 (0− ) = 5
๐‘„(0− ) = 0
131
H1
H2
Q
(a) Laplace transform each of these three equations and solve for the Laplace transform for H1
by hand; that is, you do the algebra. The answer will be in terms of R.
(b) Repeat (a) only this time use symbolic math in MATLAB; confirm that you get the same
equation for H1(s).
(c) Determine the value of R that results in a damping ratio of 0.5 (or whatever I told you in
class). Once you have determined the necessary value for R, use the ‘subs’ command to get
the transfer function with the value of R needed for the desired damping ratio.
(d) Use the impulse command in MATLAB to get plots of H1(t) using the value of R found in part (c); plot
on the same graph, H1(t) for two other values of R, one 20% greater and one 20% smaller than
the R that gives your desired damping ratio. In what ways are these plots of H1 the same?
Different?
syms s R Q H1 H2
H=solve(-Q-20*(s*H1-3)==0,Q-40*(s*H2-5)==0,H1-H2==250*s*Q+R*Q,H1,H2,Q);
pretty(H.H1)
digits 4
%The value of R in the following statements obtained using the results of
%the first three statements above.
h1a=vpa(subs(H.H1,R,3.4641));
h1b=vpa(subs(H.H1,R,3.4641*1.2));
h1c=vpa(subs(H.H1,R,3.4641*0.8));
%The polynomials in the following statements obtained using the results of
%the previous three statements above.
%The symbolic polynomials in the commands below were copied from the output
%of the previous three commands and then pasted into the ‘sym2poly’ command.
h1aTF=tf(sym2poly(30000.0*s^2 + 415.7*s + 13.0),sym2poly(s*(10000.0*s^2 +
138.6*s + 3.0)));
h1bTF=tf(sym2poly(30000.0*s^2 + 498.8*s + 13.0),sym2poly(s*(10000.0*s^2 +
166.3*s + 3.0)));
h1cTF=tf(sym2poly(30000.0*s^2 + 332.6*s + 13.0),sym2poly(s*(10000.0*s^2 +
110.9*s + 3.0)));
impulse(h1aTF,'k',h1bTF,'k.',h1cTF,'k-.',800)
legend('R = 3.4641','R = 1.2*3.4641','R = 0.8*3.4641','location','best')
title('Height H1 of water in the first tank following unequal height initial
conditions')
132
Height H1 of w ater in the first tank follow ing unequal height initial conditions
4.8
4.6
4.4
Amplitude
4.2
4
R = 3.4641
R = 1.2*3.4641
3.8
R = 0.8*3.4641
3.6
3.4
3.2
3
0
100
200
300
400
500
600
700
800
Time (seconds)
Adding friction associated with viscosity to the water flowing through the line between
tanks causes the water levels to eventually quit oscillating and settle at the correct steady
state height.
Homework 12
It can be shown that the differential equation for the suspension system shown below is a follows:
1000๐‘งฬˆ + 7200๐‘งฬ‡ + 36000๐‘ง = 7200๐‘ขฬ‡ + 36000๐‘ข
z
M=1000 kg
k=36000 N/m
b=7200 Ns/m
u
133
The solution to this differential equation is the displacement of the mass z(t) resulting from the nonsmooth road profile u(t) which represents a displacement input.
(a) What is the transfer function G(s) for this system?
(b) What are the eigenvalues, damping ratio, and time constant of this system?
๐‘ 
4
(c) Assume that ๐‘ข(๐‘ก) = 1 − cos (2๐‘ก). If ๐ฟ{cos(๐œ”๐‘ก)} = ๐‘ 2 +๐œ”2 show that ๐‘ˆ(๐‘ ) = ๐‘ (๐‘ 2 +4)
(d) For the u(t) in (c), obtain the expression for Z(s) assuming all initial conditions are zero, and then
using the inverse Laplace transform, find an equation for z(t). After finding the equation for z(t),
generate an array of values of t and z(t) in MATLAB using
>> t=0:0.01:7;
>> z=’your equation goes here’;
Don’t forget, when multiplying two arrays, element by element, you must use ‘.*’ instead of ‘*’.
Then, plot the results using:
>> plot(t,z)
Be sure to add a ‘title’, ‘xlabel’, and ‘ylabel’ to the plot.
(e) We have learned in class that you can get a plot of z(t) by pretending that Z(s) is a transfer
function with a unit impulse input and then using the command ‘impulse’ in MATLAB to
generate a plot of z(t). Use the ‘impulse’ command on Z(s) and then add this plot to the plot in
part (c) using the hold command. The plots should be identical so use dots for one of the
functions and the command ‘legend’ to distinguish between the two. Note, when you multiply
U(s) times the transfer function to get Z(s), use the command ‘series’ for multiplying two
transfer functions; do not use g*h where g and h are the two transfer functions to be
multiplied. Also, although not needed here, when adding two transfer functions, use ‘parrallel’;
do not simply add them such as g + h.
Note, instead of using the ‘hold’ command, you can use the following to get both plots of z(t) on
the same plot:
>> [zi]=impulse(Z,t);
>> plot(t,z,’r.’,t,zi,’k’)
Use this approach to generate a second combined plot. Be sure your plot has a ‘title’, ‘xlabel’,
‘ylabel’, and ‘legend’.
Confirm that the plots are identical.
(f) Another way to get a plot of z(t) is to use the command ‘lsim’. The commands will be as follows:
>> t=0:0.01:7; Actually, you don’t need to generate t again if the values of t are still in memory.
>> u=1-cos(2*t);
>> [zLsim]=lsim(G,u,t);
Generate a combined plot using
>> plot(t,z,’k.’,t,zi,’r+’,t,zLsim,’k*’)
Be sure your plot has a ‘title’, ‘xlabel’, ‘ylabel’, and ‘legend’.
Confirm that all three plots are identical.
134
(g) Considering the equation for the input u(t), what can you say about the resulting displacement
of the mass. For example, compare the input and output frequencies. Also, compare the input
and output amplitudes. You might want to plot z(t) and u(t) on the same graph to answer these
questions.
Homework 12
Solution
It can be shown that the differential equation for the suspension system shown below is a follows:
1000๐‘งฬˆ + 7200๐‘งฬ‡ + 36000๐‘ง = 7200๐‘ขฬ‡ + 36000๐‘ข
z
M=1000 kg
k=36000 N/m
b=7200 Ns/m
u
The solution to this differential equation is the displacement of the mass z(t) resulting from the nonsmooth road profile u(t) which represents a displacement input.
(a) What is the transfer function G(s) for this system?
7200๐‘ +36000
๐ป(๐‘ ) = 1000๐‘ 2 +7200๐‘ +36000
(b) What are the eigenvalues, damping ratio, and time constant of this system? -3.6±j4.8, 0.6, 0.278
(c) Assume that ๐‘ข(๐‘ก) = 1 − cos (2๐‘ก). If ๐ฟ{cos(๐œ”๐‘ก)} =
๐‘ 
๐‘ 2 +๐œ”2
show that ๐‘ˆ(๐‘ ) =
4
๐‘ (๐‘ 2 +4)
1
๐‘ 
4
− 2
=
2
๐‘  ๐‘  + 4 ๐‘ (๐‘  + 4)
(d) For the u(t) in (c), obtain the expression for Z(s) assuming all initial conditions are zero, and then
using the inverse Laplace transform, find an equation for z(t).
7200๐‘  + 36000
4
๐‘(๐‘ ) = ๐ป(๐‘ )๐‘ˆ(๐‘ ) =
2
2
1000๐‘  + 7200๐‘  + 36000 ๐‘ (๐‘  + 4)
The following m-file was used to express Z(s) in partial fractions:
๐ฟ{1 − cos(2๐‘ก)} =
G=tf([7.2 36],[1 7.2 36]);
Z=series(G,tf([4],[1 0 4 0]));
[num,den]=tfdata(Z,'v')
pfract(num,den)
๐‘(๐‘ ) =
1 0.104๐‘  + 0.842 −1.104๐‘  − 0.9356
+
+
๐‘  ๐‘  2 + 7.2๐‘  + 36
(๐‘  + 0)2 + 22
135
๐‘’ −3.6๐‘ก
|0.104๐‘  + 0.842|๐‘ =−3.6+๐‘—4.8 sin(4.8๐‘ก + ∅)
4.8
๐‘’ 0๐‘ก
|−1.104๐‘  − 0.9356|๐‘ =๐‘—2 sin (2๐‘ก + ๐œƒ)
+
2
= 1 + 0.14249๐‘’ −3.6๐‘ก sin(4.8๐‘ก + 0.81765) + 1.1049sin (2๐‘ก − 1.6131)
After finding the equation for z(t), generate an array of values of t and z(t) in MATLAB using
>> t=0:0.01:7;
>> z=’your equation goes here’;
Don’t forget, when multiplying two arrays, element by element, you must use ‘.*’ instead of ‘*’.
๐‘ง(๐‘ก) = 1 +
format shorte
t=0:0.01:7;
z=1+0.14249*exp(-3.6*t).*sin(4.8*t+0.81765)+1.1049*sin(2*t-1.6131);
plot(t,z,'k')
title('Homework 7 part(d)')
xlabel('time, sec.')
ylabel('z(t)')
Homework 7 part(d)
2.5
2
z(t)
1.5
1
0.5
0
-0.5
0
1
2
3
4
time, sec.
5
6
7
(e) We have learned in class that you can get a plot of z(t) by pretending that Z(s) is a transfer
function with a unit impulse input and then using the command ‘impulse’ in MATLAB to
generate a plot of z(t). Use the ‘impulse’ command on Z(s) and then add this plot to the plot in
part (d) using the hold command. The plots should be identical so use dots for one of the
functions and the command ‘legend’ to distinguish between the two. Note, when you multiply
U(s) times the transfer function to get Z(s), use the command ‘series’ for multiplying two
transfer functions; do not use g*h where g and h are the two transfer functions to be
multiplied. Also, although not needed here, when adding two transfer functions, use ‘parrallel’;
do not simply add them such as g + h.
G=tf([7.2 36],[1 7.2 36]);
Z=series(G,tf([4],[1 0 4 0]));
136
[zi]=impulse(Z,t);
plot(t,z,'k',t,zi,'r.')
xlabel('time, sec.')
ylabel('z(t)')
title('Homework 7 part(e)')
legend('from inverse Laplace','from impulse command','location','best')
Homework 7 part(e)
2.5
2
z(t)
1.5
1
0.5
0
from impulse command
from inverse Laplace
-0.5
0
1
2
3
4
time, sec.
5
6
7
The plots are identical.
(f) Another way to get a plot of z(t) is to use the command ‘lsim’
u=1-cos(2*t);
[zLsim]=lsim(G,u,t);
plot(t,z,'k',t,zi,'r.',t,zLsim,'k*')
xlabel('time, sec.')
ylabel('z(t)')
title('Homework 7 part(f)')
legend('from inverse Laplace','from impulse command','from lsim','location','best')
Homework 7 part(f)
2.5
2
from inverse Laplace
from impulse command
from lsim
z(t)
1.5
1
0.5
0
-0.5
0
1
2
3
4
time, sec.
5
6
7
All three plots are identical.
137
(g) Considering the equation for the input u(t), what can you say about the resulting displacement
of the mass. For example, compare the input and output frequencies. Also, compare the input
and output amplitudes. You might want to plot z(t) and u(t) on the same graph to answer these
questions.
The input and output frequencies are identical; this is always the case. In regard to the amplitude of the
output, it will either be larger or smaller than the amplitude of the input depending on the magnitude of
the transfer function at the input frequency. The input of 1-cos2t produces a wave from 0 to 2. From the
graph, we see that z(t) goes from 0 to about 2.1. The value of 2.1 can also be determined from the
inverse Laplace transform equation for z(t), i.e.
๐‘ง(๐‘ก) = 1 + 0 + 1.1049sin ( )
Note in the equation above, the peak value will be 1 + 1.1049 = 2.1049.
The entire m-file used for this homework solution is given below:
format shorte
G=tf([7.2 36],[1 7.2 36]);
Z=series(G,tf([4],[1 0 4 0]));
[num,den]=tfdata(Z,'v')
pfract(num,den)
t=0:0.01:7;
z=1+0.14249*exp(-3.6*t).*sin(4.8*t+0.81765)+1.1049*sin(2*t-1.6131);
plot(t,z,'k')
title('Homework 7 part(d)')
xlabel('time, sec.')
ylabel('z(t)')
figure
[zi]=impulse(Z,t);
plot(t,z,'k',t,zi,'r.')
xlabel('time, sec.')
ylabel('z(t)')
title('Homework 7 part(e)')
legend('from inverse Laplace','from impulse command','location','best')
figure
u=1-cos(2*t);
[zLsim]=lsim(G,u,t);
plot(t,z,'k',t,zi,'r.',t,zLsim,'k*')
xlabel('time, sec.')
ylabel('z(t)')
title('Homework 7 part(f)')
legend('from inverse Laplace','from impulse command','from lsim','location','best')
Homework 13
If a linear system has a sine wave input and all of the eigenvalues of the system have nonzero negative
real parts, then after approximately five times the largest time constant, the output will be a sine wave
at the same frequency with an amplitude equal to the input amplitude times the magnitude of the
system transfer function evaluated with s = j๐œ”I where ๐œ”๐‘– is the input frequency, i.e.
๐‘(๐‘ ) = ๐ป(๐‘ )๐‘ˆ(๐‘ )
๐‘ข(๐‘ก) = ๐ด๐‘ ๐‘–๐‘›(๐œ”๐‘– ๐‘ก)
๐‘ง(๐‘ก) = ๐ด|๐ป(๐‘—๐œ”๐‘– )|sin (๐œ”๐‘– ๐‘ก + ๐œƒ)
๐œƒ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’[๐ป(๐‘—๐œ”๐‘– )]
(a) In your own words and math, redo the proof of this result using the shortcut of the residue
theorem applied to the complex poles of Z(s).
138
(b) Apply this expedited approach to getting an equation for y(t) for ๐‘ก → ∞ for the following
system:
๐‘Œ(๐‘ ) = [
๐‘  + 10
] X(s)
๐‘ +2
๐‘ฅ(๐‘ก) = 5sin (4๐‘ก)
(c) Apply this expedited approach to getting an equation for w(t) for ๐‘ก → ∞ for the following
system:
๐‘Š(๐‘ ) = [
Homework 13
100๐‘ 
] ๐‘‰(๐‘ )
(๐‘  + 2)2 + 32
๐‘ฃ(๐‘ก) = 10sin (3๐‘ก)
Solution
If a linear system has a sine wave input and all of the eigenvalues of the system have nonzero negative
real parts, then after approximately five times the largest time constant, the output will be a sine wave
at the same frequency with an amplitude equal to the input amplitude times the magnitude of the
system transfer function evaluated with s = j๐œ”I where ๐œ”๐‘– is the input frequency, i.e.
๐‘(๐‘ ) = ๐ป(๐‘ )๐‘ˆ(๐‘ )
๐‘ข(๐‘ก) = ๐ด๐‘ ๐‘–๐‘›(๐œ”๐‘– ๐‘ก)
๐‘ง(๐‘ก) = ๐ด|๐ป(๐‘—๐œ”๐‘– )|sin (๐œ”๐‘– ๐‘ก + ๐œƒ)
๐œƒ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’[๐ป(๐‘—๐œ”๐‘– )]
(a) In your own words and math, redo the proof of this result using the shortcut of the residue
theorem applied to the complex poles of Z(s).
๐ด๐œ”๐‘–
๐‘(๐‘ ) = ๐ป(๐‘ ) 2
๐‘  + ๐œ”๐‘–2
๐‘ง(๐‘ก) = ∑ ๐‘Ÿ๐‘’๐‘ ๐‘–๐‘‘๐‘ข๐‘’๐‘  ๐‘“๐‘œ๐‘Ÿ ๐‘๐‘œ๐‘™๐‘’๐‘  ๐‘œ๐‘“ ๐ป(๐‘ ) + ∑ ๐‘Ÿ๐‘’๐‘ ๐‘–๐‘‘๐‘ข๐‘’๐‘  ๐‘œ๐‘“ 0 ± ๐‘—๐œ”๐‘–
After about five times the largest time constant assuming all poles of H(s) have non-zero negative real
parts,
๐‘ง(๐‘ก) = 0 + ∑ ๐‘Ÿ๐‘’๐‘ ๐‘–๐‘‘๐‘ข๐‘’๐‘  ๐‘œ๐‘“ 0 ± ๐‘—๐œ”๐‘– =
1
|๐ป(๐‘—๐œ”๐‘– )๐ด๐œ”๐‘– | sin(๐œ”๐‘– ๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’[๐ป(๐‘—๐œ”๐‘– )๐ด๐œ”๐‘– ])
๐œ”๐‘–
= ๐ด|๐ป(๐‘—๐œ”๐‘– )| sin(๐œ”๐‘– ๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’[๐ป(๐‘—๐œ”๐‘– )])
(b) Apply this expedited approach to getting an equation for y(t) for ๐‘ก → ∞ for the following
system:
๐‘  + 10
๐‘Œ(๐‘ ) = [
๐‘ฅ(๐‘ก) = 5sin (4๐‘ก)
] X(s)
๐‘ +2
๐‘—4 + 10
๐‘—4 + 10
๐‘ฆ(๐‘ก) = 5 |
| sin (4๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’ [
])
๐‘—4 + 2
๐‘—4 + 2
4
4
√42 + 102
=5
sin (4๐‘ก + ๐‘ก๐‘Ž๐‘›−1 ( ) − ๐‘ก๐‘Ž๐‘›−1 ( ))
10
2
√42 + 22
= 12.0416sin (4๐‘ก − 0.7266)
139
Using MATLAB to check the result for ๐œ”๐‘– = 4,
>> s=j*4;
>> H=(s+10)/(s+2);
>> 5*abs(H)= 12.0416
>> angle(H)= -0.7266
These answers agree with the hand calculations.
Using the command ‘bode’ to check all frequencies including ๐œ”๐‘– = 4,
>> H=tf([1 10],[1 2]);
>> bode(H)
Bode Diagram
Magnitude (dB)
15
10
System: H
Frequency (rad/s): 4
Magnitude (dB): 7.63
5
Phase (deg)
0
0
-30
-60
-1
10
0
10
System: H
Frequency (rad/s): 4
Phase (deg): -41.4
1
10
2
3
10
10
Frequency (rad/s)
7.63
From the graph above 20๐ฟ๐‘œ๐‘”10 |๐ป(๐‘—4)| = 7.63 ๐‘‘๐ต Thus, 5|๐ป(๐‘—4)| = 5 ∗ 10 20 = 12.04 and
the phase angle is -41.4 deg = -0.7226. These results also agree with the hand calculations.
Note, using ‘bode’, we can get the magnitude and phase of the transfer function at any input
frequency.
(c) Apply this expedited approach to getting an equation for w(t) for ๐‘ก → ∞ for the following
system:
100๐‘ 
๐‘Š(๐‘ ) = [
๐‘ฃ(๐‘ก) = 10sin (3๐‘ก)
] ๐‘‰(๐‘ )
(๐‘  + 2)2 + 32
100 ∗ ๐‘—3
100 ∗ ๐‘—3
๐‘ค(๐‘ก) = 10 |
| sin (3๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’ [
])
2
2
(๐‘—3 + 2) + 3
(๐‘—3 + 2)2 + 32
= 237.17sin (3๐‘ก + 0.3218)
140
Homework 14
Express the differential equations below in state variable format, i.e.
๐‘ฅฬ‡ 1 = ๐‘“1 (๐‘ฅ1 , ๐‘ฅ2 , … , ๐‘ฅ๐‘› , ๐‘ข)
๐‘ฅฬ‡ 1 (0− )
๐‘ฅฬ‡ 2 = ๐‘“2 (๐‘ฅ1 , ๐‘ฅ2 , … , ๐‘ฅ๐‘› , ๐‘ข) ๐‘ฅฬ‡ 2 (0− )
… … … ..
๐‘ฅฬ‡ ๐‘› = ๐‘“๐‘› (๐‘ฅ1 , ๐‘ฅ2 , … , ๐‘ฅ๐‘› , ๐‘ข) ๐‘ฅฬ‡ ๐‘› (0− )
๐‘ฆ = ๐‘“๐‘ฆ (๐‘ฅ1 , ๐‘ฅ2 , … , ๐‘ฅ๐‘› , ๐‘ข)
(1)
(2)
(3)
(4)
(5)
๐‘งฬˆ + 2๐‘งฬ‡ + 12๐‘ง = 4๐‘ข
๐‘ฆ=๐‘ง
๐‘ง(0− ) = 3
๐‘งฬ‡ (0− ) = 6
๐‘งโƒ› + ๐‘งฬˆ + 2๐‘งฬ‡ + 12๐‘ง = 4๐‘ข
๐‘ฆ = ๐‘งฬ‡
๐‘ง(0− ) = 3
๐‘งฬ‡ (0− ) = 6
๐‘งฬˆ (0− ) = 1
๐‘งฬˆ + 2๐‘งฬ‡ 3 + 12๐‘ง = 4๐‘ข
๐‘ฆ=๐‘ง
๐‘ง(0− ) = 3
๐‘งฬ‡ (0− ) = 6
−)
๐‘งฬˆ + 2๐‘งฬ‡ + 12๐‘ง = 4๐‘ข
๐‘ฆ =๐‘ข−๐‘ง
๐‘ง(0 = 2
๐‘งฬ‡ (0− ) = 0.4
๐œƒฬˆ + 0.2๐œƒฬ‡ + 9 sin(๐œƒ) = 0.18๐‘ข ๐‘ฆ = ๐œƒ ๐œƒ(0− ) = 0.1 ๐œƒฬ‡ (0− ) = 0
Homework 14
Solution
Express the differential equations below in state variable format, i.e.
๐‘ฅฬ‡ 1 = ๐‘“1 (๐‘ฅ1 , ๐‘ฅ2 , … , ๐‘ฅ๐‘› , ๐‘ข) ๐‘ฅฬ‡ 1 (0− )
๐‘ฅฬ‡ 2 = ๐‘“2 (๐‘ฅ1 , ๐‘ฅ2 , … , ๐‘ฅ๐‘› , ๐‘ข) ๐‘ฅฬ‡ 2 (0− )
… … … ..
๐‘ฅฬ‡ ๐‘› = ๐‘“๐‘› (๐‘ฅ1 , ๐‘ฅ2 , … , ๐‘ฅ๐‘› , ๐‘ข) ๐‘ฅฬ‡ ๐‘› (0− )
๐‘ฆ = ๐‘“๐‘ฆ (๐‘ฅ1 , ๐‘ฅ2 , … , ๐‘ฅ๐‘› , ๐‘ข)
(1) ๐‘งฬˆ + 2๐‘งฬ‡ + 12๐‘ง = 4๐‘ข
๐‘ฆ=๐‘ง
๐‘ง(0− ) = 3
๐‘งฬ‡ (0− ) = 6
๐‘ฅ1 = ๐‘ง ๐‘ฅ2 = ๐‘งฬ‡ ๐‘ฅฬ‡ 1 = ๐‘ฅ2 ๐‘ฅฬ‡ 2 = 4๐‘ข − 12๐‘ฅ1 − 2๐‘ฅ2 ๐‘ฅ1 (0− ) = 3 ๐‘ฅ2 (0− ) = 6
๐‘ฆ = ๐‘ฅ1
(2) ๐‘งโƒ› + ๐‘งฬˆ + 2๐‘งฬ‡ + 12๐‘ง = 4๐‘ข
๐‘ฆ = ๐‘งฬ‡
๐‘ง(0− ) = 3
๐‘งฬ‡ (0− ) = 6
๐‘งฬˆ (0− ) = 1
๐‘ฅ1 = ๐‘ง
๐‘ฅ2 = ๐‘งฬ‡ ๐‘ฅ3 = ๐‘งฬˆ
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = ๐‘ฅ3
๐‘ฅฬ‡ 3 = 4๐‘ข − 12๐‘ฅ1 − 2๐‘ฅ2 − ๐‘ฅ3
๐‘ฅ1 (0− ) = 3 ๐‘ฅ2 (0− ) = 6 ๐‘ฅ3 (0− ) = 1
๐‘ฆ = ๐‘ฅ2
(3) ๐‘งฬˆ + 2๐‘งฬ‡ 3 + 12๐‘ง = 4๐‘ข
๐‘ฆ=๐‘ง
๐‘ง(0− ) = 3
๐‘งฬ‡ (0− ) = 6
๐‘ฅ1 = ๐‘ง ๐‘ฅ2 = ๐‘งฬ‡ ๐‘ฅฬ‡ 1 = ๐‘ฅ2 ๐‘ฅฬ‡ 2 = 4๐‘ข − 12๐‘ฅ1 − 2๐‘ฅ23 ๐‘ฅ1 (0− ) = 3 ๐‘ฅ2 (0− ) = 6
(4) ๐‘งฬˆ + 2๐‘งฬ‡ + 12๐‘ง = 4๐‘ข
๐‘ฆ =๐‘ข−๐‘ง
๐‘ง(0− ) = 2
๐‘งฬ‡ (0− ) = 0.4
๐‘ฅ1 = ๐‘ง ๐‘ฅ2 = ๐‘งฬ‡ ๐‘ฅฬ‡ 1 = ๐‘ฅ2 ๐‘ฅฬ‡ 2 = 4๐‘ข − 12๐‘ฅ1 − 2๐‘ฅ2 ๐‘ฅ1 (0− ) = 2 ๐‘ฅ2 (0− ) = 0.4
๐‘ฆ = ๐‘ฅ1
๐‘ฆ = ๐‘ข − ๐‘ฅ1
(5) ๐œƒฬˆ + 0.2๐œƒฬ‡ + 9 sin(๐œƒ) = 0.18๐‘ข ๐‘ฆ = ๐œƒ ๐œƒ(0− ) = 0.1 ๐œƒฬ‡ (0− ) = 0
๐‘ฅ1 = ๐œƒ ๐‘ฅ2 = ๐œƒฬ‡ ๐‘ฅฬ‡ 1 = ๐‘ฅ2 ๐‘ฅฬ‡ 2 = 0.18๐‘ข − 9sin (๐‘ฅ1 ) − 0.2๐‘ฅ2 ๐‘ฅ1 (0− ) = 0.1 ๐‘ฅ2 (0− ) = 0 ๐‘ฆ
= ๐‘ฅ1
141
Homework 15
The differential equation for a suspension is given below. The output of interest is y = u – z where u is a
displacement input. Assume at time = 0, u(t) is a step with magnitude of 0.05 meters.
1000๐‘งฬˆ + 12,000๐‘งฬ‡ + 144,000๐‘ง = 12,000๐‘ขฬ‡ + 144,000๐‘ข
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 0
z
M
k
b
u
(a)
(b)
(c)
(d)
Find the Laplace transform of y(t), Y(s).
In MATLAB, use the impulse command to get a plot of y(t).
Express the differential equation in state variable format.
Use ‘ode45’ in MATLAB to numerically solve this differential equation and generate a plot of
y(t).
Compare this plot with the plot in (b) and confirm that the plots are identical.
Homework 15
Solution
The differential equation for a suspension is given below. The output of interest is y = u – z where u is a
displacement input. Assume at time = 0, u(t) is a step with magnitude of 0.05 meters.
1000๐‘งฬˆ + 12,000๐‘งฬ‡ + 144,000๐‘ง = 12,000๐‘ขฬ‡ + 144,000๐‘ข
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 0
z
M
k
b
u
142
(a) Find the Laplace transform of y(t), Y(s).
12,000๐‘  + 144,000
๐‘ˆ(๐‘ )]
1000๐‘  2 + 12,000๐‘  + 144,000
1000๐‘  2
0.05
50๐‘ 
=
=
2
2
1000๐‘  + 12,000๐‘  + 144,000 ๐‘ 
1000๐‘  + 12,000๐‘  + 144,000
(b) In MATLAB, use the impulse command to get a plot of y(t).
>> G=tf([50 0],[1000 12000 144000]);
>> impulse(G)
>> title('Homework 10 inverse Laplace of Y(s)')
>> ylabel('y=u-z, meters')
๐‘Œ(๐‘ ) = ๐‘ˆ(๐‘ ) − ๐‘(๐‘ ) = [๐‘ˆ(๐‘ ) −
Homew ork 10 inverse Laplace of Y(s)
0.05
0.04
y=u-z, meters
0.03
0.02
0.01
0
-0.01
-0.02
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Time (seconds)
(c) Express the differential equation in state variable format.
๐‘ฅฬ‡ 1 = ๐‘ฅ2 + 12๐‘ข
๐‘งฬˆ + 12๐‘งฬ‡ + 144๐‘ง = 12๐‘ขฬ‡ + 144๐‘ข
๐‘ฅ1 = ๐‘ง
๐‘ฅ2 = ๐‘งฬ‡ − 12๐‘ข
๐‘ฅฬ‡ 2 = 144๐‘ข − 144๐‘ฅ1 − 12(๐‘ฅ2 + 12๐‘ข) = −144๐‘ฅ1 − 12๐‘ฅ2
๐‘ฆ = ๐‘ข − ๐‘ฅ1
(d) Use ‘ode45’ in MATLAB to numerically solve this differential equation and generate a plot of
y(t).
Compare this plot with the plot in (b) and confirm that the plots are identical.
%m-file to start the simulation saved as Hmwk10Start
[t,x]=ode45(@Hmwk10Eqns,[0 0.9],[0 0]);
y=0.05-x(:,1);
plot(t,y)
title('Homework 10 numerical solution')
ylabel('y = u - z, meters')
xlabel('time, seconds')
143
%m-file containing the state variable differential equations named Hmwk10Eqns
function dx=Hmwk10Eqns(t,x)
dx=zeros(2,1);
u=0.05;
dx(1)=x(2)+12*u;
dx(2)=-144*x(1)-12*x(2);
end
Homework 10 numerical solution
0.05
0.04
y = u - z, meters
0.03
0.02
0.01
0
-0.01
-0.02
0
0.1
0.2
0.3
0.4
0.5
time, seconds
0.6
0.7
0.8
0.9
Note, the solutions are identical.
Homework 16
The differential equation for a suspension is given below. The output of interest is y = u – z where u is a
displacement input. Assume at time = 0, u(t) is a step with magnitude of 0.05 meters.
1000๐‘งฬˆ + 12,000๐‘งฬ‡ + 144,000๐‘ง = 12,000๐‘ขฬ‡ + 144,000๐‘ข
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 0
z
M
k
b
u
(a) Find the Laplace transform of y(t), Y(s).
144
(b) In MATLAB, use the impulse command to get a plot of y(t).
(c) Express the differential equation in state variable format.
(d) Use ‘ode45’ in MATLAB to numerically solve this differential equation and generate a plot of
y(t). Compare this plot with the plot in (b) and confirm that the plots are identical.
Homework 16 Solution
The differential equation for a suspension is given below. The output of interest is y = u – z where u is a
displacement input. Assume at time = 0, u(t) is a step with magnitude of 0.05 meters.
๐‘ง(0− ) = 0
1000๐‘งฬˆ + 12,000๐‘งฬ‡ + 144,000๐‘ง = 12,000๐‘ขฬ‡ + 144,000๐‘ข
๐‘งฬ‡ (0− ) = 0
z
M
k
b
u
(e) Find the Laplace transform of y(t), Y(s).
12,000๐‘  + 144,000
๐‘ˆ(๐‘ )]
1000๐‘  2 + 12,000๐‘  + 144,000
1000๐‘  2
0.05
50๐‘ 
=
=
2
2
1000๐‘  + 12,000๐‘  + 144,000 ๐‘ 
1000๐‘  + 12,000๐‘  + 144,000
(f) In MATLAB, use the impulse command to get a plot of y(t).
>> G=tf([50 0],[1000 12000 144000]);
>> impulse(G)
>> title('Homework 10 inverse Laplace of Y(s)')
>> ylabel('y=u-z, meters')
๐‘Œ(๐‘ ) = ๐‘ˆ(๐‘ ) − ๐‘(๐‘ ) = [๐‘ˆ(๐‘ ) −
Homew ork 10 inverse Laplace of Y(s)
0.05
0.04
y=u-z, meters
0.03
0.02
0.01
0
-0.01
-0.02
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Time (seconds)
145
(g) Express the differential equation in state variable format.
๐‘ฅฬ‡ 1 = ๐‘ฅ2 + 12๐‘ข
๐‘งฬˆ + 12๐‘งฬ‡ + 144๐‘ง = 12๐‘ขฬ‡ + 144๐‘ข
๐‘ฅ1 = ๐‘ง
๐‘ฅ2 = ๐‘งฬ‡ − 12๐‘ข
๐‘ฅฬ‡ 2 = 144๐‘ข − 144๐‘ฅ1 − 12(๐‘ฅ2 + 12๐‘ข) = −144๐‘ฅ1 − 12๐‘ฅ2
๐‘ฆ = ๐‘ข − ๐‘ฅ1
(h) Use ‘ode45’ in MATLAB to numerically solve this differential equation and generate a plot of
y(t).
Compare this plot with the plot in (b) and confirm that the plots are identical.
%m-file to start the simulation saved as Hmwk10Start
[t,x]=ode45(@Hmwk10Eqns,[0 0.9],[0 0]);
y=0.05-x(:,1);
plot(t,y)
title('Homework 10 numerical solution')
ylabel('y = u - z, meters')
xlabel('time, seconds')
%m-file containing the state variable differential equations named Hmwk10Eqns
function dx=Hmwk10Eqns(t,x)
dx=zeros(2,1);
u=0.05;
dx(1)=x(2)+12*u;
dx(2)=-144*x(1)-12*x(2);
end
Homework 10 numerical solution
0.05
0.04
y = u - z, meters
0.03
0.02
0.01
0
-0.01
-0.02
0
0.1
0.2
0.3
0.4
0.5
time, seconds
0.6
0.7
0.8
0.9
Note, the solutions are identical.
146
Homework 17
The differential equation for a suspension is given below. The output of interest is y = u – z where u is a
displacement input.
1000๐‘งฬˆ + 12,000๐‘งฬ‡ + 144,000๐‘ง = 12,000๐‘ขฬ‡ + 144,000๐‘ข
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 0
z
M
k
b
u
(a) Find the transfer function for Y(s). That is, if Y(s)=H(s)U(s), what is H(s)?
(b) Use the ‘phase variable’ method to express H(s) in state variable format. A=? B=? C=? D=?
The phase variable method requires that the numerator polynomial be at least one less order
than the denominator.
(c) Create a transfer function using the ‘tf’ command for H(s).
(d) Use the command ‘tf2ss’ in MATLAB to generate values of A, B, C, and D. Explain why some of
these are different from those in (b).
(e) Using the values found in (b) use the command ‘ss2tf’ to generate a transfer function. How
does this transfer function compare with H(s) in (a)?
(f) Use the ‘simulation diagram’ method to create values of A, B, C, and D for this differential
equation and output of interest y=u-z. How do these values compare with those in (b) and
those in (d)? Use ‘ss2tf’ with these values to generate a transfer fun. How does it compare
with H(s) in (a)?
Homework 17
Solution
The differential equation for a suspension is given below. The output of interest is y = u – z where u is a
displacement input.
1000๐‘งฬˆ + 12,000๐‘งฬ‡ + 144,000๐‘ง = 12,000๐‘ขฬ‡ + 144,000๐‘ข
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 0
147
z
M
k
b
u
(a) Find the transfer function for Y(s). That is, if Y(s)=H(s)U(s), what is H(s)?
12,000๐‘  + 144,000
๐‘ˆ(๐‘ )]
1000๐‘  2 + 12,000๐‘  + 144,000
1000๐‘  2
=
๐‘ˆ(๐‘ )
1000๐‘  2 + 12,000๐‘  + 144,000
1000๐‘  2
๐‘ 2
๐ป(๐‘ ) =
=
1000๐‘  2 + 12,000๐‘  + 144,000 ๐‘  2 + 12๐‘  + 144
๐‘Œ(๐‘ ) = ๐‘ˆ(๐‘ ) − ๐‘(๐‘ ) = [๐‘ˆ(๐‘ ) −
(b) Use the ‘phase variable’ method to express H(s) in state variable format. A=? B=? C=? D=?
The phase variable method requires that the numerator polynomial be at least one less order
than the denominator. Using long division to divide ๐‘  2 + 12๐‘  + 144 into ๐‘  2 gives
12๐‘  + 144
๐ป(๐‘ ) = 1 − 2
๐‘  + 12๐‘  + 144
Thus, we can write
12๐‘  + 144
12๐‘  + 144
๐‘Œ(๐‘ ) = ๐ป(๐‘ )๐‘ˆ(๐‘ ) = [1 − 2
๐‘ˆ(๐‘ )
] ๐‘ˆ(๐‘ ) = ๐‘ˆ(๐‘ ) − 2
๐‘  + 12๐‘  + 144
๐‘  + 12๐‘  + 144
12๐‘ +144
all we had was Y(s)=- 2
๐‘ˆ(๐‘ ), then the phase variable equations would be
๐‘  +12๐‘ +144
0
1
0
๐‘‹ฬ‡ = [
๐‘ฆ = [144 12]๐‘‹ + [0]๐‘ข
]๐‘‹ + [ ]๐‘ข
−144 −12
1
But, y equals u + [144 12]X. So, ๐‘ฆ = [144 12]๐‘‹ + [1]๐‘ข
0
1
0
So, ๐ด = [
] ๐ต = [ ] ๐ถ = [144 12] ๐ท = [1]
−144 −12
1
(c) Create a transfer function using the ‘tf’ command for H(s).
>> H=tf([1 0 0],[1 12 144])
Transfer function:
s^2
---------------s^2 + 12 s + 144
148
(d) Use the command ‘tf2ss’ in MATLAB to generate values of A, B, C, and D. Explain why some of
these are different from those in (b).
>> num=[1 0 0];
>> den=[1 12 144];
>> [a,b,c,d]=tf2ss(num,den)
a=
-12 -144
1 0
b=
1
0
c=
-12 -144
d=1
a, b, c, and d are not the same as A, B, C, D because the state variables are different.
(e)Using the values found in (b) use the command ‘ss2tf’ to generate a transfer function. How does
this transfer function compare with H(s) in (a)?
>> [NUM,DEN]=ss2tf(a,b,c,d)
NUM =
1 0
0
DEN =
1 12 144
This transfer function is identical to H(s) above which must be the case.
(f) Use the ‘simulation diagram’ method to create values of A, B, C, and D for this differential
equation and output of interest y=u-z. How do these values compare with those in (b) and those in (d)?
๐‘งฬˆ + 12๐‘งฬ‡ + 144๐‘ง = 12๐‘ขฬ‡ + 144๐‘ข
๐‘ฅ1 = ๐‘ง
๐‘ฅ2 = ๐‘งฬ‡ − 12๐‘ข
๐‘ฅฬ‡ 1 = ๐‘ฅ2 + 12๐‘ข ๐‘ฅฬ‡ 2 = 144๐‘ข − 144๐‘ฅ1 − 12(๐‘ฅ2 + 12๐‘ข) = −144๐‘ฅ1 − 12๐‘ฅ2
๐‘ฆ = ๐‘ข − ๐‘ฅ1
0
1
12
๐ด=[
] ๐ต = [ ] ๐ถ = [−1 0] ๐ท = [1]
−144 −12
0
B and C are not the same as B and C in (b)
149
A, B, and C are not the same as a, b, and c in (d)
Use ‘ss2tf’ with these values to generate a transfer fun. How does it compare with H(s) in (a)?
>> format short e
>> A=[0 1;-144 -12];
>> B=[12;0];
>> C=[-1 0];
>> D=[1];
>> [num,den]=ss2tf(A,B,C,D)
num =
1.0000e+000 -1.9540e-015 -8.8818e-015
den =
1 12 144
Realizing that two of the numerator terms are very small numbers (essentially zero) associated
with computational errors, we see that we get the same transfer function.
Homework 18
A cannon ball is fired at an initial angle of ๐œƒ with an initial velocity of V=100 m/sec. The differential
equations for the ball are as follows:
10๐‘งฬˆ + 0.2๐‘‰๐‘งฬ‡ = 0
10๐‘ฆฬˆ + 0.2๐‘‰๐‘ฆฬ‡ + 98 = 0
๐‘‰ = √๐‘งฬ‡ 2 + ๐‘ฆฬ‡ 2.
where the velocity of the ball V is defined by
Use the 'ode45' numerical simulation algorithm in MATLAB with the 'event' function to generate plots of
y versus z for initial values of ๐œƒ equal to 25, 45, and 65 degrees. A typical plot of y v. z is shown below.
All three plots for the three initial angles should be on the same graph for comparison. Assume y(0-) = 0
and use the 'event' function to stop the solution when y(t) returns to zero. Also, be sure to use the
commands 'xlabel', 'ylabel', 'title', and 'legend' to make your graph more professional.
y
V
๏ฑ
0
Homework 18
z
Solution
150
All equations, analysis, commands, results and conclusions are to either be typed on or pasted to this
document as you would do in a professional report.
A cannon ball is fired at an initial angle of ๐œƒ with an initial velocity of V=100 m/sec. The differential
equations for the ball are as follows:
10๐‘งฬˆ + 0.2๐‘‰๐‘งฬ‡ = 0
10๐‘ฆฬˆ + 0.2๐‘‰๐‘ฆฬ‡ + 98 = 0
where the velocity of the ball V is defined by
๐‘‰ = √๐‘งฬ‡ 2 + ๐‘ฆฬ‡ 2.
Use the 'ode45' numerical simulation algorithm in MATLAB with the 'event' function to generate plots of
y versus z for initial values of ๐œƒ equal to 25, 45, and 65 degrees. A typical plot of y v. z is shown below.
All three plots for the three initial angles should be on the same graph for comparison. Assume y(0-) = 0
and use the 'event' function to stop the solution when y(t) returns to zero. Also, be sure to use the
commands 'xlabel', 'ylabel', 'title', and 'legend' to make your graph more professional.
Cannonball Trajectory v. Firing Angle
70
25 degrees
45 degrees
65 degrees
60
50
Altitude, m
40
30
20
10
0
-10
0
20
40
60
80
Horizontal Distance, m
100
120
options=odeset('events',@HonProjStop);
V=100;TH=25*pi/180;
[t,x]=ode45(@HonProjEqns,[0 15],[0 V*cos(TH) 0
V*sin(TH)],options);
TH=45*pi/180;
[t,u]=ode45(@HonProjEqns,[0 15],[0 V*cos(TH) 0
V*sin(TH)],options);
TH=65*pi/180;
[t,w]=ode45(@HonProjEqns,[0 15],[0 V*cos(TH) 0
V*sin(TH)],options);
plot(x(:,1),x(:,3),'r.')
151
hold
plot(u(:,1),u(:,3),'bx')
plot(w(:,1),w(:,3),'k-')
hold off
xlabel('Horizontal Distance, m')
ylabel('Altitude, m')
title('Cannonball Trajectory v. Firing Angle')
legend('25 degrees','45 degrees','65 degrees')
function dx=HonProjEqns(t,x)
dx=zeros(4,1);
V=sqrt(x(2)^2+x(4)^2);
dx(1)=x(2);
dx(2)=-0.02*V*x(2);
dx(3)=x(4);
dx(4)=-9.8-0.02*V*x(4);
end
function [Val,Ister,Dir] = HonProjStop(t,x)
Val(1)=x(3);
Ister(1)=1;
Dir(1)=-1;
end
Homework 19
As shown below, two water tanks are connected by a long pipe. Initially, before the water is allowed to
flow through the pipe, the height H1 of the water in tank #1 is greater than the height H2 of the water in
tank #2.
H1
H2
d
L
Q
The equations for this system are as follows:
Differential equation for height of water in tank #1: −๐‘„ − 10๐ปฬ‡1 = 0
๐ป1 (0− ) = 10 ๐‘š
152
Differential equation for height of water in tank #2:
๐‘„ − 10๐ปฬ‡2 = 0
๐ป2 (0− ) = 5 ๐‘š
Approximate differential equation for turbulent flow ๐‘„ (m3/s) through pipe:
9,800(๐ป1 − ๐ป2 ) = 795,625๐‘„ฬ‡ + 19,338๐‘„
(1) Laplace transform these equations and solve for ๐ป1 (๐‘ ). Use the FVT and IVT to check ๐ป1 (๐‘ ).
(2) Find the inverse Laplace of ๐ป1 (๐‘ ) to get an equation for ๐ป1 (๐‘ก).
(3) In MATLAB, pretend that ๐ป1 (๐‘ ) is a transfer function with a unit impulse input. Use the
command ‘impulse’ to get a plot of ๐ป1 (๐‘ก) and plot on the same graph ๐ป1 (๐‘ก) using the equation
found in (2) above. Use the ‘legend’ command to confirm that the plots are identical.
(4) Highlight, copy, and paste your MATLAB commands and results on this MS Word document as
part of your solution to be submitted.
Homework 19 Solution
As shown below, two water tanks are connected by a long pipe. Initially, before the water is allowed to
flow through the pipe, the height H1 of the water in tank #1 is greater than the height H2 of the water in
tank #2.
H1
H2
d
L
Q
The equations for this system are as follows:
Differential equation for height of water in tank #1: −๐‘„ − 10๐ปฬ‡1 = 0
๐ป1 (0− ) = 10 ๐‘š
Differential equation for height of water in tank #2: ๐‘„ − 10๐ปฬ‡2 = 0
๐ป2 (0− ) = 5 ๐‘š
Approximate differential equation for turbulent flow ๐‘„ (m3/s) through pipe:
9,800(๐ป1 − ๐ป2 ) = 795,625๐‘„ฬ‡ + 19,338๐‘„
(1) Laplace transform these equations and solve for ๐ป1 (๐‘ ). Use the FVT and IVT to check ๐ป1 (๐‘ ).
See symbolic equations for the Laplace transform of the equations and solution for H1(s). Note,
according to the problem statement: “Initially before the water is allowed to flow through the
pipe”, tells us that Q(0-)=0.
−๐‘„(๐‘ ) − 10(๐‘ ๐ป1 (๐‘ ) − 10) = 0
๐‘„(๐‘ ) − 10(๐‘ ๐ป2 (๐‘ ) − 5) = 0
9800(๐ป1 (๐‘ ) − ๐ป2 (๐‘ )) = (795,625๐‘  + 19,338)๐‘„(๐‘ )
Eliminating Q(s) and H2(s) and solving for H1(s) gives
10๐‘  2 + 0.243055๐‘  + .018476
10๐‘  2 + 0.243055๐‘  + .018476
=
๐‘ (๐‘  2 + .0243055๐‘  + 0.00246348) ๐‘ [(๐‘  + 0.012153)2 + (0.048123)2 ]
๐น๐‘‰๐‘‡: ๐ป1 (๐‘ก)๐‘ก=∞ = ๐‘ ๐ป1 (๐‘ )๐‘ =0 = 7.5
๐ผ๐‘‰๐‘‡: ๐ป1 (๐‘ก)๐‘ก=0 = ๐‘ ๐ป1 (๐‘ )๐‘ =∞ = 10
๐ป1 (๐‘ ) =
153
(2) Find the inverse Laplace of ๐ป1 (๐‘ ) to get an equation for ๐ป1 (๐‘ก).
๐‘’ −.0121153๐‘ก
๐ป1 (๐‘ก) = (๐‘  + 0)๐ป1 (๐‘ )๐‘’ ๐‘ ๐‘ก ๐‘ =0 +
๐‘€๐‘ ๐‘–๐‘›(0.048123๐‘ก + ∅)
0.048123
๐‘€ = |(๐‘  2 + .0243055๐‘  + 0.00246348)๐ป1 (๐‘ )|๐‘ =−0.012153+๐‘—0.048123 = 0.12409
∅ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’[(๐‘  2 + .0243055๐‘  + 0.00246348)๐ป1 (๐‘ )]๐‘ =−0.012153+๐‘—0.048123 = 1.3235
๐ป1 (๐‘ก) = 7.5 + 2.5738๐‘’ −0.012153๐‘ก sin (.048123๐‘ก + 1.3235)
(3) In MATLAB, pretend that ๐ป1 (๐‘ ) is a transfer function with a unit impulse input. Use the
command ‘impulse’ to get a plot of ๐ป1 (๐‘ก) and plot on the same graph ๐ป1 (๐‘ก) using the equation
found in (2) above. Use the ‘legend’ command to confirm that the plots are identical.
(4) Highlight, copy, and paste your MATLAB commands and results on this MS Word document as
part of your solution to be submitted.
% Homework 3 MAE 3360 10-12-13
format short g
syms s Q H1 H2
A=solve(-Q-10*(s*H1-10)==0,Q-10*(s*H2-5)==0,...
9800*(H1-H2)==795625*s*Q+19338*Q,H1,H2,Q);
digits(5)
h1=vpa(A.H1);%Converts H1(s) solution to floating point numbers
pretty(h1)
[num,den]=numden(h1);% Gets numerator and denominator of H1
Num=sym2poly(num);%Converts numerator from symbolic to polynomial
Den=sym2poly(den);%converts denominator from symbolic to polynomial
roots(Den)%Gets the poles of H1(s)
H1Ptf=tf(Num,Den);%Creates a pretend transfer function assuming unit impulse input
[H1impulse,t]=impulse(H1Ptf);%Generates impulse response and time array
H1t=7.5+2.5738*exp(-0.012153*t).*sin(0.048123*t+1.3235);
plot(t,H1impulse,'r',t,H1eqn,'k:','LineWidth',2)
xlabel('time, sec.')
ylabel('H1, m')
title('Comparing analytical and numerical H1(t) solutions')
legend('impulse command with pretend tf','inverse Laplace transform')
Comparing analytical and numerical H1(t) solutions
10
impulse command with pretend tf
inverse Laplace transform
9.5
9
H1, m
8.5
8
7.5
7
6.5
6
0
50
100
150
200
250
time, sec.
300
350
400
450
154
Homework 20
1. (a) Express the following differential equation with input u(t) in state variable format:
2๐‘ค
โƒ› + 24๐‘คฬˆ + 88๐‘คฬ‡ + 96๐‘ค = 48๐‘ข
๐‘ค(0− ) = 2
(b) What is the DC gain of this differential equation?
๐‘คฬ‡ (0− ) = 1
๐‘คฬˆ (0− ) = 0
(c) What are the initial conditions for the state variables?
(d) Express the state variable equations in (a) in matrix format assuming ๐‘ค(๐‘ก) is the output of
interest, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
(e) Use the MATLAB command ‘eig’ to get the eigenvalues of this differential equation.
(f) Enter the system found in (d) into MATLAB as a state space system and use the command
‘damp’ to get the damping ratio and natural frequency. Use the command ‘dcgain’ to confirm
the answer to part (b).
(g) Use the command ‘lsim’ to get a plot of the output of interest assuming u(t) is a step with
magnitude 10. Note, considering your value for the DC gain and the fact that the input is a
constant, what should be the final value of w(t)?
(h) Find the Laplace transform ๐‘Š(๐‘ ) and use the ‘pretend’ transfer function concept with the
‘impulse’ command to get a plot of ๐‘ค(๐‘ก). Plot on the same graph as the answer to part (g) for
comparison. Be sure to label the axes and insert a legend on the graph.
2. The equations for a vehicle suspension are shown below. The input is the displacement u(t). The
output of interest is y = v – u. Express the equations for this system in state variable format, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
155
Homework 20 Solution
1. (a) Express the following differential equation with input u(t) in state variable format:
2๐‘ค
โƒ› + 24๐‘คฬˆ + 88๐‘คฬ‡ + 96๐‘ค = 48๐‘ข
๐‘ค(0− ) = 2 ๐‘คฬ‡ (0− ) = 1 ๐‘คฬˆ (0− ) = 0
๐‘ฅ1 = ๐‘ค ๐‘ฅ2 = ๐‘คฬ‡ ๐‘ฅ3 = ๐‘คฬˆ
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = ๐‘ฅ3
๐‘ฅฬ‡ 3 = 24๐‘ข − 48๐‘ฅ1 − 44๐‘ฅ2 − 12๐‘ฅ3
(b) What is the DC gain of this differential equation? DC gain=48/96=0.5
(c) What are the initial conditions for the st. variables?
๐‘ฅ1 (0− ) = 2 ๐‘ฅ2 (0− ) = 1 ๐‘ฅ3 (0− ) = 0
(d) Express the state variable equations in (a) in matrix format assuming ๐‘ค(๐‘ก) is the
output of
interest, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
๐‘ฅ1
๐‘ฅ1
๐‘ฅฬ‡ 1
0
1
0
0
๐‘ฅ
๐‘ฅ
๐‘ฅฬ‡
[
]
[ 2] = [ 0
๐‘ฆ = 1 0 0 [ 2 ] + [0]๐‘ข
0
1 ] [ 2] + [ 0 ] ๐‘ข
๐‘ฅ3
๐‘ฅฬ‡ 3
−48 −44 −12 ๐‘ฅ3
24
(e) Use the MATLAB command ‘eig’ to get the eigenvalues of this differential equation.
Eigenvalues = -2, -4, -6
(f) Enter the system found in (d) into MATLAB as a state space system and use the
command ‘damp’ to get the damping ratio and natural frequency. Use the command
‘dcgain’ to confirm the answer to part (b). DC gain =0.5
(g) Use the command ‘lsim’ to get a plot of the output of interest assuming u(t) is a step
with magnitude 10. Note, considering your value for the DC gain and the fact that the
input is a constant, what should be the final value of w(t)? See graph and code below.
(h) Find the Laplace transform ๐‘Š(๐‘ ) and use the ‘pretend’ transfer function concept with
the ‘impulse’ command to get a plot of ๐‘ค(๐‘ก). Plot on the same graph as the answer to
part (g) for comparison. Be sure to label the axes and insert a legend on the graph.
% Homework 4 Solution for ME3360
A=[0 1 0;0 0 1;-48 -44 -12];
B=[0;0;24];
C=[1 0 0];
D=[0];
EVS=eig(A)
g=ss(A,B,C,D);
DCgain=dcgain(g)
t=0:0.01:2.5;
u=10+0*t;
w=lsim(g,u,t,[2;1;0]);
G=tf([2 25 100 240],[1 12 44 48 0]);
ws=impulse(G,t);
plot(t,w,'r-.',t,ws,'k:','LineWidth',2)
title('comparing lsim plot with inverse Laplace plot')
xlabel('time, sec')
ylabel('w')
legend('using lsim','using impulse for inverse Laplace','Location','Best')
>> homework4sol
156
EVS =
-2
-4
-6
DCgain =
0.5
comparing lsim plot with inverse Laplace plot
5
4.5
w
4
3.5
3
2.5
using lsim
using impulse for inverse Laplace
2
0
0.5
1
1.5
2
2.5
time, sec
2. The equations for a vehicle suspension are shown below. The input is the displacement u(t).
The output of interest is y = v – u. Express the equations for this system in state variable format,
i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
157
๐‘ฅ1 = ๐‘ค ๐‘ฅ2 = ๐‘คฬ‡ ๐‘ฅ3 = ๐‘ฃ
0
๐‘˜
−
๐‘€
๐ด=
0
๐‘˜
[ ๐‘š
1
๐‘
−
๐‘€
0
๐‘
๐‘š
0
๐‘˜
๐‘€
0
2๐‘˜
−
๐‘š
0
๐‘
๐‘€
1
2๐‘
− ]
๐‘š
๐‘ฅ4 = ๐‘ฃฬ‡ −
0
๐‘2
๐‘š๐‘€
๐‘
๐ต=
๐‘š
๐‘˜ 2๐‘ 2
[๐‘š − ๐‘š 2 ]
๐‘
๐‘ข
๐‘š
๐ถ = [0 0 1 0]
๐ท = [−1]
Homework 21
The equations for a vehicle suspension are shown below. The input is the displacement u(t). The output
of interest is ๐‘คฬˆ /๐‘” where g is gravity, 9.8 m/s2. Express the equations for this system in state variable
format in terms of M, b, k, etc.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
158
(1) Create a new m-file for this problem. The first statements are to assign values to the design
๐‘
๐‘
๐‘๐‘ 
๐‘๐‘ 
parameters, i.e. ๐‘˜ = 36000 ๐‘š ๐พ = 100000 ๐‘š ๐‘ = 8400 ๐‘š ๐‘ = 10000 ๐‘š
๐‘€ = 1000 ๐พ๐‘” ๐‘š = 250 ๐พ๐‘”
(2) The next statements define the state variable matrices in terms of M, b, k, etc.
๐‘
๐‘ฅ1 = ๐‘ค ๐‘ฅ2 = ๐‘คฬ‡ ๐‘ฅ3 = ๐‘ฃ ๐‘ฅ4 = ๐‘ฃฬ‡ − ๐‘š ๐‘ข ๐‘ฆ =
๐‘คฬˆ
๐‘”
๐‘˜
๐‘
๐‘˜
๐‘
๐‘๐‘
= − ๐‘€๐‘” ๐‘ฅ1 − ๐‘€๐‘” ๐‘ฅ2 + ๐‘€๐‘” ๐‘ฅ3 + ๐‘€๐‘” ๐‘ฅ4 + ๐‘€๐‘š๐‘” ๐‘ข
(3) Use the ‘ss’ command to create a state space system.
(4) Use the ‘damp’ command to get the eigenvalues and damping ratio(s) of the system.
(5) Use the ‘dcgain’ command to get the DC gain.
Does this value make sense?
(6) Use the ‘step’ command to get and plot the step response of the system.
(7) Use the ‘max’ command to find the maximum value of y.
(8) Try a few different values for c and observe the difference in the maximum value of y.
Comment on the significance of the choice of c in regard to ride comfort.
Homework 21 Solution
The equations for a vehicle suspension are shown below. The input is the displacement u(t).
The output of interest is ๐‘คฬˆ /๐‘” where g is gravity, 9.8 m/s2. Express the equations for this system
in state variable format in terms of M, b, k, etc.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
(1) Create a new m-file for this problem. The first statements are to assign values to the design
๐‘
๐‘
๐‘๐‘ 
๐‘๐‘ 
parameters, i.e. ๐‘˜ = 36000 ๐‘š ๐พ = 100000 ๐‘š ๐‘ = 8400 ๐‘š ๐‘ = 10000 ๐‘š
๐‘€ = 1000 ๐พ๐‘”
๐‘š = 250 ๐พ๐‘”
See m-file below for MATLAD code.
(2) The next statements define the state variable matrices in terms of M, b, k, etc.
๐‘
๐‘ฅ1 = ๐‘ค ๐‘ฅ2 = ๐‘คฬ‡ ๐‘ฅ3 = ๐‘ฃ ๐‘ฅ4 = ๐‘ฃฬ‡ − ๐‘š ๐‘ข ๐‘ฆ =
๐‘คฬˆ
๐‘”
๐‘˜
๐‘
๐‘˜
๐‘
๐‘๐‘
= − ๐‘€๐‘” ๐‘ฅ1 − ๐‘€๐‘” ๐‘ฅ2 + ๐‘€๐‘” ๐‘ฅ3 + ๐‘€๐‘” ๐‘ฅ4 + ๐‘€๐‘š๐‘” ๐‘ข
(3) Use the ‘ss’ command to create a state space system.
(4) Use the ‘damp’ command to get the eigenvalues and damping ratio(s) of the system.
(5)
Eigenvalue
Damping Frequency
-2.60e+00 + 4.77e+00i 4.78e-01 5.43e+00
-2.60e+00 - 4.77e+00i 4.78e-01 5.43e+00
-6.98e+00
-6.98e+01
159
(6) Use the ‘dcgain’ command to get the DC gain. DC gain = 7.1054e-15
Does this value make sense? Yes, because the output of interest is normalized acceleration
and for a constant input, the acceleration eventually goes to zero. Output = DC gain*input =0
(7) Use the ‘step’ command to get and plot the step response of the system.
(8) Use the ‘max’ command to find the maximum value of y. For c=10000, the maximum
acceleration is 34.286 g’s which would be totally unacceptable. This high value is caused by the
๐‘ขฬ‡ in the differential equations which is an impulse if u is a step. Think about it; if you are moving
forward in your car at a significant speed and hit a curb, the force would probably be great
enough to knock the front axle and suspension off! For realist inputs (not pure steps), you
would like to keep the peak accelerations under about 0.1 g.
(9) Try a few different values for c and observe the difference in the maximum value of y.
Comment on the significance of the choice of c in regard to ride comfort. See m-fle and graph.
% Homework 5 MAE3360 Fall 2013
k=36000;K=100000;b=8400;c=10000;M=1000;m=250;
g=9.8;
A=[0 1 0 0;-k/M -b/M k/M b/M;0 0 0 1;k/m b/m -(K+k)/m -(b+c)/m];
B=[0;b*c/(m*M);c/m;K/m-(b+c)*c/m^2];
C=[-k/(M*g) -b/(M*g) k/(M*g) b/(M*g)];
D=[b*c/(M*m*g)];
Gss1=ss(A,B,C,D);
damp(Gss1)
DCgain=dcgain(Gss1)
[y1,t]=step(Gss1,0.1);%Note, I've stopped the plot at time 0.1 sec. to get better resolution at beginning
ymax=max(y1)
c=7500;
A=[0 1 0 0;-k/M -b/M k/M b/M;0 0 0 1;k/m b/m -(K+k)/m -(b+c)/m];
B=[0;b*c/(m*M);c/m;K/m-(b+c)*c/m^2];
C=[-k/(M*g) -b/(M*g) k/(M*g) b/(M*g)];
D=[b*c/(M*m*g)];
Gss2=ss(A,B,C,D);
[y2]=step(Gss2,t);%uses the same values of t generated by previous step to avoid plotting probems with different t's
c=12500;
A=[0 1 0 0;-k/M -b/M k/M b/M;0 0 0 1;k/m b/m -(K+k)/m -(b+c)/m];
B=[0;b*c/(m*M);c/m;K/m-(b+c)*c/m^2];
C=[-k/(M*g) -b/(M*g) k/(M*g) b/(M*g)];
D=[b*c/(M*m*g)];
Gss3=ss(A,B,C,D);
[y3]=step(Gss3,t);%uses the same values of t generated by previous step to avoid plotting probems with different t's
plot(t,y2,'k',t,y1,'r-.',t,y3,'k:','LineWidth',2)
title('comparing peak accelerations for various damping coefficients c for step inputs')
xlabel('time, sec')
ylabel('normalized acceleration w"/g')
legend('c=7500 Ns/m','c=10000 Ns/m','c=12500 Ns/m','Location','Best')
160
comparing peak accelerations for various damping coefficients c for step inputs
45
40
normalized acceleration w"/g
35
30
c=7500 Ns/m
c=10000 Ns/m
c=12500 Ns/m
25
20
15
10
5
0
-5
0
0.01
0.02
0.03
0.04
0.05 0.06
time, sec
0.07
0.08
0.09
0.1
Homework 22
The schematic for an impact barrier for a car is shown below. Typically, these barriers are
constructed of components that collapse storing and dissipating energy. For example, partially
filled barrels of water; on impact, air in the barrels softens the impact by storing energy while the
water being forced out of the crushed barrels dissipates energy. The objective is to stop a car
with as small of a maximum deceleration as possible but yet not let the barrier totally collapse.
Once a barrier totally collapses, it is equivalent to hitting an immoveable object. As shown in
the schematic, the maximum this barrier can collapse is distance D.
D
K
b
Impact Barrier System
The objective of this homework problem is to perform a series of ode45 simulations for different
values of viscous damping b to determine a value that gives the lowest possible maximum value
of deceleration without the displacement being greater than D. See section 3.6 in the notebook.
Assuming that the car has just contacted the yellow bumper with initial velocity Vo, the
differential equation for the forward displacement y of the car and bumper is as follows:
๐‘€๐‘ฆฬˆ + ๐‘๐‘ฆฬ‡ + ๐พ๐‘ฆ = 0
๐‘ฆ(0− ) = 0
๐‘ฆฬ‡ (0− ) = ๐‘‰๐‘œ
161
Specifically, determine the best damping coefficient b for the barrier assuming K=2000 N/m for
the worse case scenario of the car mass M=1000 kg with an impact speed of Vo=24 m/s; The
๐‘ฆฬˆ
maximum value of the deceleration, (๐‘”), should not be greater than 4.0 g’s with a maximum
collapse distance D = 10m . Note, use g=9.8 m/s2.
(1) Formulate a state variable model for an ode45 simulation
๐‘ฆฬˆ
(2) Your first simulation should generate plots of y and ๐‘” using b = 0. This will be one of the
worst possible values but will give you insight regarding the total time needed for the
simulation. Be sure to stop the simulation when ๐‘ฆฬ‡ first becomes negative because this
means the car and bumper have stopped moving forward and the car is bouncing back off
of the bumper; the differential equation is not a valid model after this happens.
(3) By trial and error, determine a value for b that meets the design specifications. Show
plots of
๐‘ฆฬˆ
๐‘”
for at least three values of b: your best value, a value greater, and a value
smaller. Be sure to label and include a legend on all plots.
Homework 22 Solution
The schematic for an impact barrier for a car is shown below. Typically, these barriers are
constructed of components that collapse storing and dissipating energy. For example, partially
filled barrels of water; on impact, air in the barrels softens the impact by storing energy while the
water being forced out of the crushed barrels dissipates energy. The objective is to stop a car
with as small of a maximum deceleration as possible but yet not let the barrier totally collapse.
Once a barrier totally collapses, it is equivalent to hitting an immoveable object. As shown in
the schematic, the maximum this barrier can collapse is distance D.
D
K
b
Impact Barrier System
The objective of this homework problem is to perform a series of ode45 simulations for different
values of viscous damping b to determine a value that gives the lowest possible maximum value
of deceleration without the displacement being greater than D. See section 3.6 in the notebook.
Assuming that the car has just contacted the yellow bumper with initial velocity Vo, the
differential equation for the forward displacement y of the car and bumper is as follows:
๐‘€๐‘ฆฬˆ + ๐‘๐‘ฆฬ‡ + ๐พ๐‘ฆ = 0
๐‘ฆ(0− ) = 0
๐‘ฆฬ‡ (0− ) = ๐‘‰๐‘œ
162
Specifically, determine the best damping coefficient b for the barrier assuming K=2000 N/m for
the worse case scenario of the car mass M=1000 kg with an impact speed of Vo=24 m/s; The
๐‘ฆฬˆ
maximum value of the deceleration, (๐‘”), should not be greater than 4.0 g’s with a maximum
collapse distance D = 10m . Note, use g=9.8 m/s2.
(1) Formulate a state variable model for an ode45 simulation
๐พ๐‘ฅ1 ๐‘๐‘ฅ2
๐‘ฅ1 = ๐‘ฆ ๐‘ฅ2 = ๐‘ฆฬ‡
๐‘ฅฬ‡ 1 = ๐‘ฅ2 ๐‘ฅฬ‡ 2 = −
−
๐‘ฅ1 (0− ) = 0
๐‘€
๐‘€
๐‘ฅ2 (0− ) = 24
(2) Your first simulation should generate plots of y and ๐‘ฆฬˆ /๐‘” using b = 0. This will be one of
the worst possible values but will give you insight regarding the total time needed for the
simulation. Be sure to stop the simulation when ๐‘ฆฬ‡ first becomes negative because this
means the car and bumper have stopped moving forward and the car is bouncing back off
of the bumper; the differential equation is not a valid model after this happens.
%Homework 6, MAE3360 11-19-13
%Car crash barrier design
global M K b D
D=10;M=1000;Vo=24;K=2000;g=9.8;
options=odeset('events',@Stop_3360_111913);
dr=0;b=2*dr*sqrt(K*M);
[t,x]=ode45(@Hmwk7Eqns_3360_111913,[0 3],[0 Vo],options);
plot(t,x(:,1),'k','LineWidth',2)
xlabel('time, sec.')
ylabel('car displacement, m')
title('barrier performance with zero damping')
figure
plot(t,x(:,2),'k','LineWidth',2)
xlabel('time, sec.')
ylabel('car velocity, m')
title('barrier performance with zero damping')
figure
A=-K*x(:,1)/M-b*x(:,2)/M;
plot(t,A,'k','LineWidth',2)
xlabel('time, sec.')
ylabel('car deceleration, g')
title('barrier performance with zero damping')
%Homework 6, MAE3360 111913 dx equations
function dx=Hmwk7Eqns_3360_111913(t,x)
global M K b D
dx=zeros(2,1);
dx(1)=x(2);
dx(2)=-K*x(1)/M-b*x(2)/M;
end
%Homework 6 MAE3360 111913 events to stop simulation
function [Val,Ister,Dir]=Stop_3360_111913(t,x)
global M K b D
Val(1)=x(2);
Ister(1)=1;
Dir(1)=-1;
Val(2)=D-x(1);
Ister(2)=1;
Dir(2)=-1;
end
163
barrier performance with zero damping
12
car displacement, m
10
8
6
4
2
0
0
0.05
0.1
0.15
0.2
0.25
time, sec.
0.3
0.35
0.4
0.45
barrier performance with zero damping
24
23.5
23
22
21.5
21
20.5
20
19.5
19
0
0.05
0.1
0.15
0.2
0.25
time, sec.
0.3
0.35
0.4
0.45
barrier performance with zero damping
0
-5
car deceleration, g
car velocity, m/s
22.5
-10
-15
-20
-25
0
0.05
0.1
0.15
0.2
0.25
time, sec.
0.3
0.35
0.4
0.45
164
From these three plots above, we see that with zero damping, the car hits the end of
barrier in about 0.45 sec still moving at 19.5 m/s. Also, without considering the extra
impact deceleration associated with hitting the end of the barrier, the deceleration has still
exceeded 20 g’s.
(3) By trial and error, determine a value for b that meets the design specifications. Show
plots of
๐‘ฆฬˆ
๐‘”
for at least three values of b: your best value, a value greater, and a value
smaller. Be sure to label and include a legend on all plots.
%Homework 6, MAE3360 11-19-13
%Car crash barrier design
clear all
global M K b D
D=10;M=1000;Vo=24;K=2000;g=9.8;
options=odeset('events',@Stop_3360_111913);
dr=0.5;b=2*dr*sqrt(K*M);
[t,x5]=ode45(@Hmwk7Eqns_3360_111913,[0 2],[0 Vo],options);
dr=0.45;b=2*dr*sqrt(K*M);
[t,x45]=ode45(@Hmwk7Eqns_3360_111913,[t],[0 Vo],options);% Using previous time array so can plot on
same graph
dr=0.4;b=2*dr*sqrt(K*M);
[t,x4]=ode45(@Hmwk7Eqns_3360_111913,[t],[0 Vo],options);
plot(t,x4(:,1),'r',t,x45(:,1),'k:',t,x5(:,1),'r-.','LineWidth',2)
xlabel('time, sec.')
ylabel('car displacement, m')
title('homework 6 MAE 3360 Nov. 19, 2013')
legend('damping ratio =0.4','damping ratio=0.45','damping ratio=0.5','Location','Best')
figure
plot(t,x4(:,2),'r',t,x45(:,2),'k:',t,x5(:,2),'r-.','LineWidth',2)
xlabel('time, sec.')
ylabel('car velocity, m/sec')
title('homework 6 MAE 3360 Nov. 19, 2013')
legend('damping ratio =0.4','damping ratio=0.45','damping ratio=0.5','Location','Best')
figure
A4=-K*x4(:,1)/M-b*x4(:,2)/M;
A45=-K*x45(:,1)/M-b*x45(:,2)/M;
A5=-K*x5(:,1)/M-b*x5(:,2)/M;
plot(t,A4/g,'r',t,A45/g,'k:',t,A5/g,'r-.','LineWidth',2)
xlabel('time, sec.')
ylabel('car deceleration, g')
title('homework 6 MAE 3360 Nov. 19, 2013')
legend('damping ratio =0.4','damping ratio=0.45','damping ratio=0.5','Location','Best')
Examining the three graphs below, a damping ratio of 0.45 ( b=1273 Ns/m) keeps the displacement just under D
and limits the deceleration to slightly under 2 g’s.
165
homework 6 MAE 3360 Nov. 19, 2013
12
car displacement, m
10
8
6
damping ratio =0.4
damping ratio=0.45
damping ratio=0.5
4
2
0
0
0.1
0.2
0.3
0.4
0.5
time, sec.
0.6
0.7
0.8
0.9
homework 6 MAE 3360 Nov. 19, 2013
25
damping ratio =0.4
damping ratio=0.45
damping ratio=0.5
car velocity, m/sec
20
15
10
5
0
-5
0
0.1
0.2
0.3
0.4
0.5
time, sec.
0.6
0.7
0.8
0.9
166
homework 6 MAE 3360 Nov. 19, 2013
-1.6
damping ratio =0.4
damping ratio=0.45
damping ratio=0.5
-1.8
car deceleration, g
-2
-2.2
-2.4
-2.6
-2.8
-3
0
0.1
0.2
0.3
0.4
0.5
time, sec.
0.6
0.7
0.8
0.9
Note, using the ‘events’ function to end the simulation will cause problems if
you intend to put more than one plot on a graph unless you make sure the
simulation using the shortest time is run first and ‘t’ from the previous run is
used in place of [start time
final time]. See attached m-files.
Homework 23
Two systems with the corresponding differential equations are shown below.
1. The first is a forward moving vehicle and suspension system. At time t = 0, the wheel hits a
bump defined by the surface roughness u(t). (a) What is the dependent variable? (b) What is
the input variable? (3) What is the order of the differential equation? (4) How many initial
conditions are required to solve the equation? What are the initial conditions? (5) Is the
equation linear or nonlinear? (6) Sketch a reasonable estimate of z(t) following the bump which
occurs at t = 0.
2. The second is water draining from a water tank where H is the height of the water. (1) What is
the dependent variable? (2) What is the order of the differential equation? (3) Is the equation
linear or nonlinear? (4) Since there is no input variable, there must be nonzero initial conditions
otherwise there is no solution. What are the initial conditions? (5) Considering the initial
conditions, draw a reasonable estimate of the height of the water H(t) starting at t = 0.
167
3. For systems with zero initial conditions, the ‘D’ operator can be used to convert the differential
equation to an algebraic equation. Do this for the first system.
Homework 23 Solution
Two systems with the corresponding differential equations are shown below.
1. The first is a forward moving vehicle and suspension system. At time t = 0, the wheel hits a
bump defined by the surface roughness u(t). (a) What is the dependent variable? Z
(b) What is the input variable? U
(c) What is the order of the differential equation? 2
(d) How many initial conditions are required to solve the equation? 2
What are the initial conditions? ๐‘ง(0− ) = 0, ๐‘งฬ‡ (0− ) = 0, ๐‘Ž๐‘›๐‘‘ ๐‘ข(0− ).
(e) Is the equation linear or nonlinear? Linear
(f) Sketch a reasonable estimate of z(t) following the bump which occurs at t = 0.
2. The second is water draining from a water tank where H is the height of the water. (a) What is
the dependent variable? H(b) What is the order of the differential equation? 1(c) Is the equation
linear or nonlinear? Linear(d) Since there is no input variable, there must be nonzero initial
conditions otherwise there is no solution. What are the initial conditions?5 (e) Considering the
initial conditions, draw a reasonable estimate of the height of the water H(t) starting at t = 0.
168
3. For systems with zero initial conditions, the ‘D’ operator can be used to convert the differential
equation to an algebraic equation. Do this for the first system.
(100๐ท2 + 1000๐ท + 10000)๐‘ง = (1000๐ท + 10000)๐‘ข
Homework 24
Two systems with the corresponding differential equations are shown below.
1. The first is a forward moving vehicle and suspension system. At time t = 0, the wheel hits a
bump defined by the surface roughness u(t).
(a) What is the transfer function for z?
(b) What is the characteristic polynomial for this suspension system?
(c) Manually factor, using the quadratic equation, the characteristic polynomial to compute the
eigenvalues.
(d) Use the ‘root’ command in MATLAB to get the eigenvalues.
(e) Use the ‘tf’ command in MATLAB to enter the transfer function; note, MATLAB will express
the answer in terms of ‘s’ instead of ‘D’.
(f) Use the ‘damp’ command to get the eigenvalues of this transfer function. What is the
damping ratio? What is the undamped natural frequency? What is the damped natural
frequency? What is the time constant of this system?
(g) After hitting a bump, how long will it take for the vibration to settle out within 1%?
169
(h) The original equations used to model this suspension consist of an equation for each
component, i.e.
๐‘ ๐‘๐‘Ÿ๐‘–๐‘›๐‘” ๐‘“๐‘œ๐‘Ÿ๐‘๐‘’ ๐น๐‘  = 10000(๐‘ง − ๐‘ข)
๐‘‘๐‘Ž๐‘š๐‘๐‘’๐‘Ÿ ๐‘“๐‘œ๐‘Ÿ๐‘๐‘’ ๐น๐‘‘ = 1000(๐‘งฬ‡ − ๐‘ขฬ‡ )
๐‘“๐‘œ๐‘Ÿ๐‘๐‘’ ๐‘๐‘Ž๐‘™๐‘Ž๐‘›๐‘๐‘’ ๐‘œ๐‘› ๐‘š๐‘Ž๐‘ ๐‘ : 100๐‘งฬˆ + ๐น๐‘‘ + ๐น๐‘  = 0
Convert the 2nd and 3rd equations to algebraic equations using the ‘D’ operator. Re-write these
algebraic equations in terms of ‘s’ instead of ‘D’; in symbolic math, the use of ‘D’ probably will
not work for representing algebraic equations since the use of ‘D’ implies taking the derivative.
Then, use the symbolic math command ‘solve’ in MATLAB to solve for z; the answer should be
the transfer function times u.
2. The second is water draining from a water tank where H is the height of the water. It can be
shown that the solution to this differential equation is
๐ป(๐‘ก) = 5๐‘’ −0.02๐‘ก
Create and execute an m-file with the following MATLAB commands to generate a plot of H(t).
clear all
t=0:1:250;
H=5*exp(-0.02*t);
plot(t,H,'r','LineWidth',2)
title('Homework 2: Draining a water tank')
xlabel('Time, sec.')
ylabel('Height of water, m')
Copy and paste your m-file and plot to a Word document to include with your solution to this
homework assignment.
170
Homework 24 Solution
Two systems with the corresponding differential equations are shown below.
1. The first is a forward moving vehicle and suspension system. At time t = 0, the wheel hits a
bump defined by the surface roughness u(t).
(a) What is the transfer function for z?
1000๐‘  + 10000
[
]
100๐‘  2 + 1000๐‘  + 10000
(b) What is the characteristic polynomial for this suspension system? 100๐‘  2 + 1000๐‘  + 10000
(c) Manually factor, using the quadratic equation, the characteristic polynomial to compute the
eigenvalues. ๐‘’๐‘–๐‘”๐‘’๐‘›๐‘ฃ๐‘™๐‘Ž๐‘™๐‘ข๐‘’๐‘  = −5 ± ๐‘—√75 = −5 ± ๐‘—8.6603
(d) Use the ‘roots’ command in MATLAB to get the eigenvalues.
>> roots([100 1000 10000])
ans =
-5.0000 + 8.6603i
-5.0000 - 8.6603i
(e) Use the ‘tf’ command in MATLAB to enter the transfer function; note, MATLAB will express
the answer in terms of ‘s’ instead of ‘D’.
>> G=tf([1000 10000],[100 1000 10000])
G=
1000 s + 10000
-----------------------100 s^2 + 1000 s + 10000
Continuous-time transfer function.
(f) Use the ‘damp’ command to get the eigenvalues of this transfer function.
>> damp(G)
Pole
Damping
Frequency Time Constant
(rad/seconds) (seconds)
-5.00e+00 + 8.66e+00i 5.00e-01
1.00e+01
2.00e-01
-5.00e+00 - 8.66e+00i 5.00e-01
1.00e+01
2.00e-01
What is the damping ratio? 0.5
What is the undamped natural frequency? 10 rad/sec.
What is the damped natural frequency? 8.66 rad/sec.
What is the time constant of this system? 0.2 sec
(g) After hitting a bump, how long will it take for the vibration to settle out within 1%? 1 sec.
(h) The original equations used to model this suspension consist of an equation for each
component, i.e.
๐‘ ๐‘๐‘Ÿ๐‘–๐‘›๐‘” ๐‘“๐‘œ๐‘Ÿ๐‘๐‘’ ๐น๐‘  = 10000(๐‘ง − ๐‘ข)
171
๐‘‘๐‘Ž๐‘š๐‘๐‘’๐‘Ÿ ๐‘“๐‘œ๐‘Ÿ๐‘๐‘’ ๐น๐‘‘ = 1000(๐‘งฬ‡ − ๐‘ขฬ‡ )
๐‘“๐‘œ๐‘Ÿ๐‘๐‘’ ๐‘๐‘Ž๐‘™๐‘Ž๐‘›๐‘๐‘’ ๐‘œ๐‘› ๐‘š๐‘Ž๐‘ ๐‘ : 100๐‘งฬˆ + ๐น๐‘‘ + ๐น๐‘  = 0
nd
rd
Convert the 2 and 3 equations to algebraic equations using the ‘D’ operator. Re-write these
algebraic equations in terms of ‘s’ instead of ‘D’; in symbolic math, the use of ‘D’ probably will
not work for representing algebraic equations since the use of ‘D’ implies taking the derivative.
Then, use the symbolic math command ‘solve’ in MATLAB to solve for z; the answer should be
the transfer function times u. Note, to understand what ‘collect’ and ‘pretty’ do, type just ‘H.z’.
>> syms s u Fs z Fd
>> H=solve(Fs==10000*(z-u),Fd==1000*s*(z-u),100*s^2*z+Fs+Fd==0,Fs,Fd,z);
>> Z=collect(H.z,u);
>> pretty(Z)
10(๐‘ +10)
๐‘ 2 +10๐‘ +100
The second system is water draining from a water tank where H is the
height of the water. It can be shown that the solution to this differential equation is
๐ป(๐‘ก) = 5๐‘’ −0.02๐‘ก
Create and execute an m-file with the following MATLAB commands to generate a plot of H(t).
clear all
t=0:1:250;
H=5*exp(-0.02*t);
plot(t,H,'r','LineWidth',2)
title('Homework 2: Draining a water tank')
xlabel('Time, sec.')
ylabel('Height of water, m')
Copy and paste your m-file and plot to a Word document to include with your solution to this
homework assignment.
Homework 2: Draining a water tank
5
4.5
4
Height of water, m
3.5
3
2.5
2
1.5
1
0.5
0
0
50
100
150
200
250
Time, sec.
172
Homework 25
A sliding block system is shown below. A spring connects a swinging bar to the block. A force f
is the input to the system. The differential equations that model the motion of this system
resulting from a certain input f are also given below.
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(i)
(j)
(k)
(l)
What are the unknowns?
What is the order of each differential equation?
Are the equations linear?
Use the ‘D’ operator to convert the equations to algebraic equations.
Manually solve for y by eliminating ๐œƒ.
What is the transfer function for y?
Repeat (e) but this time use symbolic math and the ‘solve’ command.
What are the eigenvalues of this system?
What are eigenvalue frequencies?
Explain why this system does not have time constants.
What are the ‘modes’ of this system? Use the MATLAB command ‘pfract’.
Suppose the force f is a single blow with a hammer. Describe the motion of the system at each
mode?
Homework 25 Solution
A sliding block system is shown below. A spring connects a swinging bar to the block. A force f
is the input to the system. The differential equations that model the motion of this system
resulting from a certain input f are also given below.
(a)
(b)
(c)
(d)
What are the unknowns? ๐‘ฆ ๐‘Ž๐‘›๐‘‘ ๐œƒ
What is the order of each differential equation? 2
Are the equations linear? yes
Use the ‘D’ operator to convert the equations to algebraic equations.
(๐ƒ๐Ÿ + ๐Ÿ๐ŸŽ๐ŸŽ)๐ฒ − ๐Ÿ“๐ŸŽ๐›‰ = ๐ŸŽ. ๐Ÿ๐Ÿ
(๐ƒ๐Ÿ + ๐Ÿ”๐Ÿ’)๐›‰ − ๐Ÿ•๐Ÿ“๐ฒ = ๐ŸŽ
173
(e) Manually solve for y by eliminating ๐œƒ.
๐Ÿ•๐Ÿ“
From 2nd equations: ๐œฝ = ๐‘ซ๐Ÿ +๐Ÿ”๐Ÿ’ ๐’š
๐Ÿ•๐Ÿ“
Into 1st equation gives: (๐‘ซ๐Ÿ + ๐Ÿ๐ŸŽ๐ŸŽ)๐’š − ๐Ÿ“๐ŸŽ ๐‘ซ๐Ÿ +๐Ÿ”๐Ÿ’ ๐’š = ๐ŸŽ. ๐Ÿ๐’‡
๐ŸŽ.๐Ÿ(๐‘ซ๐Ÿ +๐Ÿ”๐Ÿ’)
Or ๐’š = ๐‘ซ๐Ÿ’ +๐Ÿ๐Ÿ”๐Ÿ’๐‘ซ๐Ÿ +๐Ÿ๐Ÿ”๐Ÿ“๐ŸŽ ๐’‡
(f) What is the transfer function for y?
๐ŸŽ.๐Ÿ(๐ƒ๐Ÿ +๐Ÿ”๐Ÿ’)
๐ƒ๐Ÿ’ +๐Ÿ๐Ÿ”๐Ÿ’๐ƒ๐Ÿ +๐Ÿ๐Ÿ”๐Ÿ“๐ŸŽ
(g) Repeat (e) but this time use symbolic math and the ‘solve’ command.
syms s f yT
H=solve((s^2+100)*y-50*T==0.1*f,(s^2+64)*T-75*y==0,T,y);
A=H.y/f;
pretty(A)
(s2 + 64.0) 0.1
----------------------
S4 + 164.0 s2 + 2650.0
(h) What are the eigenvalues of this system?
>> roots([1 0 164 0 2650])
ans =
0.0000 +12.0759i
0.0000 -12.0759i
-0.0000 + 4.2629i
-0.0000 - 4.2629i
(i) What are eigenvalue frequencies? 12.08 and 4.26 rad/sec
(j) Explain why this system does not have time constants. The time constants are infinity since
the real parts of the eigenvalues are zero.
(k) What are the ‘modes’ of this system? Use the MATLAB command ‘pfract’.
>> pfract([1 0 64],[1 0 164 0 2650])
Second Mode:
0.641
-----------------s^2 + 145.8
174
0.359
First Mode:
------------------------s^2 + 18.17
Note, I have removed the small terms that should be zero but aren’t because of round-off
errors.
(l) Suppose the force f is a single blow with a hammer. Describe the motion of the system at each
mode?
During the first mode, the mass and bar are moving exactly in phase. During the second
mode, the movement of the mass and bar are exactly 180 degrees out of phase. The motion
transitions back and forth between the modes.
Homework 26
Use the Laplace transform to solve each of the following differential equations for v(t); show all
of your steps in getting the solution. Note, before solving for each v(t), draw a sketch of your
estimate of v(t). For each case, use the FVT and the IVT to check your V(s) before finding the
inverse Laplace transform. Then, once you get each v(t), check the solution at t=0 and t=∞ to
confirm your answer.s=-3+j
(1) ๐‘ฃฬˆ + 12๐‘ฃฬ‡ + 20๐‘ฃ = 0
(2) ๐‘ฃฬˆ + 12๐‘ฃฬ‡ + 20๐‘ฃ = 100
(3) 2๐‘ฃฬˆ + 12๐‘ฃฬ‡ + 20๐‘ฃ = 0
(4) 2๐‘ฃฬˆ + 12๐‘ฃฬ‡ + 20๐‘ฃ = 100
๐‘ฃ(0− ) = 10
๐‘ฃ(0− ) = 10
๐‘ฃ(0− ) = 10
๐‘ฃ(0− ) = 10
๐‘ฃฬ‡ (0− ) = 0
๐‘ฃฬ‡ (0− ) = 0
๐‘ฃฬ‡ (0− ) = 0
๐‘ฃฬ‡ (0− ) = 0
Homework 26 Solution
Use the Laplace transform to solve each of the following differential equations for v(t); show all
of your steps in getting the solution. Note, before solving for each v(t), draw a sketch of your
estimate of v(t). For each case, use the FVT and the IVT to check your V(s) before finding the
inverse Laplace transform. Then, once you get each v(t), check the solution at t=0 and t=∞ to
confirm your answer.
Note, all of the Laplace transforms below confirm the initial and final values. Also, all of
the inverse Laplace transforms confirm the initial and final values.
175
๐ฏ(๐ŸŽ− ) = ๐Ÿ๐ŸŽ
(1) ๐ฏฬˆ + ๐Ÿ๐Ÿ๐ฏฬ‡ + ๐Ÿ๐ŸŽ๐ฏ = ๐ŸŽ
๐‘‰(๐‘ ) =
(2) ๐ฏฬˆ + ๐Ÿ๐Ÿ๐ฏฬ‡ + ๐Ÿ๐ŸŽ๐ฏ = ๐Ÿ๐ŸŽ๐ŸŽ
๐‘‰(๐‘ ) =
10๐‘  + 120
(๐‘  + 2)(๐‘  + 10)
๐ฏ(๐ŸŽ− ) = ๐Ÿ๐ŸŽ
10๐‘  2 + 120๐‘  + 100
๐‘ (๐‘  + 2)(๐‘  + 10)
๐‘‰(๐‘ ) =
๐‘ฃ(๐‘ก) =
100๐‘’ −2๐‘ก 20๐‘’ −10๐‘ก
−
8
8
๐ฏฬ‡ (๐ŸŽ− ) = ๐ŸŽ
๐ฏ(๐ŸŽ− ) = ๐Ÿ๐ŸŽ
(3) ๐Ÿ๐ฏฬˆ + ๐Ÿ๐Ÿ๐ฏฬ‡ + ๐Ÿ๐ŸŽ๐ฏ = ๐ŸŽ
๐‘ฃ(๐‘ก) =
๐ฏฬ‡ (๐ŸŽ− ) = ๐ŸŽ
๐‘ฃ(๐‘ก) = 5 +
50๐‘’ −2๐‘ก 10๐‘’ −10๐‘ก
−
8
8
๐ฏฬ‡ (๐ŸŽ− ) = ๐ŸŽ
10๐‘  + 60
(๐‘  + 3)2 + 12
๐‘’ −3๐‘ก
|10๐‘  + 60|๐‘ =−3+๐‘— sin (1๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’(10๐‘  + 60)๐‘ =−3+๐‘— )
1
๐‘ฃ(๐‘ก) = 31.62๐‘’ −3๐‘ก sin (๐‘ก + 0.32175)
(4) ๐Ÿ๐ฏฬˆ + ๐Ÿ๐Ÿ๐ฏฬ‡ + ๐Ÿ๐ŸŽ๐ฏ = ๐Ÿ๐ŸŽ๐ŸŽ
๐ฏ(๐ŸŽ− ) = ๐Ÿ๐ŸŽ
๐‘‰(๐‘ ) =
๐‘ฃ(๐‘ก) = 5๐‘’
0๐‘ก
๐ฏฬ‡ (๐ŸŽ− ) = ๐ŸŽ
10๐‘  2 + 60๐‘  + 50
๐‘ [(๐‘  + 3)2 + 11 ]
๐‘’ −3๐‘ก 10๐‘  2 + 60๐‘  + 50
10๐‘  2 + 60๐‘  + 50
+
|
|
sin (1๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
)
)
1
๐‘ 
๐‘ 
๐‘ =−3+๐‘—
๐‘ =−3+๐‘—
๐‘ฃ(๐‘ก) = 5 + 15.811๐‘’ −3๐‘ก sin (๐‘ก + 2.8198)
Homework 27
The solutions to the following differential equations were obtained in Homework 4. For
Homework 5, you are to use the MATLAB command ‘impulse’ to get plots of the solutions to
the same equations. In each case, plot the analytical solution on the same graph to confirm they
are identical.
(1)
(2)
(3)
(4)
๐‘ฃฬˆ + 12๐‘ฃฬ‡ + 20๐‘ฃ = 0
๐‘ฃฬˆ + 12๐‘ฃฬ‡ + 20๐‘ฃ = 100
2๐‘ฃฬˆ + 12๐‘ฃฬ‡ + 20๐‘ฃ = 0
2๐‘ฃฬˆ + 12๐‘ฃฬ‡ + 20๐‘ฃ = 100
๐‘ฃ(0− ) = 10
๐‘ฃฬ‡ (0− ) = 0
๐‘ฃ(0− ) = 10
๐‘ฃฬ‡ (0− ) = 0
−)
๐‘ฃ(0 = 10
๐‘ฃฬ‡ (0− ) = 0
๐‘ฃ(0− ) = 10
๐‘ฃฬ‡ (0− ) = 0
176
Homework 27 Solution
Use the Laplace transform to solve each of the following differential equations for v(t); show all
of your steps in getting the solution. Note, before solving for each v(t), draw a sketch of your
estimate of v(t). For each case, use the FVT and the IVT to check your V(s) before finding the
inverse Laplace transform. Then, once you get each v(t), check the solution at t=0 and t=∞ to
confirm your answer.
Note, all of the Laplace transforms below confirm the initial and final values. Also, all of
the inverse Laplace transforms confirm the initial and final values.
๐ฏ(๐ŸŽ− ) = ๐Ÿ๐ŸŽ
(1) ๐ฏฬˆ + ๐Ÿ๐Ÿ๐ฏฬ‡ + ๐Ÿ๐ŸŽ๐ฏ = ๐ŸŽ
๐‘‰(๐‘ ) =
๐ฏฬ‡ (๐ŸŽ− ) = ๐ŸŽ
10๐‘  + 120
(๐‘  + 2)(๐‘  + 10)
๐‘ฃ(๐‘ก) =
100๐‘’ −2๐‘ก 20๐‘’ −10๐‘ก
−
8
8
10
using inverse Laplace
using impulse command
9
8
7
v(t)
6
5
4
3
2
1
0
0
0.5
(2) ๐ฏฬˆ + ๐Ÿ๐Ÿ๐ฏฬ‡ + ๐Ÿ๐ŸŽ๐ฏ = ๐Ÿ๐ŸŽ๐ŸŽ
1
1.5
time, sec.
๐ฏ(๐ŸŽ− ) = ๐Ÿ๐ŸŽ
10๐‘  2 + 120๐‘  + 100
๐‘‰(๐‘ ) =
๐‘ (๐‘  + 2)(๐‘  + 10)
2
2.5
3
๐ฏฬ‡ (๐ŸŽ− ) = ๐ŸŽ
50๐‘’ −2๐‘ก 10๐‘’ −10๐‘ก
๐‘ฃ(๐‘ก) = 5 +
−
8
8
177
11
using inverse Laplace
using impulse command
10
v(t)
9
8
7
6
5
0
0.5
1
2
2.5
3
๐ฏ(๐ŸŽ− ) = ๐Ÿ๐ŸŽ
๐ฏฬ‡ (๐ŸŽ− ) = ๐ŸŽ
10๐‘  + 60
๐‘‰(๐‘ ) =
(๐‘  + 3)2 + 12
(3) ๐Ÿ๐ฏฬˆ + ๐Ÿ๐Ÿ๐ฏฬ‡ + ๐Ÿ๐ŸŽ๐ฏ = ๐ŸŽ
๐‘ฃ(๐‘ก) =
1.5
time, sec.
๐‘’ −3๐‘ก
|10๐‘  + 60|๐‘ =−3+๐‘— sin (1๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’(10๐‘  + 60)๐‘ =−3+๐‘— )
1
๐‘ฃ(๐‘ก) = 31.62๐‘’ −3๐‘ก sin (๐‘ก + 0.32175)
10
using inverse Laplace
using impulse command
9
8
7
v(t)
6
5
4
3
2
1
0
0
0.5
1
1.5
2
2.5
time, sec.
(4) ๐Ÿ๐ฏฬˆ + ๐Ÿ๐Ÿ๐ฏฬ‡ + ๐Ÿ๐ŸŽ๐ฏ = ๐Ÿ๐ŸŽ๐ŸŽ
๐ฏ(๐ŸŽ− ) = ๐Ÿ๐ŸŽ
๐ฏฬ‡ (๐ŸŽ− ) = ๐ŸŽ
10๐‘  2 + 60๐‘  + 50
๐‘‰(๐‘ ) =
๐‘ [(๐‘  + 3)2 + 11 ]
178
๐‘ฃ(๐‘ก) = 5๐‘’ 0๐‘ก +
๐‘’ −3๐‘ก 10๐‘  2 + 60๐‘  + 50
10๐‘  2 + 60๐‘  + 50
|
|
sin (1๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
)
)
1
๐‘ 
๐‘ 
๐‘ =−3+๐‘—
๐‘ =−3+๐‘—
๐‘ฃ(๐‘ก) = 5 + 15.811๐‘’ −3๐‘ก sin (๐‘ก + 0.3218)
11
using inverse Laplace
using impulse command
10
v(t)
9
8
7
6
5
0
0.5
1
1.5
2
2.5
time, sec.
clear all
G=tf([10 120],[1 12 20]);
[V,t]=impulse(G);
v=100*exp(-2*t)/8-20*exp(-10*t)/8;
plot(t,v,'r',t,V,'k.','LineWidth',2)
xlabel('time, sec.')
ylabel('v(t)')
legend('using inverse Laplace','using
figure
clear all
G=tf([10 120 100],[1 12 20 0]);
[V,t]=impulse(G);
v=5+50*exp(-2*t)/8-10*exp(-10*t)/8;
plot(t,v,'r',t,V,'k.','LineWidth',2)
xlabel('time, sec.')
ylabel('v(t)')
legend('using inverse Laplace','using
figure
clear all
G=tf([10 60],[1 6 10]);
[V,t]=impulse(G);
v=31.62*exp(-3*t).*sin(t+0.32175);
plot(t,v,'r',t,V,'k.','LineWidth',2)
xlabel('time, sec.')
ylabel('v(t)')
legend('using inverse Laplace','using
figure
clear all
G=tf([10 60 50],[1 6 10 0]);
[V,t]=impulse(G);
v=5+15.81*exp(-3*t).*sin(t+0.3218);
plot(t,v,'r',t,V,'k.','LineWidth',2)
xlabel('time, sec.')
ylabel('v(t)')
legend('using inverse Laplace','using
impulse command')
impulse command')
impulse command')
impulse command')
179
Homework 28
A pile driver is used to drive the pile shown below into the ground. This is a study to determine
the significance of the pounding frequency of input force Fi on the amplitude of the force at the
ground Fg. The total mass of the pile is M=15,000 Kg. The stiffness of the pile is K=AE/L =
1.5e8 N/m where the pile length is L=15 m. Although a 5 or more lumped mass would be
preferred for the study, for simplicity, only 3 lumped masses was used. b = 50,000 Ns/m for the
viscous damping coefficient.
Fi
M/3
b
3K
M/3
L
M
K
b
3K
AE
M/3
b
3K
Fg
For the three-lumped mass model, it can be shown that the transfer function relating the ground
force Fg to the input pounding force Fi is as follows:
๐น๐‘” (๐‘ ) = [
1000๐‘  3 + 2.7๐‘’07๐‘  2 + 2.43๐‘’11๐‘  + 7.29๐‘’14
] ๐น (๐‘ )
๐‘  6 + 50๐‘  5 + 4.506๐‘’5๐‘  4 + 1.08๐‘’07๐‘  3 + 4.863๐‘’10๐‘  2 + 2.43๐‘’11๐‘  + 7.29๐‘’14 ๐‘–
Note, the total ground force will include the constant weight of the beam but we are only
considering the additional force due to the pounding.
(1) What is the DC gain of this transfer function? What does this mean?
(2) What are the eigenvalues of this transfer function? What are the resonant frequencies of the
beam (damped natural frequencies)?
(3) Use the MATLAB command ‘bode’ to determine the magnitudes of this transfer function at the
resonant frequencies. Which resonant frequency produces the greatest transfer function
magnitude? What is this magnitude (convert it from dB)?
(4) If the input force is ๐น๐‘– (๐‘ก) = 1 sin(๐œ”1 ๐‘ก) ๐‘คโ„Ž๐‘’๐‘Ÿ๐‘’ ๐œ”1 ๐‘–๐‘  ๐‘กโ„Ž๐‘’ ๐‘™๐‘œ๐‘ค๐‘’๐‘ ๐‘ก ๐‘Ÿ๐‘’๐‘ ๐‘œ๐‘›๐‘Ž๐‘›๐‘ก ๐‘“๐‘Ÿ๐‘’๐‘ž๐‘ข๐‘’๐‘›๐‘๐‘ฆ, we
know that Fg(t) will become a sine wave at the same frequency. What will be the amplitude of
the Fg sine wave?
180
Homework 28 Solution
A pile driver is used to drive the pile shown below into the ground. This is a study to determine
the significance of the pounding frequency of input force Fi on the amplitude of the force at the
ground Fg. The total mass of the pile is M=15,000 Kg. The stiffness of the pile is K=AE/L =
1.5e8 N/m where the pile length is L=15 m. Although a 5 or more lumped mass would be
preferred for the study, for simplicity, only 3 lumped masses was used. b = 50,000 Ns/m for the
viscous damping coefficient.
Fi
M/3
b
3K
M/3
L
M
K
b
3K
AE
M/3
b
3K
Fg
For the three-lumped mass model, it can be shown that the transfer function relating the ground
force Fg to the input pounding force Fi is as follows:
๐น๐‘” (๐‘ ) = [
1000๐‘  3 + 2.7๐‘’07๐‘  2 + 2.43๐‘’11๐‘  + 7.29๐‘’14
] ๐น (๐‘ )
๐‘  6 + 50๐‘  5 + 4.506๐‘’5๐‘  4 + 1.08๐‘’07๐‘  3 + 4.863๐‘’10๐‘  2 + 2.43๐‘’11๐‘  + 7.29๐‘’14 ๐‘–
Note, the total ground force will include the constant weight of the beam but we are only
considering the additional force due to the pounding.
(1) What is the DC gain of this transfer function? What does this mean?
DC gain = 1 This means if Fi is a constant C, then the final value of Fi will also be a constant
equal to DC gain*C = C.
(2) What are the eigenvalues of this transfer function? What are the resonant frequencies of the
beam (damped natural frequencies)? Resonant frequencies = 134, 374, and 540 rad/sec.
Pole
Damping
Frequency Time Constant
(rad/seconds) (seconds)
-9.91e-01 + 1.34e+02i
-9.91e-01 - 1.34e+02i
-7.77e+00 + 3.74e+02i
-7.77e+00 - 3.74e+02i
-1.62e+01 + 5.40e+02i
-1.62e+01 - 5.40e+02i
7.42e-03
7.42e-03
2.08e-02
2.08e-02
3.00e-02
3.00e-02
1.34e+02
1.34e+02
3.74e+02
3.74e+02
5.41e+02
5.41e+02
1.01e+00
1.01e+00
1.29e-01
1.29e-01
6.16e-02
6.16e-02
181
(3) Use the MATLAB command ‘bode’ to determine the magnitudes of this transfer function at the
resonant frequencies. 37.8 dB (77.6), 16.5 dB (6.7), and 0.0868 dB (1.01). Which resonant
frequency produces the greatest transfer function magnitude? 134 rad/sec.
What is this magnitude (convert it from dB)? The amplitude of Fg will be 77.6 times greater
than the amplitude of Fi.
Bode Diagram
40
System: G
Frequency (rad/s): 134
Magnitude (dB): 37.8
30
20
System: G
Frequency (rad/s): 374
Magnitude (dB): 16.5
Magnitude (dB)
10
0
System: G
Frequency (rad/s): 535
Magnitude (dB): 0.0868
-10
-20
-30
-40
-50
-60
0
Phase (deg)
-180
-360
-540
10
2
10
3
Frequency (rad/s)
(4) If the input force is ๐น๐‘– (๐‘ก) = 1 sin(๐œ”1 ๐‘ก) ๐‘คโ„Ž๐‘’๐‘Ÿ๐‘’ ๐œ”1 ๐‘–๐‘  ๐‘กโ„Ž๐‘’ ๐‘™๐‘œ๐‘ค๐‘’๐‘ ๐‘ก ๐‘Ÿ๐‘’๐‘ ๐‘œ๐‘›๐‘Ž๐‘›๐‘ก ๐‘“๐‘Ÿ๐‘’๐‘ž๐‘ข๐‘’๐‘›๐‘๐‘ฆ, we
know that Fg(t) will become a sine wave at the same frequency. What will be the amplitude of
the Fg sine wave?
Fg(t)=77.6sin(134t+๐›ฝ)
Homework 29
An impact barrier for a car is shown below. The objective is to stop a car with as small of a
maximum deceleration as possible but yet not let the barrier totally collapse; as shown, the
maximum the barrier can collapse is distance D. The specific design process is to select a
spring constant K and damping coefficient b for the barrier for the worse-case scenario of
M=1000 kg car with an impact speed of Vo=24 m/s; The maximum deceleration should not
exceed -4.0 g’s with a maximum collapse distance D = 10m .
D
K
b
Impact Barrier System
182
The differential equation for the displacement z of the car is given below
๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐’›ฬˆ + ๐’ƒ๐’›ฬ‡ + ๐‘ฒ๐’› = ๐ŸŽ
Assume t = 0 at the instant the car contacts the yellow bumper and at this instant,
๐’›(๐ŸŽ− ) = ๐ŸŽ and ๐’›ฬ‡ (๐ŸŽ− ) = ๐Ÿ๐Ÿ’ ๐’Ž/๐’”.
(a) Express the differential equation in matrix state variable format. Note, every
matrix term in ๐‘ฉ ๐’‚๐’๐’… ๐‘ซ will be zero since there is no input (u=0).
We have two outputs-of-interest, i.e. ๐’š๐Ÿ = ๐’› ๐’‚๐’๐’… ๐’š๐Ÿ = ๐’›ฬˆ .
๐’™ฬ‡
?
[ ๐Ÿ] = [
๐’™ฬ‡ ๐Ÿ
?
๐ŸŽ
? ๐’™๐Ÿ
] [๐’™ ] + [ ] ๐’–
๐ŸŽ
? ๐Ÿ
๐’š๐Ÿ
๐ŸŽ
? ? ๐’™๐Ÿ
[๐’š ] = [
] [๐’™ ] + [ ] ๐’–
๐ŸŽ
๐Ÿ
? ? ๐Ÿ
(b) Assume K = 2131 N/m and b = 1139Ns/m. Use MATLAB with your state variable
equations and the command ‘initial’ to get plots of ๐’›(๐’•) ๐’‚๐’๐’… ๐’›ฬˆ (๐’•). Do these values
for K and b satisfy the design specification? Note, once the barrier stops the
forward motion of the car, the car will bounce back. The differential equation is not
valid once the bounce back is initiated.
Homework 29 Solution
An impact barrier for a car is shown below. The objective is to stop a car with as small of a
maximum deceleration as possible but yet not let the barrier totally collapse; as shown, the
maximum the barrier can collapse is distance D. The specific design process is to select a
spring constant K and damping coefficient b for the barrier for the worse-case scenario of
M=1000 kg car with an impact speed of Vo=24 m/s; The maximum deceleration should not
exceed -4.0 g’s with a maximum collapse distance D = 10m .
D
K
b
Impact Barrier System
The differential equation for the displacement z of the car is given below
๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐’›ฬˆ + ๐’ƒ๐’›ฬ‡ + ๐‘ฒ๐’› = ๐ŸŽ
Assume t = 0 at the instant the car contacts the yellow bumper and at this instant,
183
๐’›(๐ŸŽ− ) = ๐ŸŽ and ๐’›ฬ‡ (๐ŸŽ− ) = ๐Ÿ๐Ÿ’ ๐’Ž/๐’”.
(a) Express the differential equation in matrix state variable format. Note, every
matrix term in ๐‘ฉ ๐’‚๐’๐’… ๐‘ซ will be zero since there is no input (u=0).
We have two outputs-of-interest, i.e. ๐’š๐Ÿ = ๐’› ๐’‚๐’๐’… ๐’š๐Ÿ = ๐’›ฬˆ .
[
๐’™ฬ‡ ๐Ÿ
๐ŸŽ
]=[
๐’™ฬ‡ ๐Ÿ
−๐Ÿ. ๐Ÿ๐Ÿ‘๐Ÿ
๐Ÿ
๐’š๐Ÿ
[๐’š ] = [−๐Ÿ. ๐Ÿ๐Ÿ‘๐Ÿ⁄
๐Ÿ
๐Ÿ—. ๐Ÿ–
๐’™๐Ÿ
๐Ÿ
๐ŸŽ
] [๐’™ ] + [ ] ๐’–
−๐Ÿ. ๐Ÿ๐Ÿ‘๐Ÿ— ๐Ÿ
๐ŸŽ
๐ŸŽ
๐’™๐Ÿ
๐ŸŽ
−๐Ÿ. ๐Ÿ๐Ÿ‘๐Ÿ—⁄ ] [๐’™๐Ÿ ] + [๐ŸŽ] ๐’–
๐Ÿ—. ๐Ÿ–
Note, y2 has been divided by 9.8 to normalized the deceleration by gravity to get g’s.
(b) Assume K = 2131 N/m and b = 1139Ns/m. Use MATLAB with your state variable
equations and the command ‘initial’ to get plots of ๐’›(๐’•) ๐’‚๐’๐’… ๐’›ฬˆ (๐’•). Do these values
for K and b satisfy the design specification? Note, once the barrier stops the
forward motion of the car, the car will bounce back. The differential equation is not
valid once the bounce back is initiated.
clear all
format shortg
A=[0 1;-2131/1000 -1139/1000];B=[0;0];
C=[1 0;-(2131/1000)/9.8 -(1139/1000)/9.8];D=[0;0];
G=ss(A,B,C,D);
[Y,t]=initial(G,[0;24],1);
plot(t,Y(:,1),'k','LineWidth',2)
xlabel('time, sec.')
ylabel('z, m')
title('displacement of car into barrier')
figure
plot(t,Y(:,2),'k','LineWidth',2)
xlabel('time, sec.')
ylabel('deceleration, g')
title('deceleration of car after hitting barrier')
In the plots below, the simulation has been stopped at 1 sec
since the displacement has peaked and the car starting to bounce
back. Note that the maximum displacement is about 10 m and the
maximum deceleration is slightly greater than 3 g’s , which are
within the design specification,
184
displacement of car into barrier
12
10
z, m
8
6
4
2
0
0
0.2
0.4
0.6
0.8
1
0.8
1
time, sec.
deceleration of car after hitting barrier
-1.8
-2
deceleration, g
-2.2
-2.4
-2.6
-2.8
-3
-3.2
0
0.2
0.4
0.6
time, sec.
185
Homework 30
An impact barrier for a car is shown below. When the car contacts the gray bumper, the
yellow piston starts moving forward compressing the fluid in the cylinder due to the
movement of the piston to the left. Also, the rise in pressure forces the fluid through the
orifice represented by flow rate Q out of the cylinder. Hopefully, the barrier will stop a car
with an initial impact speed of 24 m/s without the deceleration exceeding 5 g’s and without
total barrier collapse corresponding to y = 10 m. To decrease the g levels of deceleration, a
rubber ball or balloon filled with air has been placed in the water in the cylinder to
increase the compressibility of the fluid in the cylinder.
y
Q
10
water
air
The equations for the displacement y of the piston and car, for the pressure P in the
cylinder, and for the flow rate Q m3/s are as follows:
๐’šฬˆ + (๐Ÿ“๐’™๐Ÿ๐ŸŽ−๐Ÿ“ )๐‘ท = ๐ŸŽ
(๐Ÿ๐ŸŽ − ๐’š)๐‘ทฬ‡ = (๐Ÿ๐’™๐Ÿ๐ŸŽ๐Ÿ– )(๐ŸŽ. ๐ŸŽ๐Ÿ“๐’šฬ‡ − ๐‘ธ)
๐‘ธ = (๐Ÿ–. ๐Ÿ—๐’™๐Ÿ๐ŸŽ−๐Ÿ’ )√|๐‘ท| ∗ ๐’”๐’Š๐’ˆ๐’(๐‘ท)
๐’š(๐ŸŽ− ) = ๐ŸŽ ๐’Ž
๐’šฬ‡ (๐ŸŽ− ) = ๐Ÿ๐Ÿ’ ๐’Ž/๐’”
๐‘ท(๐ŸŽ− ) = ๐ŸŽ ๐‘ต/๐’Ž๐Ÿ
In the equation for Q, ‘sign(P)’ is a programming command that produces +1 if P>0 and -1
if P<0. Thus, Q can be positive or negative without calculating the square root of negative
numbers.
(a) What are the unknowns in these equations?
(b) Define state variables and write the derivative equations for your state variables.
(c) Create a MATLAB ode45 numerical simulation of these equations and plot on the
same graph ๐’š(๐’•), ๐’šฬ‡ (๐’•), ๐’‚๐’๐’… ๐’šฬˆ (๐’•)/๐’ˆ. The solution should not take more than 1 sec.
(d) From examination of your plots, what can you conclude about the performance of
this barrier system?
Note, if you have any MATLAB questions regarding this assignment, please consult
only with Professor Hullender.
186
Homework 30 Solution
An impact barrier for a car is shown below. When the car contacts the gray bumper, the
yellow piston starts moving forward compressing the fluid in the cylinder due to the
movement of the piston to the left. Also, the rise in pressure forces the fluid through the
orifice represented by flow rate Q out of the cylinder. Hopefully, the barrier will stop a car
with an initial impact speed of 24 m/s without the deceleration exceeding 5 g’s and without
total barrier collapse corresponding to y = 10 m. To decrease the g levels of deceleration, a
rubber ball or balloon filled with air has been placed in the water in the cylinder to
increase the compressibility of the fluid in the cylinder.
y
Q
10
water
air
The equations for the displacement y of the piston and car, for the pressure P in the
cylinder, and for the flow rate Q m3/s are as follows:
๐’šฬˆ + (๐Ÿ“๐’™๐Ÿ๐ŸŽ−๐Ÿ“ )๐‘ท = ๐ŸŽ
(๐Ÿ๐ŸŽ − ๐’š)๐‘ทฬ‡ = (๐Ÿ๐’™๐Ÿ๐ŸŽ๐Ÿ– )(๐ŸŽ. ๐ŸŽ๐Ÿ“๐’šฬ‡ − ๐‘ธ)
๐‘ธ = (๐Ÿ–. ๐Ÿ—๐’™๐Ÿ๐ŸŽ−๐Ÿ’ )√|๐‘ท| ∗ ๐’”๐’Š๐’ˆ๐’(๐‘ท)
๐’š(๐ŸŽ− ) = ๐ŸŽ ๐’Ž
๐’šฬ‡ (๐ŸŽ− ) = ๐Ÿ๐Ÿ’ ๐’Ž/๐’”
๐‘ท(๐ŸŽ− ) = ๐ŸŽ ๐‘ต/๐’Ž๐Ÿ
In the equation for Q, ‘sign(P)’ is a programming command that produces +1 if P>0 and -1
if P<0. Thus, Q can be positive or negative without calculating the square root of negative
numbers.
(a) What are the unknowns in these equations? y, P, and Q
(b) Define state variables and write the derivative equations for your state variables.
๐’™๐Ÿ = ๐’š ๐’™๐Ÿ = ๐’šฬ‡ ๐’™๐Ÿ‘ = ๐‘ท
๐’™ฬ‡ ๐Ÿ = ๐’™๐Ÿ ๐’™ฬ‡ ๐Ÿ = −๐Ÿ“๐’™๐Ÿ๐ŸŽ−๐Ÿ“ ๐’™๐Ÿ‘
๐‘ธ = (๐Ÿ–. ๐Ÿ—๐’™๐Ÿ๐ŸŽ−๐Ÿ’ )√|๐’™๐Ÿ‘ | ∗ ๐’”๐’Š๐’ˆ๐’(๐’™๐Ÿ‘ )
๐’™ฬ‡ ๐Ÿ‘ = (๐Ÿ๐’™๐Ÿ๐ŸŽ๐Ÿ– )(๐ŸŽ. ๐ŸŽ๐Ÿ“๐’™๐Ÿ − ๐‘ธ)/(๐Ÿ๐ŸŽ − ๐’™๐Ÿ )
(c) Create a MATLAB ode45 numerical simulation of these equations and plot on the
same graph ๐’š(๐’•), ๐’šฬ‡ (๐’•), ๐’‚๐’๐’… ๐’šฬˆ (๐’•)/๐’ˆ. The solution should not take more than 1 sec.
(d) From examination of your plots, what can you conclude about the performance of
this barrier system?
(e)
Examination of the plots below reveals that the performance of the barrier would be
unacceptable since the barrier completely collapses (y = 10 m) with the car still moving
approximately 5 m/s. Note, however, that the maximum deceleration is close to the 5 g
limit.
187
clear all
format shortg
options=odeset('events',@StopSim8);
[t,X]=ode45(@barrier3360,[0 2],[0 24 0],options);
plot(t,X(:,1),'r',t,X(:,2),'k.',t,(5e-5)*X(:,3)/9.8,'k--','LineWidth',2)
xlabel('time, sec.')
ylabel('outputs of interest')
title('Homework 8, Crash Barrier Simulation')
legend('displacement, m','velocity,m/s','deceleration/g','Location','Best')
function dx=barrier3360(t,x)
y=x(1);yd=x(2);P=x(3);%allows writing equations in terms of y, yd, and P
dx=zeros(3,1);
dx(1)=x(2);
dx(2)=-(5e-5)*P;
Q=(8.9e-4)*sqrt(abs(P))*sign(P);
dx(3)=2e8*(.05*yd-Q)/(10-y);
end
function[Val,Ister,Dir]=StopSim8(t,x)
Val(1)=x(1)-10;Ister(1)=1;Dir(1)=0;%stops simulation if y=10
Val(2)=x(2);Ister(2)=1;Dir(2)=0;%stops simulation if velocity=0
end
Homework 8, Crash Barrier Simulation
25
outputs of interest
20
displacement, m
velocity, m/s
deceleration/g
15
10
5
0
0
0.1
0.2
0.3
0.4
0.5
time, sec.
0.6
0.7
0.8
0.9
188
Homework 31
Homework 30 pertained to the simulation of the dynamics of a car impacting a crash barrier composed of a
piston and cylinder filled with water with a hole (orifice) for water to escape from the cylinder. Flow through
the orifice provides energy dissipation. The solution to the equations revealed that the design of the barrier
was ineffective at preventing a car from collapsing the barrier even though the peak deceleration was only
slightly greater than 5 g’s.
This assignment pertains to the simulation of the same barrier but this time with a series of holes staggered
along the top of the cylinder as shown in the figure below.
Q
y
a
b
c
air
water
The equations for the displacement y of the piston and car, for the pressure P in the cylinder, and for the flow
rate Q m3/s are as follows:
๐’šฬˆ + (๐Ÿ“๐’™๐Ÿ๐ŸŽ−๐Ÿ“ )๐‘ท = ๐ŸŽ
(๐Ÿ๐ŸŽ − ๐’š)๐‘ทฬ‡ = (๐Ÿ๐’™๐Ÿ๐ŸŽ๐Ÿ– )(๐ŸŽ. ๐ŸŽ๐Ÿ“๐’šฬ‡ − ๐‘ธ)
๐‘ธ = ๐’(๐Ÿ. ๐Ÿ’๐’™๐Ÿ๐ŸŽ−๐Ÿ’ )√|๐‘ท| ∗ ๐’”๐’Š๐’ˆ๐’(๐‘ท)
๐’š(๐ŸŽ− ) = ๐ŸŽ ๐’Ž
๐’šฬ‡ (๐ŸŽ− ) = ๐Ÿ๐Ÿ’ ๐’Ž/๐’”
๐‘ท(๐ŸŽ− ) = ๐ŸŽ ๐‘ต/๐’Ž๐Ÿ
where the MATLAB equations for n, the number of holes, in relation to the hole locations a, b, and c are as
follows:
a=?; b=?;c=?;
n=4;
if y>a; n=3;
if y>b; n=2;
if y>c; n=1;
end;
end;
end;
Note, c < 10, b < c, and a < b.
These equations should be inserted in your m-file prior to the new equation for Q. See the m-file listings on
the solution to Homework 8. You are to modify your simulation equations for Homework 8 to include the
staggered holes and experiment with different values of a, b, and c in an attempt to prevent y from exceeding
10 m before ๐’šฬ‡ becomes zero and without the deceleration exceeding a peak value of 5 g’s.
Show a plot with ๐’š(๐’•), ๐’šฬ‡(๐’•), ๐’‚๐’๐’… ๐’šฬˆ (๐’•)/๐’ˆ corresponding to your best design values for a, b, and c. Does your
design meet the specifications?
189
Homework 31 Solution
Homework 8 pertained to the simulation of the dynamics of a car impacting a crash barrier composed of a
piston and cylinder filled with water with a hole (orifice) for water to escape from the cylinder. Flow through
the orifice provides energy dissipation. The solution to the equations revealed that the design of the barrier
was ineffective at preventing a car from collapsing the barrier even though the peak deceleration was only
slightly greater than 5 g’s.
This assignment pertains to the simulation of the same barrier but this time with a series of holes staggered
along the top of the cylinder as shown in the figure below.
Q
y
a
b
c
air
water
The equations for the displacement y of the piston and car, for the pressure P in the cylinder, and for the flow
rate Q m3/s are as follows:
๐’šฬˆ + (๐Ÿ“๐’™๐Ÿ๐ŸŽ−๐Ÿ“ )๐‘ท = ๐ŸŽ
(๐Ÿ๐ŸŽ − ๐’š)๐‘ทฬ‡ = (๐Ÿ๐’™๐Ÿ๐ŸŽ๐Ÿ– )(๐ŸŽ. ๐ŸŽ๐Ÿ“๐’šฬ‡ − ๐‘ธ)
๐‘ธ = ๐’(๐Ÿ. ๐Ÿ’๐’™๐Ÿ๐ŸŽ−๐Ÿ’ )√|๐‘ท| ∗ ๐’”๐’Š๐’ˆ๐’(๐‘ท)
๐’š(๐ŸŽ− ) = ๐ŸŽ ๐’Ž
๐’šฬ‡ (๐ŸŽ− ) = ๐Ÿ๐Ÿ’ ๐’Ž/๐’”
๐‘ท(๐ŸŽ− ) = ๐ŸŽ ๐‘ต/๐’Ž๐Ÿ
where the MATLAB equations for n, the number of holes, in relation to the hole locations a, b, and c are as
follows:
a=?;b=?;c=?;
n=4;
if y>a; n=3;
if y>b; n=2;
if y>c; n=1;
end;
end;
end;
Note, c < 10, b < c, and a < b.
These equations should be inserted in your m-file prior to the new equation for Q. See the m-file listings on
the solution to Homework 8. You are to modify your simulation equations for Homework 8 to include the
staggered holes and experiment with different values of a, b, and c in an attempt to prevent y from exceeding
10 m before ๐’šฬ‡ becomes zero and without the deceleration exceeding a peak value of 5 g’s.
Show a plot with ๐’š(๐’•), ๐’šฬ‡(๐’•), ๐’‚๐’๐’… ๐’šฬˆ (๐’•)/๐’ˆ corresponding to your best design values for a, b, and c. Does your
design meet the specifications? The design meet specifications as shown below.
clear all
format shortg
options=odeset('events',@StopSim8);
[t,X]=ode45(@barrier9,[0 2],[0 24 0],options);
plot(t,X(:,1),'r',t,X(:,2),'k.',t,(5e-5)*X(:,3)/9.8,'k--','LineWidth',2)
xlabel('time, sec.')
ylabel('outputs of interest')
190
title('Homework 8, Crash Barrier Simulation')
legend('displacement, m','velocity, m/s','deceleration/g','Location','Best')
function dx=barrier9(t,x)
y=x(1);yd=x(2);P=x(3);%allows writing equations in terms of y, yd, and P
dx=zeros(3,1);
dx(1)=x(2);
dx(2)=-(5e-5)*P;
a=5;b=7;c=8.5;
n=4;
if y>a;n=3;end;
if y>b;n=2;end;
if y>c;n=1;end;
Q=n*(2.4e-4)*sqrt(abs(P))*sign(P);
dx(3)=2e8*(.05*yd-Q)/(10-y);
end
function[Val,Ister,Dir]=StopSim8(t,x)
Val(1)=x(1)-10;Ister(1)=1;Dir(1)=0;%stops simulation if y=10
Val(2)=x(2);Ister(2)=1;Dir(2)=0;%stops simulation if velocity=0
end
Homework 8, Crash Barrier Simulation
25
outputs of interest
20
displacement, m
velocity, m/s
deceleration/g
15
10
5
0
0
0.5
1
time, sec.
1.5
2
191
Homework 32
Roll control of an airplane is achieved by moving the ailerons.
The simulation diagram for the roll control of an airplane is shown below where ∅ is the
roll angle of the airplane and ∅๐’… is the desired roll angle. The input to the hydraulic
actuator is u(t); the actuator adjusts the aileron angle ๐œฝ which causes the plane to roll.
A control engineer has designed the controller Gc(s) to improve the speed and damping of
the roll response following a roll angle input command from the pilot.
๐ŸŽ. ๐Ÿ’๐Ÿ•๐Ÿ’๐Ÿ‘๐’”๐Ÿ + ๐Ÿ. ๐Ÿ—๐Ÿ๐’” + ๐Ÿ
๐‘ฎ๐’„ (๐’”) =
๐ŸŽ. ๐Ÿ๐ŸŽ๐Ÿ–๐Ÿ—๐’”๐Ÿ + ๐Ÿ. ๐Ÿ–๐Ÿ’๐’” + ๐Ÿ
Create a Simulink diagram of this roll control system. We would like to generate plots (on
the same graph) of ∅(๐’•) with and without the controller; without the controller means
Gc(s) = 1. The desired roll angle is a step input of 5 degrees. Also generate plots of ๐œฝ(๐’•)
with and without the controller.
Do you think the control engineer has done a good job of designing Gc(s)? What is the
maximum aileron angle with and without the controller? Is the maximum aileron angle
with the controller realistic?
192
Homework 32 Solution
Do you think the control engineer has done a good job of designing Gc(s)? The roll of the
airplane is lightly damped without the controller; with the controller, the overshoot and
settling time to the desired roll angle are reduced significantly.
What is the maximum aileron angle with and without the controller? About 53 degrees
which is too big. Is the maximum aileron angle with the controller realistic? Unlikely.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
plot(y(:,3),y(:,2),'r--',y(:,3),y(:,5),'k','Linewidth',2)
title('Homework 32 - airplane roll control')
ylabel('roll angle, \phi degrees')
xlabel('time, sec.')
legend('PID controller','unity gain controller','Location','Best')
figure
plot(y(:,3),y(:,1),'r--',y(:,3),y(:,4),'k','Linewidth',2)
title('Homework 32 - airplane roll control')
ylabel('aileron angle, \theta degrees')
xlabel('time, sec.')
legend('PID controller','unity gain controller','Location','Best')
193
Homework 32 - airplane roll control
9
8
7
roll angle, ๏ฑ degrees
6
5
4
3
PID controller
unity gain controller
2
1
0
0
0.5
1
1.5
time, sec.
2
2.5
3
Homework 32 - airplane roll control
60
50
40
aileron angle, ๏ฆ degrees
PID controller
unity gain controller
30
20
10
0
-10
-20
-30
0
0.5
1
1.5
time, sec.
2
2.5
3
194
Homework 33
1. Express the following polynomials in factored format. In each case, check your work by
multiplying the factored components to determine if they give the correct original polynomial.
For example
2๐ท2 + 10๐ท + 12 in factored format is 2(๐ท + 2)(๐ท + 3).
Checking: 2(๐ท + 2)(๐ท + 3) = 2(๐ท2 + 2๐ท + 3๐ท + 2 ∗ 3) = 2๐ท2 + 10๐ท + 12
which checks. Also, in each case: What are the roots? Are the roots real or complex.
factored format
roots real or complex
(a) ๐ท 2 + 7๐ท + 10
______________
_____
___________
(b) 3๐ท 2 + 21๐ท + 30
______________
_____
___________
(c) ๐‘  2 + 6๐‘  + 25
______________
_____
___________
(d) 2๐‘  2 + 12๐‘  + 50
______________
_____
___________
(e) (๐‘  + 3)2 + 42
______________
_____
___________
2. Assume that a polynomial has been factored and some of the roots have been found to be the
following complex pair: −2 ± ๐‘—4.
(a)
(b)
(c)
(d)
What is the time constant associated with this complex pair? ________________
What is the damped natural frequency associated with this complex pair? ______
What is the undamped natural frequency associated with this complex pair? _____
What is the damping ratio associated with this complex pair? ___________
3. Use a calculator or computer to find the roots of the following polynomial. Determine time
constants, damping ratios, undamped natural frequencies, and damped natural frequencies.
2๐‘  5 + 58๐‘  4 + 736๐‘  3 + 4720๐‘  2 + 15200๐‘  + 20000
Roots: _____________________________________________________________
Time Constants: _____________________________________________
Undamped natural frequencies: ___________________________________________
Damped natural frequencies: ___________________________________________
Homework 33 Solution
1. Express the following polynomials in factored format. In each case, check your work by
multiplying the factored components to determine if they give the correct original polynomial.
For example
2๐ท2 + 10๐ท + 12 in factored format is 2(๐ท + 2)(๐ท + 3).
195
Checking: 2(๐ท + 2)(๐ท + 3) = 2(๐ท2 + 2๐ท + 3๐ท + 2 ∗ 3) = 2๐ท2 + 10๐ท + 12
which checks. Also, in each case: What are the roots? Are the roots real or complex.
factored format
roots real or complex
(a) ๐ท2 + 7๐ท + 10
(๐ท + 2)(๐ท + 5)
-2, -5
both are real
(b) 3๐ท2 + 21๐ท + 30
3(๐ท + 2)(๐ท + 5)
-2, -5
both are real
(c) ๐‘  2 + 6๐‘  + 25
(s+3+j4)(s+3-j4)
−3 ± ๐‘—4
complex pair
(d) 2๐‘  2 + 12๐‘  + 50
2(s+3+j4)(s+3-j4)
−3 ± ๐‘—4
complex pair
(e) (๐‘  + 3)2 + 42
(s+3+j4)(s+3-j4)
−3 ± ๐‘—4
complex pair
2. Assume that a polynomial has been factored and some of the roots have been found to be the
following complex pair: −2 ± ๐‘—4.
(e)
(f)
(g)
(h)
What is the time constant associated with this complex pair? 0.5 sec.
What is the damped natural freq. associated with this complex pair? 4 rad/sec
What is the undamped natural freq. associated with this complex pair? √20 = 4.472
What is the damping ratio associated with this complex pair? 0.4472
3. Use a calculator or computer to find the roots of the following polynomial. Determine time
constants, damping ratios, undamped natural frequencies, and damped natural frequencies.
2๐‘  5 + 58๐‘  4 + 736๐‘  3 + 4720๐‘  2 + 15200๐‘  + 20000
Roots: −8 ± ๐‘—6, − 5, − 4 ± ๐‘—2
Time Constants: 0.125 sec. 0.2 sec. 0.25 sec.
Undamped natural frequencies: 10 rad/sec 4.472 rad/sec
Damped natural frequencies: 6 rad/sec 2 rad/sec
Homework 34 Exercise to learn some MATLAB basics
There is a difference in lower case and upper case letters. All commands are lower case. Type
help 'command name' to understand how to use a particular command. Note, for some reason in
the help write ups, the command names are shown with upper case letters.
For example, you can have MATLAB format numbers in many ways. To see the possibilities:
>> help format
format SHORT Scaled fixed point format with 5 digits.
format LONG Scaled fixed point format with 15 digits for double and 7 digits for single.
format SHORTE Floating point format with 5 digits.
format LONGE Floating point format with 15 digits for double and 7 digits for single.
format SHORTG Best of fixed or floating point format with 5 digits.
196
format LONGG
Best of fixed or floating point format with 15 digits for double and 7
digits for single.
format SHORTENG Engineering format that has at least 5 digits and a power that is a
multiple of three
format LONGENG Engineering format that has exactly 16 significant digits and a power
that is a multiple of three.
Type:
>> format shortg
(What I recommend in general)
Enter different values for the variable ‘a’ and observe how MATLAB displays the number for
different formats:
>> a=123456
>> a=123456789123456789
2. Enter a polynomial. For example: 8๐‘  3 + 3๐‘  2 + 12๐‘  + 16
>> n=[8 3 12 16];
Without the ‘; ‘ at the end, the result will echo back. Leave off the ; and see what happens.
3. Find the roots of a polynomial.
>> roots(n)
If you want use the roots or have access to them,
>> [R]=roots(n)
R(1) will be the first root, R(2) will be the 2nd root, etc.
4. Multiply two polynomials using the command ‘conv’: (2s+3)(s+4) = 2s2 +11s + 12
>> n1=[2 3];
>> n2=[1 4];
>> conv(n1,n2)
5. Enter the ratio of two polynomials such as a transfer function. For example:
8๐‘ 3 +3๐‘ 2 +12๐‘ +16
๐บ(๐‘ ) = ๐‘ 4 +22๐‘ 3 +164๐‘ 2 +488๐‘ +480 (note, the numerator is from part 2 above)
>> d=[1 22 164 488 480];
>> G=tf(n,d)
6. We can also enter a transfer function if the numerator and denominator are factored:
(๐‘  + 2)(๐‘  + 3)
๐ป = 4.078
(๐‘  + 5)(๐‘  + 6 + ๐‘—7)(๐‘  + 6 − ๐‘—7)
The numerator roots are called ‘zeros’: -2 and -3
The denominator roots are called ‘poles’: - 5 and -6 - j7 and -6 + j7
The number 4.078 in front is called the gain.
>>H=zpk([-2 -3],[-5 -6 – j*7 -6 +j*7],4.078)
Note, we can change the format to the polynomial format using ‘tf’:
>>H=tf(H)
7. We know that the denominator of a transfer function is called the characteristic polynomial
and its roots are the eigenvalues. The eigenvalues give us damping ratios and natural
frequencies.
197
>> damp(H)
This command gives us the eigenvalues for a transfer function.
8. Suppose you have several commands that may need to be repeated more than once and you
don’t want to have to keep typing them over and over; this can be done by creating an M-file.
To create a new M-file with a series of commands, under the ‘home’ tab and then ‘new’ tab,
select ‘script’; if the series of commands require inputs and outputs, select ‘function’. Type in
the commands and save it with a name and location you can find. You will probably need to
change the path to this location so MATLAB can find it; use ‘set path’ under the ‘home’ tab.
Note, when creating an M-file, it is wise to add comment statements to help you remember the
purpose of the M-file and how to use it. The % notes the beginning of a comment. Also,
comments at the beginning will be displayed following the command help ‘name of M-file’.
Sample M-file: Suppose we want an M-file to plot y = 2sin(๐œ‹t) and x = 2sin(๐œ‹t+0.75) for
0≤ ๐‘ก ≤ 8 every 0.1 sec.
%The following M-file is to be saved with the name ‘plot demo’
% plotting sine functions y = 2sin(๐…t) and x = 2sin(๐…t +0.75) for 0≤t≤8 every 0.1 sec
t=0:0.1:8; %Generates values of t from 0 to 8 every 0.1 sec.
y=2*sin(pi*t); %Generates a value for y for each value of t.
x=2*sin(pi*t+0.75); % Generates a value for x for each value of t.
% >> help plot
to see possible data patterns and colors
plot(t,y,'r',t,x,'k-.','Linewidth',2) %Plots y and x on the same plot as a functions of time
%Avoid using blue; black and red copy best for black and white only copies.
title('plot demo for two functions')
xlabel('time,sec.')
ylabel('sine functions y and ')
legend('y(t)','x(t)','Location','Best')
%Type ‘help legend’ to see the options
You need to save this file under the name ‘plot_demos’
To execute this M-file, >> plot_demos in the command window.
9. Now let's create an M-file to solve simultaneous symbolic algebraic equations. Suppose we
have the following equations in terms of the symbolic letter ‘a’ and we want to get the solution
for x in terms of ‘a’ and then get the solution for x after assigning a value to ‘a’ corresponding to
the input variable ‘A’.
2๐‘ฅ + ๐‘Ž๐‘ฆ = 4
−3๐‘ฅ + 5๐‘ฆ = 2
Under ‘new’ select New Function
% Symbolic math demo
% Using symbolic math to solve simultaneous equations
function [X]=SolveSymEqns(A)
syms a y x % declare a to be symbolic so we can substitute a value for it
H=solve(2*x+a*y==4,-3*x+5*y==2,x,y);
x=H.x % this gives the symbolic solution for x
x=subs(H.x,a,A) % this substitutes the input value A for a
digits(5) % this specifies the number of floating point digits to be displayed
198
X=vpa(x) % this displays x as a floating point number
end % this designates the end of the function
To execute this M-file for A=4 type the following in the command window:
>> SolveSymEqns;
10. Using your calculator, find the magnitude and phase angle of Z below; also do it using
MATLAB to check your answers:
(๐‘  + 2)(๐‘  + 10)
๐‘ = [0.1 2
]
(๐‘  + 4๐‘  + 16) ๐‘ =−3+๐‘—5
>> s=-3+j*5;
>> Z=0.1*(s+2)*(s+10)/(s^2+4*s+16);
>> MagZ=abs(Z)
>> AngleZ=angle(Z)
Homework 34 Solution
8.
%The following M-file is to be saved with the name ‘plot demo’
% plotting sine functions y = 2sin(?t) and x = 2sin(?t +0.75) for 0?t?8 every 0.1 sec
t=0:0.1:8; %Generates values of t from 0 to 8 every 0.1 sec.
y=2*sin(pi*t); %Generates a value for y for each value of t.
x=2*sin(pi*t+0.75); % the same function shifted in phase
plot(t,y,'r',t,x,'k-.','Linewidth',2) %Plots y and x on the same plot as a functions of
time
%Avoid using blue; black and red copy best.
title('plot demo for two functions')
xlabel('time,sec.')
ylabel('sine functions')
legend('y(t)','x(t)','Location','Best')
%Type ‘help legend’ to see the options
You need to save this file under the name ‘plot_demos’
To execute this M-file, >> plot_demos in the command window.
199
plot demo for two functions
2
1.5
1
sine functions
0.5
y(t)
x(t)
0
-0.5
-1
-1.5
-2
0
1
2
3
4
time,sec.
5
6
7
8
9.
% Symbolic math demo
% Using symbolic math to solve simultaneous equations
function [X]=SolveSymEqns(A)
syms a x y% declare a to be symbolic so we can substitute a value for it
H=solve(2*x+a*y==4,-3*x+5*y==2,x,y);
x=H.x
x=subs(H.x,a,A)
digits(5)
X=vpa(x)
end % this designates the end of the function
To execute this M-file for A=4 type the following in the command window:
>> SolveSymEqns(4); % assigns A=4 to be used in the M-file
x = -(2*(a - 10))/(3*a + 10)
x = 6/11
X = 0.54545
ans = 0.54545
10. Using your calculator, find the magnitude and phase angle of Z below; also do it using
MATLAB to check your answers:
(๐‘  + 2)(๐‘  + 10)
๐‘ = [0.1 2
]
(๐‘  + 4๐‘  + 16) ๐‘ =−3+๐‘—5
Using calculator: ๐‘ = 0.1
|−1+๐‘—5|๐‘’ ๐‘—๐‘Ž๐‘›๐‘”๐‘™๐‘’(−1+๐‘—5) |7+๐‘—5|๐‘’ ๐‘—๐‘Ž๐‘›๐‘”๐‘™๐‘’(7+๐‘—5)
2
|(−3+๐‘—5)2 +4(−3+๐‘—5)+16|๐‘’ ๐‘—๐‘Ž๐‘›๐‘”๐‘™๐‘’((−3+๐‘—5) +4(−3+๐‘—5)+16)
= 0.1
|−1 + ๐‘—5|๐‘’ ๐‘Ž๐‘›๐‘”๐‘™๐‘’(−1+๐‘—5) |7 + ๐‘—5|๐‘’ ๐‘Ž๐‘›๐‘”๐‘™๐‘’(7+๐‘—5)
|−12 − ๐‘—10|๐‘’ ๐‘—๐‘Ž๐‘›๐‘”๐‘™๐‘’(−12−๐‘—10)
5.099๐‘’ ๐‘—1.7682 8.6023๐‘’ ๐‘—0.62025
0.1
15.62๐‘’ −๐‘—2.4469
200
= 0.1
5.099 ∗ 8.6023 ๐‘—(1.7682+0.62025+2.4469)
๐‘’
15.62
= 0.28081๐‘’ ๐‘—4.8354 = 0.28081๐‘’ −๐‘—1.4479
Using MATLAB:
>> s= -3+j*5;
>> Z=0.1*(s+2)*(s+10)/(s^2+4*s+16);
>> MagZ=abs(Z)
>> AngleZ=angle(Z)
MagZ =
0.28081
AngleZ =
-1.4479
Homework 35
1. Obtain a linear approximation for the following differential equation by first
finding a straight line approximation for y3. Hint: y(t) will eventually
become constant at which time ๐‘ฆฬ‡ ๐‘Ž๐‘›๐‘‘ ๐‘ฆฬˆ will be zero; solve the equation
for the final value of y(t). The straight line approximation needs to pass
through the initial and final values of y.
๐‘ฆฬˆ + 2๐‘ฆฬ‡ + 3๐‘ฆ 3 = 24
๐‘ฆ(0− ) = 1
๐‘ฆฬ‡ (0− ) = 0
2. Consider the following differential equation for y with input u.
3๐‘ฆโƒ› + 36๐‘ฆฬˆ + 183๐‘ฆฬ‡ + 246๐‘ฆ = 6๐‘ขฬˆ + 54๐‘ขฬ‡ + 1476๐‘ข
(a) What is the transfer function?
(b) What are the eigenvalues?
(c) What is the damping ratio?
(d) What is the damped natural frequency?
(e) What are the time constants?
(f) It can be shown that if u(t) is a constant, then y(t) will eventually
become a constant. Approximately how long will take for y(t) to be
within 1% of its final value?
Homework 35 Solution
1. Obtain a linear approximation for the following differential equation by first
finding a straight line approximation for y3. Hint: y(t) will eventually
become constant at which time ๐‘ฆฬ‡ ๐‘Ž๐‘›๐‘‘ ๐‘ฆฬˆ will be zero; solve the equation
for the final value of y(t). The straight line approximation needs to pass
through the initial and final values of y.
201
๐‘ฆฬˆ + 2๐‘ฆฬ‡ + 3๐‘ฆ 3 = 24
๐‘ฆ(0− ) = 1
๐‘ฆฬ‡ (0− ) = 0
Setting derivatives of y to zero to get the final value gives: 0 + 0+3y3=24. Final
value of y = 2. So, we need the equation for a line that passes through (y,y3)=(1,1)
and (2,8). ๐‘ฆ 3 ≈ 7๐‘ฆ − 6. Thus, ๐‘ฆฬˆ + 2๐‘ฆฬ‡ + 3(7๐‘ฆ − 6) = 24 or
๐‘ฆฬˆ + 2๐‘ฆฬ‡ + 21๐‘ฆ = 42
2. Consider the following differential equation for y with input u.
3๐‘ฆโƒ› + 36๐‘ฆฬˆ + 183๐‘ฆฬ‡ + 246๐‘ฆ = 6๐‘ขฬˆ + 54๐‘ขฬ‡ + 1476๐‘ข
(a) What is the transfer function?
6๐‘  2 +54๐‘ +1476
3๐‘  3 +36๐‘  2 +183๐‘ +246
(b) What are the eigenvalues? -2, -5+j4, -5-j4
(c) What is the damping ratio? 0.781
(d) What is the damped natural frequency?4 rad/sec
(e) What are the time constants? 0.5 and 0.2 sec
(f) It can be shown that if u(t) is a constant, then y(t) will eventually become
a constant. Approximately how long will take for y(t) to be within 1% of its
final value? 5x0.5 = 2.5 sec
Homework 36
Consider the following three lumped mass approximation model for a pile being driven into the
ground with input force F(t); the output of interest is the force f(t) exerted on the ground
resulting from the input force F(t).
F(t)
F(t)
M
k
z
b
v
M
k
b
M
w
b
k
f
m=10 kg
b=5 Ns/m
k=1000 N/m
f
It can be shown that the equations representing this model for displacements z, v, and w defined
to be zero at equilibrium and assuming zero displacement at the bottom end of the pile are as
shown below. The ground force ๐‘“ is the force that forces the bottom end of the pile into the
ground. The output of interest to us is the ground force.
๐‘š๐‘งฬˆ + ๐‘๐‘งฬ‡ + ๐‘˜๐‘ง = ๐‘๐‘ฃฬ‡ + ๐‘˜๐‘ฃ + ๐น
202
๐‘š๐‘ฃฬˆ + 2๐‘๐‘ฃฬ‡ + 2๐‘˜๐‘ฃ = ๐‘๐‘งฬ‡ + ๐‘˜๐‘ง + ๐‘๐‘คฬ‡ + ๐‘˜๐‘ค
๐‘š๐‘คฬˆ + 2๐‘๐‘คฬ‡ + 2๐‘˜๐‘ค = ๐‘๐‘ฃฬ‡ + ๐‘˜๐‘ฃ
๐‘“ = 3๐‘š๐‘” + ๐‘๐‘คฬ‡ + ๐‘˜๐‘ค
A symbolic math M-file is shown in the notebook for obtaining the transfer function relating the
output to the input.
(a) Type or paste this M-file into your computer and demonstrate you can get this transfer
function; use ‘s’ instead of ‘d’. Be prepared to explain (for instance on an exam) the purpose of
each of the command lines in the M-file.
The transfer function H(s) relating the ground force f to the input force F is shown below. Did
you M-file give the same result?
๐‘“(๐‘ ) = ๐ป(๐‘ )๐น(๐‘ )
6.25๐‘  3 + 3750๐‘  2 + 750,000๐‘  + 50,000,000
๐ป(๐‘ ) =
50๐‘  6 + 125๐‘  5 + 25,088๐‘  4 + 30,011๐‘  3 + 3,004,000๐‘  2 + 750,000๐‘  + 50,000,000
(b) Suppose the input F(t) is a step with magnitude Fo. Use the final value theorem to compute the
final value of the ground force (note we are neglecting the weight 3Mg of the beam). Explain
why this value makes sense.
(c) An important property of a transfer function is its ‘DC gain’ where
๐ท๐ถ ๐‘”๐‘Ž๐‘–๐‘› =
๐‘“๐‘–๐‘›๐‘Ž๐‘™ ๐‘ฃ๐‘Ž๐‘™๐‘ข๐‘’ ๐‘œ๐‘“ ๐‘œ๐‘ข๐‘ก๐‘๐‘ข๐‘ก
๐‘š๐‘Ž๐‘”๐‘›๐‘–๐‘ก๐‘ข๐‘‘๐‘’ ๐‘œ๐‘“ ๐‘Ž ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก ๐‘–๐‘›๐‘๐‘ข๐‘ก
The DC gain can be computed by setting s in a transfer function to zero. What is the DC gain of
H(s) above? The MATLAB command is dcgain(H). Enter this transfer function H into MATLAB
and use the ‘dcgain’ command. What is the answer? Does it make sense? Why?
(d) We know that the partial fractions of a transfer function are called the ‘modes’ of the transfer
function or the modes of the system. The sum of the mode responses makeup the total system
response. Use the MATLAB command ‘pfract’ to get the modes of this system. What are the
time constants, damping ratios, and frequencies of the different modes? If the input F(t) is an
impulse, which mode will be the most important? Why?
(e) Enter each mode as a separate transfer function into MATLAB: H1(s), H2(s), and H3(s). Use the
‘impulse’ command to compare the impulse response of the modes, i.e.
>> impulse(H,’r’,H1,’k--‘,H2,’r*’,H3,’k-.’,5) % The ‘5’ limits the time to 5 sec
>> legend(‘all 3 modes together’,’first mode’,’second mode’,third mode’,’Location’,’Best’)
(f) Which mode response most closely resembles the total system response? Why?
Homework 36 Solution
Homework 37
In each case below, check your Laplace transform and final equation for y(t) using the initial and
final value theorems and calculating y(t)t=0 and ๐‘ฆ(๐‘ก)๐‘ก=∞ .
203
1. Use the residue method to solve the following differential equation for y(t).
๐‘ฆฬˆ + 7๐‘ฆฬ‡ + 10๐‘ฆ = 10
๐‘ฆ(0− ) = 0 ๐‘ฆฬ‡ (0− ) = 10
2. Use the residue method to solve the following differential equation for y(t).
๐‘ฆฬˆ + 7๐‘ฆฬ‡ + 10๐‘ฆ = 20๐‘ข + 14๐‘ขฬ‡
๐‘ฆ(0− ) = 10 ๐‘ฆฬ‡ (0− ) = 0
u(t)
0.5
0
3.
๐‘Œ(๐‘ ) =
t
25
๐‘ (๐‘ 2 +6๐‘ +25)
Solve for y(t)
Homework 37 Solution
In each case below, check your Laplace transform and final equation for y(t) using the initial and
final value theorems and calculating y(t)t=0 and ๐‘ฆ(๐‘ก)๐‘ก=∞ .
1. Use the residue method to solve the following differential equation for y(t).
๐‘ฆฬ‡ (0− ) = 10
10
๐‘  2 ๐‘Œ − 10 + 7๐‘ ๐‘Œ + 10๐‘Œ =
๐‘ 
10 + 10๐‘ 
๐‘Œ(๐‘ ) =
๐น๐‘‰๐‘‡: ๐‘ฆ(∞) = 1 ๐ผ๐‘‰๐‘‡: ๐‘ฆ(0+ ) = 0
๐‘ (๐‘  + 2)(๐‘  + 5)
๐‘ฆฬˆ + 7๐‘ฆฬ‡ + 10๐‘ฆ = 10
๐‘ฆ(0− ) = 0
๐‘ฆ(๐‘ก) = 1 + 1.666๐‘’ −2๐‘ก − 2.666๐‘’ −5๐‘ก
๐‘ฆ(๐‘ก)๐‘ก=∞ = 1 + 0 + 0 = 1
๐‘ฆ(๐‘ก)๐‘ก=0 = 1 + 1.666 − 2.666 = 0
2. Use the residue method to solve the following differential equation for y(t).
๐‘ฆ(0− ) = 10
๐‘ฆฬˆ + 7๐‘ฆฬ‡ + 10๐‘ฆ = 20๐‘ข + 14๐‘ขฬ‡
๐‘ฆฬ‡ (0− ) = 0
u(t)
0.5
0
t
๐‘  2 ๐‘Œ − 10๐‘  + 7(๐‘ ๐‘Œ − 10) + 10๐‘Œ = (14๐‘  + 20)
0.5
๐‘ 
10๐‘  2 + 77๐‘  + 10
๐น๐‘‰๐‘‡: 1 ๐ผ๐‘‰๐‘‡: 10
๐‘ (๐‘  + 5)(๐‘  + 2)
๐‘ฆ(๐‘ก) = 1 + 17.333๐‘’ −2๐‘ก − 8.333๐‘’ −5๐‘ก ๐‘ฆ(∞) = 1 ๐‘ฆ(0) = 1 + 17.333 − 8.333 = 10
๐‘Œ(๐‘ ) =
204
3.
FVT:
๐‘Œ(๐‘ ) =
25
๐‘ (๐‘ 2 +6๐‘ +25)
Solve for y(t).
๐ผ๐‘‰๐‘‡: ๐‘ฆ(0+ ) = 0
๐‘ฆ(∞) = 1
๐‘ฆ(๐‘ก) = 1๐‘’ 0๐‘ก +
๐‘’ −3๐‘ก
25
25
))
|
| sin (4๐‘ก + ๐‘Ž๐‘›๐‘”๐‘’๐‘™ (
4 −3 + ๐‘—4
−3 + ๐‘—4
๐‘ฆ(๐‘ก) = 1 + 1.25๐‘’ −3๐‘ก sin(4๐‘ก − 2.2143)
๐‘ฆ(∞) = 1 + 0 = 1
๐‘ฆ(0) = 1 + 1.25 sin(−2.2143) = 0
Homework 38
The purpose of this assignment is to demonstrate the power of being able to generate a plot of an
inverse Laplace transform without having to first generate the equation for the inverse Laplace;
this is done by pretending that the Laplace transform is a transfer function with a unit impulse
input. We can do this because the Laplace transform of a unit impulse is 1.
In Homework 37, for each problem below, you found the equation for Y(s) and then found y(t)
using the inverse Laplace transform. In this assignment, you are to use the MATLAB command
‘impulse’ to get a plot of y(t) without having to first get the equation for y(t) as you did in
Homework 37. For each problem below, generate two plots for y(t) for comparison on a single
graph, one plot using the equation for y(t) and the other plot generated using the ‘impulse’
command.
1.
๐‘ฆฬˆ + 7๐‘ฆฬ‡ + 10๐‘ฆ = 10
๐‘ฆ(0− ) = 0
๐‘Œ(๐‘ ) =
10 + 10๐‘ 
๐‘ (๐‘  + 2)(๐‘  + 5)
๐‘ฆฬ‡ (0− ) = 10
๐‘ฆ(๐‘ก) = 1 + 1.666๐‘’ −2๐‘ก − 2.666๐‘’ −5๐‘ก
๐‘ฆ(0− ) = 10
2. ๐‘ฆฬˆ + 7๐‘ฆฬ‡ + 10๐‘ฆ = 20๐‘ข + 14๐‘ขฬ‡
๐‘ฆฬ‡ (0− ) = 0
u(t)
0.5
0
t
๐‘Œ(๐‘ ) =
10๐‘  2 + 77๐‘  + 10
๐‘ (๐‘  + 5)(๐‘  + 2)
๐‘ฆ(๐‘ก) = 1 + 17.333๐‘’ −2๐‘ก − 8.333๐‘’ −5๐‘ก
205
3.
๐‘Œ(๐‘ ) =
25
๐‘ (๐‘ 2 +6๐‘ +25)
๐‘ฆ(๐‘ก) = 1 + 1.25๐‘’ −3๐‘ก sin(4๐‘ก − 2.2143)
Homework 38 Solution
The purpose of this assignment is to demonstrate the power of being able to generate a plot of an
inverse Laplace transform without having to first generate the equation for the inverse Laplace;
this is done by pretending that the Laplace transform is a transfer function with a unit impulse
input. We can do this because the Laplace transform of a unit impulse is 1.
In Homework 37, for each problem below, you found the equation for Y(s) and then found y(t)
using the inverse Laplace transform. In this assignment, you are to use the MATLAB command
‘impulse’ to get a plot of y(t) without having to first get the equation for y(t) as you did in
Homework 37. For each problem below, generate two plots for y(t) for comparison on a single
graph, one plot using the equation for y(t) and the other plot generated using the ‘impulse’
command.
1.
๐‘ฆฬˆ + 7๐‘ฆฬ‡ + 10๐‘ฆ = 10
๐‘ฆ(0− ) = 0
๐‘Œ(๐‘ ) =
10 + 10๐‘ 
๐‘ (๐‘  + 2)(๐‘  + 5)
๐‘ฆฬ‡ (0− ) = 10
๐‘ฆ(๐‘ก) = 1 + 1.666๐‘’ −2๐‘ก − 2.666๐‘’ −5๐‘ก
206
Homework 7.1
1.4
using impulse
using inverse Laplace
1.2
1
y
0.8
0.6
0.4
0.2
0
0
0.5
1
1.5
2
2.5
time, sec
๐‘ฆ(0− ) = 10
2. ๐‘ฆฬˆ + 7๐‘ฆฬ‡ + 10๐‘ฆ = 20๐‘ข + 14๐‘ขฬ‡
3
3.5
4
4.5
๐‘ฆฬ‡ (0− ) = 0
u(t)
0.5
0
t
๐‘Œ(๐‘ ) =
10๐‘  2 + 77๐‘  + 10
๐‘ (๐‘  + 5)(๐‘  + 2)
๐‘ฆ(๐‘ก) = 1 + 17.333๐‘’ −2๐‘ก − 8.333๐‘’ −5๐‘ก
207
Homework 7.2
11
using impulse
using inverse Laplace
10
9
8
y
7
6
5
4
3
2
1
3.
0
0.5
๐‘Œ(๐‘ ) =
1
1.5
2
2.5
time, sec
3
3.5
4
4.5
25
๐‘ (๐‘ 2 +6๐‘ +25)
๐‘ฆ(๐‘ก) = 1 + 1.25๐‘’ −3๐‘ก sin(4๐‘ก − 2.2143)
Homework 7.3
1.4
using impulse
using inverse Laplace
1.2
1
y
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
1
time, sec
1.2
1.4
1.6
1.8
Y1=tf([10 10],[1 7 10 0]);
208
[y1i,t]=impulse(Y1);
y1=1+1.666*exp(-2*t)-2.666*exp(-5*t);
plot(t,y1i,'r',t,y1,'k.','Linewidth',2)
xlabel('time, sec')
ylabel('y')
legend('using impulse','using inverse Laplace')
title('Homework 7.1')
figure
clear t
Y2=tf([10 77 10],[1 7 10 0]);
[y2i,t]=impulse(Y2);
y2=1+17.333*exp(-2*t)-8.333*exp(-5*t);
plot(t,y2i,'r',t,y2,'k.','Linewidth',2)
xlabel('time, sec')
ylabel('y')
legend('using impulse','using inverse Laplace')
title('Homework 7.2')
figure
clear t
Y3=tf(25,[1 6 25 0]);
[y3i,t]=impulse(Y3);
y3=1+1.25*exp(-3*t).*sin(4*t-2.2143);
plot(t,y3i,'r',t,y3,'k.','Linewidth',2)
xlabel('time, sec')
ylabel('y')
legend('using impulse','using inverse Laplace')
title('Homework 7.3')
Homework 39
The schematic for a vehicle suspension is shown below. The differential equation for the upward
displacement y of the vehicle mass in terms of the road profile u is also shown below. The
frequency ๐œ” of the road profile is a function of the vehicle speed.
(a) Solve the differential equation for y(t) using Laplace transforms for ๐œ” = 10 ๐‘Ÿ๐‘Ž๐‘‘/๐‘ .
209
(b) Show that the equation for y(t) as ๐‘ก → ∞ is a sine function. What is the amplitude of the y(t)
sine function? How much larger or smaller is this amplitude compared to the amplitude of the
road sine function?
(c) Using MATLAB, plot y(t) and show that y(t) does eventually become a constant amplitude sine
function. Confirm from your plot that the amplitude in (b) is correct.
(d) Use the MATLAB command ‘bode’ to generate the frequency response of the transfer function
for this suspension and confirm that the amplitude at ๐œ” = 10 ๐‘Ÿ๐‘Ž๐‘‘/๐‘  is correct.
Homework 39 Solution
The schematic for a vehicle suspension is shown below. The differential equation for the upward
displacement y of the vehicle mass in terms of the road profile u is also shown below. The
frequency ๐œ” of the road profile is a function of the vehicle speed.
(a) Solve the differential equation for y(t) using Laplace transforms for ๐œ” = 10 ๐‘Ÿ๐‘Ž๐‘‘/๐‘ .
Since we are interested in the steady state solution, it doesn’t matter what the initial
conditions are. The point of the problem is to observe how the solution converges to the
steady state sinusoidal function.
๐€๐ฌ๐ฌ๐ฎ๐ฆ๐ข๐ง๐  ๐ณ๐ž๐ซ๐จ ๐ข๐ง๐ข๐ญ๐ข๐š๐ฅ ๐œ๐จ๐ง๐๐ข๐ญ๐ข๐จ๐ง๐ฌ: ๐˜(๐ฌ) = [
๐Ÿ–๐ŸŽ๐ŸŽ๐ฌ + ๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐ŸŽ
๐ŸŽ. ๐Ÿ(๐Ÿ๐ŸŽ)
]
๐Ÿ๐ŸŽ๐ŸŽ๐ฌ๐Ÿ + ๐Ÿ–๐ŸŽ๐ŸŽ๐ฌ + ๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐ŸŽ ๐ฌ ๐Ÿ + ๐Ÿ๐ŸŽ๐ŸŽ
๐Ÿ–๐ฌ + ๐Ÿ๐ŸŽ๐ŸŽ
๐ŸŽ. ๐Ÿ๐Ÿ๐Ÿ“๐ฌ
๐Ÿ − ๐ŸŽ. ๐Ÿ๐Ÿ๐Ÿ“๐ฌ
= ๐Ÿ
+ ๐Ÿ
๐Ÿ
+
+ ๐Ÿ๐ŸŽ๐ŸŽ๐ฌ + ๐Ÿ–๐ŸŽ๐ŸŽ๐ฌ + ๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐ŸŽ ๐ฌ + ๐Ÿ–๐ฌ + ๐Ÿ๐ŸŽ๐ŸŽ
๐ฌ + ๐Ÿ๐ŸŽ๐ŸŽ
๐ฒ(๐ญ) = ๐ŸŽ. ๐Ÿ๐Ÿ‘๐Ÿ”๐Ÿ’๐ž−๐Ÿ’๐ญ ๐ฌ๐ข๐ง(๐Ÿ—. ๐Ÿ๐Ÿ”๐Ÿ“๐Ÿ๐ญ + ๐Ÿ. ๐Ÿ—๐Ÿ–๐Ÿ๐Ÿ‘) + ๐ŸŽ. ๐Ÿ๐Ÿ”๐ŸŽ๐Ÿ ๐ฌ๐ข๐ง(๐Ÿ๐ŸŽ๐ญ − ๐ŸŽ. ๐Ÿ–๐Ÿ—๐Ÿ”๐Ÿ)
Assuming the initial value of z is 0.3, z(0-) = 0.3:
๐˜(๐ฌ) =
๐ฌ๐Ÿ’
๐Ÿ–๐ฌ๐Ÿ‘
๐ŸŽ.๐Ÿ‘๐’”๐Ÿ‘ +๐Ÿ.๐Ÿ’๐’”๐Ÿ +๐Ÿ‘๐Ÿ–๐’”+๐Ÿ‘๐Ÿ’๐ŸŽ
๐ŸŽ.๐Ÿ’๐Ÿ๐Ÿ“๐ฌ+๐Ÿ.๐Ÿ’
๐Ÿ−๐ŸŽ.๐Ÿ๐Ÿ๐Ÿ“๐ฌ
๐’€(๐’”) = ๐ฌ๐Ÿ’ +๐Ÿ–๐ฌ๐Ÿ‘ +๐Ÿ๐ŸŽ๐ŸŽ๐ฌ๐Ÿ +๐Ÿ–๐ŸŽ๐ŸŽ๐ฌ+๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐ŸŽ = ๐ฌ๐Ÿ +๐Ÿ–๐ฌ+๐Ÿ๐ŸŽ๐ŸŽ + ๐ฌ๐Ÿ +๐Ÿ๐ŸŽ๐ŸŽ
๐ฒ(๐ญ) = ๐ŸŽ. ๐Ÿ’๐Ÿ‘๐Ÿ๐Ÿ–๐ž−๐Ÿ’๐ญ ๐ฌ๐ข๐ง(๐Ÿ—. ๐Ÿ๐Ÿ”๐Ÿ“๐Ÿ๐ญ + ๐Ÿ. ๐Ÿ‘๐Ÿ—๐Ÿ‘) + ๐ŸŽ. ๐Ÿ๐Ÿ”๐ŸŽ๐Ÿ ๐ฌ๐ข๐ง(๐Ÿ๐ŸŽ๐ญ − ๐ŸŽ. ๐Ÿ–๐Ÿ—๐Ÿ”๐Ÿ)
Show that the equation for y(t) as ๐‘ก → ∞ is a sine function. What is the amplitude of the y(t)
sine function? How much larger or smaller is this amplitude compared to the amplitude of
the road sine function? Regardless of the initial conditions:
As ๐‘ก → ∞, ๐‘ฆ(๐‘ก) = 0.1601 sin(10๐‘ก − 0.8961) ๐‘‡โ„Ž๐‘’ ๐‘Ž๐‘š๐‘๐‘™๐‘–๐‘ก๐‘ข๐‘‘๐‘’ ๐‘–๐‘  1.6 ๐‘ก๐‘–๐‘š๐‘’๐‘  ๐‘”๐‘Ÿ๐‘’๐‘Ž๐‘ก๐‘’๐‘Ÿ.
(b) Using MATLAB, plot y(t) and show that y(t) does eventually become a constant
amplitude sine function.
It will take about 1.25 seconds for y(t) to reach steady state behavior. So, we will run the
simulation for 3 seconds to see enough of the steady behavior to get the steady state sine wave
210
amplitude. Also, the largest pole magnitude is 10; so, we need a time increment no greater than
1/(10*10) = 0.01.
>> t=0:0.01:3;
>> y=0.1364*exp(-4*t).*sin(9.1652*t+1.9823)+0.1601*sin(10*t-0.8961);
>> Y=0.4318*exp(-4*t).*sin(9.1652*t+1.393)+0.1601*sin(10*t-0.8961);
>> plot(t,y,'r',t,Y,'k.','Linewidth',2)
>> xlabel('time, sec.')
>> ylabel('y(t)')
>> title('plots of y(t) for different initial conditions')
>> legend('initial value of y = 0','initial value of y=0.3','Location','best')
plots of y(t) for different initial conditions
0.3
initial value of y = 0
initial value of y=0.3
0.25
0.2
X: 2.76
Y: 0.1601
0.15
y(t)
0.1
0.05
0
-0.05
-0.1
-0.15
-0.2
0
0.5
1
1.5
time, sec.
2
2.5
3
Confirm from your plot that the amplitude in (b) is correct. As shown above, the amplitude is
correct.
(c) Use the MATLAB command ‘bode’ to generate the frequency response of the transfer
function for this suspension and confirm that the amplitude at ๐œ” = 10 ๐‘Ÿ๐‘Ž๐‘‘/๐‘  is correct.
>> g=tf([8 100],[1 8 100]);
>> bode(g,{2 20})
>> 10^(4.06/20) = 1.5959
As shown in the frequency response plot below, the amplitude at 10 rad/s is 4.06 dB which is
equivalent to a gain of 1.5959 ≈ 1.6 which agrees with the time domain solution. Also note that
the phase on the frequency response plot is -51.8 degrees which is -0.9041 rad which is also
approximately which is approximately equal to -0.8961 rad obtained using the inverse Laplace
transform.
211
Bode Diagram
6
Magnitude (dB)
4
2
System: g
Frequency (rad/s): 10
Magnitude (dB): 4.06
0
-2
-4
Phase (deg)
-6
0
-45
System: g
Frequency (rad/s): 10
Phase (deg): -51.8
-90
-135
10
1
Frequency (rad/s)
212
Homework 40
The schematic for a vehicle suspension is shown below. The differential equation for the upward
displacement y of the vehicle mass in terms of the road profile u is also shown below. Assume
the road profile input is a step of 0.1 m at time zero and assume the initial conditions are all zero.
(a) Draw an estimate of y(t). Be sure to show the initial and final values and the approximate time
to steady state.
y
0
time
(b) Define state variables for this differential equation and write the derivative equations, i.e.
๐‘ฅฬ‡ 1 =?
๐‘ฅฬ‡ 2 =?
(c) Use ode45 to generate a numerical solution and a plot of y. Does your plot match your estimate
in part (a)?
(d) Also generate a plot of the suspension stroke = u – y.
213
Homework 40 Solution
The schematic for a vehicle suspension is shown below. The differential equation for the upward
displacement y of the vehicle mass in terms of the road profile u is also shown below. Assume
the road profile input is a step of 0.1 m at time zero and assume the initial conditions are all zero.
(a) (15%) Draw an estimate of y(t). Be sure to show the initial and final values and the approximate
time to steady state.
y, m
0.1
0
1.25
time, sec
(b) (25%) Define state variables for this differential equation and write the derivative equations, i.e.
๐’™๐Ÿ = ๐’š ๐’™๐Ÿ = ๐’šฬ‡ − ๐Ÿ–๐’–
๐’™ฬ‡ ๐Ÿ = ๐’™๐Ÿ + ๐Ÿ–๐’–
๐’™ฬ‡ ๐Ÿ = −๐Ÿ๐ŸŽ๐ŸŽ๐’™๐Ÿ − ๐Ÿ–๐’™๐Ÿ + ๐Ÿ‘๐Ÿ”๐’–
(c) (40%) Use ode45 to generate a numerical solution and a plot of y. Does your plot match your
estimate in part (a)? Yes, the initial and final values match as well as the time to steady state.
clear all
[t,x]=ode45(@hmwk9eqns3360,[0 1.25],[0 0]);
y=x(:,1);
plot(t,y,'r','Linewidth',2)
xlabel('time, sec.')
ylabel('y(t), m')
title('Homework 9 Vehicle Mass Displacement')
figure
y2=0.1-x(:,1);
plot(t,y2,'r','Linewidth',2)
xlabel('time, sec.')
ylabel('u-y(t), m')
title('Homework 9 Variation in Suspension Stroke')
214
function dx = hmwk9eqns3360( t,x )
dx=zeros(2,1);
u=0.1;
dx(1)=x(2)+8*u;
dx(2)=-100*x(1)-8*x(2)+36*u;
end
Homework 9 Vehicle Mass Displacement
0.14
0.12
0.1
y(t), m
0.08
0.06
0.04
0.02
0
0
0.2
0.4
0.6
0.8
1
1.2
1.4
time, sec.
(d) (20%) Also generate a plot of the suspension stroke = u – y.
Homework 9 Variation in Suspension Stroke
0.1
0.08
u-y(t), m
0.06
0.04
0.02
0
-0.02
-0.04
0
0.2
0.4
0.6
0.8
1
1.2
1.4
time, sec.
215
Homework 41
A cannon ball is fired at an initial angle of ๐œƒ = 60๐‘‘๐‘’๐‘” with an initial velocity of V=100 m/sec. The
differential equations for the trajectory of the ball can be shown to be:
๐‘‰ = √๐‘งฬ‡ 2 + ๐‘ฆฬ‡ 2
10๐‘งฬˆ + 0.2๐‘งฬ‡ ๐‘‰ = 0
10๐‘ฆฬˆ + 0.2๐‘ฆฬ‡ ๐‘‰ + 98 = 0
๐‘ฆ(0− ) = 0
๐‘ฆฬ‡ (0− ) = 100 ๐‘ ๐‘–๐‘›( 60 ๐‘‘๐‘’๐‘”) = 86.6๐‘š/๐‘ 
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 100 ๐‘๐‘œ๐‘ ( 60 ๐‘‘๐‘’๐‘”) = 50๐‘š/๐‘ 
y
V(0)=100
๏ฑ (0) = 60 deg
0
(a)
(b)
(c)
(d)
(e)
z
On the graph above, draw an estimate of the trajectory of the ball.
Define state variables for the two differential equations above.
What are the initial conditions for your state variables?
Find the derivative equations for the state variables.
Create M-files for obtaining a plot of the trajectory, with y and z coordinates as shown above,
using ode45. Use an event function to end the simulation when the ball hits the ground on its
descent. Use common sense to determine if your simulation is probably correct.
Homework 41 Solution
A cannon ball is fired at an initial angle of ๐œƒ = 60๐‘‘๐‘’๐‘” with an initial velocity of V=100 m/sec. The
differential equations for the trajectory of the ball can be shown to be:
๐‘‰ = √๐‘งฬ‡ 2 + ๐‘ฆฬ‡ 2
10๐‘งฬˆ + 0.2๐‘งฬ‡ ๐‘‰ = 0
10๐‘ฆฬˆ + 0.2๐‘ฆฬ‡ ๐‘‰ + 98 = 0
๐‘ฆ(0− ) = 0
๐‘ฆฬ‡ (0− ) = 100 ๐‘ ๐‘–๐‘›( 60 ๐‘‘๐‘’๐‘”) = 86.6๐‘š/๐‘ 
๐‘ง(0− ) = 0
๐‘งฬ‡ (0− ) = 100 ๐‘๐‘œ๐‘ ( 60 ๐‘‘๐‘’๐‘”) = 50๐‘š/๐‘ 
216
y
V(0)=100
๏ฑ (0) = 60 deg
0
z
(a) On the graph above, draw an estimate of the trajectory of the ball.
(b) Define state variables for the two differential equations above.
๐‘ฅ1 = ๐‘ง ๐‘ฅ2 = ๐‘งฬ‡ ๐‘ฅ3 = ๐‘ฆ ๐‘ฅ4 = ๐‘ฆฬ‡
(c) What are the initial conditions for your state variables?
๐‘ฅ1 (0− ) = 0 ๐‘ฅ2 (0− ) = 50
๐‘ฅ3 (0− ) = 0
๐‘ฅ4 (0− ) = 86.6
(d) Find the derivative equations for the state variables.
๐‘‰ = √๐‘ฅ22 + ๐‘ฅ42
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −0.02๐‘‰๐‘ฅ2
๐‘ฅฬ‡ 3 = ๐‘ฅ4
๐‘ฅฬ‡ 4 = −9.8 − 0.02๐‘‰๐‘ฅ4
(e) Create M-files for obtaining a plot of the trajectory, with y and z coordinates as shown above,
using ode45. Use an event function to end the simulation when the ball hits the ground on its
descent. Use common sense to determine if your simulation is probably correct. The graph
below makes sense.
function trajectory
options=odeset('events',@SimStop);
V=100;TH=60*pi/180;
[t,x]=ode45(@TrajectoryEqns,[0 15],[0 V*cos(TH) 0 V*sin(TH)],options);
plot(x(:,1),x(:,3),'r.')
xlabel('Horizontal Distance, m')
ylabel('Altitude, m')
title('Homework 10 Cannonball Trajectory - 60 deg. firing angle')
function dx = TrajectoryEqns( t,x )
dx=zeros(4,1);
V=sqrt(x(2)^2+x(4)^2);
dx(1)=x(2);
dx(2)=-0.02*V*x(2);
dx(3)=x(4);
dx(4)=-9.8-0.02*V*x(4);
end
217
function [Val,Ister,Dir] = SimStop(t,x)
Val(1)=x(3);
Ister(1)=1;
Dir(1)=-1;
end
end
From >> doc odset
value(i) is the value of the ith event function.
isterminal(i) = 1 if the integration is to terminate at a zero of this event function, otherwise, 0.
direction(i) = 0 if all zeros are to be located (the default), +1 if only zeros where the event
function is increasing, and -1 if only zeros where the event function is decreasing.
Homework 10 Cannonball Trajectory - 60 deg. firing angle
70
60
50
Altitude, m
40
30
20
10
0
-10
0
10
20
30
40
50
Horizontal Distance, m
60
70
80
Homework 42
Repeat problem 41 but this time using SIMULINK to get the plot. Note, I suggest you first draw
a simulation diagram starting by solving for ๐‘งฬˆ ๐‘Ž๐‘›๐‘‘ ๐‘ฆฬˆ and then putting these terms through
integrators. You will need to use ‘Sqrt’ and ‘Product’ from ‘Math Operations’ in the library.
Don’t forget to add initial conditions to the appropriate integrators. Also, use the solution to
Homework 41 to get the final simulation time or guess long to get it.
Homework 42 Solution
Repeat problem 10 but this time using SIMULINK to get the plot. Note, I suggest you first draw
a simulation diagram starting by solving for ๐‘งฬˆ ๐‘Ž๐‘›๐‘‘ ๐‘ฆฬˆ and then putting these terms through
integrators. You will need to use ‘Sqrt’ and ‘Product’ from ‘Math Operations’ in the library.
Don’t forget to add initial conditions to the appropriate integrators. Also, use the solution to
Homework 10 to get the final simulation time or guess long to get it.
218
Simulink Diagram
Plotting Commands (20%)
>> plot(y(:,2),y(:,1),'r','linewidth',2)
>> title('Homework 11: Simulink solution to cannonball trajectory')
>> ylabel('height of ball, m')
>> xlabel('horizontal travel distance of ball, m')
Graph with labels
219
Homework 11: Simulink solution to cannonball trajectory
70
60
height of ball, m
50
40
30
20
10
0
0
10
20
30
40
50
horizontal travel distance of ball, m
60
70
80
Homework 43
The radar dish system shown below is used to track airplane targets as they pass overhead. The
input to the system is the true angle to the target ∅๐‘‘ (degrees) which is a ramp defined by 10t. In
other words, the targets typically pass over at a rate of 10 deg./sec. The pointing angle of the
dish is denoted by ∅ also in degrees.
(a) The input to the controller is e. Show that the differential equation for the controller is
0.0234๐‘ขฬ‡ + ๐‘ข = 0.4758๐‘’ฬ‡ + ๐‘’
(b) The input to the hydraulic positioner is u. Show that the differential equation for the hydraulic
positioner is
5∅ฬˆ + ∅ฬ‡ = 100๐‘ข
220
(c) Assign the three state variables for this system and express the state variable equations in matrix
format where the output of interest is ∅, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต∅๐‘‘
๐‘ฆ = ๐ถ๐‘‹ + ๐ท∅๐‘‘
(d) Use ‘damp’ to compute the eigenvalues of this system. Based on the time constants, about how
long does it take to acquire the target?
(e) Assume that the initial pointing angle ∅(0− ) of the dish is 90 degrees (vertical) at the time that
the control system becomes aware of a passing target which at that instant is at an angle of 30
degrees above the horizon. Use ‘lsim’ to generate and then plot the time response of the pointing
angle of the dish.
Homework 43 Solution
The radar dish system shown below is used to track airplane targets as they pass overhead. The
input to the system is the true angle to the target ∅๐‘‘ (degrees) which is a ramp defined by 10t. In
other words, the targets typically pass over at a rate of 10 deg./sec. The pointing angle of the
dish is denoted by ∅ also in degrees.
(a) (10%) The input to the controller is e. Show that the differential equation for the controller is
0.0234๐‘ขฬ‡ + ๐‘ข = 0.4758๐‘’ฬ‡ + ๐‘’
(b) (10%) The input to the hydraulic positioner is u. Show that the differential equation for the
hydraulic positioner is
5∅ฬˆ + ∅ฬ‡ = 100๐‘ข
221
(c) (40%) Assign the three state variables for this system and express the state variable equations in
matrix format where the output of interest is ∅, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต∅๐‘‘
๐‘ฆ = ๐ถ๐‘‹ + ๐ท∅๐‘‘
The equations for this system are:
0.0234๐‘ขฬ‡ + ๐‘ข = 0.4758๐‘’ฬ‡ + ๐‘’, ๐‘’ = ∅๐‘‘ − ∅
and
5∅ฬˆ + ∅ฬ‡ + 0∅ = 100๐‘ข.
The unknowns are ๐‘ข, ๐‘’, ๐‘Ž๐‘›๐‘‘ ∅. We have a first order differential equation for u, an algebraic
equation for e, and a 2nd order differential equation for ∅. We will need 3 state variables:
0.4758
๐‘ฅ1 = ∅
๐‘ฅ2 = ∅ฬ‡
๐‘ฅ3 = ๐‘ข −
๐‘’ = ๐‘ข − 20.333๐‘’
0.0234
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −406.667๐‘ฅ1 − 0.2๐‘ฅ2 + 20๐‘ฅ3 + 406.667∅๐‘‘
๐‘ฅฬ‡ 3 = 826.1966๐‘ฅ1 − 42.735๐‘ฅ3 − 826.1966∅๐‘‘
0
1
0
0
๐ด = [−406.667 −0.2
๐ต = [ 406.667 ]
20 ]
826.1966
0
−42.735
−826.1966
๐‘ฆ = ∅ ๐‘‡โ„Ž๐‘ข๐‘  ๐ถ = [1 0 0] ๐ท = [0]
(d) (10%) Use ‘damp’ to compute the eigenvalues of this system. Based on the time constants, about
how long does it take to acquire the target? Time required is 5/2.84 ≈ 1.75 ๐‘ ๐‘’๐‘.
>> A=[0 1 0;-406.667 -0.2 20;826.1966 0 -42.735];B=[0;406.667;-826.1966];
>> C=[1 0 0];D=0;
>> G=ss(A,B,C,D);
>> damp(G)
Pole
Damping
Frequency Time Constant
(rad/seconds) (seconds)
-2.84e+00
NA
NA
3.53e-01
-1.00e+01
NA
NA
9.97e-02
-3.01e+01
NA
NA
3.33e-02
Note, real eigenvalues do not have a damping ratio or frequency; so, MATLAB listing is
incorrect.
(e) (30%) Assume that the initial pointing angle ∅(0− ) of the dish is 90 degrees (vertical) at the time
that the control system becomes aware of a passing target which at that instant is at an angle of 30
degrees above the horizon. Use ‘lsim’ to generate and then plot the time response of the pointing
angle of the dish.
>> t=0:1/300:2;
>> PhiTar=30+10*t;
>> Xi=[90;0;0];
>> Phi=lsim(G,PhiTar,t,Xi);
>> plot(t,PhiTar,'r',t,Phi,'k-.','Linewidth',2)
>> xlabel('time, sec')
>> ylabel('angle, deg')
>> legend('angle to target','angle of radar antenna')
222
>> title('Homeowrk 12: state variable version of radar antenna control')
Homeowrk 12: state variable version of radar antenna control
90
angle to target
angle of radar antenna
80
angle, deg
70
60
50
40
30
20
0
0.2
0.4
0.6
0.8
1
time, sec
1.2
1.4
1.6
1.8
2
Homework 44
The schematic for a suspension system is shown below. The stochastic input is the road profile r(t)
which has irregularities consistent with a path through a cow pasture.
w
z
r
๐บฬ‚๐‘ฆ๐‘ฆ (๐‘“) =
No.
1
3
4
5
6
๐บฬ‚๐‘ฆ๐‘ฆ (๐œ…)
๐ด
๐ด๐œ ๐‘−1
= ๐‘ =
๐œ
๐œ… ๐œ
๐‘“๐‘
Description
Smooth runway
Smooth highway
Highway with gravel
Pasture
Plowed field
N
3.8
2.1
2.1
1.6
1.6
A
4.3 x 10-11
4.8 x 10-7
4.4 x 10-6
3.0 x 10-4
6.5 x 10-4
The maximum allowable decrease in the gap size between the two masses in the suspension is
called the suspension stroke. If the gap decreases as much as the stroke, the suspension is said to
223
bottom out. The transfer function for the decrease in the gap size, y = z – w, is shown in the
following equation
๐‘Œ(๐‘ ) = [
1200๐‘  2
] ๐‘…(๐‘ )
๐‘  4 + 48๐‘  3 + 1776๐‘  2 + 14400๐‘  + 172800
We are interested in simulating y(t) and then computing its mean and standard deviation. This
information will be used to determine the necessary design value for the stroke such that there is
a high probability (95%) that the suspension will not bottom out when the vehicle is moving
through a pasture at 10 m/s. For the suspension to bottom out
y(t) ≥ stroke.
(a) (5%) What is the DC gain of this transfer function? _______
(5%) Explain the significance of the DC gain. What does it mean specifically for this
suspension? ________________________________________________
(b) (10%) What are the eigenvalues of this system? ___________________
(c) (10%) Considering the eigenvalues, what is the largest time increment H that should be
used to create r(t)? Hint: Watch the lecture and see lecture notes on picking N and H.
_____
(d) (10%) What is the minimum N that should be used when creating r(t)? _________
Be sure to explain your answer.
(e) (15%) Using N = 8192 and H = 0.0025 (not the answers to (c) and (d)), use StochInput
to generate values for r(t) if the vehicle is moving 10 m/s. Plot the values of r(t) and use
the function comppsd to generate and plot the PSD of r(t); use the axis command to limit
the frequency axis of the plot to 5 hz in order to get good resolution at the low
frequencies. Note, StochInput and comppsd are files that you must copy and paste into
MATLAB.
(f) (20%) Using r(t) from (e), use lsim to generate values for y(t). Plot y(t). Also, plot only
the first 5 seconds of y(t) for better observation resolution.
(g) (5%) Comparing r(t) and y(t), what can you say about the frequency content of each; why
is there such a difference? You may want to put both on the same graph for comparison.
(h) (10%) Use commands std and mean to get the standard deviation and mean of y(t).
224
(i) (10%) Based on the PSD for the pasture and the vehicle speed, what size stroke is needed
for there to be a 95% probability of the suspension not bottoming out? _________
Be sure to show and explain all calculations.
Homework 44 Solution
The schematic for a suspension system is shown below. The stochastic input is the road profile r(t)
which has irregularities consistent with a path through a cow pasture.
w
z
r
๐บฬ‚๐‘ฆ๐‘ฆ (๐‘“) =
No.
1
3
4
5
6
๐บฬ‚๐‘ฆ๐‘ฆ (๐œ…)
๐ด
๐ด๐œ ๐‘−1
= ๐‘ =
๐œ
๐œ… ๐œ
๐‘“๐‘
Description
Smooth runway
Smooth highway
Highway with gravel
Pasture
Plowed field
N
3.8
2.1
2.1
1.6
1.6
A
4.3 x 10-11
4.8 x 10-7
4.4 x 10-6
3.0 x 10-4
6.5 x 10-4
The maximum allowable decrease in the gap size between the two masses in the suspension is
called the suspension stroke. If the gap decreases as much as the stroke, the suspension is said to
bottom out. The transfer function for the decrease in the gap size, y = z – w, is shown in the
following equation
๐‘Œ(๐‘ ) = [
1200๐‘  2
] ๐‘…(๐‘ )
๐‘  4 + 48๐‘  3 + 1776๐‘  2 + 14400๐‘  + 172800
We are interested in simulating y(t) and then computing its mean and standard deviation. This
information will be used to determine the necessary design value for the stroke such that there is
a high probability (95%) that the suspension will not bottom out when the vehicle is moving
through a pasture at 10 m/s. For the suspension to bottom out
y(t) ≥ stroke.
(j) (5%) What is the DC gain of this transfer function? DC gain = 0
225
(5%) Explain the significance of the DC gain. What does it mean specifically for this
suspension? If the input r(t) is a step, the gap between the masses will collapse to some
degree but then eventually return to its original size. So, the gap size change will end up
being zero.
(k) (10%) What are the eigenvalues of this system? ? −3.35 ± ๐‘—1.07 ๐‘Ž๐‘›๐‘‘ − 20.6 ± ๐‘—30.8
>> damp(G)
(l) (10%) Considering the eigenvalues, what is the largest time increment H that should be
used to create r(t)? Hint: Watch the lecture and see lecture notes on picking N and H.
For M being the largest eigenvalue magnitude for real and complex eigenvalues
1
๐ป≤
10๐‘€
1
=
= 0.002699
10√20. 62 + 30.82
Rounding down, I would use H = 0.0025 s.
If there was a maximum frequency fmax hz specified in the desired input PSD, then we
1
would need to check and determine if H needs to be even smaller to satisfy ๐ป ≤ 10๐‘“
๐‘š๐‘Ž๐‘ฅ
.
This problem does not have an fmax specified for the input PSD.
(m) (10%) What is the minimum N that should be used when creating r(t)? N = 2048
Be sure to explain your answer.
The value of N must be big enough so that the final simulation time = NH is at least twice
the transient period associated with the eigenvalue time constants which are 1/3.35 =
0.299 and 1/20.6 = 0.0485. So, 5 times the largest time constant is 1.49 which will just
get us through the startup transient period. Assuming we want to observe some of the
stationary steady state behavior, the final time needs to be at least 3 or 4 times 1.49 s. So,
if the final time is 4.5 s, then the number of points N must be greater than 4.5/H, i.e.
๐‘ ≥ 4.5/0.0025 = 1800
Since N must be a power of 2 and 210 = 1024 and 211 = 2048 then N = 2048 is the
minimum number of points that can be used.
(n) (15%) Using N = 8192 and H = 0.0025 (not the answers to (c) and (d)), use StochInput
to generate values for r(t) if the vehicle is moving 10 m/s. Plot the values of r(t) and use
the function comppsd to generate and plot the PSD of r(t); use the axis command to limit
the frequency axis of the plot to 5 hz in order to get good resolution at the low
frequencies. StochInput and comppsd are files that you must copy and paste into
MATLAB. Note in the PSD plot below that the PSD at f = 0 is zero which means the
mean value of r(t) is zero.
226
Plot of r(t) for entire range of time t
Plot of PSD of r(t) for limited range of f
0.5
0.16
0.4
0.14
0.3
0.12
PSD of r(t)
r(t)
0.2
0.1
0
-0.1
0.08
0.06
0.04
-0.2
0.02
-0.3
-0.4
0.1
0
5
10
15
20
0
25
0
0.5
1
1.5
time, s
2
2.5
3
3.5
4
4.5
5
Frequency hz
(o) (20%) Using r(t) from (e), use lsim to generate values for y(t). Plot y(t). Also, plot only
the first 5 seconds of y(t) for better observation resolution.
Vehicle speed 10 m/s in pasture
Vehicle speed 10 m/s in pasture
0.15
Change in gap size, y, m
Change in gap size, y, m
0.15
0.1
0.05
0
-0.05
-0.1
-0.15
-0.2
0
5
10
15
20
0.1
0.05
0
-0.05
-0.1
25
0
0.5
1
Time, s
1.5
2
2.5
3
3.5
4
4.5
5
Time, s
(p) (5%) Comparing r(t) and y(t), what can you say about the frequency content of each; why
is there such a difference? You may want to put both on the same graph for comparison.
Both plots have the same lower frequency trends exhibited by the major ups and downs;
but, the high frequencies in r(t) are essentially filtered out by the suspension.
Vehicle speed 10 m/s in pasture
0.2
Decrease in gap size y, m
Input r, m
Change in gap size, y, m
0.15
0.1
0.05
0
-0.05
-0.1
-0.15
-0.2
-0.25
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Time, s
227
(q) (10%) Use commands std and mean to get the standard deviation and mean of y(t).
๐œŽ๐‘ฆ = 0.04479 ๐‘š
๐œ‡๐‘ฆ = −0.00027 ≈ 0
Of course, we know the mean of y(t) must be zero since the mean value of the input r(t) is zero.
We know that the mean of r(t) is zero since there is no impulse in the input PSD at zero
frequency which means the mean is zero (see lecture notes). Since the mean of r(t) is zero, the
mean value of y(t) also has to be zero. But then, the mean of y(t) would be zero even if there
was a non-zero mean input since the DC gain of the transfer function is zero.
(r) (10%) Based on the PSD for the pasture and the vehicle speed, what size stroke is needed
for there to be a 95% probability of the suspension not bottoming out? 0.074 m
Be sure to show and explain all calculations.
Based on the Central Limit Theorem, the distribution of y is assumed to be normal. Using
disttool, the probability distribution function shows that the stroke must be 0.074 m in
order for 95% of gap decreases to be less than 0.074 m. See the figure below.
1
0.8
0.6
0.4
0.2
0
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4
Using the probability table in the notes, there is a 90% probability of y being between
-1.64๐œŽ๐‘ฆ and +1.64๐œŽ๐‘ฆ . Thus, there is %5 probability of y being greater than 1.64๐œŽ๐‘ฆ . So,
there is a 95% probability of y being less than 1.64๐œŽ๐‘ฆ = 1.64(0.04479) = 0.074 which
agrees with the disttool method.
๐’Œ๐ˆ๐’™
๐ŸŽ. ๐Ÿ”๐Ÿ•๐Ÿ’๐ˆ๐’™
๐Ÿ. ๐Ÿ”๐Ÿ’๐ˆ๐’™
๐Ÿ. ๐Ÿ—๐Ÿ”๐ˆ๐’™
๐Ÿ. ๐Ÿ“๐Ÿ–๐ˆ๐’™
Confidence Factor
๐‘ท๐’“๐’๐’ƒ๐’‚๐’ƒ๐’Š๐’๐’Š๐’•๐’š ๐’๐’‡ |๐’™ − ๐๐’™ | ≤ ๐’Œ๐ˆ๐’™
0.50
0.90
0.95
0.99
228
1
0.8
0.6
0.4
0.2
0
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4
function Homework_12_3360_11_17_20
num=[1200 0 0];
den=[1 48 1776 14400 172800];
G=tf(num,den)
N=8192;H=0.0025;
[r,t]=pasture(N,H);
figure(3)
y=lsim(G,r,t);
plot(t,y,'r','linewidth',2)
xlabel('Time, s','fontsize',18)
ylabel('Change in gap size, y, m','fontsize',18)
title('Vehicle speed 10 m/s in pasture','fontsize',18)
grid
figure(4)
plot(t,y,'r','linewidth',2)
xlabel('Time, s','fontsize',18)
ylabel('Change in gap size, y, m','fontsize',18)
title('Vehicle speed 10 m/s in pasture','fontsize',18)
axis([0 5 -0.15 0.15])
grid
figure(5)
plot(t,y,'r',t,r,'k:','linewidth',2)
xlabel('Time, s','fontsize',18)
ylabel('Change in gap size, y, m','fontsize',18)
title('Vehicle speed 10 m/s in pasture','fontsize',18)
legend('Decrease in gap size y, m','Input r, m')
axis([0 5 -0.3 0.2])
grid
SDEV=std(y)
MEAN=mean(y)
% This function generates the input for Homework 12 MAE 3360 Nov 2020
function [r,t]=pasture(N,H)
[r,t]=StochInput(N,H);
229
figure(1)
plot(t,r,'r')
xlabel('time, s','fontsize',16)
ylabel('r(t)','fontsize',16)
title('Plot of r(t) for entire range of time t','fontsize',16)
figure(2)
[PSD,f]=comppsd(r,N,H);
plot(f,PSD,'r','linewidth',3)
xlabel('Frequency hz','fontsize',16)
ylabel('PSD of r(t)','fontsize',16)
title('Plot of PSD of r(t) for limited range of f','fontsize',16)
axis([0 5 0 0.16])
end
% -----------------------------------------------------------------% function [Y,t]=StochInput(N,H)
% Generates N points in time Y(t) at a time interval of H with zero mean.
% N must be a power of 2! The N points will be generated
% so as to have a desired one-sided PSD defined in the function
% dpsd(f) at the end of this file. f is the frequency in Hertz.
% The frequency resolution will be 1/NH.
% The smallest frequency will be 0 Hz.
% The largest frequency will be 1/2H Hz. Note, the frequency 1/2H
% is referred to as the folding or Nyquist frequency.
%
% If you don't want this m-file to automatically plot y(t) and the
% desired PSD, you need to add "%" signs to all plot commands
% in this function.
%
% The time span for y(t) will be from 0 to NH.
function[Y,t]=StochInput(N,H)
no2=N/2;
% Step 1: Generate frequencies and PSD values at each frequency
f=0:1/(N*H):1/(2*H);%Note, the first frequency is zero but we don't
%compute GY at f=0 to avoid potential computational problems. GY at f=0
%should be zero for a zero mean process.
GY(1)=0;
% The desired PSD is defined in function dpsd at the end of this file
for m1=2:no2+1;
GY(m1)=dpsd(f(m1));
end
% Step 1: Generate N/2 random phase angles with uniform denisty
%
between 0 and 2pi
TH=random('unif',0,2*pi,no2,1);
% Step 2: Generate the appropriate amplitude at each frequency using
% the random phase angles.
for m=2:no2;
C=sqrt(GY(m)*N*H/2);
CTH=cos(TH(m-1))*C;
STH=sin(TH(m-1))*C;
Y(m)=CTH+j*STH;
k=N+2-m;
Y(k)=CTH-j*STH;
end
% Step 3: Make sure the N/2+1 value is real that the negative frequency
% values will be the mirror image of the positive frequency values.
no2p1=no2+1;
230
C=sqrt(GY(no2p1)*N*H/2);
CTH=cos(TH(no2))*C;
Y(no2p1)=CTH+j*0.e0;
% Make sure the zero frequency value is zero to achieve
% a zero mean time series.
Y(1)=0.e0+j*0.e0;
% Generate Y(t), the inverse transform of the N Fourier Transform
% values Y(f).
[Y]=ifft(Y);
% Rescale to get the correct time series corresponding to this desired PSD.
for m=1:N;
Y(m)=real(Y(m)/H);
end
t=0:H:(N-1)*H;t=t';
Y=Y';
% Plot the PSD and time series
%figure
%plot(t,Y,'r','linewidth',2);
%xlabel('Time (sec)')
%ylabel('Output variable with the desired PSD')
%figure
%plot(f,GY,'r','linewidth',2)% Used to confirm desired PSD
%xlabel('Frequency (Hertz)')
%ylabel('Desired PSD, (units of output)^2/hz')
end
%------------------------------------% This function will be called for each value of f
% You need equations or logic for GY describing the desired PSD.
% The logic below is for a bandlimited white noise with one-sided PSD
% with magnitude 900 over the frequency range 1.995 < f < 2.005 hz.
% Note, the frequency resolution 1/NH must be <= 0.001 hz to get
% at least 10 values in this narrow frequency range.
function [GY]=dpsd(f)
GY=(3e-4)*10^0.6/f^1.6;%PSD for pasture at 10 m/s
end
%-----------------------------------------------------------% function[PSD,f]=comppsd(Y,N,H)
% This function generates N/2 unique values for the
% PSD of Y(t) at a frequency resolution of 1/NH. The
% zero frequency value represents the mean value squared times 2NH.
% Note, the PSD is plotted for all values of frequency.
% After generating the plot, for better resolution, you can change
% the scales of the plot using the command axis([XMIN XMAX YMIN YMAX]).
function[PSD,f]=comppsd(Y,N,H)
[Y]=fft(Y);
NO2=N/2;
for m=1:NO2
PSD(m)=2*H*abs(Y(m))^2/N;
end
f=0:1/(N*H):(N-2)/(2*N*H);
%plot(f,PSD)
%xlabel('Frequency (Hertz)')
%ylabel('PSD (units of y^2)/(cycles/sec)')
end
end
231
Homework 45
The electrical circuit shown below consists of resistances R1 and R2, inductors L1 and L2, and
capacitors C. The circuit is used to filter the input voltage V1(t). The output V4(t) represents V1(t)
after being filtered.
R1
L1
C
+
V1
C
_
R2
L2
V4
It can be shown that the equation for V4(s) is
๐‘ฝ๐Ÿ’ (๐’”) = [
๐‘ช๐Ÿ ๐‘ณ๐Ÿ ๐‘ณ๐Ÿ ๐’”๐Ÿ’
+
๐‘ช๐Ÿ (๐‘ณ๐Ÿ ๐‘น๐Ÿ
๐‘ช๐‘ณ๐Ÿ ๐’”๐Ÿ (๐‘ช๐‘น๐Ÿ ๐’” + ๐Ÿ)
] ๐‘ฝ (๐’”)
+ ๐‘ณ๐Ÿ ๐‘น๐Ÿ + ๐‘ณ๐Ÿ ๐‘น๐Ÿ )๐’”๐Ÿ‘ + ๐‘ช(๐Ÿ๐‘ณ๐Ÿ + ๐‘ณ๐Ÿ + ๐‘ช๐‘น๐Ÿ ๐‘น๐Ÿ )๐’”๐Ÿ + ๐‘ช(๐Ÿ๐‘น๐Ÿ + ๐‘น๐Ÿ )๐’” + ๐Ÿ ๐Ÿ
(a) (10%) What is the low frequency gain (D.C. gain) of this filter? That is, as the input
frequency approaches zero, what is the gain?
(b) (10%) If L2 = 2L1, what is the high frequency gain of the filter? That is, as the input
frequency approaches infinity, what is the gain.
(c) (10%) Considering what happens to low input frequencies and what happens to high
input frequencies, what kind of a filter is this? For example, low pass or band pass or
high pass or what?
(d) (12%) Assume the following parameters and generate the frequency response plot of
the transfer function using the MATLAB command ‘bode’.
L1 = 1e-3 h L2 = 2L1 C = 1e-6 f R1=15.8 ๐›บ R2=2R1
(e) (5%) Does the frequency response plot confirm you answer in (c)? Explain. Yes.
(f) (10%) Assuming that transfer function magnitudes below -3 dB are filtered, what
range of frequencies are not filtered?
(g) (5%) What are the eigenvalues of this filter?
(h) (8%) If V1(t) = 1sin(5000t), what is V4(t)? That is, what is V1(t) after being filtered?
(i) (8%) If V1(t) = 1sin(75000t), what is V4(t)? That is, what is V1(t) after being filtered?
(j) (4%) What can you conclude about the effects of the filter considering your answers in
(g) and (h)? For an input with frequency of 5000 rad/s, the amplitude is attenuated by a
factor of 0.067; for 75000 rad/s, the amplitude is attenuated by 0.464.
(k) (6%) Generate a time array for an lsim simulation of this transfer function for the input
in (h); explain how you picked the final time and time increment.
(l) (6%) Using your time array and lsim to simulate your transfer function with the input
in (h), plot V4(t).
232
(m)
(6%) Does the steady state amplitude of V4(t) from your simulation agree with
your answer in (h)?
Homework 45 Solution
The electrical circuit shown below consists of resistances R1 and R2, inductors L1 and L2, and
capacitors C. The circuit is used to filter the input voltage V1(t). The output V4(t) represents V1(t)
after being filtered.
R1
L1
C
+
V1
C
_
R2
L2
V4
It can be shown that the equation for V4(s) is
๐‘ฝ๐Ÿ’ (๐’”) = [
๐‘ช๐‘ณ๐Ÿ ๐’”๐Ÿ (๐‘ช๐‘น๐Ÿ ๐’” + ๐Ÿ)
] ๐‘ฝ (๐’”)
๐‘ช๐Ÿ ๐‘ณ๐Ÿ ๐‘ณ๐Ÿ ๐’”๐Ÿ’ + ๐‘ช๐Ÿ (๐‘ณ๐Ÿ ๐‘น๐Ÿ + ๐‘ณ๐Ÿ ๐‘น๐Ÿ + ๐‘ณ๐Ÿ ๐‘น๐Ÿ )๐’”๐Ÿ‘ + ๐‘ช(๐Ÿ๐‘ณ๐Ÿ + ๐‘ณ๐Ÿ + ๐‘ช๐‘น๐Ÿ ๐‘น๐Ÿ )๐’”๐Ÿ + ๐‘ช(๐Ÿ๐‘น๐Ÿ + ๐‘น๐Ÿ )๐’” + ๐Ÿ ๐Ÿ
(a) (10%) What is the low frequency gain (D.C. gain) of this filter? That is, as the input frequency
approaches zero, what is the gain? Setting s = 0 in the transfer function gives zero
(b) (10%) If L2 = 2L1, what is the high frequency gain of the filter? That is, as the input
frequency approaches infinity, what is the gain. Setting s = infinity in the transfer
function gives zero.
(c) (10%) Considering what happens to low input frequencies and what happens to high
input frequencies, what kind of a filter is this? For example, low pass or band pass or
high pass or what? It is a band pass filter.
(d) (12%) Assume the following parameters and generate the frequency response plot of
the transfer function using the MATLAB command ‘bode’.
L1 = 1e-3 h L2 = 2L1 C = 1e-6 f R1=15.8 ๐›บ R2=2R1
% Homework 11 3360 Nov 2020
>> L1=1e-3;L2=2*L1;C=1e-6;R1=15.8;R2=2*R1;
>> G=tf([C^2*L2*R2 C*L2 0 0],[C^2*L2*L1 C^2*(L1*R2+L2*R1+L2*R2)
C*(2*L1+L2+C*R1*R2) C*(2*R1+R2) 1])
bode(G)
...
233
G=
31600 s^3 + 1e09 s^2
-----------------------------------------------s^4 + 63200 s^3 + 2.25e09 s^2 + 3.16e13 s + 5e17
Bode Diagram
20
System: G
Frequency (rad/s): 1.38e+04
Magnitude (dB): -2.97
10
Magnitude (dB)
0
System: G
Frequency (rad/s): 5.15e+04
Magnitude (dB): -3.04
-10
-20
-30
-40
-50
Phase (deg)
-60
180
90
0
-90
3
10
4
5
10
10
6
10
Frequency (rad/s)
(e) (5%) Does the frequency response plot confirm you answer in (c)? Explain. Yes.
There is midrange of frequencies that do not get filtered whereas low and high
frequencies do get filtered.
(f) (10%) Assuming that transfer function magnitudes below -3 dB are filtered, what
range of frequencies are not filtered? Approximately 13,800 to 51,500 rad/s are not
filtered.
(g) (5%) What are the eigenvalues of this filter?
>> damp(G)
Eigenvalue
Damping Frequency
-4.38e+03 + 1.82e+04i 2.33e-01 1.88e+04
-4.38e+03 - 1.82e+04i 2.33e-01 1.88e+04
-2.72e+04 + 2.61e+04i 7.22e-01 3.77e+04
-2.72e+04 - 2.61e+04i 7.22e-01 3.77e+04
(h) (8%) If V1(t) = 1sin(5000t), what is V4(t)? That is, what is V1(t) after being filtered?
Getting magnitude and angle from the frequency response plot below at 5000 rad/s:
170
๐‘‰4 (๐‘ก) = 1(10)−25.3/20 ๐‘ ๐‘–๐‘›(5000๐‘ก +
2๐œ‹) = 0.067๐‘ ๐‘–๐‘›(5000๐‘ก + 5.93)
180
234
Bode Diagram
Magnitude (dB)
20
0
System: g
Frequency (rad/s): 7.51e+04
Magnitude (dB): -6.67
System: g
Frequency (rad/s): 5.01e+03
Magnitude (dB): -25.3
-20
-40
-60
180
Phase (deg)
System: g
Frequency (rad/s): 5e+03
Phase (deg): 170
90
0
System: g
Frequency (rad/s): 7.5e+04
Phase (deg): -61.5
-90
3
10
4
10
Frequency (rad/s)
5
10
(i) (8%) If V1(t) = 1sin(75000t), what is V4(t)? That is, what is V1(t) after being filtered?
61.5
๐‘‰4 (๐‘ก) = 1(10)−6.67/20 ๐‘ ๐‘–๐‘›(75000๐‘ก −
2๐œ‹) = 0.464๐‘ ๐‘–๐‘›(75000๐‘ก − 2.15)
180
(j) (4%) What can you conclude about the effects of the filter considering your answers in
(g) and (h)? For an input with frequency of 5000 rad/s, the amplitude is attenuated by a
factor of 0.067; for 75000 rad/s, the amplitude is attenuated by 0.464.
(k) (6%) Generate a time array for an lsim simulation of this transfer function for the input
in (h); explain how you picked the final time and time increment. The largest time
constant is 1/4380. So, the final time needs to be larger that 5/4380 = 0.0011. The output
will be oscillating with a frequency of 5000 rad/s; so, to get at least 50 points per cycle of
๐Ÿ๐…
oscillation, we need a time increment of ๐Ÿ“๐ŸŽ๐ŸŽ๐ŸŽ(๐Ÿ“๐ŸŽ) = ๐Ÿ. ๐Ÿ“๐’†(−๐Ÿ“); to get about 5 cycles after
reaching steady state, the final time needs to be
0.0011 +
๐Ÿ๐…๐Ÿ“
๐Ÿ“๐ŸŽ๐ŸŽ๐ŸŽ
= ๐ŸŽ. ๐ŸŽ๐ŸŽ๐Ÿ•๐Ÿ’. So, t = 0 : 2.5e-5 : 0.0074;
(l) (6%) Using your time array and lsim to simulate your transfer function with the input
in (h), plot V4(t).
>> t=0:2.5e-5:0.0074;
>> V4=lsim(G,V1,t);
>> plot(t,V4)
>> plot(t,V4,'r','linewidth',3)
>> xlabel('Time, s','fontsize',16)
>> ylabel('V_4(t), volts')
>> grid
235
0.15
0.1
X: 0.006
Y: 0.05387
4
V (t), volts
0.05
0
-0.05
-0.1
-0.15
-0.2
0
1
2
3
4
5
6
7
Time, s
8
-3
x 10
(m) (6%) Does the steady state amplitude of V4(t) from your simulation agree with your
answer in (h)? The prediction from the frequency response plot was 0.067 at
approximately 5000 rad/s and the simulation steady state amplitude is very close
at 0.05387. Also, abs(G(s))s=j5000 = 0.05396 which matches exactly the time
response amplitude. The accuracy of reading the bode plot is the difference;
increasing the resolution (not shown), at exactly 5000, 10^(-25.4/20) = 0.0537.
Homework 46
The schematic of a block of iron with length L, width L/2 and height L/2 is shown below. A constant heat
source qi is shown on the schematic entering the block at a central location towards the right end.
Initially, the block is at the same temperature of the air Ta which is constant. As the block heats up,
convection heat transfer occurs at all surfaces and conduction heat transfer occurs withing the block. A
simple lumped parameter model for approximating the temperature distribution in the block is based
on dividing the block into right and left halves and assuming the temperatures TL and TR are uniform in
each half. Obviously, a more accurate model would be one divided into 3 or 4 or more parts.
The equations for the heat transfer rates (๐‘ž๐ฟ๐‘Ž , ๐‘ž๐‘…๐‘Ž , ๐‘ž๐‘…๐ฟ ) and temperatures (๐‘‡๐‘… , ๐‘‡๐ฟ ) for this thermal
model are given below. The constants a, b, and c are defined by the length L, specific heat Cp, thermal
conductivity k and density ๐œŒ of the mass and by the convection heat transfer coefficient h which are all
known values.
1
1
1
(1) ๐‘‡๐ฟ − ๐‘‡๐‘Ž = ๐‘ž๐ฟ๐‘Ž (2) ๐‘‡๐‘… − ๐‘‡๐‘Ž = ๐‘ž๐‘…๐‘Ž (3) ๐‘‡๐‘… − ๐‘‡๐ฟ = ๐‘ž๐‘…๐ฟ
๐‘
๐‘
๐‘
(4) ๐‘ž๐‘– − ๐‘ž๐‘…๐ฟ − ๐‘ž๐‘…๐‘Ž =
1
๐‘‡ฬ‡
๐‘Ž ๐‘…
(5) ๐‘ž๐‘…๐ฟ − ๐‘ž๐ฟ๐‘Ž =
1
๐‘‡ฬ‡
๐‘Ž ๐ฟ
qi
3L/4
L/4
L/4
236
Ta
TL
TR
L/2
L/2
L/2
L/2
(a) (10%) Which of the 5 equations are algebraic and which are differential?_________________
(b) (30%) Defining x1 to be TR and x2 to be TL, express these equations in matrix state variable
format shown below. Note, the format assumes there are three outputs of interest TR, TL
and qRL and two inputs Ta and qi.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ˆ
๐‘ฅฬ‡
? ? ๐‘ฅ1
? ? ๐‘‡๐‘Ž
[ 1] = [
] [๐‘ฅ ] + [
][ ]
๐‘ฅฬ‡ 2
? ? 2
? ? ๐‘ž๐‘–
๐‘Œ = ๐ถ๐‘‹ + ๐ท๐‘ˆ
๐‘‡๐‘…
? ? ๐‘ฅ
? ? ๐‘‡
1
[ ๐‘‡๐ฟ ] = [? ?] [๐‘ฅ ] + [? ?] [ ๐‘Ž ]
๐‘ž๐‘–
2
๐‘ž๐‘…๐ฟ
? ?
? ?
(c) (20%) Using a = 1.7991e(-5) b = 21 and c = 62.5, enter these state variable equations in
MATLAB and find the eigenvalues. ______________________
(d) (10%) Based on the eigenvalues and assuming the inputs are constant, how long would a
simulation need to run for the solution to reach steady state? ______________________
(e) (20%) Use the command ss2f to get the transfer functions for the outputs of interest. For
example,
๐‘‡๐‘… (๐‘ ) = [? ]๐‘‡๐‘Ž (๐‘ ) + [? ]๐‘ž๐‘– (๐‘ )
(f) (10%) Considering that the initial temperature of the block is 300 °K, Ta = 300 °K, and qi = 2000
W/s, draw estimates of the plots of TR(t) and TL(t). Hint: Use the DC gains of the transfer
functions to get the final values.
237
Homework 46 Solution
The schematic of a block of iron with length L, width L/2 and height L/2 is shown below. A
constant heat source qi is shown on the schematic entering the block at a central location
towards the right end. Initially, the block is at the same temperature of the air T a which is
constant. As the block heats up, convection heat transfer occurs at all surfaces and conduction
heat transfer occurs withing the block. A simple lumped parameter model for approximating
the temperature distribution in the block is based on dividing the block into right and left halves
and assuming the temperatures TL and TR are uniform in each half. Obviously, a more accurate
model would be one divided into 3 or 4 or more parts.
The equations for the heat transfer rates (๐‘ž๐ฟ๐‘Ž , ๐‘ž๐‘…๐‘Ž , ๐‘ž๐‘…๐ฟ ) and temperatures (๐‘‡๐‘… , ๐‘‡๐ฟ ) for this
thermal model are given below. The constants a, b, and c are defined by the length L, specific
heat Cp, thermal conductivity k and density ๐œŒ of the mass and by the convection heat transfer
coefficient h which are all known values.
1
(1) ๐‘‡๐ฟ − ๐‘‡๐‘Ž = ๐‘ž๐ฟ๐‘Ž
๐‘
1
1
(2) ๐‘‡๐‘… − ๐‘‡๐‘Ž = ๐‘ž๐‘…๐‘Ž (3) ๐‘‡๐‘… − ๐‘‡๐ฟ = ๐‘ž๐‘…๐ฟ
๐‘
๐‘
(4) ๐‘ž๐‘– − ๐‘ž๐‘…๐ฟ − ๐‘ž๐‘…๐‘Ž =
1
๐‘‡ฬ‡
๐‘Ž ๐‘…
(5) ๐‘ž๐‘…๐ฟ − ๐‘ž๐ฟ๐‘Ž =
1
๐‘‡ฬ‡
๐‘Ž ๐ฟ
qi
3L/4
L/4
L/4
Ta
TL
TR
L/2
L/2
L/2
L/2
(a) (10%) Which of the 5 equations are algebraic and which are differential? 1,2, 3 algebraic; 4,5 diff
(b) (30%) Defining x1 to be TR and x2 to be TL, express these equations in matrix state variable format
shown below. Note, the format assumes there are three outputs of interest TR, TL and qRL and
two inputs Ta and qi.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ˆ
๐‘ฅ1
−๐‘Ž(๐‘ + ๐‘)
๐‘Ž๐‘
๐‘ฅฬ‡
๐‘Ž๐‘ ๐‘Ž ๐‘‡๐‘Ž
[ 1] = [
][ ] +[
][ ]
๐‘Ž๐‘ 0 ๐‘ž๐‘–
๐‘ฅฬ‡ 2
๐‘Ž๐‘
−๐‘Ž(๐‘ + ๐‘) ๐‘ฅ2
๐‘Œ = ๐ถ๐‘‹ + ๐ท๐‘ˆ
238
๐‘‡๐‘…
1 0 ๐‘ฅ
0 0 ๐‘‡
1
[ ๐‘‡๐ฟ ] = [0 1 ] [๐‘ฅ ] + [0 0] [ ๐‘Ž ]
๐‘ž๐‘–
2
๐‘ž๐‘…๐ฟ
๐‘ −๐‘
0 0
(c) (20%) Using a = 1.7991e(-5) b = 21 and c = 62.5, enter these state variable equations in
MATLAB and find the eigenvalues. -0.0018801 -0.0011245
A=
-0.0015023 0.00037782
0.00037782 -0.0015023
eig(A)
ans =
-0.0018801
-0.0011245
(d) (10%) Based on the eigenvalues and assuming the inputs are constant, how long would a
simulation need to run for the solution to reach steady state? 5/0.0011245 = 4446 s
(e) (20%) Use the command ss2f to get the transfer functions for the outputs of interest. For
example,
[num,den]=ss2tf(A,B,C,D,1)
[num,den]=ss2tf(A,B,C,D,2)
num =
0 0.0011245 2.1141e-06
0 0.0011245 2.1141e-06
0
0
0
den =
1 0.0030046 2.1141e-06
num =
0 1.7991e-05 2.7028e-08
0
0 6.7976e-09
0 0.00037782 4.2485e-07
den =
1 0.0030046 2.1141e-06
๐‘‡๐‘… (๐‘ ) = [
0.0011245๐‘  + 2.1141๐‘’ − 6
1.7991๐‘’(−5)๐‘  + 2.7028๐‘’ − 8
] ๐‘ž๐‘– (๐‘ )
] ๐‘‡๐‘Ž (๐‘ ) + [ 2
2
๐‘  + 0.003๐‘  + 2.1141๐‘’ − 6
๐‘  + 0.003๐‘  + 2.1141๐‘’ − 6
๐‘‡๐ฟ (๐‘ ) = [
0.0011245๐‘  + 2.1141๐‘’ − 6
6.7976๐‘’ − 9
] ๐‘‡๐‘Ž (๐‘ ) + [ 2
] ๐‘ž (๐‘ )
2
๐‘  + 0.003๐‘  + 2.1141๐‘’ − 6
๐‘  + 0.003๐‘  + 2.1141๐‘’ − 6 ๐‘–
๐‘ž๐‘…๐ฟ (๐‘ ) = [0]๐‘‡๐‘Ž (๐‘ ) + [
0.00037782๐‘  + 4.2485๐‘’ − 7
] ๐‘ž (๐‘ )
๐‘  2 + 0.003๐‘  + 2.1141๐‘’ − 6 ๐‘–
239
(f) (10%) Considering that the initial temperature of the block is 300 °K, Ta = 300 °K, and qi = 2000
W/s, draw estimates of the plots of TR(t) and TL(t). Hint: Use the DC gains of the transfer
functions to get the final values.
TR
326
TL
306
300
400
qRL
0
4446
t, s
G=ss(A,B,C,D);
DCgain=dcgain(G)
DCgain =
1 0.012785
1 0.0032153
3.5527e-15 0.20096
thus, final value of TR =1*Ta + 0.012785*qi = 300 + 25.57 = 326
thus, final value of TL =1*Ta + 0.0032153*qi = 300 + 6.43 = 306
thus, final value of qRL =0*Ta + 0.2*qi = 400
% homework 10 3360 Fall 2020
format shortg
K=84;Cp=452;h=200;L=0.5;den=7870;
M=L^3*den/4;
c=5*h*L^2/4
a=2/(Cp*M)
b=K*L/2
A=[-a*(b+c) a*b;a*b
-a*(b+c)]
B=[a*c a;a*c 0]
eig(A)
C=[1 0;0 1;b -b]
D=[0 0;0 0;0 0];
t=0:5:5000;
Ta=300+0*t;
qi=2000+0*t;
G=ss(A,B,C,D);
DCgain=dcgain(G)
[num,den]=ss2tf(A,B,C,D,1)
[num,den]=ss2tf(A,B,C,D,2)
240
Homework 47
In order to keep the inverted pendulum shown below vertical, the pendulum is attached to a cart
that moves laterally with displacement z. The lateral movement results from a feedback control
force Fi acting on the cart; the pendulum angle ๐œƒ is measured with a sensor. The output from this
sensor is ๐œƒ๐‘š = ๐œƒ + ๐‘› where n is high frequency sensor noise that adds to the true angle ๐œƒ. The
sensor output ๐œƒ๐‘š is the input to a control transfer function that generates the force Fi to move the
cart.
Since we are trying to keep the pendulum vertical (๐œƒ = 0), the small angle assumption for ๐œƒ is
sufficiently accurate since ๐œƒ should always be near zero.
Ms
๏ฑ
L
z
Fi
Mc
The small angle approximation differential equations for the pendulum and cart are
(1) ๐œƒฬˆ = 8.1๐œƒ − 0.5๐‘งฬˆ
equation for pendulum considering the cart movement
(2) ๐‘งฬˆ = −0.2๐œƒฬˆ − 0.09๐น๐‘–
equation for the cart displacement considering the pendulum
The desired equation for the control force consists of a proportional plus derivative transfer function, i.e.
๐น๐‘– (๐‘ ) = −⌈377 + 75.4๐‘ ⌉๐œƒ๐‘š (๐‘ )
However, since ๐œƒ๐‘š contains high frequency noise, the equation for the control force is modified to be a
proportional plus bandlimited derivative transfer function, i.e.
๐น๐‘– (๐‘ ) = − ⌈377 +
75.4๐‘ 
๐‘ 
+1
30
⌉ ๐œƒ๐‘š (๐‘ )
which simplifies to
(3)
๐น๐‘– (๐‘ ) = − [
2639๐‘ +11310
] [๐œƒ(๐‘ ) +
๐‘ +30
๐‘›(๐‘ )]
Define G4(s) to be
๐บ4 (๐‘ ) = − [
2639๐‘  + 11310
]
๐‘  + 30
So, we have three equations (1), (2), and (3) with unknowns ๐œƒ, z, and Fi; the input to the system is n(t).
241
(a) (5%) The third equation contains a bandlimited differentiator. At what frequency does the filter
theoretically begin to filter sensor noise in the bandlimited differentiator? ___________
(b) (10%) Laplace transform (1) assuming all initial conditions are zero; solve (1) for the transfer
function relating ๐œƒ(๐‘ ) to Z(s), i.e.
(4)
๐œƒ(๐‘ ) = ๐บ1 (๐‘ )๐‘(๐‘ )
๐บ1 (๐‘ ) =?
(c) (10%) Laplace transform (2) for all initial conditions zero and solve for Z(s), i.e.
(5)
๐‘(๐‘ ) = −๐บ2 (๐‘ )๐œƒ(๐‘ ) − ๐บ3 (๐‘ )๐น๐‘– (๐‘ )
๐บ2 (๐‘ ) =?
๐บ3 (๐‘ ) =?
(d) (25%) Using the approach explained in the SIMULINK lecture, complete the block diagram
below which links (3), (4), and (5) together; that is, insert the correct transfer functions in each
box.
๐›‰๐ฆ
n
Fi
๐›‰
Z
−
+
+
G4
G3
−
G1
G2
(e) (30%) Construct this diagram in SIMULINK with n(t) = 0.001sin(100t) and generate a 2.5 s plot
of ๐œƒ(๐‘ก). Note, without noise, the pendulum would remain vertical. However, the noise will
continually keep causing the pendulum to move off vertical and start to fall; but, the control force
will cause the cart to move so as to hopefully keep bringing the pendulum back to vertical.
(Copy and paste plot and MATLAB code here. Also, copy and paste your SIMULINK diagram
here also.)
(f) (10%) The results in (e) should be a steady state oscillation about vertical. What is the amplitude
of this steady state oscillation? _________ What is the frequency of this oscillation? ________
(g) (10%) It can be shown that the dominate eigenvalues of the system with the feedback force to
move the cart are −2.37 ± ๐‘—2.73. Considering that the frequency of the noise is 100 rad/s,
explain the rational for picking the filter frequency in (a).
242
Homework 47 Solution
In order to keep the inverted pendulum shown below vertical, the pendulum is attached to a cart
that moves laterally with displacement z. The lateral movement results from a feedback control
force Fi acting on the cart; the pendulum angle ๐œƒ is measured with a sensor. The output from this
sensor is ๐œƒ๐‘š = ๐œƒ + ๐‘› where n is high frequency sensor noise that adds to the true angle ๐œƒ. The
sensor output ๐œƒ๐‘š is the input to a control transfer function that generates the force Fi to move the
cart.
Since we are trying to keep the pendulum vertical (๐œƒ = 0), the small angle assumption for ๐œƒ is
sufficiently accurate since ๐œƒ should always be near zero.
Ms
๏ฑ
L
z
Fi
Mc
The small angle approximation differential equations for the pendulum and cart are
(1) ๐œƒฬˆ = 8.1๐œƒ − 0.5๐‘งฬˆ
equation for pendulum considering the cart movement
(2) ๐‘งฬˆ = −0.2๐œƒฬˆ − 0.09๐น๐‘–
equation for the cart displacement considering the pendulum
The desired equation for the control force consists of a proportional plus derivative transfer function, i.e.
๐น๐‘– (๐‘ ) = −⌈377 + 75.4๐‘ ⌉๐œƒ๐‘š (๐‘ )
However, since ๐œƒ๐‘š contains high frequency noise, the equation for the control force is modified to be a
proportional plus bandlimited derivative transfer function, i.e.
๐น๐‘– (๐‘ ) = − ⌈377 +
75.4๐‘ 
๐‘ 
+1
30
⌉ ๐œƒ๐‘š (๐‘ )
which simplifies to
(3)
๐น๐‘– (๐‘ ) = − [
2639๐‘ +11310
] [๐œƒ(๐‘ ) +
๐‘ +30
๐‘›(๐‘ )]
Define G4(s) to be
๐บ4 (๐‘ ) = − [
2639๐‘  + 11310
]
๐‘  + 30
So, we have three equations (1), (2), and (3) with unknowns ๐œƒ, z, and Fi; the input to the system is n(t).
243
(a) (5%) The third equation contains a bandlimited differentiator. At what frequency does the filter
theoretically begin to filter sensor noise in the bandlimited differentiator? 30 rad/s
(b) (10%) Laplace transform (1) assuming all initial conditions are zero; solve (1) for the transfer
function relating ๐œƒ(๐‘ ) to Z(s), i.e.
−0.5๐‘  2
(4)
๐œƒ(๐‘ ) = ๐บ1 (๐‘ )๐‘(๐‘ )
๐บ1 (๐‘ ) = 2
๐‘  − 8.1
(c) (10%) Laplace transform (2) for all initial conditions zero and solve for Z(s), i.e.
(5)
๐‘(๐‘ ) = −๐บ2 (๐‘ )๐œƒ(๐‘ ) − ๐บ3 (๐‘ )๐น๐‘– (๐‘ )
๐บ2 (๐‘ ) = 0.2 ๐บ3 (๐‘ ) =
0.09
๐‘ 2
(d) (25%) Using the approach explained in the SIMULINK lecture, complete the block diagram
below which links (3), (4), and (5) together; that is, insert the correct transfer functions in each
box.
๐›‰๐ฆ
n
Fi
๐›‰
Z
−
+
+
G4
G3
−
G1
G2
(e) (30%) Construct this diagram in SIMULINK with n(t) = 0.001sin(100t) and generate a 2.5 s plot
of ๐œƒ(๐‘ก). Note, without noise, the pendulum would remain vertical. However, the noise will
continually keep causing the pendulum to move off vertical and start to fall; but, the control force
will cause the cart to move so as to hopefully keep bringing the pendulum back to vertical.
(Copy and paste plot and MATLAB code here. Also, copy and paste your SIMULINK diagram
here also.)
>> plot(out.Y(:,1),out.Y(:,2),'r','linewidth',3)
>> ylabel('theta, rad','fontsize',20)
>> xlabel('time, s','fontsize',20)
244
Plot generated using the default variable-step integration. Note, the sharpness in
the peaks at steady state telling us that the step size is not small enough to accurately
plot the solution associated with the input frequency of 100 rad/s.
245
Solution plot after changing to a fixed step solution method specifying that the step
size be small enough to give at least 100 points every input cycle, i.e.
[2๐…/๐Ÿ๐ŸŽ๐ŸŽ]/๐Ÿ๐ŸŽ๐ŸŽ ≈ ๐ŸŽ. ๐ŸŽ๐ŸŽ๐Ÿ“. Note how the steady state solution now has an essentially
constant amplitude with a frequency of [2๐…/(๐Ÿ. ๐Ÿ๐Ÿ๐Ÿ“ − ๐Ÿ. ๐Ÿ๐Ÿ“)] ≈ ๐Ÿ๐ŸŽ๐ŸŽ which is the
input frequency.
(f) (10%) The results in (e) should be a steady state oscillation about vertical. What is the amplitude
of this steady state oscillation? ≈ ๐Ÿ. ๐Ÿ๐’†(−๐Ÿ“)
What is the frequency of this oscillation? ≈ 100 ๐‘Ÿ๐‘Ž๐‘‘/๐‘ 
(g) (10%) It can be shown that the dominate eigenvalues of the system with the feedback force to
move the cart are −2.37 ± ๐‘—2.73. Considering that the frequency of the noise is 100 rad/s,
explain the rational for picking the filter frequency in (a). The filter frequency must be greater
than the eigenvalue frequency or else the filter will prevent the control force from
effectively stabilizing the pendulum. On the other hand, the filter frequency must be less
than the noise frequency otherwise the noise will not be filtered. The filter frequency of 30
is at least 10 times the eigenvalue frequency and about 1/3 of the noise frequency.
246
Homework 48
A transfer function does not always represent the model of some engineering system.
Instead, some transfer functions may have been designed to filter some measured signal.
For example, consider all the radio station broadcast frequencies in the space around you.
A radio has a bandpass filter transfer function that filters out all radio station frequencies
except the frequency of the radio station that you want to listen to; the width of the
frequency band in this case is very small so as to let only that one particular frequency pass
for you to hear; the width of the band of frequencies passed through could be large
however depending on the application. A low pass filter is designed to filter signals with
high frequencies and only allow signals with low frequencies to pass through. A high pass
filter is designed to filter signals with low frequencies and only allow signals with high
frequencies to pass through.
Example filter design problem
It is usually very important to use a low pass filter on a signal containing high frequency
noise before differentiating the signal since differentiating a high frequency signal produces
very large values.
For example, suppose a signal y(t) = 1sin(10t) is measured with a sensor. Suppose the output of the
sensor, ys(t), however, contains low amplitude high frequency noise n(t), i.e.
๐’š๐’” (๐’•) = ๐’š(๐’•) + ๐’(๐’•)
= ๐Ÿ๐’”๐’Š๐’(๐Ÿ๐ŸŽ๐’•) + ๐ŸŽ. ๐ŸŽ๐Ÿ๐’”๐’Š๐’(๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐’•)
(a) (16%) What is the equation for ๐’šฬ‡ ๐’” (๐’•) ? ________________
(b) (10%) What is the amplitude ๐’šฬ‡ (๐’•)? _________
(c) (10%) What is the amplitude ๐’ฬ‡ (๐’•)? ____________
(d) (10%) Even though the amplitude of n(t) is small compared to the amplitude of y(t),
how do the amplitudes of their derivatives compare?
________________________________________________________________
____________________________________________________________________
(e) (10%) Why is the presence of the noise a problem when differentiating a signal
containing noise?
_______________________________________________________________________
(f) The transfer function for differentiating ๐’š๐’” (๐’•) to get ๐’šฬ‡ ๐’” (๐’•) is [s]; that is
๐’€ฬ‡๐’” (๐’”) = ๐‘ณ{๐’šฬ‡ ๐’” } = [๐’”]๐’€๐’” (๐’”)
247
A simple transfer function for low pass filtering and differentiating ๐’š๐’” (๐’•) to
minimize the effects of the high frequency noise is called a bandlimited
differentiator and is shown below.
๐ฌ
๐›š๐ฌ
๐˜ฬ‡๐ฌ๐Ÿ (๐ฌ) = [ ๐ฌ
] ๐˜๐’” (๐ฌ) = [
] ๐˜ (๐ฌ)
๐ฌ+๐›š ๐’”
+
๐Ÿ
๐Ž
where ๐›š is conventionally called the bandwidth frequency where the filtering
begins.
(20%) Generate the frequency responses for three bandlimited differentiators using
values of ๐Ž equal to 100, 300, and 1000 rad/s; use the MATLAB command bode
with all three plots on the same graph for comparison.
(g) Suppose ๐’(๐’•) = ๐ŸŽ. ๐ŸŽ๐Ÿ๐’”๐’Š๐’(๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐’•). Click with the mouse on the bode plots in
part (f) and determine the amplitude of the filtered ๐’ฬ‡ (๐’•) if each of the bandlimited
differentiators had been used to differentiate the filtered n(t).
(g.1) (6%) ๐›š = ๐Ÿ๐ŸŽ๐ŸŽ
amplitude of ๐’ฬ‡ (๐’•) =?
(g.2) (6%) ๐›š = ๐Ÿ‘๐ŸŽ๐ŸŽ
amplitude of ๐’ฬ‡ (๐’•) =?
(g.3) (6%) ๐›š = ๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ
amplitude of ๐’ฬ‡ (๐’•) =?
๐›š=∞
๐’‚๐’Ž๐’‘๐’๐’Š๐’•๐’–๐’…๐’† ๐’๐’‡ ๐’ฬ‡ (๐’•) = ๐Ÿ๐ŸŽ ๐’„๐’‚๐’”๐’† ๐’๐’‡ ๐’๐’ ๐’‡๐’Š๐’๐’•๐’†๐’“๐’Š๐’๐’ˆ
(h) (6%) After reviewing the results obtained in part (g), what filter frequency,๐›š,would
you suggest be used if the frequency of the noise is 1000 rad/s?
Homework 48 Solution
A transfer function does not always represent the model of some engineering system.
Instead, some transfer functions may have been designed to filter some measured signal.
For example, consider all the radio station broadcast frequencies in the space around you.
A radio has a bandpass filter transfer function that filters out all radio station frequencies
except the frequency of the radio station that you want to listen to; the width of the
frequency band in this case is very small so as to let only that one particular frequency pass
for you to hear; the width of the band of frequencies passed through could be large
however depending on the application. A low pass filter is designed to filter signals with
high frequencies and only allow signals with low frequencies to pass through. A high pass
filter is designed to filter signals with low frequencies and only allow signals with high
frequencies to pass through.
248
Example filter design problem
It is usually very important to use a low pass filter on a signal containing high frequency
noise before differentiating the signal since differentiating a high frequency signal produces
very large values.
For example, suppose a signal y(t) = 1sin(10t) is measured with a sensor. Suppose the output of the
sensor, ys(t), however, contains low amplitude high frequency noise n(t), i.e.
๐’š๐’” (๐’•) = ๐’š(๐’•) + ๐’(๐’•)
= ๐Ÿ๐’”๐’Š๐’(๐Ÿ๐ŸŽ๐’•) + ๐ŸŽ. ๐ŸŽ๐Ÿ๐’”๐’Š๐’(๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐’•)
(a) (16%) What is the equation for ๐’šฬ‡ ๐’” (๐’•) ? 10cos(10t)+10cos(1000t)
(b) (10%) What is the amplitude ๐’šฬ‡ (๐’•)? 10
(c) (10%) What is the amplitude ๐’ฬ‡ (๐’•)? 10
(d) (10%) Even though the amplitude of n(t) is small compared to the amplitude of y(t),
how do the amplitudes of their derivatives compare? The amplitudes are the same
which means 50% of my derivative is associated with noise which totally invalidates
my measured data.
(e) (10%) Why is the presence of the noise a problem when differentiating a signal
containing noise?
Because the amplitude of the derivative of high frequency noise is proportional to
the frequency causing huge errors unless the noise is first removed before
differentiating.
(f) The transfer function for differentiating ๐’š๐’” (๐’•) to get ๐’šฬ‡ ๐’” (๐’•) is [s]; that is
๐’€ฬ‡๐’” (๐’”) = ๐‘ณ{๐’šฬ‡ ๐’” } = [๐’”]๐’€๐’” (๐’”)
A simple transfer function for low pass filtering and differentiating ๐’š๐’” (๐’•) to
minimize the effects of the high frequency noise is called a bandlimited
differentiator and is shown below.
๐ฌ
๐›š๐ฌ
๐˜ฬ‡๐ฌ๐Ÿ (๐ฌ) = [ ๐ฌ
] ๐˜๐’” (๐ฌ) = [
] ๐˜ (๐ฌ)
๐ฌ+๐›š ๐’”
+
๐Ÿ
๐Ž
where ๐›š is conventionally called the bandwidth frequency where the filtering
begins.
(20%) Generate the frequency responses for three bandlimited differentiators using
values of ๐Ž equal to 100, 300, and 1000 rad/s; use the MATLAB command bode
with all three plots on the same graph for comparison.
>> G100=tf([1 0],[1/100 1]);
>> G300=tf([1 0],[1/300 1]);
249
>> G1000=tf([1 0],[1/1000 1]);
>> bode(G100,G300,G1000,{10 10000})
60
Magnitude (dB)
System: G1000
Frequency (rad/s): 1.01e+03
Magnitude (dB): 57
Bode Diagram
50
System: G300
Frequency (rad/s): 1.03e+03
Magnitude (dB): 49.2
System: G100
Frequency (rad/s): 1.01e+03
Magnitude (dB): 40
40
30
20
Phase (deg)
10
90
45
0
1
10
2
3
10
4
10
10
Frequency (rad/s)
(g) Suppose ๐’(๐’•) = ๐ŸŽ. ๐ŸŽ๐Ÿ๐’”๐’Š๐’(๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐’•). Click with the mouse on the bode plots in
part (f) and determine the amplitude of the filtered ๐’ฬ‡ (๐’•) if each of the bandlimited
differentiators had been used to differentiate the filtered n(t).
๐Ÿ’๐ŸŽ/๐Ÿ๐ŸŽ
(g.1) (6%) ๐›š = ๐Ÿ๐ŸŽ๐ŸŽ ๐’‚๐’Ž๐’‘๐’๐’Š๐’•๐’–๐’†๐’… ๐’๐’‡ ๐’ฬ‡ (๐’•) = ๐ŸŽ. ๐ŸŽ๐Ÿ ∗ ๐Ÿ๐ŸŽ
=๐Ÿ
(g.2) (6%) ๐›š = ๐Ÿ‘๐ŸŽ๐ŸŽ ๐’‚๐’Ž๐’‘๐’๐’Š๐’•๐’–๐’…๐’† ๐’๐’‡ ๐’ฬ‡ (๐’•) = ๐ŸŽ. ๐ŸŽ๐Ÿ ∗ ๐Ÿ๐ŸŽ
๐Ÿ’๐Ÿ—.๐Ÿ/๐Ÿ๐ŸŽ
= ๐Ÿ. ๐Ÿ–๐Ÿ–
๐Ÿ“๐Ÿ•/๐Ÿ๐ŸŽ
(g.3) (6%) ๐›š = ๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ ๐’‚๐’Ž๐’‘๐’๐’Š๐’•๐’–๐’…๐’† ๐’๐’‡ ๐’ฬ‡ (๐’•) = ๐ŸŽ. ๐ŸŽ๐Ÿ ∗ ๐Ÿ๐ŸŽ
= ๐Ÿ•. ๐ŸŽ๐Ÿ–
๐›š=∞
๐’‚๐’Ž๐’‘๐’๐’Š๐’•๐’–๐’…๐’† ๐’๐’‡ ๐’ฬ‡ (๐’•) = ๐Ÿ๐ŸŽ ๐’„๐’‚๐’”๐’† ๐’๐’‡ ๐’๐’ ๐’‡๐’Š๐’๐’•๐’†๐’“๐’Š๐’๐’ˆ
(h) (6%) After reviewing the results obtained in part (g), what filter frequency, ๐›š, would
you suggest be used if the frequency of the noise is 1000 rad/s? ๐›š ≤ ๐Ÿ๐ŸŽ๐ŸŽ
Homework 49
Consider the following differential equation for y(t) with input u(t):
2๐‘ฆฬ‡ + 4๐‘ฆ = 6๐‘ขฬ‡
๐‘ฆ(0− ) = 0 ๐‘ข(0− ) = 0
U(t)
10
0
time
(a) (5%)What is the time constant associated with this differential equation?
(b) (5%) What is the Laplace transform of ๐‘ข(๐‘ก).
250
(c) (5%) What is the Laplace transform of ๐‘ขฬ‡ (๐‘ก).
(d) (10%) Laplace transform the differential equation and solve for Y(s).
(e) (5%) Apply the final value theorem to Y(s). Does the theorem give the correct final
value? Explain.
(f) (5%) Apply the initial value theorem to Y(s). Does the theorem give the correct value?
Explain.
(g) (6%) Find the equation for y(t) by finding the inverse Laplace of Y(s) from (d). (pg.25)
(4%) Substitute t = 0 and t = ∞ into your equation for y(t). Are these values correct?
(h) (15%) Express the differential equation in state variable format for an ode45 numerical
simulation to get ๐‘ฅฬ‡ 1 = −2๐‘ฅ1 − 6๐‘ข. In terms of y and u, what is the equation definition
for ๐‘ฅ1 ?
(i) (10%) Draw a sketch of ๐‘ขฬ‡ (๐‘ก).
๐‘ขฬ‡ (๐‘ก)
0
1
time t
(j) (10%) Explain why it would be impossible to do an ode45 simulation if the state variable
equation for ๐‘ฅฬ‡ 1 contained ๐‘ขฬ‡ .
(k) (15%) Generate an ode45 simulation and plot y(t). Plot on the same graph for comparison
y(t) from (d).
(l) (5%) How do the two plots in (k) compare?
Homework 49 Solution
Consider the following differential equation for y(t) with input u(t):
2๐‘ฆฬ‡ + 4๐‘ฆ = 6๐‘ขฬ‡
๐‘ฆ(0− ) = 0 ๐‘ข(0− ) = 0
U(t)
10
0
time
(a) (5%)What is the time constant associated with this differential equation? 0.5 s
(b) (5%) What is the Laplace transform of ๐‘ข(๐‘ก). 10/s
(c) (5%) What is the Laplace transform of ๐‘ขฬ‡ (๐‘ก). sU(s) = 10
(d) (10%) Laplace transform the differential equation and solve for Y(s).
251
๐Ÿ๐’”๐’€(๐’”) + ๐Ÿ’๐’€(๐’”) = ๐Ÿ”๐’”๐‘ผ(๐’”)
๐’€(๐’”) =
๐Ÿ”๐’”
๐Ÿ”๐’” ๐Ÿ๐ŸŽ
๐Ÿ”๐ŸŽ
๐Ÿ‘๐ŸŽ
๐‘ผ(๐’”) =
=
=
๐Ÿ๐’” + ๐Ÿ’
๐Ÿ๐’” + ๐Ÿ’ ๐’”
๐Ÿ๐’” + ๐Ÿ’ ๐’” + ๐Ÿ
(e) (5%) Apply the final value theorem to Y(s). Does the theorem give the correct final
value? Explain.
sY(s)s=0 = 0 Since the derivative of u is zero as time goes to infinity and since the
derivative y goes to zero, solving for y(t) in the original differential equation gives y
= 0 which confirms the final value theorem.
(f) (5%) Apply the initial value theorem to Y(s). Does the theorem give the correct value?
๐Ÿ‘๐ŸŽ๐’”
Explain. ๐’š(๐ŸŽ+ ) = ๐’”๐’€(๐’”)๐’”→∞ = (๐’”+๐Ÿ)
๐’”→∞
=(
๐Ÿ‘๐ŸŽ
๐Ÿ+
๐Ÿ
๐’”
)
= ๐Ÿ‘๐ŸŽ
๐’”→∞
This is the correct value for ๐’š(๐ŸŽ+ ) which is different than ๐’š(๐ŸŽ− ) because of the
derivative of a step which is an impulse at t = 0.
(g) (6%) Find the equation for y(t) by finding the inverse Laplace of Y(s) from (d).
๐’š(๐’•) = (๐’“๐’†๐’”๐’Š๐’…๐’–๐’† ๐’‡๐’๐’“ ๐’” = −๐Ÿ) = ๐Ÿ‘๐ŸŽ๐’†−๐Ÿ๐’•
(4%) Substitute t = 0 and t = ∞ into your equation for y(t). Are these values correct?
๐’š(๐ŸŽ) = ๐Ÿ‘๐ŸŽ๐’†−๐ŸŽ = ๐Ÿ‘๐ŸŽ
๐’š(∞) = ๐Ÿ‘๐ŸŽ๐’†−∞ = ๐ŸŽ These are both correct.
(h) (15%) Express the differential equation in state variable format for an ode45 numerical
simulation to get ๐‘ฅฬ‡ 1 = −2๐‘ฅ1 − 6๐‘ข. In terms of y and u, what is the equation definition
for ๐‘ฅ1 ?
๐’šฬ‡ − ๐Ÿ‘๐’–ฬ‡ = −๐Ÿ๐’š Thus, ๐’™๐Ÿ = ๐’š − ๐Ÿ‘๐’– So, ๐’™ฬ‡ ๐Ÿ = −๐Ÿ๐’š = −๐Ÿ(๐’™๐Ÿ + ๐Ÿ‘๐’–) = −๐Ÿ๐’™๐Ÿ − ๐Ÿ”๐’–
(i) (10%) Draw a sketch of ๐‘ขฬ‡ (๐‘ก).
๐‘ขฬ‡ (๐‘ก)
∞
Impulse with area 10 at t = 0
1
time t
(j) (10%) Explain why it would be impossible to do an ode45 simulation if the state variable
equation for ๐‘ฅฬ‡ 1 contained ๐‘ขฬ‡ . Because a value of infinity for zero length of time cannot
be put into MATLAB as an equation for ๐’–ฬ‡ (๐’•).
252
(k) (15%) Generate an ode45 simulation and plot y(t). Plot on the same graph for comparison
y(t) from (d).
Solution Hmwk 6 part k
30
inverse Laplace
ode45
25
y(t)
20
15
10
5
0
0
0.5
1
1.5
2
2.5
time, s
function Homework_6_3360_Fall_2020
format shortg
[t,x]=ode45(@eqns,[0 2.5],[0]);
Y=30*exp(-2*t);
y=x(:,1)+3*10;
plot(t,Y,'r*',t,y,'K','linewidth',2)
xlabel('time, s','fontsize',18)
ylabel('y(t)','fontsize',18)
title('Solution Hmwk 6 part k','fontsize',18)
legend('inverse Laplace','ode45')
grid
function dx=eqns(t,x)
dx=zeros(1,1);
dx(1)=-2*x(1)-6*10;
end
end
(l) (5%) How do the two plots in (k) compare? The two plots are identical.
253
Homework #50
The magnitude of a ratio of complex numbers can be calculated by first finding
magnitudes of the individual complex numbers and then multiplying and/or
dividing them.
Also, the angle of a ratio of complex numbers can be found by adding and/or
subtracting the angles of the individual complex numbers. Consider the following
ratio of complex numbers:
๐บ=
(−2 + ๐‘—3)(−4 − ๐‘—8)
4๐‘—(−6 + ๐‘—10)
(a) (20%) Find the magnitude of G, |๐บ|, using the MATLAB command ‘abs’.
_________
(b) (20%) Use a calculator and find |๐บ| by finding the individual magnitudes
and then the product and ratio of the magnitudes, i.e.
|−2 + ๐‘—3| ∗ |−4 − ๐‘—8| ?∗?
(−2 + ๐‘—3)(−4 − ๐‘—8)
|๐บ| = |
=
= __________
|=
|4๐‘—| ∗ |−6 + ๐‘—10|
4๐‘—(−6 + ๐‘—10)
?∗?
(c) (5%) Confirm that a and b give the same answer.
(d) (20%) Find the angle of G using the MATLAB command ‘angle’.
angle(G) = ?
(e) (20%) Use a calculator and the inverse tangent to get the angle of G, i.e.
(−2 + ๐‘—3)(−4 − ๐‘—8)
๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
)
4๐‘—(−6 + ๐‘—10)
= ๐‘Ž๐‘›๐‘”๐‘™๐‘’(−2 + ๐‘—3) + ๐‘Ž๐‘›๐‘”๐‘™๐‘’(−4 − ๐‘—8) − ๐‘Ž๐‘›๐‘”๐‘™๐‘’(4๐‘—) − ๐‘Ž๐‘›๐‘”๐‘™๐‘’(−6 + ๐‘—10)
= ? + ? − ? − ? = _____________
(f) (5%) confirm d and e give the same angle.
(g) (10%) For s = -2+j4, use MATLAB to calculate the magnitude and angle of H.
๐ป=
3๐‘ +5
7๐‘  3 +4๐‘  2 +2๐‘ +10
magnitude = _____ angle = ___________
254
Homework #50 Solution
The magnitude of a ratio of complex numbers can be calculated by first finding
magnitudes of the individual complex numbers and then multiplying and/or
dividing them.
Also, the angle of a ratio of complex numbers can be found by adding and/or
subtracting the angles of the individual complex numbers. Consider the following
ratio of complex numbers:
๐บ=
(−2 + ๐‘—3)(−4 − ๐‘—8)
4๐‘—(−6 + ๐‘—10)
(h) (20%) Find the magnitude of G, |๐บ|, using the MATLAB command ‘abs’.
|๐†| =0.69133 See code below.
>> G=(-2+j*3)*(-4-j*8)/(4*j*(-6+j*10))
G = -0.63235 + 0.27941i
>> Mg=abs(G)
Mg = 0.69133
(i) (20%) Use a calculator and find |๐บ| by finding the individual magnitudes
and then the product and ratio of the magnitudes, i.e.
(−๐Ÿ + ๐ฃ๐Ÿ‘)(−๐Ÿ’ − ๐ฃ๐Ÿ–)
|−๐Ÿ + ๐ฃ๐Ÿ‘| ∗ |−๐Ÿ’ − ๐ฃ๐Ÿ–| √๐Ÿ’ + ๐Ÿ— ∗ √๐Ÿ๐Ÿ” + ๐Ÿ”๐Ÿ’
|๐†| = |
=
|=
|๐Ÿ’๐ฃ| ∗ |−๐Ÿ” + ๐ฃ๐Ÿ๐ŸŽ|
๐Ÿ’๐ฃ(−๐Ÿ” + ๐ฃ๐Ÿ๐ŸŽ)
๐Ÿ’ ∗ √๐Ÿ‘๐Ÿ” + ๐Ÿ๐ŸŽ๐ŸŽ
=
๐Ÿ‘. ๐Ÿ”๐ŸŽ๐Ÿ“๐Ÿ” ∗ ๐Ÿ–. ๐Ÿ—๐Ÿ’๐Ÿ’๐Ÿ‘
= ๐ŸŽ. ๐Ÿ”๐Ÿ—๐Ÿ๐Ÿ‘๐Ÿ’
๐Ÿ’ ∗ ๐Ÿ๐Ÿ. ๐Ÿ”๐Ÿ”๐Ÿ
(j) (5%) Confirm that a and b give the same answer. Same answer.
(k) (20%) Find the angle of G using the MATLAB command ‘angle’.
angle(G) = 2.7255 rad See code below.
>> angle(G)
ans =
2.7255
255
(l) (20%) Use a calculator and the inverse tangent to get the angle of G, i.e.
(−2 + ๐‘—3)(−4 − ๐‘—8)
๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
)
4๐‘—(−6 + ๐‘—10)
= ๐š๐ง๐ ๐ฅ๐ž(−๐Ÿ + ๐ฃ๐Ÿ‘) + ๐š๐ง๐ ๐ฅ๐ž(−๐Ÿ’ − ๐ฃ๐Ÿ–) − ๐š๐ง๐ ๐ฅ๐ž(๐Ÿ’๐ฃ) − ๐š๐ง๐ ๐ฅ๐ž(−๐Ÿ” + ๐ฃ๐Ÿ๐ŸŽ)
3
4
-2
-4
10
-6
-8
A calculator does not know if a negative sign is in the numerator or
denominator; so, it gives an answer in quadrant 1 or quadrant 4, both are wrong. I
always put positive numbers in a calculator and then figure out what the result
means using the graph (see red angles on graphs above).
= [๐… − ๐’•๐’‚๐’−๐Ÿ (๐Ÿ‘/๐Ÿ)] + [๐… + ๐’•๐’‚๐’−๐Ÿ (๐Ÿ–/๐Ÿ’)] −
๐…
− [๐… − ๐’•๐’‚๐’−๐Ÿ (๐Ÿ๐ŸŽ/๐Ÿ”)]
๐Ÿ
= ๐Ÿ. ๐Ÿ•๐Ÿ๐Ÿ“๐Ÿ“
(m)
(5%) confirm d and e give the same angle. Same answer
(n) (10%) For s = -2+j4, use MATLAB to calculate the magnitude and angle of H.
๐‡=
๐Ÿ‘๐ฌ+๐Ÿ“
๐Ÿ•๐ฌ ๐Ÿ‘ +๐Ÿ’๐ฌ ๐Ÿ +๐Ÿ๐ฌ+๐Ÿ๐ŸŽ
magnitude = 0.020134
angle = 1.98387 rad
>> s=-2+j*4;
>> H=(3*s+5)/(7*s^3+4*s^2+2*s+10)
H = -0.0072407 + 0.018787i
>> abs(H)
ans =
0.020134
>> angle(H)
ans =
1.9387
256
Homework #51
1.(a) Repeat the Euler’s integration portion of Quiz 12 on page 97 in this book but
starting with an initial value of 3 instead of 1. (5%) Before doing the integration
steps, draw an estimate of the plot for x(t).
(20%) For the differential equation below, use Euler’s numerical integration to
compute the first two solution values of x(t) using a time step of T = 0.01.
๐ฑฬ‡ + ๐Ÿ๐ŸŽ๐ฑ = ๐Ÿ๐ŸŽ
Time t
x(t)
0
3
๐ฑ(๐ŸŽ− ) = ๐Ÿ‘
๐’™ฬ‡ (๐’•) = ๐Ÿ๐ŸŽ − ๐Ÿ๐ŸŽ๐’™(๐’•)
x(t+T)=x(t)+T๐’™ฬ‡ (๐’•)
0.01
0.02
(b) (20%) Use separation of variables to get the exact answer x(t) at t = 0.02.
(5%) What is the percent error of the Euler solution at t = 0.02?
2. See Quiz 31 on page 110 in the problems text.
257
A spring-mass –damper system is shown below; the displacement of the mass is z.
z
spring
damper
mass
The differential equation for the position of the mass is as follows
๐‘งฬˆ + 0.1๐‘งฬ‡ + 0.01๐‘ง = 0
๐‘ง(0− ) = 0 ๐‘š ๐‘งฬ‡ (0− ) = 2 ๐‘š/๐‘ 
(c) (10%) Draw an estimate of z(t).
(d) (15%) Define state variables for this 2nd order differential equation and then
write the derivative equations for the state variables, i.e.
๐‘ฅ1 =?
๐‘ฅฬ‡ 1 =?
๐‘ฅ2 =?
๐‘ฅฬ‡ 2 =?
(e) (25%) Complete the first two time steps of the Euler numerical integration
solution of these state variable equations to get values of the state variables
after two time steps of โˆ†๐‘ก = 1 sec.
t
๐‘ฅ1 (๐‘ก)
๐‘ฅ2 (๐‘ก)
๐‘ฅฬ‡ 1 (๐‘ก)
๐‘ฅฬ‡ 2 (๐‘ก)
๐‘ฅ1 (๐‘ก + โˆ†๐‘ก) =
๐‘ฅ1 (๐‘ก) + โˆ†๐‘ก๐‘ฅฬ‡ 1 (๐‘ก)
๐‘ฅ2 (๐‘ก + โˆ†๐‘ก) =
๐‘ฅ2 (๐‘ก) + โˆ†๐‘ก๐‘ฅฬ‡ 2 (๐‘ก)
0
1
2
258
Homework #51 Solution
1.(a) Repeat the Euler’s integration portion of Quiz 12 on page 97 in the problems
text but starting with an initial value of 3 instead of 1. (5%) Before doing the
integration steps, draw an estimate of the plot for x(t). The initial value is 3;
setting ๐ฑฬ‡ =0 gives
the final value of 2; the time constant is 0.1 s. So, 5*0.1 =
0.5 s.
3
x(t)
2
0
0.5
(20%) For the differential equation below, use Euler’s numerical integration to
compute the first two solution values of x(t) using a time step of T = 0.01.
๐ฑฬ‡ + ๐Ÿ๐ŸŽ๐ฑ = ๐Ÿ๐ŸŽ
๐ฑ(๐ŸŽ− ) = ๐Ÿ‘
๐’™ฬ‡ (๐’•) = ๐Ÿ๐ŸŽ − ๐Ÿ๐ŸŽ๐’™(๐’•)
x(t+T)=x(t)+T๐’™ฬ‡ (๐’•)
Time t
x(t)
0
3
20-10*3=-10
3+0.01*(-10)=2.9
0.01
2.9
20-10*2.9=-9
2.9+0.01*(-9)=2.81
0.02
2.81
(b) (20%) Use separation of variables to get the exact answer x(t) at t = 0.02.
๐๐ฑ
+ ๐Ÿ๐ŸŽ๐ฑ = ๐Ÿ๐ŸŽ
๐’…๐’•
๐ฑ(๐ŸŽ− ) = ๐Ÿ‘
๐๐ฑ = (๐Ÿ๐ŸŽ − ๐Ÿ๐ŸŽ๐ฑ)๐๐ญ
๐‘ฅ
๐‘ก
๐‘‘๐‘ฅ
∫
= ∫ ๐‘‘๐‘ก
3 20 − 10๐‘ฅ
0
259
๐’๐’†๐’• ๐’– = ๐Ÿ๐ŸŽ๐’™ − ๐Ÿ๐ŸŽ ๐’•๐’‰๐’–๐’” ๐’…๐’– = ๐Ÿ๐ŸŽ๐’…๐’™
๐Ÿ๐ŸŽ๐’™(๐’•)−๐Ÿ๐ŸŽ
∫
๐Ÿ๐ŸŽ(๐Ÿ‘)−๐Ÿ๐ŸŽ
๐’•
๐’…๐’–
= − ∫ ๐’…๐’•
๐Ÿ๐ŸŽ๐’–
๐ŸŽ
๐’๐’(๐Ÿ๐ŸŽ๐’™(๐’•) − ๐Ÿ๐ŸŽ) − ๐’๐’(๐Ÿ๐ŸŽ) = −๐Ÿ๐ŸŽ๐’•
๐Ÿ๐ŸŽ๐’™(๐’•) − ๐Ÿ๐ŸŽ
๐’๐’ (
) = −๐Ÿ๐ŸŽ
๐Ÿ๐ŸŽ
๐Ÿ๐ŸŽ๐’™(๐’•) − ๐Ÿ๐ŸŽ
= ๐’†−๐Ÿ๐ŸŽ๐’•
๐Ÿ๐ŸŽ
๐‘ฅ(๐‘ก) = 2 + ๐‘’ −10๐‘ก
Checking the answer at t = 0 and at t = ∞ gives x(0) = 3 and x(∞) = 2
๐‘“๐‘œ๐‘Ÿ ๐‘ก = 0.02,
๐‘ฅ(0.02) = 2 + ๐‘’ −0.2 = 2.8187
(5%) What is the percent error of the Euler solution at t = 0.02?
(2.8187-2.81)/2.8187 = 0.0031 (0.31% error)
Note, you can always check your solution by substituting it back into the original
differential equation and see if it satisfies it.
๐(๐Ÿ + ๐’†−๐Ÿ๐ŸŽ๐’• )
+ ๐Ÿ๐ŸŽ(๐Ÿ + ๐’†−๐Ÿ๐ŸŽ๐’• ) = −๐Ÿ๐ŸŽ๐’†−๐Ÿ๐ŸŽ๐’• + ๐Ÿ๐ŸŽ + ๐Ÿ๐ŸŽ๐’†−๐Ÿ๐ŸŽ๐’• = ๐Ÿ๐ŸŽ
๐’…๐’•
Which checks and confirms the solution.
260
2. See Quiz 31 on page 110 in the problems text.
A spring-mass –damper system is shown below; the displacement of the mass is z.
z
spring
mass
damper
The differential equation for the position of the mass is as follows
๐‘งฬˆ + 0.1๐‘งฬ‡ + 0.01๐‘ง = 0
๐‘ง(0− ) = 0 ๐‘š ๐‘งฬ‡ (0− ) = 2 ๐‘š/๐‘ 
(f) (10%) Draw an estimate of z(t). Note, the time constant is 20 s.
z(t)
0
100
t
nd
(g) (15%) Define state variables for this 2 order differential equation and then
write the derivative equations for the state variables, i.e.
๐‘ฅ1 = ๐‘ง
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅ2 = ๐‘งฬ‡
๐‘ฅฬ‡ 2 = −0.01๐‘ฅ1 − 0.1๐‘ฅ2
(h) (25%) Complete the first two time steps of the Euler numerical integration
solution of these state variable equations to get values of the state variables
after two time steps of โˆ†๐‘ก = 1 sec.
๐‘ฅ1 (๐‘ก)
๐‘ฅฬ‡ 2 (๐‘ก)
๐‘ฅ1 (๐‘ก + โˆ†๐‘ก) =
๐‘ฅ1 (๐‘ก) + โˆ†๐‘ก๐‘ฅฬ‡ 1 (๐‘ก)
๐‘ฅ2 (๐‘ก + โˆ†๐‘ก) =
๐‘ฅ2 (๐‘ก) + โˆ†๐‘ก๐‘ฅฬ‡ 2 (๐‘ก)
๐‘ฅ2 (๐‘ก)
๐‘ฅฬ‡ 1 (๐‘ก)
0 0
2
2
-0 – 0.1*2=-0.2
0+1*2=2
2+1*(-0,2)=1.8
1 2
1.8
1.8
-0.01*2-0.1*1.8
= -0.2
2+1*1.8 = 3.8
1.8+1*(-0.2)=1.6
t
261
Homework #52
The schematic for an impact barrier for a car is shown below. Typically, these
barriers are constructed of components that collapse storing and dissipating energy.
For example, partially filled barrels of water; on impact, air in the barrels is
compressed softening the impact by storing energy while the water being forced
out of the crushed barrels dissipates energy. In the schematic, the spring represents
the component that stores the energy and the damper represents the component that
dissipates the energy.
The barrier design specifications are to stop a car with a maximum deceleration not
greater than 4 g’s while avoiding a total collapse of the barrier (D=10 m). If the
barrier totally collapses before the forward velocity goes to zero, there will likely
be very high g’s and damage to the car. Obviously, the possibility of satisfying the
design specifications depends on the size and speed of the car.
D
K
b
Impact Barrier System
A demo MATLAB m-file for simulating the performance of this barrier is
provided in the 4th module in Canvas and can be downloaded for execution in
MATLAB; this code is also listed at the end of this assignment.
Assignment objectives
The first objective of this homework assignment is to teach valuable coding
techniques associated with ode45 using this demo function file. The students are
to study the code and be able to explain the purpose of each line; as with the many
examples in the books, the code can be used as a template for slight modifications
for future simulation problems.
The second objective of this homework assignment is to perform slightly modified
versions of this code to determine how values of b affect the performance of the
barrier in regard to meeting the design specifications for a particular size car and
particular impact velocity.
262
Model for the barrier system
Assuming that the car has just contacted the yellow bumper with initial velocity
Vo, the differential equation for the forward displacement y of the car and bumper
moving as if stuck together is as follows:
๐‘€๐‘ฆฬˆ + ๐‘๐‘ฆฬ‡ + ๐พ๐‘ฆ = 0
๐‘ฆ(0− ) = 0
๐‘ฆฬ‡ (0− ) = ๐‘‰๐‘œ ๐‘ฆ(๐‘ก) < ๐ท ๐‘ฆฬ‡ (๐‘ก) > 0
The model is observed to be a 2nd order linear differential equation that is only
valid if ๐‘ฆ(๐‘ก) < ๐ท. The impact with the bumper is assumed to be at ๐‘ฆ(0− ) = 0
with initial impact velocity ๐‘ฆฬ‡ (0− ) = ๐‘‰๐‘œ .
Before doing any simulations, it is important to understand the model and predict
the results of a valid simulation. First of all, this is not a simulation where the
variables will reach steady state. For example, a plot of y(t) should start at 0 and
hopefully never reach the value D before ๐‘ฆฬ‡ (๐‘ก) goes to zero. Also, if ๐‘ฆฬ‡ (๐‘ก) reaches
zero, it means the forward movement of the car has ended and the simulation
should stop since the barrier will be permanently crushed and the equation is no
longer valid; that is, even if the car would in reality bounce back, the car and
bumper would no longer be in contact. It is also important to predict values for the
deceleration (-๐‘ฆฬˆ ) of the car.
Solving the equation for −๐‘ฆฬˆ gives −๐‘ฆฬˆ = (๐‘๐‘ฆฬ‡ + ๐พ๐‘ฆ)/๐‘€. At time = 0,
−๐‘ฆฬˆ (0) = [๐‘๐‘ฆฬ‡ (0− ) + ๐พ๐‘ฆ(0− )]/๐‘€ = ๐‘๐‘ฆฬ‡ (0− )/๐‘€
So, if it is important for the deceleration to not exceed 4g’s, then, for certain,
selection of b for an initial velocity and car mass must satisfy
๐‘<
4๐‘€๐‘”
4๐‘€๐‘”
− =
๐‘ฆฬ‡ (0 ) ๐‘‰๐‘œ
We don’t know if the deceleration will decrease or increase from this value; we
only know that b cannot be greater than this value otherwise we are guaranteed of
not meeting the design specification. This is the initial guess for a value of b using
the simulation code provided with this assignment.
(4) (25%) Define state variables and write the state variable derivative equations
in terms of M, b, and K required for an ode45 simulation. Confirmed that
you have done it correctly by examining the dx function in the MATLAB
code. What are the state variable initial conditions?
263
(5) (25%) Execute the MATLAB code provided for this assignment. What are
the parameter values used in the code?
M = _______ K = ________ Vo = ______ D = ____ b = _________
For these parameter values, does the design meet the performance specifications? _____
Explain why or why not by showing and referring to the plot. Use the ‘data cursor’.
(6) (50%) By trial-and-error, find the smallest value of b that can be used and still meet the
design specifications for the same values of M, K, Vo and D. bmin = _______
Use the ‘data cursor’ to label the peak value of deceleration.
%Always add comments before the first command to explain how to use
%the function. These comments will appear if you type 'help functionname'
%in the command window. For example: >> help Homework_52
function Homework_52
clear all%makes sure all memory is clear at start of simulation
options=odeset('events',@StopSim);%look of event to be defined in function
StopSim
M=1000;K=2000;Vo=23;D=10;g=9.81;% Fixed parameter values
b=4*M*g/Vo %b design parameter value to be determined
[t,x]=ode45(@eqns,[0 3],[0 Vo],options);%runs simulation with events to
% stop it. Final time = 3 guessing this is more than enough needed
% initial values of state variables of 0 and Vo.
y=x(:,1);yd=x(:,2);ydd=-(b*yd+K*y)/M;%Assigning natural variable names
%to the outputs of interest.
plot(t,y/D,'r',t,yd/Vo,'k--',t,-ydd/g,'r.','linewidth',2)% Note that the
% variables being plotted have been normalized so they can go on a
% single plot for easy comparison. Without normalizing, resolution
% for some data will be lost and the results worthless.
grid
xlabel('time, s','fontsize',18)
ylabel('normalized variables','fontsize',18)
legend('normalized displacement, y/D','normalized velocity, y_d/V_o',...
'normalize deceleration, y_d_d/g','location','best')%The underscore prints
%prints a subscript; use ^ for superscripts; use \ for greek symbols,
%for example \phi or \PHI. Click on figure properties under 'Edit' in
%a plot to edit the size of the axis which will change the legend fonts.
function dx=eqns(t,x)
Y=x(1);Yd=x(2);%So we can write dx equations
%in terms of natural variables Y and Yd
dx=zeros(2,1);%Basically defines how many dx equations to look for
dx(1)=Yd;%We could have used dx(1)=x(2)but then
%we would have to remember the definition of x(2)
dx(2)=-(b*Yd+K*Y)/M;%Note, this is the equation for acceleration
%which will be needed when generating the plots
end
function [Val,Ister,Dir]=StopSim(t,x)
%there are two possible events to stop the simulation before final time
Ister(1)=1;Val(1)=D-x(1);Dir(1)=-1;%Stops the simulation if x(1)=D
Ister(2)=1;Val(2)=x(2);Dir(1)=-1;%Stops the simulation if x(2)=0
end
end
264
Homework #52 Solution
The schematic for an impact barrier for a car is shown below. Typically, these
barriers are constructed of components that collapse storing and dissipating energy.
For example, partially filled barrels of water; on impact, air in the barrels is
compressed softening the impact by storing energy while the water being forced
out of the crushed barrels dissipates energy. In the schematic, the spring represents
the component that stores the energy and the damper represents the component that
dissipates the energy.
The barrier design specifications are to stop a car with a maximum deceleration not
greater than 4 g’s while avoiding a total collapse of the barrier (D=10 m). If the
barrier totally collapses before the forward velocity goes to zero, there will likely
be very high g’s and damage to the car. Obviously, the possibility of satisfying the
design specifications depends on the size and speed of the car.
D
K
b
Impact Barrier System
A demo MATLAB m-file for simulating the performance of this barrier is
provided in the 4th module in Canvas and can be downloaded for execution in
MATLAB; this code is also listed at the end of this assignment.
Assignment objectives
The first objective of this homework assignment is to teach valuable coding
techniques associated with ode45 using this demo function file. The students are
to study the code and be able to explain the purpose of each line; as with the many
examples in the books, the code can be used as a template for slight modifications
for future simulation problems.
The second objective of this homework assignment is to perform slightly modified
versions of this code to determine how values of b affect the performance of the
barrier in regard to meeting the design specifications for a particular size car and
particular impact velocity.
265
Model for the barrier system
Assuming that the car has just contacted the yellow bumper with initial velocity
Vo, the differential equation for the forward displacement y of the car and bumper
moving as if stuck together is as follows:
๐‘€๐‘ฆฬˆ + ๐‘๐‘ฆฬ‡ + ๐พ๐‘ฆ = 0
๐‘ฆ(0− ) = 0
๐‘ฆฬ‡ (0− ) = ๐‘‰๐‘œ ๐‘ฆ(๐‘ก) < ๐ท ๐‘ฆฬ‡ (๐‘ก) > 0
The model is observed to be a 2nd order linear differential equation that is only
valid if ๐‘ฆ(๐‘ก) < ๐ท. The impact with the bumper is assumed to be at ๐‘ฆ(0− ) = 0
with initial impact velocity ๐‘ฆฬ‡ (0− ) = ๐‘‰๐‘œ .
Before doing any simulations, it is important to understand the model and predict the
results of a valid simulation. First of all, this is not a simulation where the variables will
reach steady state. For example, a plot of y(t) should start at 0 and hopefully never reach
the value D before ๐‘ฆฬ‡ (๐‘ก ) goes to zero. Also, if ๐‘ฆฬ‡ (๐‘ก ) reaches zero, it means the forward
movement of the car has ended and the simulation should stop since the barrier will be
permanently crushed and the equation is no longer valid; that is, even if the car would in
reality bounce back, the car and bumper would no longer be in contact. It is also
important to predict values for the deceleration (-๐‘ฆฬˆ ) of the car. Solving the equation for
−๐‘ฆฬˆ gives −๐‘ฆฬˆ = (๐‘๐‘ฆฬ‡ + ๐พ๐‘ฆ)/๐‘€. At time = 0,
−๐‘ฆฬˆ (0) = [๐‘๐‘ฆฬ‡ (0− ) + ๐พ๐‘ฆ(0− )]/๐‘€ = ๐‘๐‘ฆฬ‡ (0− )/๐‘€
So, if it is important for the deceleration to not exceed 4g’s, then, for certain, selection of b for an
initial velocity and car mass must satisfy
4๐‘€๐‘”
4๐‘€๐‘”
๐‘<
− =
๐‘ฆฬ‡ (0 ) ๐‘‰๐‘œ
We don’t know if the deceleration will decrease or increase from this value; we only know that b
cannot be greater than this value otherwise we are guaranteed of not meeting the design
specification. This is the initial guess for a value of b using the simulation code provided with
this assignment in part (2) to get the first graph.
(7) (25%) Define state variables and write the state variable derivative equations in terms of
M, b, and K required for an ode45 simulation. Confirmed that you have done it correctly
by examining the dx function in the MATLAB code. What are the state variable initial
conditions?
๐พ๐‘ฅ1 ๐‘๐‘ฅ2
๐‘ฅ1 = ๐‘ฆ ๐‘ฅ2 = ๐‘ฆฬ‡
๐‘ฅฬ‡ 1 = ๐‘ฅ2 ๐‘ฅฬ‡ 2 = −
−
๐‘ฅ1 (0− ) = 0 ๐‘ฅ2 (0− ) = 24
๐‘€
๐‘€
(8) (25%) Execute the MATLAB code provided for this assignment. What are the
parameter values used in the code?
M = 1000 kg K = 2000 N/m Vo = 24 m/s D = 10 m
For b = 0.75(4Mg/Vo)=1226 Ns/m, the graph is shown below.
266
Using b=0.75*4Mg/Vo the velocity=0 at y=10m
3.5
normalized variables
3
X: 0.1635
Y: 3.104
2.5
normalized displacement, y/D
normalized velocity, y d/Vo
2
normalize deceleration, y dd/g
1.5
X: 0.8807
Y: 0.989
1
0.5
X: 0.8807
Y: 0
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
time, s
For these parameter values, does the design meet the performance specifications? Yes
Explain why or why not by showing and referring to the plot. Use the ‘data cursor’.
As shown in the figure above, the normalized displacement is only 0.989 which means
y=9.89 m which is less than 10 m when the velocity goes to zero. The peak deceleration is
3.104 g’s.
%Always add comments before the first command to explain how to use
%the function. These comments will appear if you type 'help functionname'
%in the command window. For example: >> help Homework_3_3360_Spr_2021
function Homework_3_3360_Spr_2021
clear all%makes sure all memory is clear at start of simulation
format shortg % my preferred format
options=odeset('events',@StopSim);%look of event to be defined in function StopSim
M=1000;K=2000;Vo=24;D=10;g=9.81;% Fixed parameter values
b=0.75*4*M*g/Vo %b design parameter value to be determined
[t,x]=ode45(@eqns,[0 3],[0 Vo],options);%runs simulation with events to
% stop it. Final time = 3 guessing this is more than enough needed
% initial values of state variables of 0 and Vo.
y=x(:,1);yd=x(:,2);ydd=-(b*yd+K*y)/M;%Assigning natural variable names
%to the outputs of interest.
plot(t,y/D,'r',t,yd/Vo,'k--',t,-ydd/g,'r.','linewidth',2)% Note that the
% variables being plotted have been normalized so they can go on a
% single plot for easy comparison. Without normalizing, resolution
% for some data will be lost and the results worthless.
grid
xlabel('time, s','fontsize',18)
267
ylabel('normalized variables','fontsize',18)
legend('normalized displacement, y/D','normalized velocity, y_d/V_o',...
'normalize deceleration, y_d_d/g','location','best')%The underscore prints
%prints a subscript; use ^ for superscripts; use \ for greek symbols,
%for example \phi or \PHI. Click on figure properties under 'Edit' in
%a plot to edit the size of the axis which will change the legend fonts.
function dx=eqns(t,x)
Y=x(1);Yd=x(2);%So we can write dx equations
%in terms of natural variables Y and Yd
dx=zeros(2,1);%Basically defines how many dx equations to look for
dx(1)=Yd;%We could have used dx(1)=x(2)but then
%we would have to remember the definition of x(2)
dx(2)=-(b*Yd+K*Y)/M;%Note, this is the equation for acceleration
%which will be needed when generating the plots
end
function [Val,Ister,Dir]=StopSim(t,x)
%there are two possible events to stop the simulation before final time
Ister(1)=1;Val(1)=D-x(1);Dir(1)=-1;%Stops the simulation if x(1)=D
Ister(2)=1;Val(2)=x(2);Dir(1)=-1;%Stops the simulation if x(2)=0
end
end
(50%) By trial-and-error, find the smallest value of b that can be used and still meet the design
specifications for the same values of M, K, Vo and D.
As shown on the plot below using b = (0.73)4Mg/Vo = 1193.6 Ns/m the performance is
slightly out of specifications since y/D reaches 1 and the velocity is still not zero.
Use the ‘data cursor’ to label the peak value of deceleration. 3.057 g’s still within spec. Based
on this result, the minimum value of b is 0.74 or 0.75 times 4Mg/Vo.
268
Using b=0.73*4Mg/Vo
3.5
normalized variables
3
X: 0.2385
Y: 3.057
2.5
normalized displacement, y/D
normalized velocity, y d/Vo
2
normalize deceleration, y dd/g
1.5
X: 0.8627
Y: 1
1
0.5
X: 0.8627
Y: 0.01914
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
time, s
The next plot demonstrates what happens if the value of b is 25% greater than 4Mg/Vo, i.e.
B = 1.25(4Mg/Vo). The velocity does reach zero at the 7.6 m displacement, which is within
specifications, but the peak deceleration is 5 g’s.
Using b=1.25*4Mg/Vo the velocity=0 at y=10m
5
normalized variables
normalized displacement, y/D
normalized velocity, y d/Vo
4
normalize deceleration, y dd/g
3
2
X: 0.7764
Y: 0.7642
1
0
X: 0.7807
Y: -3.238e-17
-1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
time, s
269
Homework #53
1. (20%) Use the quadratic formula to factor each characteristic polynomial below to find
the eigenvalues and time constants. For complex eigenvalues, determine the damping ratio
and the undamped natural frequency. In each case, check the results by remultiplying to
see if you get the original polynomial. Note, using a calculator or computer to factor these
polynomials will be a mistake because you won’t be able to use one on an exam and you
will need to have memorized the quadratic formula and the following general form:
๐ฌ๐Ÿ + ๐Ÿ๐›…๐›š๐ง ๐ฌ + ๐›š๐Ÿ๐ง
Polynomial
๐‘ซ๐Ÿ + ๐Ÿ•๐‘ซ + ๐Ÿ๐ŸŽ
๐Ÿ‘๐‘ซ๐Ÿ + ๐Ÿ๐Ÿ๐‘ซ + ๐Ÿ‘๐ŸŽ
๐’”๐Ÿ + ๐Ÿ”๐’” + ๐Ÿ๐Ÿ“
๐Ÿ๐’”๐Ÿ + ๐Ÿ๐Ÿ๐’” + ๐Ÿ“๐ŸŽ
(๐’” + ๐Ÿ‘)๐Ÿ + ๐Ÿ’๐Ÿ
Eigenvalues Time constant Damping ratio ๐œน Undamped natural
frequency ๐Ž๐’
2. This problem is the same as Homework 30 on page 186 in the problems book with a
slight addition associated with a linearized solution for accuracy comparison.
An impact barrier for a car is shown below. When the car contacts the gray bumper, the
yellow piston starts moving forward compressing the fluid in the cylinder due to the
movement of the piston to the left. Also, the rise in pressure forces the fluid through the
orifice represented by flow rate Q out of the cylinder. Hopefully, the barrier will stop a car
with an initial impact speed of 24 m/s without the deceleration exceeding 5 g’s and without
total barrier collapse corresponding to y = 10 m. To decrease the g levels of deceleration, a
rubber ball or balloon filled with air has been placed in the water in the cylinder to
increase the compressibility of the fluid in the cylinder.
y
Q
10
water
air
The equations for the displacement y of the piston and car, for the pressure P in the
cylinder, and for the flow rate Q m3/s are as follows:
๐’šฬˆ + (๐Ÿ“๐’™๐Ÿ๐ŸŽ−๐Ÿ“ )๐‘ท = ๐ŸŽ
(๐Ÿ๐ŸŽ − ๐’š)๐‘ทฬ‡ = (๐Ÿ๐’™๐Ÿ๐ŸŽ๐Ÿ– )(๐ŸŽ. ๐ŸŽ๐Ÿ“๐’šฬ‡ − ๐‘ธ)
๐‘ธ = (๐Ÿ–. ๐Ÿ—๐’™๐Ÿ๐ŸŽ−๐Ÿ’ )√|๐‘ท| ∗ ๐’”๐’Š๐’ˆ๐’(๐‘ท)
๐’š(๐ŸŽ− ) = ๐ŸŽ ๐’Ž
๐’šฬ‡ (๐ŸŽ− ) = ๐Ÿ๐Ÿ’ ๐’Ž/๐’”
๐‘ท(๐ŸŽ− ) = ๐ŸŽ ๐‘ต/๐’Ž๐Ÿ
270
In the equation for Q, ‘sign(P)’ is a programming command that produces +1 if P>0 and -1
if P<0. Thus, Q can be positive or negative without computing errors associated with
calculating the square root of negative numbers. Use g = 9.81 m/s2.
(e) (5%) What are the unknowns in these equations?
(f) (20%) Define state variables and write the derivative equations for your state
variables in a suitable format for ode45.
(g) (20%) Create a MATLAB ode45 numerical simulation of these equations and plot
on the same graph ๐’š(๐’•)/๐Ÿ๐ŸŽ, ๐’šฬ‡ (๐’•)/๐Ÿ๐Ÿ’, ๐’‚๐’๐’… ๐’šฬˆ (๐’•)/๐’ˆ. Use event functions to end the
simulation should ๐’š(๐’•) ๐ข๐ง๐œ๐ซ๐ž๐š๐ฌ๐ž๐ฌ ๐ญ๐จ ๐Ÿ๐ŸŽ ๐จ๐ซ ๐’šฬ‡ (๐’•) ๐’…๐’†๐’„๐’“๐’†๐’‚๐’”๐’†๐’” ๐’•๐’ ๐ŸŽ.
(h) (5%) From examination of your plots, what can you conclude about the
performance of this barrier system? For example, does it meet the design
specifications?
(i) (20%) Repeat (c) but this time use a linear approximation for the equation for Q;
approximate √๐‘ท with a straight-line for values of P between the initial value and
the maximum value observed in (c); use the command ‘max(P)’ to get the maximum
value. Use the ‘hold on’ command to put these plots on the same graph in (c) for
comparison using red for the nonlinear model and black for the linear
approximation model.
(j) (5%) What can you say about the accuracy of the linearized solution?
(5%) Why does the linearized solution run longer?
Suggested portion of MATAB code for running and plotting both models on same graph:
[t,X]=ode45(@barrier3360,[0 2],[0 24 0],options);
plot(t,X(:,1)/10,'r-',t,X(:,2)/24,'r--',t,(5e-5)*X(:,3)/9.8,'r:','LineWidth',2)
hold on
clear t X
[t,X]=ode45(@barrier3360L,[0 2],[0 24 0],options);
plot(t,X(:,1)/10,'k-',t,X(:,2)/24,'k--',t,(5e-5)*X(:,3)/9.8,'k:','LineWidth',2)
xlabel('Time, sec.','fontsize',18)
ylabel('Normalized outputs of interest','fontsize',18)
title('Homework 4, Crash Barrier Simulation','fontsize',18)
legend('nonlinear displacement/10','nonlinear velocity/24','nonlinear deceleration/g',...
'linear displacement/10','linear velocity/24',...
'linear deceleration/g','Location','Best')
grid
271
Homework #53 Solution
1. (20%) Use the quadratic formula to factor each characteristic polynomial below to find
the eigenvalues and time constants. For complex eigenvalues, determine the damping ratio
and the undamped natural frequency. In each case, check the results by remultiplying to
see if you get the original polynomial. Note, using a calculator or computer to factor these
polynomials will be a mistake because you won’t be able to use one on an exam and you
will need to have memorized the quadratic formula and the following general form:
๐ฌ๐Ÿ + ๐Ÿ๐›…๐›š๐ง ๐ฌ + ๐›š๐Ÿ๐ง
Eigenvalues Time constant(s) Damping ratio ๐œน Undamped natural
frequency ๐Ž๐’ rad/s
๐Ÿ
0.5 and 0.2
Not applicable
Not applicable
๐‘ซ + ๐Ÿ•๐‘ซ + ๐Ÿ๐ŸŽ -2 and -5
๐Ÿ
0.5 and 0.2
Not applicable
Not applicable
๐Ÿ‘๐‘ซ + ๐Ÿ๐Ÿ๐‘ซ + ๐Ÿ‘๐ŸŽ -2 and -5
๐Ÿ
0.333
0.6
5
−3 ± ๐‘—4
๐’” + ๐Ÿ”๐’” + ๐Ÿ๐Ÿ“
๐Ÿ
0.333
0.6
5
−3 ± ๐‘—4
๐Ÿ๐’” + ๐Ÿ๐Ÿ๐’” + ๐Ÿ“๐ŸŽ
๐Ÿ
๐Ÿ
0.333
0.6
5
−3 ± ๐‘—4
(๐’” + ๐Ÿ‘) + ๐Ÿ’
Note: Frequencies and damping ratios only have meaning for complex roots.
Polynomial
2. This problem is the same as Homework 30 on page 186 in the problems book with a
slight addition associated with a linearized solution for accuracy comparison.
An impact barrier for a car is shown below. When the car contacts the gray bumper, the
yellow piston starts moving forward compressing the fluid in the cylinder due to the
movement of the piston to the left. Also, the rise in pressure forces the fluid through the
orifice represented by flow rate Q out of the cylinder. Hopefully, the barrier will stop a car
with an initial impact speed of 24 m/s without the deceleration exceeding 5 g’s and without
total barrier collapse corresponding to y = 10 m. To decrease the g levels of deceleration, a
rubber ball or balloon filled with air has been placed in the water in the cylinder to
increase the compressibility of the fluid in the cylinder.
y
Q
10
water
air
The equations for the displacement y of the piston and car, for the pressure P in the
cylinder, and for the flow rate Q m3/s are as follows:
๐’šฬˆ + (๐Ÿ“๐’™๐Ÿ๐ŸŽ−๐Ÿ“ )๐‘ท = ๐ŸŽ
(๐Ÿ๐ŸŽ − ๐’š)๐‘ทฬ‡ = (๐Ÿ๐’™๐Ÿ๐ŸŽ๐Ÿ– )(๐ŸŽ. ๐ŸŽ๐Ÿ“๐’šฬ‡ − ๐‘ธ)
๐‘ธ = (๐Ÿ–. ๐Ÿ—๐’™๐Ÿ๐ŸŽ−๐Ÿ’ )√|๐‘ท| ∗ ๐’”๐’Š๐’ˆ๐’(๐‘ท)
๐’š(๐ŸŽ− ) = ๐ŸŽ ๐’Ž
๐’šฬ‡ (๐ŸŽ− ) = ๐Ÿ๐Ÿ’ ๐’Ž/๐’”
๐‘ท(๐ŸŽ− ) = ๐ŸŽ ๐‘ต/๐’Ž๐Ÿ
272
In the equation for Q, ‘sign(P)’ is a programming command that produces +1 if P>0 and -1
if P<0. Thus, Q can be positive or negative without computing errors associated with
calculating the square root of negative numbers. Use g = 9.81 m/s2.
(k) (5%) What are the unknowns in these equations? y, P and Q
(l) (20%) Define state variables and write the derivative equations for your state variables in
a suitable format for ode45.
x1 = y x2 = yฬ‡ x3 = P
Writing the derivatives in terms of the natural variables for clarification and checking:
function dx=barrier3360(t,x)
dx=zeros(3,1);
y=x(1);yd=x(2);P=x(3);%Allows writing dx eqn’s using natural variables
๐ = (๐Ÿ–. ๐Ÿ—๐ฑ๐Ÿ๐ŸŽ−๐Ÿ’ )√|๐| ∗ ๐ฌ๐ข๐ ๐ง(๐);
๐’…๐’™(๐Ÿ) = ๐’š๐’…;
๐’…๐’™(๐Ÿ) = −(๐Ÿ“๐’† − ๐Ÿ“) ∗ ๐‘ท;
๐’…๐’™(๐Ÿ‘) = (๐Ÿ๐’†๐Ÿ–) ∗ (๐ŸŽ. ๐ŸŽ๐Ÿ“ ∗ ๐’š๐’… − ๐‘ธ)/(๐Ÿ๐ŸŽ − ๐’š);
end
(m)(20%) Create a MATLAB ode45 numerical simulation of these equations and plot on the
same graph ๐‘ฆ(๐‘ก)/10, ๐‘ฆฬ‡ (๐‘ก)/24, ๐‘Ž๐‘›๐‘‘ ๐‘ฆฬˆ (๐‘ก)/๐‘”. Use event functions to end the simulation
should ๐‘ฆ(๐‘ก) increases to 10 or ๐‘ฆฬ‡ (๐‘ก) ๐‘‘๐‘’๐‘๐‘Ÿ๐‘’๐‘Ž๐‘ ๐‘’๐‘  ๐‘ก๐‘œ 0.
Graph and code shown below.
(n) (5%) From examination of your plots, what can you conclude about the performance of
this barrier system? For example, does it meet the design specifications?
It stops the car before the barrier bottoms out but the deceleration is slightly greater
than 5 g’s. So, it doesn’t totally meet the design specifications.
(o) (20%) Repeat (c) but this time use a linear approximation for the equation for Q;
approximate √๐‘ƒ with a straight-line for values of P the initial value and the maximum
value observed in (c); use the command ‘max(P)’ to get the maximum value. Use the
‘hold on’ command to put these plots on the same graph in (c) for comparison using red
for the nonlinear model and black for the linear approximation model. See graph and
code below. Pmax was found to be 1.087e6. √๐‘ท ≈ ๐‘ท/√๐Ÿ. ๐ŸŽ๐Ÿ–๐Ÿ•๐’†๐Ÿ”
(p) (5%) What can you say about the accuracy of the linearized solution?
The linearized solution is reasonably accurate.
(5%) Why does the linearized solution run longer?
It runs longer because the displacement never reaches 10 m and the velocity is
exponentially approaching zero but never gets there.
273
Homework 4, Crash Barrier Simulation
Normalized outputs of interest
6
nonlinear displacement/10
nonlinear velocity/24
nonlinear deceleration/g
linear displacement/10
linear velocity/24
linear deceleration/g
5
4
3
2
1
0
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Time, sec.
function Homework_4_3360_Apr_2021
clear all
format shortg
options=odeset('events',@StopSim8);
[t,X]=ode45(@barrier3360,[0 2],[0 24 0],options);
plot(t,X(:,1)/10,'r-',t,X(:,2)/24,'r--',t,(5e-5)*X(:,3)/9.8,'r:','LineWidth',2)
hold on
Pm=max(x(:,3))
clear t X
[t,X]=ode45(@barrier3360L,[0 2],[0 24 0],options);
plot(t,X(:,1)/10,'k-',t,X(:,2)/24,'k--',t,(5e-5)*X(:,3)/9.8,'k:','LineWidth',2)
xlabel('Time, sec.','fontsize',18)
ylabel('Normalized outputs of interest','fontsize',18)
title('Homework 4, Crash Barrier Simulation','fontsize',18)
legend('nonlinear displacement/10','nonlinear velocity/24',...
'nonlinear deceleration/g',...
'linear displacement/10','linear velocity/24',...
'linear deceleration/g','Location','Best')
Grid
dx(function dx=barrier3360(t,x)
y=x(1);yd=x(2);P=x(3);%allows writing equations in terms of y, yd, and P
dx=zeros(3,1);
dx(1)=yd;
dx(2)=-(5e-5)*P;
Q=(8.9e-4)*sqrt(abs(P))*sign(P);
dx(3)=2e8*(.05*yd-Q)/(10-y);
end
function dx=barrier3360L(t,x)
y=x(1);yd=x(2);P=x(3);%allows writing equations in terms of y, yd, and P
dx=zeros(3,1);
dx(1)=yd;
dx(2)=-(5e-5)*P;
Q=(8.9e-4)*P/sqrt(Pm); % Using straight-line approximation for sqrt(P)
dx(3)=2e8*(.05*yd-Q)/(10-y);
end
function[Val,Ister,Dir]=StopSim8(t,x)
Val(1)=x(1)-10;Ister(1)=1;Dir(1)=0;%stops simulation if y=10
Val(2)=x(2);Ister(2)=1;Dir(2)=0;%stops simulation if velocity=0
end
end
274
Homework #54
The equations for the water flowing through a long line between two tanks and the height of the
water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 − ๐ป2 = 250๐‘„ฬ‡
H1
๐ป1 (0− ) = 2
๐ป2 (0− ) = 5
๐‘„(0− ) = 0
H2
Q
(a) (5%) List the unknowns and confirm you have enough equations to solve for any or all of the unknowns.
(b) (10%) Laplace transform each of these three equations.
(c) (15%) Eliminate Q and reduce the equations down to two equations with unknowns H1(s) and H2(s) .
Dropping the notation ‘(s)’ since every term is in the Laplace domain and to minimize the writing:
(d) (10%) Reduce the equations down to one equation for the unknown H1(s) by solving for
H2(s) in the one of the equations in (c) and putting the equation for H2(s) in the other equation.
Show that
6666.6๐‘  2 + 4
๐ป1 (๐‘ ) =
๐‘ (3333.3๐‘  2 + 1)
(e) (5%) Use the quadratic formula to get the poles of H1(s)?
(5%) What does the final value theorem give for H1(∞).
(5%) Explain why the final value theorem is likely to give a misleading answer.
(f) (10%) Use the initial value theorem to check if your H1(s) gives the correct the initial value.
(5%) Does your H1(s) give the correct initial value for H1? If not, find your error.
(g) (10%) Use ‘pfract’ in MATLAB to express H1(s) in partial fraction format.
(h) (15%) Use the techniques in Lecture #11 (pages 26-34 in the book) to find the inverse
Laplace of H1(s) to get an equation for H1(t).
(5%) Substitute t = 0 and t = ∞ into your equation for H1(t) to see if you get the correct initial
and final values of H1. Explain why the solution is correct or incorrect.
275
Homework #55
The objective of this assignment is to teach and demonstrate the value and simplicity of using
frequency response for sinusoidal inputs to get the steady state output instead of having to find the
inverse Laplace transform or having to do a MATLAB simulation to get the same results.
A pile driver is used to drive the pile shown below into the ground. This is a study to determine the
significance of the pounding frequency of the input force F on the amplitude of the penetration force f
at the ground. The total mass of the pile is M=15,000 Kg. The stiffness of the pile is K=AE/L = 1.5e8 N/m;
the pile length is L=15 m. Although a 5 or more lumped mass model would be preferred for the study,
for simplicity, only 2 lumped masses will be used. Assume b = 2e5 Ns/m for the damping coefficient.
F
M /2
z
2K
b
M
K
w
M /2
b
2K
f
It can be shown that the equations for the displacements z and w of the masses and the
equation for the penetration force f at the ground are:
2
(๐‘๐‘คฬ‡ + 2๐พ๐‘ค + ๐น − 2๐พ๐‘ง − ๐‘๐‘งฬ‡ )
๐‘€
2
๐‘คฬˆ = (๐‘๐‘งฬ‡ + 2๐พ๐‘ง − 4๐พ๐‘ค − 2๐‘๐‘คฬ‡ )
๐‘€
๐‘“ = ๐‘๐‘คฬ‡ + 2๐พ๐‘ค + ๐‘€๐‘”
๐‘งฬˆ =
(a) (15%) Using symbolic math in MATLAB, show that the Laplace transform equation for the
force at the ground associated with the pounding force F at the top is
711.11๐‘  2 + 2.133๐‘’6๐‘  + 1.6๐‘’9
๐‘“(๐‘ ) = [ 4
] ๐น(๐‘ )
๐‘  + 80๐‘  3 + 1.2067๐‘’5๐‘  2 + 2.133๐‘’6๐‘  + 1.6๐‘’9
Note, the equation for the ground force f includes the weight of the pile as an additional input.
However, we are only interested in the transfer function for the input force F.
(b) (5%) What is the transfer function for f?
(c) (5%) What is the characteristic polynomial for this system?
276
(d) (5%) What is the DC gain of this transfer function? Explain why this value for the DC gain
makes sense.
(e) (5%) What are the eigenvalues for this system? The ‘damp’ command in the code in (a)
above gives
(f) (5%) What are the resonant frequencies (damped natural frequencies) for the beam?
(g) (5%) What are the damping ratios for this system?
(h) (5%) Is the system over damped or lightly damped or what? What is the significance of the
damping level in regard to force (or stress) oscillations up and down the beam?
(i) (5%) Based on examination of the frequency response (bode plot) of the transfer function,
what pounding frequency will produce the largest amplitude of the force at the ground?
(j) (10%) Suppose the pounding force is sinusoidal with the first resonant frequency found in (i)
with an amplitude of 500 N. What will be the steady state amplitude and frequency of the force
at the ground?
(3%) Is the amplitude of the force at the ground greater or less than the input force
amplitude?
(2%) How much bigger or smaller?
(k) (7%) Confirm your answer in (j) using lsim in MATLAB.
(l) (8%) Suppose the pounding force is a series of pulses with amplitude of 500 and with the
period of the pulses corresponding to the frequency in (i). Use lsim in MATAB to simulate the
system to determine the steady state amplitude of the force at the ground due to F. Use the
(homemade) MATLAB function PulseSeries.m in Canvas to generate the pulse series. See
example in book in Section 2.8.4.1.
To generate a series of pulses, certain parameters must be specified: N, m and the number of
points per pulse (NumPPP) must be integers. I suggest m=5 which means the width of the pulse
will be 1/m = 1/5 of the pulse period mT as shown on the schematic below. Also, if NumPPP =
10, then there will be enough points to accurately define the shape of the pulse. The fundamental
frequency of the pulse series is 2๐œ‹/๐‘š๐‘‡ rad/s; this needs to match the first resonant frequency of
the beam model; thus, ๐‘‡ = 2๐œ‹/124๐‘š = 2๐œ‹/(124 ∗ 5) = 0.01 s. The total simulation time is
NmT where N is the number of pulses to be included in the simulation. The simulation time
needs to be great enough to be able to observe some of the steady state oscillations. Since the
largest time constant is 1/5.09 = 0.2 s, the simulation needs to run at least 1.5 s which will give
about 0.5 s of steady state oscillations or 0.5/(mT) = 0.5/(0.05) = 10 cycles of ground force
pulses. So, N = 1.5/mT = 30.
277
f(t)
T
F
t
mT
(m) (3%) Compare the amplitudes from (j) and (l).
(3%) Which one is greater and why do you think it is?
(n) How critical is the sinewave-pounding-frequency to the performance of the pile driver?
(3%) For example, how much do your answers in (j) change if the pounding frequency is
increased by 10%?
(3%) What if the pounding frequency is decreased by 10%?
(3%) What does this tell you about the significance of input frequencies at the resonant
frequencies of the system.
Homework #54 Solution
The equations for the water flowing through a long line between two tanks and the height of the
water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 − ๐ป2 = 250๐‘„ฬ‡
๐ป1 (0− ) = 2
๐ป2 (0− ) = 5
๐‘„(0− ) = 0
H1
H2
Q
(a) (5%) List the unknowns and confirm you have enough equations to solve for any or all of the unknowns.
H1 H2 and Q
(b) (10%) Laplace transform each of these three equations.
−๐‘„(๐‘ ) − 20[๐‘ ๐ป1 (๐‘ ) − 2] = 0
๐‘„(๐‘ ) − 40[๐‘ ๐ป2 (๐‘ ) − 5] = 0
๐ป1 (๐‘ ) − ๐ป2 (๐‘ ) = 250[๐‘ ๐‘„(๐‘ ) − 0]
278
(c) (15%) Eliminate Q(s) and reduce the equations down to two equations with unknowns H1(s) and H2(s) .
Dropping the notation ‘(s)’ since every term is in the Laplace domain and to minimize the writing:
๐‘„=
๐ป1 − ๐ป2
250๐‘ 
Thus,
−
๐ป1 − ๐ป2
− 20[๐‘ ๐ป1 − 2] = 0
250๐‘ 
๐ป1 − ๐ป2
− 40[๐‘ ๐ป2 − 5] = 0
250๐‘ 
(d) (10%) Reduce the equations down to one equation for the unknown H1(s) by solving for
H2(s) in the one of the equations and putting the equation for H2(s) in the other equation. Show
that
6666.6๐‘  2 + 4
๐ป1 (๐‘ ) =
๐‘ (3333.3๐‘  2 + 1)
Solving for H2 in the first equation: H2 = 5,000s2H1 + H1 -10,000s
Putting this equation for H2 in the other equation gives
๐ป1 (๐‘ ) =
10๐‘’7๐‘  2 + 6๐‘’4
6666.6๐‘  2 + 4
2๐‘  2 + 0.0012
=
=
๐‘ (5๐‘’7๐‘  2 + 1.5๐‘’4) ๐‘ (3333.3๐‘  2 + 1) ๐‘ (๐‘  2 + 0.0003)
Symbolic math in MATLAB can also be used to get this solution.
syms s H1 Q H2
E1=-Q-20*(s*H1-2)==0;
E2=Q-40*(s*H2-5)==0;
E3=H1-H2==250*s*Q;
h=solve(E1,E2,E3,H1,H2,Q);
pretty(h.H1)
4(5000๐‘  2 + 3)
6666.6๐‘  2 + 4
=
๐‘ (10000๐‘  2 + 3) ๐‘ (3333.3๐‘  2 + 1)
(e) (5%) What are the poles of H1(1)?
Using the quadratic formula: −0 ± √0 − 0.0003 = ±๐‘—0.0173 The other pole is s = 0.
(5%) What does the final value theorem give for H1(∞).
๐ป1 (∞) = ๐‘ ๐ป1 (๐‘ )๐‘ =0 = ๐‘ 
10๐‘’7๐‘  2 + 6๐‘’4
6
=
=4
2
๐‘ (5๐‘’7๐‘  + 1.5๐‘’4)๐‘ =0 1.5
279
(5%) Explain why the final value theorem is likely to give a misleading answer.
H1(s) has a complex pair of poles with a zero-real part. This means that a portion of H1(t) will
oscillate forever and never go to a constant. The final value theorem cannot be used for cases of
poles with positive real parts or complex poles with zero real parts.
(f) (10%) Use the initial value theorem to check if your H1(s) gives the correct the initial value.
๐ป1 (0+ ) = ๐‘ ๐ป1 (๐‘ )๐‘ =∞ = ๐‘ 
10๐‘’7๐‘  2 + 6๐‘’4
10๐‘’7
=
=2
2
๐‘ (5๐‘’7๐‘  + 1.5๐‘’4)๐‘ =0
5๐‘’7
๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘ 
(5%) Does your H1(s) give the correct initial value for H1? Yes
(g) (10%) Express H1(s) in partial fraction format.
>> den=[5e7 0 1.5e4 0];
>> num=[1e8 0 6e4];
>> H1=tf(num,den)
H1 =
1e08 s^2 + 60000
----------------------5e07 s^3 + 15000 s
>> pfract(num,den)
4
-2 s
H1(s) = ---- + -----------s
s^2 + 0.0003
4
-2s
= ----- + -------------------------------s
(s + j0.0173)(s – j0.0173)
(h) (15%) Use the techniques in Lecture #11 to find the inverse Laplace of H1(s) to find an
equation for H1(t).
๐‘’ 0๐‘ก
|−2(๐‘—0.0173)|๐‘ ๐‘–๐‘›(00173๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’(−2(๐‘—0.0173))
0.0173
๐œ‹
= 4 + 2๐‘ ๐‘–๐‘›(0.0173๐‘ก − )
2
๐ป1 (๐‘ก) = 4๐‘’ 0๐‘ก +
(5%) Substitute t = 0 and t = ∞ into your equation for H1(t) to see if you get the correct initial
and final values of H1.
At t = 0:
280
๐œ‹
๐ป1 (0) = 4 + 2๐‘ ๐‘–๐‘›(0 − ) = 4 − 2 = 2 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘–๐‘  ๐‘๐‘œ๐‘Ÿ๐‘Ÿ๐‘’๐‘๐‘ก
2
At t = ∞:
๐œ‹
๐ป1 (๐‘ก)๐‘ก→∞ = 4 + 2๐‘ ๐‘–๐‘›(0.0173๐‘ก − )
2
๐‘ ๐‘–๐‘›๐‘’๐‘ค๐‘Ž๐‘ฃ๐‘’ ๐‘œ๐‘ ๐‘๐‘–๐‘™๐‘™๐‘Ž๐‘ก๐‘–๐‘›๐‘” ๐‘Ž๐‘๐‘œ๐‘ข๐‘ก 4
This makes since the final value theorem gave a constant of 4 which is consistent with a
sinewave oscillating about an average value of 4.
Note, in reality, viscous flow through the pipe will cause the water levels to eventually settle to
equal heights of 4 m. We could have predicted this final value since the water volume remains
constant which is the sum of the water heights times the tank areas at any time.
281
Homework #56
The input to the suspension system shown below is the road displacement u(t).
z
z
u
The equations for this suspension system are:
1000๐‘งฬˆ + 2400๐‘งฬ‡ + 9000๐‘ง = 2400๐‘ขฬ‡ + 9000๐‘ข
all initial conditions are zero
(1) 20%) Using the simulation diagram approach express this differential
equation in state variable format assuming z is the output of interest, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข ๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
๐ด =? ๐ต =? ๐ถ =? ๐ท =?
(2) (20%) Repeat (1) using the phase variable method.
(3) (20%) Repeat (1) using the MATLAB command tf2ss.
(4) (10%) For all three formulations in (1), (2), and (3), demonstrate using the
MATLAB command ss2tf that all three must be valid representations since
all 3 of them give the same transfer function for Z(s).
(5) (20%) Starting with the original differential equation, create a simulation
diagram containing integrators and then create a SIMULINK model
corresponding to your simulation diagram.
(6) (10%) For a step input of 0.05 m, generate a plot of z(t) using the
formulations in (1), (2), (3) and (5) and put them on the same graph for
comparison. Confirm that all 4 plots are identical.
282
Homework #56 Solution
This assignment is very similar to 5.49 on page 69 in the problems book and a problem in Section 1.4.2 in
the theory book. The objective of this assignment is to teach and demonstrate the value and simplicity
of using frequency response for sinusoidal inputs to get the steady state output instead of having to
find the inverse Laplace transform or having to do a MATLAB simulation to get the same results.
A pile driver is used to drive the pile shown below into the ground. This is a study to determine the
significance of the pounding frequency of the input force F on the amplitude of the penetration force f
at the ground. The total mass of the pile is M=15,000 Kg. The stiffness of the pile is K=AE/L = 1.5e8 N/m;
the pile length is L=15 m. Although a 5 or more lumped mass model would be preferred for the study,
for simplicity, only 2 lumped masses will be used. Assume b = 2e5 Ns/m for the damping coefficient.
F
M /2
z
2K
b
M
K
w
M /2
b
2K
f
It can be shown that the equations for the displacements z and w of the masses and the
equation for the penetration force f at the ground are:
2
(๐‘๐‘คฬ‡ + 2๐พ๐‘ค + ๐น − 2๐พ๐‘ง − ๐‘๐‘งฬ‡ )
๐‘€
2
๐‘คฬˆ = (๐‘๐‘งฬ‡ + 2๐พ๐‘ง − 4๐พ๐‘ค − 2๐‘๐‘คฬ‡ )
๐‘€
๐‘“ = ๐‘๐‘คฬ‡ + 2๐พ๐‘ค + ๐‘€๐‘”
๐‘งฬˆ =
(a) (15%) Using symbolic math in MATLAB, show that the Laplace transform equation for the
force at the ground associated with the pounding force F at the top is
711.11๐‘  2 + 2.133๐‘’6๐‘  + 1.6๐‘’9
๐‘“(๐‘ ) = [ 4
] ๐น(๐‘ )
๐‘  + 80๐‘  3 + 1.2067๐‘’5๐‘  2 + 2.133๐‘’6๐‘  + 1.6๐‘’9
Note, the equation for the ground force f includes the weight of the pile as an additional input.
However, we are only interested in the transfer function for the input force F.
% m-file for finding the transfer function, eigenvalues, and freq. response
283
function Homework_6_3360_Spr_2021
format shortg
syms Z W f b K M s F
E1=s^2*Z==2*(b*s*W+2*K*W+F-2*K*Z-b*s*Z)/M;
E2=s^2*W==2*(b*s*Z+2*K*Z-4*K*W-2*b*s*W)/M;
E3=f==(2*K+b*s)*W;
G=solve(E1,E2,E3,Z,W,f);
Gf=subs(G.f,[M K b],[1.5e4 1.5e8 2e5]);
digits(4)
Gfv=vpa(Gf);
[num,den]=numden(Gfv/F);
Num=sym2poly(num);
Den=sym2poly(den);
GF=tf(Num,Den)
damp(GF)
figure(1)
bode(GF,{50 500},'r')
grid
end
6400 s^2 + 1.92e07 s + 1.44e10
GF =
---------------------------------------------------9 s^4 + 720 s^3 + 1.086e06 s^2 + 1.92e07 s + 1.44e10
Divide numerator and denominator by 9 to get the coefficient on s4 equal to 1 gives
711.11๐‘  2 + 2.133๐‘’6๐‘  + 1.6๐‘’9
๐‘“(๐‘ ) = [ 4
] ๐น(๐‘ )
๐‘  + 80๐‘  3 + 1.2067๐‘’5๐‘  2 + 2.133๐‘’6๐‘  + 1.6๐‘’9
(b) (5%) What is the transfer function for f?
711.11๐‘  2 + 2.133๐‘’6๐‘  + 1.6๐‘’9
[ 4
]
๐‘  + 80๐‘  3 + 1.2067๐‘’5๐‘  2 + 2.133๐‘’6๐‘  + 1.6๐‘’9
(c) (5%) What is the characteristic polynomial for this system?
๐‘  4 + 80๐‘  3 + 1.2067๐‘’5๐‘  2 + 2.133๐‘’6๐‘  + 1.6๐‘’9
(d) (5%) What is the DC gain of this transfer function? DC gain =1 found by setting s = 0 in
the transfer function. Explain why this value for the DC gain makes sense. If F is a constant
force (constant means zero frequency) such as would be achieved by setting a weight on top
of the pile, the increase in force at the ground will be the same as the constant force input.
(e) (5%) What are the eigenvalues for this system? The ‘damp’ command in the code in (a)
above gives
Eigenvalues
-5.09e+00 + 1.24e+02i
-5.09e+00 - 1.24e+02i
-3.49e+01 + 3.22e+02i
-3.49e+01 - 3.22e+02i
Damping ratio
4.12e-02
4.12e-02
1.08e-01
1.08e-01
Frequency
1.24e+02
1.24e+02
3.24e+02
3.24e+02
284
(f) (5%) What are the resonant frequencies (damped natural frequencies) for the beam? From
the results shown in (e), the resonant frequencies of the pile are 124 and 322 rad/s (19.7 and
51.2 hz).
(g) (5%) What are the damping ratios for this system? From the results shown in (e), the
damping ratios are 0.041 and 0.108.
(h) (5%) Is the system over damped or lightly damped or what? What is the significance of the
damping level in regard to force (or stress) oscillations up and down the beam? The eigenvalues
are very lightly damped which means the force waves will be very oscillatory lasting for a
relatively long time before they damp out.
(i) (5%) Based on examination of the frequency response (bode plot) of the transfer function,
what pounding frequency will produce the largest amplitude of the force at the ground? The
command bode is included in the code in (a); the gain of the transfer function peaks in the
frequency response at the resonant frequencies 123 and 321 rad/s which are essentially 124
and 322 in the eigenvalues.
30
System: GF
Frequency (rad/s): 123
Magnitude (dB): 23
Bode Diagram
Magnitude (dB)
20
System: GF
Frequency (rad/s): 321
Magnitude (dB): -1.45
10
0
-10
-20
-30
0
Phase (deg)
-90
-180
-270
-360
2
10
Frequency (rad/s)
285
(j) (10%) Suppose the pounding force is sinusoidal with the first resonant frequency found in (i)
with an amplitude of 500 N. What will be the steady state amplitude and frequency of the force
at the ground? The gain of the transfer function at 123 rad/s is 23.1 dB which means the
gain of the transfer function is 10(23.1/20) = 14.28. The frequency of the ground force will
also be 123 rad/s and the amplitude will be 14.28 times larger, 14.28*500 = 7144 N.
(3%) Is the amplitude of the force at the ground greater or less than the input force
amplitude? Greater
(2%) How much bigger or smaller? 14.28 times greater
(k) (7%) Confirm your answer in (j) using lsim in MATLAB.
(a) Examining the real parts of the eigenvalues, the largest time constant is 0.2 s. So, it will take
about 5*0.2 = 1 s for the simulation to reach steady state. To see at least 10 steady state
oscillations at 124 rad/s (19.7 hz), the simulation needs to run at least 1.5 s with a time
increment of approximately 1/(10*124) = 0.0008; I will use 0.001s. As shown in the plot, the
steady state amplitude is 7085 which is very close to 7144 in part (j) using the frequency resp.
X: 1.394
Y: 7085
8000
ground force, N
6000
4000
2000
0
-2000
-4000
-6000
-8000
0
0.5
1
1.5
time, s
t=0:0.0001:1.5;
Fi=500*sin(124*t);
[gf]=lsim(GF,Fi,t);
figure(2)
plot(t,gf,'r','linewidth',2)
xlabel('time, s','fontsize',18)
ylabel('ground force, N','fontsize', 18)
grid
286
(l) (8%) Suppose the pounding force is a series of pulses with amplitude of 500 and with the
period of the pulses corresponding to the frequency in (i). Use lsim in MATAB to simulate the
system to determine the steady state amplitude of the force at the ground due to F. Use the
(homemade) MATLAB function PulseSeries.m in Canvas to generate the pulse series. See
example in book in Section 2.2.5.
To generate a series of pulses, certain parameters must be specified: N, m and the number of
points per pulse (NumPPP) must be integers. I suggest m=5 which means the width of the pulse
will be 1/m = 1/5 of the pulse period mT as shown on the schematic below. Also, if NumPPP =
10, then there will be enough points to accurately define the shape of the pulse. The fundamental
frequency of the pulse series is 2๐œ‹/๐‘š๐‘‡ rad/s; this needs to match the first resonant frequency of
the beam model; thus, ๐‘‡ = 2๐œ‹/124๐‘š = 2๐œ‹/(124 ∗ 5) = 0.01 s. The total simulation time is
NmT where N is the number of pulses to be included in the simulation. The simulation time
needs to be great enough to be able to observe some of the steady state oscillations. Since the
largest time constant is 1/5.09 = 0.2 s, the simulation needs to run at least 1.5 s which will give
about 0.5 s of steady state oscillations or 0.5/(mT) = 0.5/(0.05) = 10 cycles of ground force
pulses. So, N = 1.5/mT = 30.
f(t)
T
F
t
mT
>> T=0.01;m=5;F=500;N=30;NumPPP=10;
>> [F,t] = PulseSeries(T,m,F,N,NumPPP);
550
500
450
pulse function amplitude
400
350
300
250
200
150
100
50
0
0
0.5
1
1.5
time, sec.
287
Consider the following commands to simulate the ground force for the pulse series input:
>> GF=tf([711.11 2.133e6 1.6e9],[1 80 1.2067e5 2.133e6 1.6e9]);
>> [f]=lsim(GF,F,t);
>> plot(t,f,'r','linewidth',2)
>> title('Pile driver with 19.6 hz pulse input')
>> xlabel('Time,s','fontsize',16)
>> ylabel('Ground force, N','fontsize',16)
Pile driver with 19.6 hz pulse input
3000
X: 1.269
Y: 2900
Ground force, N
2000
1000
0
-1000
-2000
-3000
0
0.5
1
1.5
Time,s
(m) (3%) Compare the amplitudes from (j) and (l). For a sinewave input, the ground force
amplitude is 7085 n; with the pulse series input, the amplitude is 2900 N which is only
2900/500 = 5.8 times larger than the input amplitude compared to 14.28 times with the
sinewave input.
(3%) Which one is greater and why do you think it is? The sinewave input generates the
greatest ground force amplitude because it is continuous and represents a greater input
energy. It can be shown that the RMS value of the sinewave is 500/sqrt(2) = 354. Using the
‘rms’ command in MATLAB, the RMS value of the pulse series is only 234. A true
comparison would require that the work done by the pile driver be the same in each case.
>> RMS=rms(F)
RMS = 234.24
288
(n) How critical is the sinewave-pounding-frequency to the performance of the pile driver?
(3%) For example, how much do your answers in (j) change if the pounding frequency is
increased by 10%? A 10% increase in pounding frequency decreases the gain from 14.28
down to 10(15.2/20) = 5.75.
Bode Diagram
30
20
System: GF
Frequency (rad/s): 111
Magnitude (dB): 14.5
System: GF
Frequency (rad/s): 135
Magnitude (dB): 15.2
Magnitude (dB)
10
0
-10
-20
-30
0
Phase (deg)
-90
-180
-270
-360
2
10
Frequency (rad/s)
(3%) What if the pounding frequency is decreased by 10%? A 10% decrease in pounding
frequency decreases the gain from 14.28 down to 10(14.5/20) = 5.3.
(3%) What does this tell you about the significance of input frequencies at the resonant
frequencies of the system. The input frequency needs to be as close as possible to maximize
the performance of the pile driver. In reality, the true resonant frequency can only be
estimated; however, if would be possible to vary the pounding frequency from the best
estimate until the peak performance is achieved.
289
Homework #57
The input to the suspension system shown below is the road displacement u(t).
z
z
u
The equations for this suspension system are:
3000๐‘งฬˆ + 18000๐‘งฬ‡ + 120000๐‘ง = 18000๐‘ขฬ‡ + 120000๐‘ข
(1) (5%) What is the transfer function H(s) for z?
(2) (10%) What are the eigenvalues of this suspension? ______
(3) (10%) What is the damping ratio of this suspension? ______
(4) (10%) What is the damped natural frequency of this suspension? ________
(5) Assume the road profile is Gaussian with a PSD given below for the vehicle
traveling 20 m/s.
๐บ๐‘ข๐‘ข (๐‘“) = 0
๐บ๐‘ข๐‘ข (๐‘“) =
0.001
๐‘“2
๐‘“ > 80โ„Ž๐‘ง
0.01 ≤ ๐‘“ ≤ 80 โ„Ž๐‘ง
(10%) What is the mean value of the road profile? ____________
(10%) What is the mean square value of the road profile? ________
290
(10%) What is the approximate probability that the road elevation at any location
exceeds 0.5 m greater than the mean elevation? Hint: Use the table in the book
and/or the MATLAB ‘disttool’ function. ________
(15%) Determine the mean square value of z(t). ________
(5%) How does this value compare with the mean square value of the road profile.
Explain why the two values are essentially the same. _________________
Recall, the mean square value is calculated by integrating the PSD over all
frequencies. As explained in the book, you can get an equation for the PSD using
the input PSD and the transfer function. So, using H(s) found in (1) above, the
PSD of the displacement z of the vehicle with input u(t) is
๐บ๐‘ง๐‘ง (๐‘“) = ๐บ๐‘ข๐‘ข (๐‘“)[๐ป(๐‘ )๐ป(−๐‘ )]๐‘ =๐‘—2๐œ‹๐‘“
Or, in terms of the Laplace operator s, the PSD of z(t) is
๐บ๐‘ง๐‘ง (๐‘ ) = ๐ป(๐‘ )๐ป(−๐‘ )๐บ๐‘ข๐‘ข (๐‘“)๐‘“=
๐‘ 
๐‘—2๐œ‹
= ๐‘”(๐‘ )๐‘”(−๐‘ )
A homemade symbolic math m-file for integrating a PSD is listed below. You can
use it to get the mean square value.
% function [MSV]=msv(G,f1,f2)
% Generates the mean square value, MSV, of a variable with symbolic
% transfer function G assuming the input to this transfer function
% is a one sided unity band limited white noise from f1 hertz to f2 hertz.
% A typical value of f1 is zero and a typical value for f2 is 1/2h where
% h is the sampling interval in seconds.
function [MSV]=msv(G,f1,f2)
syms s f
Gms=subs(G,s,-s);
GGms=G*Gms;
GGmsf=subs(GGms,s,j*2*pi*f);
MSV=double(int(GGmsf,f,f1,f2));
end
(6) (15%) Knowing the mean and mean square values for z(t), what is the 95%
probability value of displacement z? That is, there is only a 5% probability that at
any time, z(t) is greater than this value? Hint: Use the table in the book and/or the
MATLAB ‘disttool’ function. ________
291
292
Homework #57 Solution
The input to the suspension system shown below is the road displacement u(t).
z
z
u
The equations for this suspension system are:
1000๐‘งฬˆ + 2400๐‘งฬ‡ + 9000๐‘ง = 2400๐‘ขฬ‡ + 9000๐‘ข
all initial conditions are zero
(7) 20%) Using the simulation diagram approach express this differential
equation in state variable format assuming z is the output of interest, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข ๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
๐ด =? ๐ต =? ๐ถ =? ๐ท =?
๐‘งฬˆ + 2.4๐‘งฬ‡ + 9๐‘ง = 2.4๐‘ขฬ‡ + 9๐‘ข
๐‘งฬˆ − 2.4๐‘ขฬ‡ = −9๐‘ง − 2.4๐‘งฬ‡ + 9๐‘ข
๐‘ฅ1 = ๐‘ง ๐‘ฅ2 = ๐‘งฬ‡ − 2.4๐‘ข
๐‘ฅฬ‡ 1 = ๐‘ฅ2 + 2.4๐‘ข
๐‘ฅฬ‡ 2 = −9๐‘ฅ1 − 2.4(๐‘ฅ2 + 2.4๐‘ข) + 9๐‘ข
= −9๐‘ฅ1 − 2.4๐‘ฅ2 + 3.24๐‘ข
๐ด=[
0
1
]
−9 −2.4
๐ต=[
2.4
]
3.24
๐ถ = [1 0] ๐ท = [0]
(8) (20%) Repeat (1) using the phase variable method.
0
1
0
๐ด=[
] ๐ต = [ ] ๐ถ = [9 2.4] ๐ท = [0]
−9 −2.4
1
293
(9) (20%) Repeat (1) using the MATLAB command tf2ss.
>> num=[2.4 9];den=[1 2.4 9];
>> [Am,Bm,Cm,Dm]=tf2ss(num,den)
Am =
-2.4
-9
1
0
Bm = 1
0
Cm = 2.4
9
Dm = 0
(10)
(10%) For all three formulations in (1), (2), and (3), demonstrate
using the MATLAB command ss2tf that all three must be valid
representations since all 3 of them give the same transfer function for Z(s).
% Homework #9 MAE 3360 Spring 2021
As=[0 1;-9 -2.4];Bs=[2.4;3.24];Cs=[1 0];Ds=[0];
Ap=[0 1;-9 -2.4];Bp=[0;1];Cp=[9 2.4];Dp=[0];
num=[2.4 9];den=[1 2.4 9];
[Am,Bm,Cm,Dm]=tf2ss(num,den);
[Nums,Dens]=ss2tf(As,Bs,Cs,Ds);Gs=tf(Nums,Dens)
[Nump,Denp]=ss2tf(Ap,Bp,Cp,Dp);Gp=tf(Nump,Denp)
[Numm,Denm]=ss2tf(Am,Bm,Cm,Dm);Gm=tf(Numm,Denm)
Gs =
2.4 s + 9
--------------s^2 + 2.4 s + 9
Gp =
2.4 s + 9
--------------s^2 + 2.4 s + 9
Gm =
2.4 s + 9
--------------s^2 + 2.4 s + 9
(11)
(20%) Starting with the original differential equation, create a
simulation diagram containing integrators and then create a SIMULINK
model corresponding to your simulation diagram. Assuming a step for u:
294
(12)
(10%) For a step input of 0.05 m, generate a plot of z(t) using the
formulations in (1), (2), (3) and (5) and put them on the same graph for
comparison. Confirm that all 4 plots are identical.
Step Response
0.07
0.06
Amplitude
0.05
0.04
0.03
Simulation Diagram
0.02
Phase Variable
Matlab
0.01
0
Simulink
0
1
2
3
4
Time (seconds)
>> step(0.05*Gs,'r',0.05*Gp,'k:',0.05*Gm,'k*')
>> hold
>> plot(Z(:,1),Z(:,2),'r--')
>> legend('Simulation Diagram','Phase Variable','Matlab','Simulink','location','best')
>> grid
295
Homework #58
A simple model for a suspension consists of a sprung mass (displacement z) and an unsprung
mass (displacement w) as shown in the schematic below. The input to the suspension system is
the road displacement u(t). Specific details associated with the springs and dampers are not
depicted. For this problem, we are interested in the decrease in the size of the gap between the
two masses. The ‘stroke’ of the suspension is how much the gap can decrease without the
suspension bottoming-out. Thus, the output of interest is y = w – z where y is defined to be the
decrease in the gap size.
z
w
u
The equations for this system are given below; you will learn how to get these equations for a
specific suspension design in MAE3319.
๐‘งฬˆ + 6๐‘งฬ‡ + 40๐‘ง = 6๐‘คฬ‡ + 40๐‘ค
๐‘คฬˆ + 100๐‘คฬ‡ + 4000๐‘ค = 12๐‘งฬ‡ + 80๐‘ง + 80๐‘ขฬ‡ + 4000๐‘ข
(1) (15%) Complete the simulation diagram (section 3.2 in book) below linking the two
differential equations. Note, 1/s is Laplace notation for integration.
๐‘งฬˆ
1
๐‘งฬ‡
๐‘ 
๐‘คฬˆ − 80๐‘ขฬ‡
1
๐‘ 
๐‘คฬ‡ − 80๐‘ข
(2) 15%) Define the state variables as the outputs of the integrators on your diagram and write
the state variable equations including the equation for the output of interest, i.e.
296
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
๐ด =?
๐ต =?
๐ถ =?
๐ท =?
(3) (5%) Enter this state space system into MATAB and use the damp command to get the
eigenvalues.
Eigenvalues =
?
(5%) Damping ratios =
?
(5%) Time constants =
?
(5%) Damped natural frequencies =
?
(4) (5%) Assume that this vehicle is moving over a road in a pasture at 20 m/s (see section 8.3.6
in the book). Using the parameters in the table, what is the PSD of the input u(t)?
Guu(f) =
?
(5) (10%) Using the m-file StochInput, generate and plot the random profile for the road
assuming that the road PSD is the defined in (4) for frequencies between 0.1 and 100 hz
and zero for all other frequencies. Note, the m-file StochInput contains a function dpsd at the
very end; the logic for the desired PSD must be entered in this function. Examples of dpsd are in
Section 8.3.5.1 in the book. Confirm that the function listed below corresponds to the road
profile specified in (4):
function [GY]=dpsd(f)% This function will be called for each value of f.
% You need equations or logic for GY describing the desired PSD.
GY=1.81e-3/f^1.6;
if f >100;GY=0;end
if f<0.1;GY=0;end
end
Also, you will need to follow the instructions discussed in section 8.3.5.1 in the book for
selecting the time increment H and the total number of points N.
H=
?
N=
?
(6) (10%) Using lsim in MATLAB and the road profile generated in (5), generate a plot of y(t).
297
(7) (5%) Draw a line on your plot in (6) corresponding to a Stroke of 0.125 meters. Looking at
this plot of y(t), count the number of times that y(t) exceeds the Stroke corresponding to the
suspension bottoming-out; calculate the frequency that this occurs.
(times of bottoming-out)/sec =
?
(8) (10%) Change the output of interest (1) to ๐‘ฆฬ‡ and then repeat (6) but this time plot ๐‘ฆฬ‡ (๐‘ก).
(9) (10%) Using the MATLAB command std, find the standard deviation of y and ๐‘ฆฬ‡ . Use these
standard deviations in the formula in section 8.3.8 to calculate an estimate of the frequency of
bottoming-out. How does this frequency compare with the frequency found in (7)? __________
Homework #58 Solution
The input to the suspension system shown below is the road displacement u(t).
z
z
u
The equations for this suspension system are:
3000๐‘งฬˆ + 18000๐‘งฬ‡ + 120000๐‘ง = 18000๐‘ขฬ‡ + 120000๐‘ข
(1) (5%) What is the transfer function H(s) for z?
18000๐‘  + 120000
3000๐‘  2 + 18000๐‘  + 120000
(2) (10%) What are the eigenvalues of this suspension? −3 ± ๐‘—5.57
3000(๐‘  2 + 6๐‘  + 40) = 3000(๐‘  + 3 + ๐‘—5.57)(๐‘  + 3 − ๐‘—5.57)
(3) (10%) What is the damping ratio of this suspension? 0.474
298
2๐›ฟ๐œ”๐‘› = 2๐›ฟ√40 = 6 ๐‘กโ„Ž๐‘ข๐‘  ๐›ฟ =
6
2√40
= 0.474
(4) (10%) What is the damped natural frequency of this suspension? ๐œ”๐‘‘ = 5.57
(5) Assume the road profile is Gaussian with a PSD given below for the vehicle
traveling 20 m/s.
๐บ๐‘ข๐‘ข (๐‘“) = 0
๐บ๐‘ข๐‘ข (๐‘“) =
๐‘“ > 80โ„Ž๐‘ง & ๐‘“ < 0.01
0.001
๐‘“2
0.01 ≤ ๐‘“ ≤ 80 โ„Ž๐‘ง
(10%) What is the mean value of the road profile? 0
Mean equals zero since there is no impulse at f = 0 in the PSD.
(10%) What is the mean square value of the road profile?
80 0.001
Mean square value is area under the PSD = ∫0.01
๐‘“2
๐‘‘๐‘“ = 0.1 ๐‘š2
(10%) What is the approximate probability that the road elevation at any location
exceeds 0.5 m greater than the mean elevation? Using the table in Section 8.24:
|๐‘ง − 0| ≤ 1.64๐œŽ๐‘ง = 1.64√0.1 = 0.52 for 90% probability. That is, there is a 90%
probability that -0.52<z<0.52. So, there is 5% probability for z to be less than
-0.52 and 5% probability for z to be greater than 0.52.
Or, using the command ‘disttool’, we get 100-94 = 6 % probability. Note, you can
get better resolution by decreasing the upper bound on sigma without changing the
answer. The 6% area of the probability density function is shown below.
1.5
1
0.8
1
0.6
0.5
0.4
0.2
0
-4
-3
-2
-1
0
1
2
3
4
0
-4
-3
-2
-1
0
1
2
3
4
299
(15%) Determine the mean square value of z(t). Using formulas below: 0.101 m2
A simple way to compute the mean square value without having to simulate the
system is to obtain the equation for the PSD of z(t), ๐บ๐‘ง๐‘ง (๐‘“), and then integrate it
over the applicable frequency range. You can do the integration manually or with
symbolic math. Or, you can split the input PSD into positive and negative parts as
shown in the formulation below, g(s) and g(-s), and then use the mfile msv.
(5%) How does this value compare with the mean square value of the road profile. Same.
Explain why the two values are essentially the same. The displacement of the vehicle mass
essentially follows the road profile and the profile irregularities are not significant in the
frequency range close to the suspension resonant frequency to cause large amplitudes of
vibration.
Recall, the mean square value is calculated by integrating the PSD over all frequencies. As
explained in the book, you can get an equation for the PSD using the input PSD and the transfer
function. So, using H(s) found in (1) above, the PSD of the displacement z of the vehicle with
input u(t) is
๐บ๐‘ง๐‘ง (๐‘“) = ๐บ๐‘ข๐‘ข (๐‘“)[๐ป(๐‘ )๐ป(−๐‘ )]๐‘ =๐‘—2๐œ‹๐‘“
Or, in terms of the Laplace operator s, the PSD of z(t) is
๐บ๐‘ง๐‘ง (๐‘ ) = ๐ป(๐‘ )๐ป(−๐‘ )๐บ๐‘ข๐‘ข (๐‘“)๐‘“=
๐‘ 
๐‘—2๐œ‹
= ๐‘”(๐‘ )๐‘”(−๐‘ )
A homemade symbolic math m-file for integrating a PSD is listed below. You can
use it to get the mean square value.
% function [MSV]=msv(G,f1,f2)
% Generates the mean square value, MSV, of a variable with symbolic
% transfer function G assuming the input to this transfer function
% is a one sided unity band limited white noise from f1 hertz to f2 hertz.
% A typical value of f1 is zero and a typical value for f2 is 1/2h where
% h is the sampling interval in seconds.
function [MSV]=msv(G,f1,f2)
syms s f
Gms=subs(G,s,-s);
GGms=G*Gms;
GGmsf=subs(GGms,s,j*2*pi*f);
MSV=double(int(GGmsf,f,f1,f2));
end
๐ป(๐‘ ) =
18000๐‘  + 120000
3000๐‘  2 + 18000๐‘  + 120000
300
๐บ๐‘ข๐‘ข (๐‘“)๐‘“=
๐‘ 
๐‘—2๐œ‹
0.001
=[ 2 ]
๐‘“
๐‘“=
๐‘ 
๐‘—2๐œ‹
=[
√0.001 √0.001
๐‘  ] [ −๐‘  ]
2๐œ‹
2๐œ‹
Thus,
18000๐‘  + 120000
√0.001
๐‘”(๐‘ ) = [
]
[
๐‘  ]
3000๐‘  2 + 18000๐‘  + 120000
2๐œ‹
=[
3576๐‘  + 23843
]
3000๐‘  3 + 18000๐‘  2 + 120000๐‘ 
>> H=(3576*s+23843)/(3000*s^3+18000*s^2+120000*s);
>> MSVz=msv(H,0.01,80)
MSVz =
0.10162 + 5.0269e-88i = 0.10162
(6) (15%) Knowing the mean and mean square values for z(t), what is the 95%
probability value of displacement z? That is, there is only a 5% probability that at
any time, z(t) is greater than this value?
Variance of z is √0.10162 = 0.32
As shown on the disttool graphs below, the displacement value of 0.52 m is the 5%
value for z(t) to be above this level.
1.5
1
0.8
1
0.6
0.4
0.5
0.2
0
-4
-3
-2
-1
0
1
2
3
4
0
-4
-3
-2
-1
0
1
2
3
4
301
Previous Exams and Solutions
Exam 1a
1. (20%) For each differential equation below, answer the following questions:
(a) ๐‘ฃฬˆ + 16๐‘ฃฬ‡ + 12๐‘ฃ = 5
Is the equation linear?________ What is the order? _______ What is the dependent
variable?_______
What is the independent variable?_____ What is the final value of the dependent
variable?________
(b) 2๐‘ฆโƒ› + 0.4๐‘ฆฬˆ + 0.1(๐‘ฆฬ‡ )5 + 10๐‘ฆ = 24
Is the equation linear?________ What is the order? _______ What is the dependent
variable?_______
What is the independent variable?_____ What is the final value of the dependent
variable?________
2. Before the valve on the water tank is opened, the height H of the water in the tank is 10 m.
Once the valve is opened, water flows out of the tank. The differential equation for H with water
flowing out is as follows
4๐ปฬ‡ + 0.8√๐ป = 0
(10%) On the sketch below, draw a reasonable estimate of H as a function of time.
H
H
valve
0
flow
time
Use separation of variables to solve this differential equation for H(t).
Does your equation for H(t) give the correct initial and final values for H?
(20%) Equation for H(t) _______________________________
(5%) Initial value of H from the equation __________
(5%) Final value of H from the equation ___________
302
3. A pendulum is attached to a cart as shown below. The system is shown in equilibrium, that
is, nothing is moving.
spring
cart
pendulum
If the cart is rolled to the right or left and released or if the pendulum is raised to the right or left
and then released, the cart will start rolling back and forth compressing and extending the spring
while the pendulum swings back and forth.
z
๏ฑ
It can be shown, for small angles, the following two simultaneous equations with unknowns
๐‘ง ๐‘Ž๐‘›๐‘‘ ๐œƒ accurately model the dynamics of this system
๐œƒฬˆ + 3๐œƒฬ‡ + 9๐œƒ = −0.9๐‘งฬˆ
7๐‘งฬˆ + 175๐‘ง = −2๐œƒฬˆ
Using the 'D' operator, convert these equations to algebraic equations, eliminate ๐œƒ, and finally
end up with a single differential equation for ๐‘ง. What is the order of this differential equation?
(15%) Equations in terms of the 'D' operator
(20%) Single differential equation in terms of z only
(5%) Order of the differential equation for z? ___________
303
Exam 1a Solution
1. (20%) For each differential equation below, answer the following questions:
(a) ๐‘ฃฬˆ + 16๐‘ฃฬ‡ + 12๐‘ฃ = 5
Is the equation linear?__yes___ What is the order? ___2nd_ What is the dependent
variable?_v_____
What is the independent variable? time
What is the final value of the dependent variable? 5/12=0.4166
(b) 2๐‘ฆโƒ› + 0.4๐‘ฆฬˆ + 0.1(๐‘ฆฬ‡ )5 + 10๐‘ฆ = 24
Is the equation linear?__no What is the order? ___3rd What is the dependent variable?_y____
What is the independent variable? time What is the final value of the dependent variable? 2.4
2. Before the valve on the water tank is opened, the height H of the water in the tank is 10 m.
Once the valve is opened, water flows out of the tank. The differential equation for H with water
flowing out is as follows
4๐ปฬ‡ + 0.8√๐ป = 0
(10%) On the sketch below, draw a reasonable estimate of H as a function of time.
H
10
H
valve
flow
0
time
Use separation of variables to solve this differential equation for H(t).
๐ป(๐‘ก)
๐‘ก
๐‘‘๐ป
4∫
= − ∫ 0.8๐‘‘๐‘ก
๐ป(๐‘ก) = (√๐ป(0) − 0.1๐‘ก)2
√๐ป(๐‘ก) − √๐ป(0) = −0.1๐‘ก
๐ป(0) √๐ป
0
Does your equation for H(t) give the correct initial and final values for H?
(20%) Equation for H(t)
๐ป(๐‘ก) = (√10 − 0.1๐‘ก)2
(5%) Initial value of H from the equation ๐ป(0) = (√10 − 0.1 ∗ (0))2 = 10
√
2
(5%) Final value of H from the equation ๐ป(∞) = (√10 − 0.1๐‘ก) = 0
√ H cannot go
negative
304
3. A pendulum is attached to a cart as shown below. The system is shown in equilibrium, that
is, nothing is moving.
spring
cart
pendulum
If the cart is rolled to the right or left and released or if the pendulum is raised to the right or left
and then released, the cart will start rolling back and forth compressing and extending the spring
while the pendulum swings back and forth.
z
๏ฑ
It can be shown, for small angles, the following two simultaneous equations with unknowns
๐‘ง ๐‘Ž๐‘›๐‘‘ ๐œƒ accurately model the dynamics of this system
๐œƒฬˆ + 3๐œƒฬ‡ + 9๐œƒ = −0.9๐‘งฬˆ
7๐‘งฬˆ + 175๐‘ง = −2๐œƒฬˆ
Using the 'D' operator, convert these equations to algebraic equations, eliminate ๐œƒ, and finally
end up with a single differential equation for ๐‘ง. What is the order of this differential equation?
(15%) Equations in terms of the 'D' operator
(7๐ท2 + 175)๐‘ง = −2๐ท2 ๐œƒ
(๐ท2 + 3๐ท + 9)๐œƒ = −0.9๐ท2 ๐‘ง
(20%) Single differential equation in terms of z only
−0.9๐ท2 ๐‘ง
๐œƒ= 2
๐ท + 3๐ท + 9
−0.9๐ท2 ๐‘ง
2
2
(7๐ท + 175)๐‘ง = −2๐ท 2
๐ท + 3๐ท + 9
Which simplifies to
(5.2๐ท4 + 21๐ท3 + 238๐ท2 + 525๐ท + 1575)๐‘ง = 0
which corresponds to the following differential equation:
5.2๐‘ง (4) + 21๐‘งโƒ› + 238๐‘งฬˆ + 525๐‘งฬ‡ + 1575๐‘ง = 0
(5%) Order of the differential equation for z? 4th
305
Exam 1b
1.
(15%) Obtain a linear approximation to the following differential equation based on the initial
and final values of z.
๐‘งฬˆ + 3๐‘งฬ‡ + 6√๐‘ง = 12
2.
๐‘ง(0− ) = 1
Consider the following Laplace transform for Z(s):
๐‘(๐‘ ) =
6๐‘  2 + 20๐‘  + 80
๐‘ [๐‘  2 + 12๐‘  + 40]
(a) (5%) Use the final value theorem (FVT) to compute the final value of z(t).
(b)(5%) Use the initial value theorem (IVT) to compute the value of z(t) at t = 0+.
(c)(9%) What are the poles of Z(s) which are the roots of the denominator polynomial?
FVT: ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐น(๐‘ )๐‘ →0
IVT: ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐น(๐‘ )๐‘ →∞
3. The equations for the water flowing through a long line between two tanks and the height of the
water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 − ๐ป2 = 250๐‘„ฬ‡
H1
๐ป1 (0− ) = 3
๐ป2 (0− ) = 5
๐‘„(0− ) = 0
H2
Q
(a) (25%) Laplace transform each of these three equations.
(b)(15%) Reduce the equations down to two equations with unknowns H1(s) and H2(s) .
(c)(15%) Reduce the equations down to one equation for the unknown H1(s).
(d)(6%) Use the final value theorem to determine the final value of H1. Does this value make
sense?
(e) (5%) Use the initial value theorem to check the initial value. Is it correct?
306
Exam 1b Solution
1. (15%) Obtain a linear approximation to the following differential equation using the initial and final
values of z.
๐‘งฬˆ + 3๐‘งฬ‡ + 6√๐‘ง = 12
๐‘ง(0− ) = 1
0 + 0 + 6√๐‘ง = 12 ๐‘กโ„Ž๐‘ข๐‘ ,
๐‘ง(∞) = 4
1
2
√๐‘ง ≅ ๐‘ง +
3
3
๐‘ง 2
๐‘งฬˆ + 3๐‘งฬ‡ + 6[ + ] = 12
3 3
๐‘งฬˆ + 3๐‘งฬ‡ + 2๐‘ง = 8
2. Consider the following Laplace transform for Z(s):
๐‘(๐‘ ) =
6๐‘  2 + 20๐‘  + 80
๐‘ [๐‘  2 + 12๐‘  + 40]
(a) (5%) Use the final value theorem (FVT) to compute the final value of z(t).
80
๐‘ ๐‘(๐‘ )๐‘ =0 =
=2
40
(b)(5%) Use the initial value theorem (IVT) to compute the value of z(t) at t = 0+.
๐‘ ๐‘(๐‘ )๐‘ =∞ = 6
(c)(9%) What are the poles of Z(s) which are the roots of the denominator polynomial?
๐‘  = 0, − 6 + ๐‘—2, − 6 − ๐‘—2
FVT: ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐น(๐‘ )๐‘ →0
IVT: ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐น(๐‘ )๐‘ →∞
3. The equations for the water flowing through a long line between two tanks and the height of the
water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 − ๐ป2 = 250๐‘„ฬ‡
๐ป1 (0− ) = 3
๐ป2 (0− ) = 5
๐‘„(0− ) = 0
307
H1
H2
Q
(a) (25%) Laplace transform each of these three equations.
−๐‘„ − 20[๐‘ ๐ป1 (๐‘ ) − 3] = 0
๐‘„ − 40[๐‘ ๐ป2 − 5] = 0
๐ป1 − ๐ป2 = 250[๐‘ ๐‘„(๐‘ ) − 0]
(b)(15%) Reduce the equations down to two equations with unknowns H1(s) and H2(s) .
๐ป1 − ๐ป2
๐‘„=
250๐‘ 
Thus,
−
๐ป1 − ๐ป2
− 20[๐‘ ๐ป1 (๐‘ ) − 3] = 0
250๐‘ 
๐ป1 − ๐ป2
− 40[๐‘ ๐ป2 − 5] = 0
250๐‘ 
(c)(15%) Reduce the equations down to one equation for the unknown H1(s).
๐ป2 = [5,000๐‘  2 + 1]๐ป1 + 15,000๐‘ 
Thus,
๐ป1 =
1.5๐‘ฅ108 ๐‘  2 + 65,000
๐‘ (5๐‘ฅ107 ๐‘  2 + 15,000)
(d)(6%) Use the final value theorem to determine the final value of H1. Does this value make
sense?
65,000
๐‘ ๐ป1 (๐‘ )๐‘ =0 =
= 4.333
15,000
Since the initial water height in this tank was 3 and the other 5, a final value between 3 and 5 makes
sense. However, the poles of the denominator are complex with zero real part which means the H1 will
oscillate forever and never reach a constant value. So, the final value theorem cannot be used in such
cases.
(e) (5%) Use the initial value theorem to check the initial value. Is it correct?
๐‘ ๐ป1 (๐‘ )๐‘ =∞ =
1.5๐‘ฅ108
5๐‘ฅ107
= 3 which is the correct value.
308
Exam 1c
1.
Consider the following differential equation with input u.
๐‘งโƒ› + 8๐‘งฬˆ + 37๐‘งฬ‡ + 50๐‘ง = 150๐‘ข + 25๐‘ขฬ‡
(a) (5%) What is the transfer function for z?
(b) Consider the following MATLAB command and results:
>> roots([1 8 37 50])
ans: -2, -3-j4, -3+j4
(b.1) (6%) What are the eigenvalues of this system?
(b.2) (4%) What are the time constants of this system?
(b.3) (2%) What is the damped natural frequency of this system?
(b.4) (2%) What is the undamped natural frequency of this system?
(b.5) (2%) What is the damping ratio?
(b.6) (4%) Assume that the input u is a constant of 4. About how long will it take for z to
reach its final value and what will be the final value?
2. The differential equations for the suspension shown below with input displacement u(t)
are
๐‘งฬˆ + 2๐‘งฬ‡ + 10๐‘ง = 2๐‘คฬ‡ + 10๐‘ค
2๐‘คฬ‡ + 20๐‘ค = 2๐‘งฬ‡ + 10๐‘ง + 10๐‘ข
(a) (20%) Find the transfer function for z
Z
W
U
309
(b) (10%) The MATLAB command for entering a transfer function is as follows:
>> H=tf(a,b)
For this problem, what is a and what is b?
a= ?
b= ?
3. Consider the following differential equation with a constant input:
2๐‘งฬˆ + 4√15๐‘งฬ‡ + 2๐‘ง 3 = 54
๐‘ง(0− ) = 2
๐‘งฬ‡ (0− ) = 0
(a) (15%) Linearize this differential equation by obtaining a straight line approximation
for ๐‘ง 3 .
(b) (10%) What are the eigenvalues of the linearized differential equation?
Note, √15 = 3.872983346
4.
(20%) Consider the following differential equation with input u:
2๐‘ฆฬˆ + 16 ๐‘ฆฬ‡ + 30๐‘ฆ = 2๐‘ขฬ‡ + 4๐‘ข
What are the modes of this system?
Exam 1c Solution
1. Consider the following differential equation with input u.
๐‘งโƒ› + 8๐‘งฬˆ + 37๐‘งฬ‡ + 50๐‘ง = 150๐‘ข + 25๐‘ขฬ‡
(a) (5%) What is the transfer function for z? (can be in terms of D or s)
25๐ท + 150
3
๐ท + 8๐ท2 + 37๐ท + 50
(b) Consider the following MATLAB command and results:
>> roots([1 8 37 50])
ans: -2, -3-j4, -3+j4
(b.1) (6%) What are the eigenvalues of this system?
-2, -3-j4, -3+j4
(b.2) (4%) What are the time constants of this system? ½ and 1/3
(b.3) (2%) What is the damped natural frequency of this system? 4 rad/sec
(b.4) (2%) What is the undamped natural frequency? ๐œ”๐‘› = √32 + 42 = 5 ๐‘Ÿ๐‘Ž๐‘‘/๐‘ ๐‘’๐‘
310
(b.5) (2%) What is the damping ratio? Damping ratio = 0.6
(b.6) (4%) Assume that the input u is a constant of 4. About how long will it take for z to
reach its final value and what will be the final value? 5*0.5=2.5 sec.
Set the derivatives to zero in the differential equation to get: 50*z=150*4 or z =12
2. The differential equations for the suspension shown below with input displacement u(t)
are
๐‘งฬˆ + 2๐‘งฬ‡ + 10๐‘ง = 2๐‘คฬ‡ + 10๐‘ค
2๐‘คฬ‡ + 20๐‘ค = 2๐‘งฬ‡ + 10๐‘ง + 10๐‘ข
(a) (20%) Find the transfer function for z
Z
W
U
Converting differential equations to algebraic equations using the D or s operator and solving for
z gives the following transfer function:
2๐ท3
20๐ท + 100
+ 20๐ท2 + 20๐ท + 100
(b) (10%) The MATLAB command for entering a transfer function is as follows:
>> H=tf(a,b)
For this problem, what is a and what is b?
a= [20 100];
b= [2 20 20 100];
3. Consider the following differential equation with a constant input:
2๐‘งฬˆ + 4√15๐‘งฬ‡ + 2๐‘ง 3 = 54
๐‘ง(0− ) = 2
๐‘งฬ‡ (0− ) = 0
(a) (15%) Linearize this differential equation by obtaining a straight line approximation for ๐‘ง 3 . z
starts at 2 and ends at 3; thus, a straight line through these two points gives
311
๐‘งฬˆ + 2√15๐‘งฬ‡ + 19๐‘ง = 57
(b)(10%) What are the eigenvalues of the linearized differential equation?
Note, √15 = 3.872983346
๐‘’๐‘–๐‘”๐‘’๐‘›๐‘ฃ๐‘Ž๐‘™๐‘ข๐‘’๐‘  = −√15 ± √15 − 19 = −√15 ± ๐‘—2 = −3.873 ± ๐‘—2
4.
(20%) Consider the following differential equation with input u:
2๐‘ฆฬˆ + 16 ๐‘ฆฬ‡ + 30๐‘ฆ = 2๐‘ขฬ‡ + 4๐‘ข
What are the modes of this system? The modes are the partial fractions of the transfer
function, i.e.
๐ท+2
−0.5
1.5
+
[ 2
]=
๐ท + 8๐ท + 15
๐ท+3 ๐ท+5
−0.5
Usually, the first mode is the one with the largest time constant. So, the first mode is ๐ท+3 and
the second mode is
1.5
.
๐ท+5
Exam 2a
1. The differential equations for the suspension shown below with input displacement u(t) are
๐‘งฬˆ + 10๐‘งฬ‡ + 100๐‘ง = 10๐‘คฬ‡ + 100๐‘ค
๐‘คฬ‡ + 40๐‘ค = ๐‘งฬ‡ + 10๐‘ง + 30๐‘ข
(a) (10%) Assume all initial conditions are zero and convert the equations above to Laplace
domain.
312
Z
W
U
(b) (10%) Demonstrate that if you solve for W(s) in the first equation and then substitute this
expression for W(s) into the 2nd equation, when you solve for Z(s) you get
3000 + 300๐‘ 
๐‘(๐‘ ) = [ 3
] ๐‘ˆ(๐‘ )
๐‘  + 40๐‘  2 + 300๐‘  + 3000
(c) (10%) What is the transfer function for this system?
(d) (12%) Consider the following MATLAB command and results:
>> roots([1 40 300 3000])
ans =
-33.7442
-3.1279 + 8.8950i
-3.1279 - 8.8950i
What are the eigenvalues of this system?
(e) (8%) What are the time constants of this system?
(f) (12%) If the input u(t) is a unit step, the general form of the equation for z(t) can be shown
to be
๐‘ง(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘๐‘’ −๐‘‘๐‘ก + ๐‘“๐‘’ −๐‘”๐‘ก sin (โ„Ž๐‘ก + ∅)
What are b = _______
d = _______________
g = __________
h = ________________
(g) (8%) What is the final value of z(t) and how long will it take to get within 1% of this value?
2. (15%) Use the residue theorem to solve the following differential equation for y(t).
22๐‘ฆฬ‡ + 44๐‘ฆ = 88
๐‘ฆ(0− ) = 5
3. (15%) Use separation of variables to solve the differential equation in problem 2.
313
Exam 2a Solution
1. The differential equations for the suspension shown below with input displacement u(t) are
๐‘งฬˆ + 10๐‘งฬ‡ + 100๐‘ง = 10๐‘คฬ‡ + 100๐‘ค
๐‘คฬ‡ + 40๐‘ค = ๐‘งฬ‡ + 10๐‘ง + 30๐‘ข
(a) (10%) Assume all initial conditions are zero and convert the equations above to Laplace
domain.
Z
W
U
(๐‘  2 + 10๐‘  + 100)๐‘ = (10๐‘  + 100)๐‘Š
(๐‘  + 40)๐‘Š = (๐‘  + 10)๐‘ + 30๐‘ˆ
(b) (10%) Demonstrate that if you solve for W(s) in the first equation and then substitute this
expression for W(s) into the 2nd equation, when you solve for Z(s) you get
3000 + 300๐‘ 
๐‘(๐‘ ) = [ 3
] ๐‘ˆ(๐‘ )
๐‘  + 40๐‘  2 + 300๐‘  + 3000
2
๐‘  + 10๐‘  + 100
(๐‘  + 40) (
) ๐‘ = (๐‘  + 10)๐‘ + 30๐‘ˆ
10๐‘  + 100
(๐‘  + 40)(๐‘  2 + 10๐‘  + 100) = (10๐‘  + 100)(๐‘  + 10)๐‘ + 30(10๐‘  + 100)๐‘ˆ
(๐‘  3 + 50๐‘  2 + 500๐‘  + 4000 − 10๐‘  2 − 200๐‘  − 1000)๐‘ = (300๐‘  + 3000)๐‘ˆ
3000 + 300๐‘ 
๐‘(๐‘ ) = [ 3
] ๐‘ˆ(๐‘ )
๐‘  + 40๐‘  2 + 300๐‘  + 3000
(c) (10%) What is the transfer function for this system?
3000 + 300๐‘ 
[ 3
]
๐‘  + 40๐‘  2 + 300๐‘  + 3000
(d) (12%) Consider the following MATLAB command and results:
>> roots([1 40 300 3000])
ans =
-33.7442
-3.1279 + 8.8950i
-3.1279 - 8.8950i
What are the eigenvalues of this system?
-33.7442
-3.1279 + 8.8950i
-3.1279 - 8.8950i
(e) (8%) What are the time constants of this system?
1/33.7442 = 0.0296 and 1/3.1279 = 0.3197
(f) (12%) If the input u(t) is a unit step, the general form of the equation for z(t) can be shown
to be
๐‘ง(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘๐‘’ −๐‘‘๐‘ก + ๐‘“๐‘’ −๐‘”๐‘ก sin (โ„Ž๐‘ก + ∅)
314
๐‘(๐‘ ) = [
What are
b=0
d = 33.7442
3000 + 300๐‘ 
1
]
๐‘  3 + 40๐‘  2 + 300๐‘  + 3000 ๐‘ 
g = 3.1279
h = 8.8950
(g) (8%) What is the final value of z(t) and how long will it take to get within 1% of this value?
Final Value = sZ(s)s=0 = 3000/3000 = 1
Time required ≅ 5*0.3197 =1.6 sec
2. (15%) Use the residue theorem to solve the following differential equation for y(t).
22๐‘ฆฬ‡ + 44๐‘ฆ = 88
๐‘ฆ(0− ) = 5
22(๐‘ ๐‘Œ๐‘ ) − 5) + 44๐‘Œ(๐‘ ) = 88/๐‘ 
๐‘Œ(๐‘ ) =
5๐‘  + 4
๐‘ (๐‘  + 2)
๐‘ฆ(๐‘ก) = 2 + 3๐‘’ −2๐‘ก
3. (15%) Use separation of variables to solve the differential equation in problem 2.
๐‘ฆ(๐‘ก)
๐‘ก
๐‘‘๐‘ฆ
∫
= − ∫ ๐‘‘๐‘ก
๐‘ฆ(0) 2๐‘ฆ − 4
0
๐‘™๐‘› [
2๐‘ฆ(๐‘ก) − 4
] = −2๐‘ก
2๐‘ฆ(0) − 4
2๐‘ฆ(๐‘ก) − 4
= ๐‘’ −2๐‘ก
2๐‘ฆ(0) − 4
๐‘ฆ(๐‘ก) = 2 + 3๐‘’ −2๐‘ก
Exam 2b
1.
(30%) Find the magnitude and angle of the following complex numbers:
4 + j4
-4 + j4
-4 – j4
4 - j4
(4 + ๐‘—4)(−4 + ๐‘—4)
4 − ๐‘—4
2. For the differential equation below,
2๐‘งฬˆ + 24๐‘งฬ‡ + 40๐‘ง = 20๐‘ข
๐‘ง(0− ) = 0.5
๐‘งฬ‡ (0− ) = 3
๐‘ข(๐‘ก) = 5
315
(a) (20%) Solve for the Laplace transform of z(t), i.e. Z(s)=?.
(b)(5%) Check your Z(s) to see if it gives the correct initial value using the initial value theorem.
(c)(5%) Check your Z(s) to see if it gives the correct final value using the final value theorem.
IVT: limit sF(s)s=∞
FVT: limit sF(s)s=0
๐ฟ{๐‘“} = ๐น(๐‘ )
๐ฟ{๐‘“ฬ‡} = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ{๐‘“ฬˆ} = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡ (0− )
3. (a) (30%) Find the inverse Laplace transform of Y(s) below.
32
๐‘Œ(๐‘ ) =
๐‘ [(๐‘  + 4)2 + 42 ]
(b) (5%) Plug t = 0 into your equation for y(t) and see if it gives the same value as the IVT.
(c) (5%) Plug t=∞ into your equation for y(t) and see if it gives the same value as the FVT.
Portion of inverse Laplace for complex poles of
๐‘(๐‘ )
[(๐‘ +๐‘Ÿ)2 +๐œ”2 ]๐ท(๐‘ )
๐‘’ −๐‘Ÿ๐‘ก ๐‘(−๐‘Ÿ+๐‘—๐œ”)
|
| sin (๐œ”๐‘ก
๐œ” ๐ท(−๐‘Ÿ+๐‘—๐œ”)
+
๐‘(−๐‘Ÿ+๐‘—๐œ”)
๐‘Ž๐‘›๐‘”๐‘™๐‘’ [๐ท(−๐‘Ÿ+๐‘—๐œ”)])
Exam 2b
Solution
1. (30%) Find the magnitude and angle of the following complex numbers:
+4
๐œ‹
+4
4
3๐œ‹
−1 +4
2
2
-4 + j4 Magnitude= √4 + 4 = √32 = 5.66
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐‘ก๐‘Ž๐‘› ( ) =
−4
4
−4
5๐œ‹
-4 – j4 Magnitude= √42 + 42 = √32 = 5.66
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐‘ก๐‘Ž๐‘›−1 (−4) = 4
−4
7๐œ‹
4 - j4 Magnitude=√42 + 42 = √32 = 5.66
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐‘ก๐‘Ž๐‘›−1 ( ) =
+4
4
(4+๐‘—4)(−4+๐‘—4)
๐œ‹
3๐œ‹
7๐œ‹
3๐œ‹
Magnitude= 5.66*5.66/5.66 = 5.66 ๐‘Ž๐‘›๐‘”๐‘™๐‘’ = 4 + 4 − 4 = − 4
4−๐‘—4
4 + j4 Magnitue= √42 + 42 = √32 = 5.66
2.
๐‘Ž๐‘›๐‘”๐‘™๐‘’ = ๐‘ก๐‘Ž๐‘›−1 ( ) =
For the differential equation below,
2๐‘งฬˆ + 24๐‘งฬ‡ + 40๐‘ง = 20๐‘ข
๐‘ง(0− ) = 0.5
(a) (20%) Solve for the Laplace transform of z(t), Z(s).
๐‘งฬ‡ (0− ) = 3
2[๐‘  2 ๐‘(๐‘ ) − 0.5๐‘  − 3] + 24[๐‘ ๐‘(๐‘ ) − 0.5] + 40๐‘(๐‘ ) = 20
๐‘(๐‘ ) =
๐‘ข(๐‘ก) = 5
5
๐‘ 
0.5๐‘  2 + 9๐‘  + 50
๐‘ (๐‘  2 + 12๐‘  + 20)
(b)(5%) Check your Z(s) to see if it gives the correct initial value using the initial value theorem.
๐‘ ๐‘(๐‘ )๐‘ =∞ = 0.5 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘ 
316
(c)(5%) Check your Z(s) to see if it gives the correct final value using the final value theorem.
50
๐‘ ๐‘(๐‘ )๐‘ =0 =
= 2.5 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘  ๐‘ค๐‘–๐‘กโ„Ž ๐‘œ๐‘Ÿ๐‘–๐‘”๐‘–๐‘›๐‘Ž๐‘™ ๐‘‘๐‘–๐‘“๐‘“. ๐‘’๐‘ž๐‘› ๐‘ค๐‘–๐‘กโ„Ž ๐‘‘๐‘’๐‘Ÿ๐‘–๐‘ฃ๐‘Ž๐‘ก๐‘–๐‘ฃ๐‘’๐‘  = 0
20
IVT: limit sF(s)s=∞ FVT: limit sF(s)s=0
๐ฟ{๐‘“} = ๐น(๐‘ )
๐ฟ{๐‘“ฬ‡} = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ{๐‘“ฬˆ} = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡ (0− )
3. (a) (30%) Find the inverse Laplace transform of Y(s) below.
32
๐‘Œ(๐‘ ) =
๐‘ [(๐‘  + 4)2 + 42 ]
32๐‘’ ๐‘ ๐‘ก
1 32
32
+ | |
๐‘’ −4๐‘ก sin [4๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’( )๐‘ =−4+๐‘—4 ]
}
2
2
[(๐‘  + 4) + 4 ] ๐‘ =0 4 ๐‘  ๐‘ =−4+๐‘—4
๐‘ 
1 32 −4๐‘ก
3๐œ‹
3๐œ‹
=1+
๐‘’ sin (4๐‘ก − ) = 1 + √2๐‘’ −4๐‘ก sin (4๐‘ก − )
4 √32
4
4
(b) (5%) Plug t = 0 into your equation for y(t) and see if it gives the same value as the IVT.
๐‘ฆ(0) = 1 − 1 = 0 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘  ๐‘ค๐‘–๐‘กโ„Ž ๐ผ๐‘‰๐‘‡
(c) (5%) Plug t=∞ into your equation for y(t) and see if it gives the same value as the FVT.
๐‘ฆ(∞) = 1 − 0 = 1 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘  ๐‘ค๐‘–๐‘กโ„Ž ๐น๐‘‰๐‘‡
๐‘ฆ(๐‘ก) = {
Exam 2c
1.
(a) (10%) Find the initial and final values for the following Laplace transform using the Initial
Value Theorem and the Final Value theorem:
2๐‘  + 4
๐‘Š(๐‘ ) =
๐‘ (2๐‘  + 10)(๐‘  + 10)
(b) (20%) Use residue theorem to find the inverse Laplace transform of W(s) in part (a); check
you final equation at t = 0 and at t = ∞.
2. The input to the vehicle suspension shown below is the displacement u(t). The equations that
define this suspension are as follows:
317
(b) Suppose that the transfer function for w is as follows:
8๐‘ +25
๐‘ 2 +8๐‘ +25
(b.1) (2%) What is the DC gain?
(b.2) (4%) What are the eigenvalues?
(b.3) (2%) What is the undamped natural frequency, ๐œ”๐‘› ?
(b.4) (2%) What is the damping ratio?
(b.5) (2%) What is the time constant?
(b.6) (2%) If u(t) is a bump, about how long will it take to return to equilibrium?
3. (36%) Using the transfer function for the suspension in (2.b) above, assume that u(t) is a unit
step input and get an equation for w(t).
Exam 2c Solution
1. (a) (10%) Find the initial and final values for the following Laplace transform using the
Initial Value Theorem and the Final Value theorem:
๐‘Š(๐‘ ) =
2๐‘  + 4
๐‘ (2๐‘  + 10)(๐‘  + 10)
0+4
FVT gives (0+10)(0+10) = 0.04
Dividing the numerator and denominator by s2, the IVT gives [
2/๐‘ +4/๐‘ 2
10
๐‘ 
10
๐‘ 
(2+ )(1+ )
]
=0
๐‘ =∞
(b) (20%) Use residue theorem to find the inverse Laplace transform of W(s) in part (a); check
you final equation at t = 0 and at t = ∞.
0+2
−5 + 2
−10 + 2
๐‘ค(๐‘ก) =
๐‘’ −0๐‘ก +
๐‘’ −5๐‘ก +
๐‘’ −10๐‘ก
(0 + 5)(0 + 10)
(−5)(−5 + 10)
(−10)(−10 + 5)
= 0.04 + 0.12๐‘’ −5๐‘ก − 0.16๐‘’ −10๐‘ก
Checking:
๐‘ค(๐‘ก)๐‘ก=∞ = 0.04 + 0 + 0 = 0.04 which checks
๐‘ค(๐‘ก)๐‘ก=0 = 0.04 + 0.12 − 0.16 = 0 which checks
2. The input to the vehicle suspension shown below is the displacement u(t). The equations
that define this suspension are as follows:
318
(b) Suppose that the transfer function for w is as follows:
8๐‘ +25
๐‘ 2 +8๐‘ +25
(b.1) (2%) What is the DC gain? 1
(b.2) (4%) What are the eigenvalues? -4±๐‘—3
(b.3) (2%) What is the undamped natural frequency, ๐œ”๐‘› ? 5 rad/sec
(b.4) (2%) What is the damping ratio? 0.8
(b.5) (2%) What is the time constant? 0.25 sec
(b.6) (2%) If u(t) is a bump, about how long will it take to return to equilibrium? 1.25 sec
3. (36%) Using the transfer function for the suspension in (2.b) above, assume that u(t) is a
unit step input and get an equation for w(t).
8๐‘  + 25
1
8๐‘  + 25
๐‘Š(๐‘ ) = [ 2
] =
๐‘  + 8๐‘  + 25 ๐‘  ๐‘ [(๐‘  + 4)2 + 32 ]
25 0๐‘ก ๐‘’ −4๐‘ก
๐‘ค(๐‘ก) =
๐‘’ +
๐‘€ ๐‘ ๐‘–๐‘›( 3๐‘ก + ๐œ‘)
25
3
8๐‘  + 25
8(−4 + ๐‘—3) + 25
√(−7)2 + (24)2 25
๐‘€=|
|
=|
|=
=
=5
๐‘ 
−4 + ๐‘—3
5
๐‘ =−4+๐‘—3
√(−4)2 + (3)2
๐œ‘ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’(−7 + 24๐‘—) − ๐‘Ž๐‘›๐‘”๐‘™๐‘’(−4 + ๐‘—3) ≈ (๐œ‹ − 1.28) − (๐œ‹ − 0.64) = −0.64
๐‘ค(๐‘ก) = 1 + 1.66๐‘’ −4๐‘ก ๐‘ ๐‘–๐‘›( 3๐‘ก − 0.64)
Exam 3a
1. Consider the following differential equation for y(t).
2๐‘ฆฬ‡ + 5๐‘ฆ = 25 ๐‘ฆ(0− ) = 6
(a) (25%) Use the Laplace transform and the residue theorem to solve this differential equation
for y(t).
(b) (10%) Check your equation for y(t) at t = 0 and at t = ∞. Does your equation give the
correct values at t = 0 and at t = ∞?
(c) (15%) Perform two steps of Euler's integration to get y(T) and y(2T). Use 1/10 of the time
constant for T.
2. Consider the hydraulic lift system shown below. Fluid flows, Q, into the bottom of the
hydraulic cylinder. The pressure, P, increases and pushes the mass upwards with velocity ๐‘ฃ.
The model for the system is represented by the following equations :
1000๐‘ฃฬ‡ + 0.05๐‘ƒ = 9800
๐‘ƒ = 100000๐‘„
๐‘„ = 0.05๐‘ฃ
Velocity
v
Pressure
P
Flow Rate
Q
319
(a) (5%) We have three equations. What are the three unknowns?
(b) (20%) Assuming the initial velocity is zero, Laplace transform the equations and then find a
single equation for the Laplace transform of the pressure P(s).
(c) (10%) What is the final value for P(t) and how long does it take for P(t) to reach this final
value within 1 %?
3. (10%) Express the following 3rd order differential equation in a format of three simultaneous
1st order differential equations. All initial conditions are zero.
2๐‘งโƒ› + 16๐‘งฬˆ + 8๐‘งฬ‡ + 5๐‘ง = 10
4. (5%) Consider the Laplace transform W(s) shown below. Pretend that W(s) is a transfer
function with the input being a unit impulse. What are the MATLAB commands for getting a
plot of w(t) using the 'impulse' command in MATLAB?
2๐‘  + 4
๐‘Š(๐‘ ) = 2
3๐‘  + 20๐‘  + 5
>> help tf
TF Creation of transfer functions or conversion to transfer function.
SYS = TF(NUM,DEN) creates a continuous-time transfer function SYS with
numerator(s) NUM and denominator(s) DEN. The output SYS is a TF object.
>> help impulse
IMPULSE Impulse response of LTI models.
IMPULSE(SYS) plots the impulse response of the LTI model SYS (created
with either TF, ZPK, or SS).
Exam 3a Solution
1. Parts (a) and (b) of this problem are the Key Assignment. Consider the following differential
equation for y(t).
2๐‘ฆฬ‡ + 5๐‘ฆ = 25 ๐‘ฆ(0− ) = 6
(a) (25%) Use the Laplace transform and the residue theorem to solve this differential equation
for y(t).
2(๐‘ ๐‘Œ − 6) + 5๐‘Œ = 25/๐‘ 
6๐‘  + 12.5
๐‘Œ(๐‘ ) =
๐‘ (๐‘  + 2.5)
๐‘ฆ(๐‘ก) = 5 + ๐‘’ −2.5๐‘ก
(b) (10%) Check your equation for y(t) at t = 0 and at t = ∞. Does your equation give the
correct values at t = 0 and at t = ∞?
๐‘ฆ(๐‘ก)๐‘ก=0 = 6
๐‘ฆ(๐‘ก)๐‘ก=∞ = 5
Thus, the equation for y(t) gives the correct initial and final values.
(c) (15%) Perform two steps of Euler's integration to get y(T) and y(2T). Use 1/10 of the time
constant for T.
Time constant is 0.4 seconds so T=0.04.
320
t
0
0.04
0.08
y(t) ๐‘ฆฬ‡ (๐‘ก) = −2.5๐‘ฆ + 12.5 ๐‘ฆ(๐‘ก + ๐‘‡) = ๐‘‡๐‘ฆฬ‡ (๐‘ก) + ๐‘ฆ(๐‘ก)
6
12.5-2.5*6=-2.5
0.04*(-2.5)+6=5.9
5.9 12.5-2.5*5.9=-2.25
0.04*(-2.25)+5.9=5.81
5.81
2. Consider the hydraulic lift system shown below. Fluid flows, Q, into the bottom of the
hydraulic cylinder. The pressure, P, increases and pushes the mass upwards with velocity ๐‘ฃ.
The model for the system is represented by the following equations :
1000๐‘ฃฬ‡ + 0.05๐‘ƒ = 9800
๐‘ƒ = 100000๐‘„
๐‘„ = 0.05๐‘ฃ
Velocity
v
Pressure
P
Flow Rate
Q
(a) (5%) We have three equations. What are the three unknowns? v, P, and Q
(b) (20%) Assuming the initial velocity is zero, Laplace transform the equations and then find a
single equation for the Laplace transform of the pressure P(s).
9800
1000๐‘ ๐‘‰ + 0.05๐‘ƒ =
๐‘ 
๐‘ƒ = 100000๐‘„
๐‘„ = 0.05๐‘‰
Solving for P gives
49000
๐‘ƒ(๐‘ ) =
๐‘ (๐‘  + 0.25)
(c) (10%) What is the final value for P(t) and how long does it take for P(t) to reach this final
value within 1 %?
49000
๐‘ ๐‘ƒ(๐‘ )๐‘ =0 =
= 196000
It takes about 5 time constants which is 20 seconds.
(๐‘ +0.25)๐‘ =0
321
3. (10%) Express the following 3rd order differential equation in a format of three simultaneous
1st order differential equations. All initial conditions are zero.
2๐‘งโƒ› + 16๐‘งฬˆ + 8๐‘งฬ‡ + 5๐‘ง = 10
๐‘ฅ1 = ๐‘ง
๐‘ฅ2 = ๐‘งฬ‡
๐‘ฅ3 = ๐‘งฬˆ
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = ๐‘ฅ3
๐‘ฅฬ‡ 3 = 5 − 2.5๐‘ฅ1 − 4๐‘ฅ2 − 8๐‘ฅ3
4. (5%) Consider the Laplace transform W(s) shown below. Pretend that W(s) is a transfer
function with the input being a unit impulse. What are the MATLAB commands for getting a
plot of w(t) using the 'impulse' command in MATLAB?
2๐‘  + 4
๐‘Š(๐‘ ) = 2
3๐‘  + 20๐‘  + 5
>> w=tf([2 4],[3 20 5]);
>> impulse(w)
>> help tf
TF Creation of transfer functions or conversion to transfer function.
SYS = TF(NUM,DEN) creates a continuous-time transfer function SYS with
numerator(s) NUM and denominator(s) DEN. The output SYS is a TF object.
>> help impulse
IMPULSE Impulse response of LTI models.
IMPULSE(SYS) plots the impulse response of the LTI model SYS (created
with either TF, ZPK, or SS).
๐ฟ{๐‘“} = ๐น(๐‘ )
๐ฟ{๐‘“ฬ‡} = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ{๐‘“ฬˆ} = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡ (0− )
Exam 3b
1. Use Laplace transform to solve the following differential equations for z(t):
(a) (10%) ๐‘งฬ‡ + 25๐‘ง = 2๐‘ขฬ‡ + 15๐‘ข ๐‘ง(0− ) = 4
The input u(t) is a step with magnitude 5.
(b) (10%) What are MATLAB commands to get a plot of z(t) in part (a) using the ‘impulse’
command.
(c) (10%) ๐‘งฬˆ + 6๐‘งฬ‡ + 25๐‘ง = 50๐‘ข(๐‘ก) ๐‘ง(0− ) = 1 ๐‘งฬ‡ (0− ) = 0 The input u(t) is a unit impulse.
๐ฟ๐‘Ž๐‘. [๐‘“(๐‘ก)] = ๐น(๐‘ ) ๐ฟ๐‘Ž๐‘. [ ๐‘“ฬ‡ (๐‘ก)] = ๐‘ ๐น(๐‘ ) − ๐‘“(0− ) ๐ฟ๐‘Ž๐‘. [๐‘“ฬˆ (๐‘ก)] = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡(0− )
1 ๐‘(๐‘ )
๐‘(๐‘ )
)
|
|
๐‘’ −๐‘Ÿ๐‘ก sin(๐œ”๐‘ก + ๐œ‘)
๐œ‘ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
๐œ” ๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
2. A vehicle suspension system is defined by the following differential equations with input u(t):
100๐‘คฬˆ + 600๐‘คฬ‡ + 2500๐‘ค = 600๐‘ฃฬ‡ + 2500๐‘ฃ
200๐‘ฃฬˆ + 900๐‘ฃฬ‡ + 5000๐‘ฃ = 600๐‘คฬ‡ + 2500๐‘ค + 300๐‘ขฬ‡ + 2500๐‘ข
(a) (20%) Define state variables and then find the equations for the derivatives of the state
variables.
322
(b) (10%) Express your state variable derivative equations from (a) in state variable matrix
format assuming the output of interest is y = u - v, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =?
3. Consider the following non-linear differential equation for v(t):
๐‘ฃฬˆ + 84๐‘ฃฬ‡ + 300๐‘ฃ 3 = 2400
๐‘ฃ(0− ) = 1.9 ๐‘ฃฬ‡ (0− ) = 2
(a) (10%) What is the equilibrium (final value) of v(t)?
(b) (15%) Find a straight line approximation for ๐‘ฃ 3 for values of ๐‘ฃ in the neighborhood of the
equilibrium value.
(c) (5%) Substitute you straight line equation for ๐‘ฃ 3 in the original differential equation to
obtain a linear differential equation.
(d) (5%) The equilibrium value of your linear differential equation should be the same as the
equilibrium value for the original differential equation. Is this the case?
(e) (5%) What are the eigenvalues of your linearized differential equation? Time constants?
๐‘“(๐‘ฃ) = ๐‘“(๐‘ฃ๐‘œ ) + [
๐œ•๐‘“
1 ๐œ• 2๐‘“
] (๐‘ฃ − ๐‘ฃ๐‘œ ) + [ 2 ] (๐‘ฃ − ๐‘ฃ๐‘œ )2 + โ‹ฏ
๐œ•๐‘ฃ ๐‘ฃ๐‘œ
2! ๐œ•๐‘ฃ ๐‘ฃ
๐‘œ
Exam 3b
Solution
1. Use Laplace transform to solve the following differential equations for z(t):
(a) (10%) ๐‘งฬ‡ + 25๐‘ง = 2๐‘ขฬ‡ + 15๐‘ข
๐‘ง(0− ) = 4
The input u(t) is a step with magnitude 5.
๐‘ ๐‘(๐‘ ) − 4 + 25๐‘(๐‘ ) = (2๐‘  + 15)
๐‘(๐‘ ) =
๐Ÿ“
๐ฌ
14๐‘  + 75
๐‘ (๐‘  + 25)
๐‘ง(๐‘ก) = 3 + 11๐‘’ −25๐‘ก
(b) (10%) What are MATLAB commands to get a plot of z(t) in part (a) using the ‘impulse’
command.
>> z=tf([14 75],[1 25 0]);
>> impulse(z)
(c) (10%) ๐‘งฬˆ + 6๐‘งฬ‡ + 25๐‘ง = 50๐‘ข(๐‘ก) ๐‘ง(0− ) = 1 ๐‘งฬ‡ (0− ) = 0 The input u(t) is a unit impulse.
(๐‘  2 ๐‘(๐‘ ) − 1๐‘ ) + 6(๐‘ ๐‘(๐‘ ) − 1) + 25๐‘(๐‘ ) = 50(๐Ÿ)
๐‘(๐‘ ) =
๐‘  + 56
(๐‘  + 3)2 + 42
1
๐‘ง(๐‘ก) = |๐‘  + 56|๐‘ =−3+๐‘—4 ๐‘’ −3๐‘ก sin (4๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’(๐‘  + 56)๐‘ =−3+๐‘—4 )
4
๐‘ง(๐‘ก) = 13.29๐‘’ −3๐‘ก sin (4๐‘ก + 0.0753)
๐ฟ๐‘Ž๐‘. [๐‘“(๐‘ก)] = ๐น(๐‘ )
๐ฟ๐‘Ž๐‘. [ ๐‘“ฬ‡ (๐‘ก)] = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ๐‘Ž๐‘. [๐‘“ฬˆ (๐‘ก)] = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡(0− )
323
1 ๐‘(๐‘ )
|
|
๐‘’ −๐‘Ÿ๐‘ก sin(๐œ”๐‘ก + ๐œ‘)
๐œ” ๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
๐‘(๐‘ )
)
๐œ‘ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
2. A vehicle suspension system is defined by the following differential equations with input u(t):
100๐‘คฬˆ + 600๐‘คฬ‡ + 2500๐‘ค = 600๐‘ฃฬ‡ + 2500๐‘ฃ
200๐‘ฃฬˆ + 900๐‘ฃฬ‡ + 5000๐‘ฃ = 600๐‘คฬ‡ + 2500๐‘ค + 300๐‘ขฬ‡ + 2500๐‘ข
๐‘คฬˆ + 6๐‘คฬ‡ + 25๐‘ค = 6๐‘ฃฬ‡ + 25๐‘ฃ
๐‘ฃฬˆ + 4.5๐‘ฃฬ‡ + 25๐‘ฃ = 3๐‘คฬ‡ + 12.5๐‘ค + 1.5๐‘ขฬ‡ + 12.5๐‘ข
(a) (20%) Define state variables and then find the equations for the derivatives of the state
variables.
๐‘ฅ1 = ๐‘ค
๐‘ฅ2 = ๐‘คฬ‡
๐‘ฅ3 = ๐‘ฃ
๐‘ฅ4 = ๐‘ฃฬ‡ − 1.5๐‘ข
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −25๐‘ฅ1 − 6๐‘ฅ2 + 25๐‘ฅ3 + 6๐‘ฅ4 + 9๐‘ข
๐‘ฅฬ‡ 3 = ๐‘ฅ4 + 1.5๐‘ข
๐‘ฅฬ‡ 4 = 12.5๐‘ฅ1 + 3๐‘ฅ2 − 25๐‘ฅ3 − 4.5๐‘ฅ4 + 5.75๐‘ข
(b) (10%) Express your state variable derivative equations from (a) in state variable matrix
format assuming the output of interest is y = u - v, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
๐ด =?
๐ต =?
๐ถ =?
๐ท =?
0
0
1
0 0
25 6 ] ๐ต = [ 9 ] ๐ถ = [0 0
๐ด = [−25 −6
0
0
0
1
1.5
12.5 3 −25 −4.5
5.75
3. Consider the following non-linear differential equation for v(t):
๐‘ฃฬˆ + 84๐‘ฃฬ‡ + 300๐‘ฃ 3 = 2400
−1 0] ๐ท = [1]
๐‘ฃ(0− ) = 1.9 ๐‘ฃฬ‡ (0− ) = 2
(a) (10%) What is the equilibrium (final value) of v(t)?
0 + 0 + 300๐‘ฃ 3 = 2400 ๐‘กโ„Ž๐‘ข๐‘  ๐‘ฃ(∞) = 2
(b) (15%) Find a straight line approximation for ๐‘ฃ 3 for values of ๐‘ฃ in the neighborhood of the
equilibrium value.
๐‘ฃ 3 ≈ 23 + 3(2)2 (๐‘ฃ − 2) = 12๐‘ฃ − 16
(c) (5%) Substitute you straight line equation for ๐‘ฃ 3 in the original differential equation to
obtain a linear differential equation.
๐‘ฃฬˆ + 84๐‘ฃฬ‡ + 300(12๐‘ฃ − 16) = 2400
๐‘ฃฬˆ + 84๐‘ฃฬ‡ + 3600๐‘ฃ = 7200
(d) (5%) The equilibrium value of your linear differential equation should be the same as the
equilibrium value for the original differential equation. Is this the case?
324
7200
= 2 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘ 
3600
(e) (5%) What are the eigenvalues of your linearized differential equation? Time constants?
๐‘ฃ=
๐‘  2 + 84๐‘  + 3600 = (๐‘  + 42 + ๐‘—42.85)(๐‘  + 42 − ๐‘—42.85)
๐‘’๐‘–๐‘”๐‘’๐‘›๐‘ฃ๐‘Ž๐‘™๐‘ข๐‘’๐‘  = −42 ± ๐‘—42.85
1
= 0.0238 ๐‘ ๐‘’๐‘๐‘œ๐‘›๐‘‘๐‘ 
42
๐œ•๐‘“
1 ๐œ• 2๐‘“
๐‘“(๐‘ฃ) = ๐‘“(๐‘ฃ๐‘œ ) + [ ] (๐‘ฃ − ๐‘ฃ๐‘œ ) + [ 2 ] (๐‘ฃ − ๐‘ฃ๐‘œ )2 + โ‹ฏ
๐œ•๐‘ฃ ๐‘ฃ๐‘œ
2! ๐œ•๐‘ฃ ๐‘ฃ
๐‘ก๐‘–๐‘š๐‘’ ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก =
๐‘œ
Exam 3c
1.
Use the Laplace transform to solve the following differential equations for w(t). In each case, check W(s)
using the initial and final value theorems. Also, using your final equation for w(t), check using w(t) at t = 0
and at t = ∞. Also, in each case determine the time constant(s).
(a) (19 pts) 4๐‘คฬ‡ + 40๐‘ค = 0
๐‘ค(0− ) = 5
(b) (19 pts) 2๐‘คฬˆ + 12๐‘คฬ‡ + 50๐‘ค = 12๐‘ขฬ‡ + 50๐‘ข
๐‘ค(0− ) = 0 ๐‘คฬ‡ (0− ) = 0
u(t)
2
0
t
2. A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity 156.2 m/s.
The differential eqn for the vertical displacement is ๐‘ฆฬˆ + 0.005๐‘‰๐‘ฆฬ‡ ≈ −10 ๐‘ฆ(0− ) = 2 ๐‘š ๐‘ฆฬ‡ (0− ) = 100 ๐‘š/๐‘ 
and the equation for the horizontal displacement is ๐‘คฬˆ + 0.005๐‘‰๐‘คฬ‡ = 0
๐‘ค(0− ) = 0 ๐‘š ๐‘คฬ‡ (0− ) = 120 ๐‘š/๐‘ 
where ๐‘‰ = √๐‘ฆฬ‡ 2 + ๐‘คฬ‡ 2
(a) (16 pts) Express these equations in state variable format for an ode45 simulation.
(b) (26 pts) Complete the MATLAB code below for ode45 m-files to simulate these equations.
[t,x]=ode45(@Exam3Eqns,[0 10],[ 2 100 0 120 ]);
y=x(:,1);
w=x(:,3);
plot(?,?)
xlabel(‘ horizontal displacement, m ‘)
ylabel(‘ height, m‘)
325
function dx=Exam3Eqns(t,x)
dx=zeros( ? , 1);
dx(1)= ?;
dx(2)=?;
dx(3)=?;
dx(4)=?;
end
(c) (5 pts) Draw a sketch of what you think the plot will look like.
y
2
w
0
3.
(10 pts) The Z transform transfer function relating W(z) to the input U(z) for problem 1(b) above for
T=0.02 and u(t) piecewise constant is shown below. What is the discrete time solution to this this
differential equation?
0.1177๐‘ง − 0.1083
๐‘Š(๐‘ง) = [ 2
] ๐‘ˆ(๐‘ง)
๐‘ง − 1.878๐‘ง + 0.8869
๐‘{๐‘“(๐‘ก)) = ๐น(๐‘ง)
๐‘{๐‘“(๐‘ก + ๐‘‡)} = ๐‘ง๐น(๐‘ง)
๐‘{(๐‘“(๐‘ก + 2๐‘‡)} = ๐‘ง 2 ๐น(๐‘ง)
๐‘{๐‘“(๐‘ก − ๐‘‡)} = ๐‘ง −1 ๐น(๐‘ง)
๐‘(๐‘“(๐‘ก − 2๐‘‡)} = ๐‘ง −2 ๐น(๐‘ง)
4.
(22 pts) Express the following differential equation in state variable format assuming ๐‘คฬ‡ is the output of
interest. The input is a step with magnitude of 2. What are the initial conditions for the state variables?
A = ? B = ? C = ? D = ? initial conditions = ?
2๐‘คฬˆ + 12๐‘คฬ‡ + 50๐‘ค = 12๐‘ขฬ‡ + 50๐‘ข
๐‘ค(0− ) = 0
๐‘คฬ‡ (0− ) = 0
Exam 3c Solution
1.
Use the Laplace transform to solve the following differential equations for w(t). In each case, check W(s)
using the initial and final value theorems. Also, using your final equation for w(t), check using w(t) at t = 0
and at t = ∞. Also, in each case determine the time constant(s).
(a) (19 pts) 4๐‘คฬ‡ + 40๐‘ค = 0
๐‘ค(0− ) = 5
๐‘คฬ‡ + 10๐‘ค = 0
5
๐น๐‘‰๐‘‡ ๐‘”๐‘–๐‘ฃ๐‘’๐‘  0 ๐ผ๐‘‰๐‘‡ ๐‘”๐‘–๐‘ฃ๐‘’๐‘  5 ๐‘ก๐‘–๐‘š๐‘’ ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘›๐‘Ž๐‘ก = 0.1
๐‘  + 10
๐‘ค(๐‘ก) = 5๐‘’ −10๐‘ก
๐‘ค(0) = 5
๐‘ค(∞) = 0
๐‘Š(๐‘ ) =
326
(b) (19 pts) 2๐‘คฬˆ + 12๐‘คฬ‡ + 50๐‘ค = 12๐‘ขฬ‡ + 50๐‘ข
u(t)
๐‘ค(0− ) = 0
๐‘คฬ‡ (0− ) = 0
EV = −3 ๏‚ฑ j 4
๏ด = 1/ 3
2
0
t
6๐‘  + 25
2
]
๐น๐‘‰๐‘‡ ๐‘”๐‘–๐‘ฃ๐‘’๐‘  2 ๐ผ๐‘‰๐‘‡ ๐‘”๐‘–๐‘ฃ๐‘’๐‘  0
(๐‘  + 3)2 + 42 ๐‘ 
๐‘€
12๐‘  + 50
๐‘ค(๐‘ก) = 2 + ๐‘’ −3๐‘ก sin(4๐‘ก + ∅)
๐‘€=|
|
= 10
4
๐‘ 
๐‘ =−3+๐‘—4
∅ = ๐‘Ž๐‘›๐‘”(14 + ๐‘—48) − ๐‘Ž๐‘›๐‘”(−3 + ๐‘—4) = −0.9273
๐‘Š(๐‘ ) = [
๐‘ค(๐‘ก) = 2 + 2.5๐‘’ −3๐‘ก ๐‘ ๐‘–๐‘›(4๐‘ก − 0.9273)
For ๐‘  = −๐‘Ÿ ± ๐‘—๐œ”,
2.
๐‘€
๐œ”
๐‘’ −๐‘Ÿ๐‘ก sin(๐œ”๐‘ก + ๐œƒ)
๐‘€=|
๐‘(๐‘ )
|
๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
๐‘ค(0) = 2 − 2 = 0 ๐‘ค(∞) = 2
๐‘(๐‘ )
๐œƒ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’ {
}
๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity 156.2 m/s.
The differential eqn for the vertical displacement is ๐‘ฆฬˆ + 0.005๐‘‰๐‘ฆฬ‡ ≈ −10 ๐‘ฆ(0− ) = 2 ๐‘š ๐‘ฆฬ‡ (0− ) = 100 ๐‘š/๐‘ 
and the equation for the horizontal displacement is ๐‘คฬˆ + 0.005๐‘‰๐‘คฬ‡ = 0
๐‘ค(0− ) = 0 ๐‘š ๐‘คฬ‡ (0− ) = 120 ๐‘š/๐‘ 
where ๐‘‰ = √๐‘ฆฬ‡ 2 + ๐‘คฬ‡ 2
(a) (16 pts) Express these equations in state variable format for an ode45 simulation.
(b) (26 pts) Complete the MATLAB code below for ode45 m-files to simulate these equations.
[t,x]=ode45(@Exam3Eqns,[0 10],[ 2 100 0 120 ]);
y=x(:,1);
w=x(:,3);
plot(w,y)
xlabel(‘ horizontal displacement, m ‘)
ylabel(‘ height, m‘)
function dx=Exam3Eqns(t,x)
dx=zeros( ? , 1);
dx(1)= x(2);
V=sqrt(x(2)^2+x(4)^2);
dx(2)=-10-0.005*V*x(2);
dx(3)=x(4);
dx(4)=-0.005*V*x(4);
end
327
(c) (5 pts) Draw a sketch of what you think the plot will look like.
y
2
w
0
3.
(10 pts) The Z transform transfer function relating W(z) to the input U(z) for problem 1(b) above for
T=0.02 and u(t) piecewise constant is shown below. What is the discrete time solution to this this
differential equation?
0.1177๐‘ง − 0.1083
๐‘Š(๐‘ง) = [ 2
] ๐‘ˆ(๐‘ง)
๐‘ง − 1.878๐‘ง + 0.8869
๐‘ง 2 ๐‘Š(๐‘ง) − 1.878๐‘ง๐‘Š(๐‘ง) + 0.8869๐‘Š(๐‘ง) = 0.1177๐‘ง๐‘ˆ(๐‘ง) − 0.1083๐‘ˆ(๐‘ง)
Taking the inverse Z transform
๐‘ค๐‘˜+2 − 1.878๐‘ค๐‘˜ + 0.8869๐‘ค๐‘˜ = 0.1177๐‘ข๐‘˜+1 − 0.1083๐‘ข๐‘˜
Or
๐‘ค๐‘˜= 1.878๐‘ค๐‘˜−1 − 0.8869๐‘ค๐‘˜−2 + 0.1177๐‘ข๐‘˜−1 − 0.1083๐‘ข๐‘˜−2
๐‘{๐‘“(๐‘ก)) = ๐น(๐‘ง)
๐‘{๐‘“(๐‘ก + ๐‘‡)} = ๐‘ง๐น(๐‘ง)
๐‘{(๐‘“(๐‘ก + 2๐‘‡)} = ๐‘ง 2 ๐น(๐‘ง)
๐‘{๐‘“(๐‘ก − ๐‘‡)} = ๐‘ง −1 ๐น(๐‘ง)
๐‘(๐‘“(๐‘ก − 2๐‘‡)} = ๐‘ง −2 ๐น(๐‘ง)
4.
(22 pts) Express the following differential equation in state variable format assuming ๐‘คฬ‡ is the output of
interest. The input is a step with magnitude of 2. What are the initial conditions for the state variables?
A = ? B = ? C = ? D = ? initial conditions = ?
๐‘ฅ1 = ๐‘ค
๐ด=[
0
−25
2๐‘คฬˆ + 12๐‘คฬ‡ + 50๐‘ค = 12๐‘ขฬ‡ + 50๐‘ข
๐‘ค(0− ) = 0 ๐‘คฬ‡ (0− ) = 0
๐‘ฅ2 = ๐‘คฬ‡ − 6๐‘ข ๐‘ฅฬ‡1 = ๐‘ฅ2 + 6๐‘ข
๐‘ฅฬ‡ 2 = −25๐‘ฅ1 − 6๐‘ฅ2 − 11๐‘ข
๐‘ฆ = ๐‘ฅ2 + 6๐‘ข
1
]
−6
6
๐ต=[
] ๐ถ = [0
−11
1]
๐ท = [6]
๐‘ฅ1 (0− ) = 0 ๐‘ฅ2 (0− ) = 0
Exam 3d
1. Use Laplace transform to solve the following differential equations for z(t):
(a) (15%) 2๐‘งฬ‡ + 10๐‘ง = 4๐‘ขฬ‡ + 20๐‘ข ๐‘ง(0− ) = 3
The input u(t) is a step with magnitude 2.
−)
(b) (15%) 10๐‘งฬˆ + 60๐‘งฬ‡ + 250๐‘ง = 24๐‘ข(๐‘ก) ๐‘ง(0 = 0 ๐‘งฬ‡ (0− ) = 0 The input u(t) is a unit
impulse.
1 ๐‘(๐‘ )
๐‘(๐‘ )
)
|
|
๐‘’ −๐‘Ÿ๐‘ก sin(๐œ”๐‘ก + ๐œ‘)
๐œ‘ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
๐œ” ๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
2. A vehicle suspension system is defined by the following differential equations with input u(t):
328
100๐‘คฬˆ + 600๐‘คฬ‡ + 2500๐‘ค = 600๐‘ฃฬ‡ + 2500๐‘ฃ
200๐‘ฃฬˆ + 900๐‘ฃฬ‡ + 5000๐‘ฃ = 600๐‘คฬ‡ + 2500๐‘ค + 300๐‘ขฬ‡ + 2500๐‘ข
(a) (20%) Express this system of equations in state variable format.
(b) (10%) Express your state variable equations from (a) in state variable matrix format
assuming the output of interest is y = v - w, i.e.
(c)
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
= ๐ถ๐‘‹ + ๐ท๐‘ข
๐ด =? ๐ต =
๐ถ =?
๐ท =?
3. Consider the following non-linear differential equation for v(t):
๐‘ฃฬˆ + 2.4๐‘ฃฬ‡ + 3๐‘ฃ 3 = 3000
๐‘ฃ(0− ) = 10.01 ๐‘ฃฬ‡ (0− ) = 2
(a) (10%) What is the equilibrium (final value) of v(t)?
(b) (15%) Find a straight line approximation for ๐‘ฃ 3 for values of ๐‘ฃ in the neighborhood of the
equilibrium value.
(c) (5%) Substitute you straight line equation for ๐‘ฃ 3 in the original differential equation to
obtain a linear differential equation.
(d) (5%) The equilibrium value of your linear differential equation should be the same as the
equilibrium value for the original differential equation. Is this the case?
(e) (5%) What are the eigenvalues of your linearized differential equation? Time constants?
๐‘“(๐‘ฃ) = ๐‘“(๐‘ฃ๐‘œ ) + [
๐œ•๐‘“
1 ๐œ• 2๐‘“
] (๐‘ฃ − ๐‘ฃ๐‘œ ) + [ 2 ] (๐‘ฃ − ๐‘ฃ๐‘œ )2 + โ‹ฏ
๐œ•๐‘ฃ ๐‘ฃ๐‘œ
2! ๐œ•๐‘ฃ ๐‘ฃ
๐‘œ
Exam 3d Solution
1. Use Laplace transform to solve the following differential equations for z(t):
(a) (15%) 2๐‘งฬ‡ + 10๐‘ง = 4๐‘ขฬ‡ + 20๐‘ข ๐‘ง(0− ) = 3
The input u(t) is a step with magnitude 2.
2[๐‘ ๐‘ − 3] + 10๐‘ = [4๐‘  + 20]๐‘ˆ
2
14๐‘  + 40
(2๐‘  + 10)๐‘ = (4๐‘  + 20) + 6 =
๐‘ 
๐‘ 
7๐‘  + 20
๐‘(๐‘ ) =
๐‘ (๐‘  + 5)
๐‘ง(๐‘ก) = ๐‘…๐‘’๐‘ ๐‘–๐‘‘๐‘ข๐‘’ ๐‘“๐‘œ๐‘Ÿ ๐‘  = 0 + ๐‘…๐‘’๐‘ ๐‘–๐‘‘๐‘ข๐‘’ ๐‘“๐‘œ๐‘Ÿ ๐‘  = −5
๐‘ง(๐‘ก) = 4 + 3๐‘’ −5๐‘ก
Checking z(t) at t = ∞ gives the correct value of 4.
However, the t = 0+ value of z is different
from the t = 0 value due to the impulse created by ๐‘ขฬ‡ .
(b) (15%) 10๐‘งฬˆ + 60๐‘งฬ‡ + 250๐‘ง = 24๐‘ข(๐‘ก) ๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 0 The input u(t) is a unit
impulse.
(10๐‘  2 + 60๐‘  + 250)๐‘ = 24
2.4
๐‘(๐‘ ) =
(๐‘  + 3)2 + 42
1
๐‘ง(๐‘ก) = |2.4 + ๐‘—0|๐‘’ −3๐‘ก sin[4๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’(2.4 + ๐‘—0)] = 0.6๐‘’ −3๐‘ก sin (4๐‘ก)
4
329
The t = ∞ value of z and the t = 0- value check; note, we have the impulse input in the equation
for ๐‘งฬˆ which changes the initial value of ๐‘งฬ‡ but not the initial value of ๐‘ง.
1 ๐‘(๐‘ )
๐‘(๐‘ )
)
|
|
๐‘’ −๐‘Ÿ๐‘ก sin(๐œ”๐‘ก + ๐œ‘)
๐œ‘ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
๐œ” ๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
2. A vehicle suspension system is defined by the following differential equations with input u(t):
100๐‘คฬˆ + 600๐‘คฬ‡ + 2500๐‘ค = 600๐‘ฃฬ‡ + 2500๐‘ฃ
200๐‘ฃฬˆ + 900๐‘ฃฬ‡ + 5000๐‘ฃ = 600๐‘คฬ‡ + 2500๐‘ค + 300๐‘ขฬ‡ + 2500๐‘ข
(a) (20%) Express this system of equations in state variable format.
๐‘คฬˆ + 6๐‘คฬ‡ + 25๐‘ค = 6๐‘ฃฬ‡ + 25๐‘ฃ
๐‘ฃฬˆ + 4.5๐‘ฃฬ‡ + 25๐‘ฃ = 3๐‘คฬ‡ + 12.5๐‘ค + 1.5๐‘ขฬ‡ + 12.5๐‘ข
๐‘ฅ1 = ๐‘ค ๐‘ฅ2 = ๐‘คฬ‡
๐‘ฅ3 = ๐‘ฃ
๐‘ฅ4 = ๐‘ฃฬ‡ − 1.5๐‘ข
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −25๐‘ฅ1 − 6 ๐‘ฅ2 + 25๐‘ฅ3 + 6๐‘ฅ4 + 9๐‘ข
๐‘ฅฬ‡ 3 = ๐‘ฅ4 + 1.5๐‘ข
๐‘ฅฬ‡ 4 = 12.5๐‘ฅ1 + 3๐‘ฅ2 − 25๐‘ฅ3 − 4.5๐‘ฅ4 + 5.75๐‘ข
(b) (10%) Express your state variable equations from (a) in state variable matrix format
assuming the output of interest is y = v - w, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข ๐ด =? ๐ต =
? ๐ถ =? ๐ท =?
0
0
1
0 0
25 6 ]
๐ด = [−25 −6
๐ต=[ 9 ]
๐ถ = [−1 0 1 0]
๐ท = [0]
0
0
0
1
1.5
12.5 3 −25 −4.5
5.75
3. Consider the following non-linear differential equation for v(t):
๐‘ฃฬˆ + 2.4๐‘ฃฬ‡ + 3๐‘ฃ 3 = 3000
๐‘ฃ(0− ) = 10.01 ๐‘ฃฬ‡ (0− ) = 2
(a) (10%) What is the equilibrium (final value) of v(t)?
0 + 0 + 3๐‘ฃ 3 = 1000
๐‘ฃ(∞) = 10
(b) (15%) Find a straight line approximation for ๐‘ฃ 3 for values of ๐‘ฃ in the neighborhood of the
equilibrium value.
๐‘ฃ 3 ≈ 103 + 3(102 )(๐‘ฃ − 10) = 300๐‘ฃ − 2000
(c) (5%) Substitute you straight line equation for ๐‘ฃ 3 in the original differential equation to
obtain a linear differential equation.
๐‘ฃฬˆ + 2.4๐‘ฃฬ‡ + 3(300๐‘ฃ − 2000) = 3000
๐‘ฃฬˆ + 2.4๐‘ฃฬ‡ + 900๐‘ฃ = 9000
(d) (5%) The equilibrium value of your linear differential equation should be the same as the
equilibrium value for the original differential equation. Is this the case?
0 + 0 + 900๐‘ฃ = 9000
๐‘ฃ(∞) = 10
๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘ 
(e) (5%) What are the eigenvalues of your linearized differential equation? Time constants?
๐‘’๐‘–๐‘”๐‘’๐‘›๐‘ฃ๐‘Ž๐‘™๐‘ข๐‘’๐‘  = −1.2 ± ๐‘—29.98
1
๐‘ก๐‘–๐‘š๐‘’ ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก =
= 0.833
1.2
330
Exam 4.a
1.
A hydraulic car lift is shown below. At time t = 0, the valve is opened allowing pressurize
fluid to flow into the cylinder pressurizing the fluid under the piston causing the piston and
car to rise with velocity v.
velocity
v
piston
valve
closed
piston
P
Q
valve
open
The equations for this system are given below
๐’‡๐’๐’“๐’„๐’† ๐’ƒ๐’‚๐’๐’‚๐’๐’„๐’† ๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐’—ฬ‡ + ๐Ÿ—. ๐Ÿ–๐‘ท = ๐Ÿ—๐Ÿ–๐ŸŽ๐ŸŽ ๐’—(๐ŸŽ− ) = ๐ŸŽ ๐’Ž/๐’”
๐’—๐’‚๐’๐’—๐’† ๐’†๐’’๐’–๐’‚๐’•๐’Š๐’๐’ ๐‘ท = ๐Ÿ๐ŸŽ๐ŸŽ, ๐ŸŽ๐ŸŽ๐ŸŽ๐‘ธ ๐‘ต/๐’Ž๐Ÿ
๐’„๐’š๐’๐’Š๐’๐’…๐’†๐’“ ๐’†๐’’๐’–๐’‚๐’•๐’Š๐’๐’
๐‘ธ = ๐ŸŽ. ๐ŸŽ๐Ÿ“๐’— ๐’Ž๐Ÿ‘ /๐’”
(a)
(b)
(c)
(d)
(e)
(f)
What are the unknowns in the equations?
We know that the velocity will eventually become constant. What is this constant?
Convert the first equation to an algebraic equation using the Laplace transform.
Solve for the Laplace transform of v, i.e. V(s) = ?
Check your V(s) using the initial and final value theorems.
How long will it take for the velocity to become constant (within 1%)?
2. The mass shown below is sitting on a nonlinear spring with the spring force Fs = 10z3 N.
(a) If the mass vibrates with a small amplitude about equilibrium (z=4), obtain a linear
approximation for the differential equation for z by obtaining a straight line
approximation for z3.
๐Ÿ“๐’›ฬˆ + ๐Ÿ๐ŸŽ๐’›๐Ÿ‘ = ๐Ÿ”๐Ÿ’๐ŸŽ
331
M
z
(b) What is the frequency of vibration?
3. A sliding block system is shown below. A spring connects a swinging bar to the block. A force f is
the input to the system. The differential equations that model the motion of this system
resulting from a certain input f are also given below.
(a) What is the transfer function for y, i.e. ๐’€(๐’”) = [? ]๐‘ญ(๐’”) ๐’˜๐’‰๐’†๐’“๐’† ๐‘ญ(๐’”) = ๐‘ณ๐’‚๐’‘๐’๐’‚๐’„๐’†(๐’‡)
Exam 4.a Solution
1. A hydraulic car lift is shown below. At time t = 0, the valve is opened allowing pressurize
fluid to flow into the cylinder pressurizing the fluid under the piston causing the piston and
car to rise with velocity v.
velocity
v
piston
valve
closed
piston
P
Q
valve
open
332
The equations for this system are given below
๐’‡๐’๐’“๐’„๐’† ๐’ƒ๐’‚๐’๐’‚๐’๐’„๐’† ๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐’—ฬ‡ + ๐Ÿ—. ๐Ÿ–๐‘ท = ๐Ÿ—๐Ÿ–๐ŸŽ๐ŸŽ ๐’—(๐ŸŽ− ) = ๐ŸŽ ๐’Ž/๐’”
๐’—๐’‚๐’๐’—๐’† ๐’†๐’’๐’–๐’‚๐’•๐’Š๐’๐’ ๐‘ท = ๐Ÿ๐ŸŽ๐ŸŽ, ๐ŸŽ๐ŸŽ๐ŸŽ๐‘ธ ๐‘ต/๐’Ž๐Ÿ
๐’„๐’š๐’๐’Š๐’๐’…๐’†๐’“ ๐’†๐’’๐’–๐’‚๐’•๐’Š๐’๐’
๐‘ธ = ๐ŸŽ. ๐ŸŽ๐Ÿ“๐’— ๐’Ž๐Ÿ‘ /๐’”
(a)(6%)What are the unknowns in the equations? v, P, and Q
(b)(10%)We know that the velocity will eventually become constant. What is this constant?
0 + 9.8(100,000)0.05๐‘ฃ = 9800
๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘”๐‘–๐‘ฃ๐‘’๐‘  ๐‘ฃ = 0.2 ๐‘š/๐‘ 
(c)(10%)Convert the first equation to an algebraic equation using the Laplace transform.
๐ฟ๐‘Ž๐‘๐‘™๐‘Ž๐‘๐‘’ ๐‘œ๐‘“ ๐‘ฃฬ‡ = ๐‘ ๐‘‰
9800
๐ฟ๐‘Ž๐‘๐‘™๐‘Ž๐‘๐‘’ ๐‘œ๐‘“ 9800 =
๐‘ 
Thus,
1000๐‘ ๐‘‰ + 9.8๐‘ƒ =
9800
๐‘ 
(d)(15%)Solve for the Laplace transform of v, i.e. V(s) = ?
1000๐‘ ๐‘‰ + 9.8(100,000)0.05๐‘‰ =
๐‘‰(๐‘ ) =
9800
๐‘ 
9800
9.8
=
๐‘ (1000๐‘  + 9800(5)] ๐‘ (๐‘  + 49)
(e)(10%)Check your V(s) using the initial and final value theorems. If doesn’t check, go
back and determine what is wrong with part (c).
FVT:
IVT:
๐‘ฃ(๐‘ก)๐‘ก=∞
๐น๐‘‰๐‘‡: ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘‰(๐‘ )๐‘ =0
9.8
= ๐‘ ๐‘‰(๐‘ )๐‘ =0 = 49 = 0.2
๐ผ๐‘‰๐‘‡: ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘‰(๐‘ )๐‘ =∞
๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘–๐‘  ๐‘๐‘œ๐‘Ÿ๐‘Ÿ๐‘’๐‘๐‘ก
9.8
๐‘ฃ(๐‘ก)๐‘ก=∞ = ๐‘ ๐‘‰(๐‘ )๐‘ =0 = ∞+49 = 0 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘–๐‘  ๐‘๐‘œ๐‘Ÿ๐‘Ÿ๐‘’๐‘๐‘ก
(f)(3%)How long will it take for the velocity to become constant (within 1%)? 5/49 ≈ 0.1 ๐‘ ๐‘’๐‘
2. The mass shown below is sitting on a nonlinear spring with the spring force Fs = 10z3 N.
(a) (20%)If the mass vibrates with a small amplitude about equilibrium (z=4), obtain a linear
approximation for the differential equation for z by obtaining a straight line approximation
for z3.
5๐‘งฬˆ + 10๐‘ง 3 = 640
333
z3
M
z
64
0
4
z
z is always in the neighborhood of the equilibrium value of z=4.
Thus
๐‘ง 3 ≈ 43 + 3(4)2 (๐‘ง − 4) = 48๐‘ง − 128
5๐‘งฬˆ + 10(48๐‘ง − 128) = 640
Or,
5๐‘งฬˆ + 480๐‘ง = 1920
Checking:
0 + 480๐‘ง = 1920 ๐‘คโ„Ž๐‘–๐‘๐‘˜ ๐‘”๐‘–๐‘ฃ๐‘’๐‘  ๐‘ง = 4 ๐‘คโ„Ž๐‘–๐‘โ„Ž ๐‘โ„Ž๐‘’๐‘๐‘˜๐‘ 
(b) (5%)What is the frequency of vibration?
General form:
๐‘  2 + ๐œ”๐‘›2 = ๐ถ
๐œ”๐‘›2 =
480
5
= 96
๐‘กโ„Ž๐‘ข๐‘  ๐œ”๐‘› = √96 ≈ 9.8 ๐‘Ÿ๐‘Ž๐‘‘/๐‘ ๐‘’๐‘
3. A sliding block system is shown below. A spring connects a swinging bar to the block. A
force f is the input to the system. The differential equations that model the motion of this
system resulting from a certain input f are also given below.
(c) (21%) What is the transfer function for y, i.e. ๐‘Œ(๐‘ ) = [? ]๐น(๐‘ ) ๐‘คโ„Ž๐‘’๐‘Ÿ๐‘’ ๐น(๐‘ ) =
๐ฟ๐‘Ž๐‘๐‘™๐‘Ž๐‘๐‘’(๐‘“)
Note, since we only want the transfer function, we don’t need to consider any initial conditions
when doing the Laplace transform.
๐‘  2 ๐‘Œ + 100๐‘Œ − 50๐œƒ = 10๐น
๐‘  2 ๐œƒ + 64๐œƒ − 75๐‘Œ = 0
From the first equation,
(๐‘  2 + 100)๐‘Œ − 10๐น = 50๐œƒ
Into the 2nd equation gives
๐‘ ๐‘œ
(๐‘  2 + 100)๐‘Œ/50 − 10๐น/50 = ๐œƒ
334
(๐‘  2 + 64)[(๐‘  2 + 100)๐‘Œ/50 − 10๐น/50] − 75๐‘Œ = 0
Or
(0.02๐‘  4 + 3.28๐‘  2 + 53)๐‘Œ = 0.2๐น
Or
๐‘Œ(๐‘ ) = [
๐‘ 4
10
] ๐น(๐‘ )
+ 164๐‘  2 + 2650
Exam 4.b
1.
๐’€(๐’”) = [
๐Ÿ๐’”+๐Ÿ”
] ๐‘ผ(๐’”)
(๐’”+๐Ÿ’)๐Ÿ +๐Ÿ“๐Ÿ
(a) (4%) What are the eigenvalues?
(b) (4%) What is the undamped natural frequency?
(c) (4%) What is the damping ratio?
(d) (4%) What is the time constant?
(e) (4%) If u(t) = 10, what is the final value of y?
(f) (3%) How long will it take for y to reach this final value within 1%?
2. (25%) Fill in the blanks below.
๐Ÿ๐’”๐Ÿ + ๐Ÿ“๐ŸŽ๐’” + ๐Ÿ๐Ÿ๐Ÿ
๐‘พ(๐’”) =
๐’”(๐’”๐Ÿ + ๐Ÿ๐ŸŽ๐’” + ๐Ÿ•๐Ÿ’)
๐’˜(๐’•) = ๐’‚๐’†๐’ƒ๐’• + ๐’„๐’†๐’…๐’• ๐ฌ๐ข๐ง (๐’‡๐’• + ∅)
๐’‚ =? _______________ ๐’ƒ =? ______________ ๐’… = ? _________________ ๐’‡ =? _________________
3. The input flow to a water tank system is ๐‘„๐‘– . The equations that model the water heights H1 and
H2 and the flow Q between the tanks are as follows:
๐‘ธ๐’Š − ๐‘ธ − ๐Ÿ’๐‘ฏฬ‡๐Ÿ = ๐ŸŽ
๐‘ฏ๐Ÿ (๐ŸŽ− ) = ๐Ÿ๐ŸŽ
๐‘ธ − ๐Ÿ”๐‘ฏฬ‡๐Ÿ = ๐ŸŽ
๐‘ฏ๐Ÿ (๐ŸŽ− ) = ๐Ÿ
๐‘ฏ๐Ÿ − ๐‘ฏ๐Ÿ = ๐Ÿ๐ŸŽ๐ŸŽ๐‘ธฬ‡ + ๐Ÿ๐ŸŽ๐‘ธ
๐‘ธ(๐ŸŽ− ) = ๐ŸŽ
335
Qi
H1 (t )
H 2 (t )
Q
(a) (3%) What are the unknowns?
(b) (6%) Define state variables for this system of equations.
(c) (3%) What are the initial conditions for your state variables?
(d) (10%) Write the derivative equations for your state variables.
(e) (10%) Express your state variable equations in matrix format assuming Q is the output
of interest.
4. (20%) Find ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ฃ(๐‘ก)๐‘ก→∞
๐’—ฬˆ + ๐Ÿ“๐’—ฬ‡ + ๐Ÿ๐Ÿ‘๐’— = ๐Ÿ๐Ÿ”๐’‡(๐’•)
๐’‡(๐’•) = ๐Ÿ๐ŸŽ๐ฌ๐ข๐ง (๐Ÿ“๐’•)
Exam 4.b Solution
๐Ÿ๐’”+๐Ÿ”
1. ๐’€(๐’”) = [(๐’”+๐Ÿ’)๐Ÿ +๐Ÿ“๐Ÿ ] ๐‘ผ(๐’”)
(a) (4%) What are the eigenvalues? −4 ± ๐‘—5
(b) (4%) What is the undamped natural frequency? √41 = 6.4
(c) (4%) What is the damping ratio? 0.625
(d) (4%) What is the time constant? 0.25
(e) (4%) If u(t) = 10, what is the final value of y? 1.46
(f) (3%) How long will it take for y to reach this final value within 1%? 1.25 sec
336
2. (25%) Fill in the blanks below.
๐‘พ(๐’”) =
๐Ÿ๐’”๐Ÿ + ๐Ÿ“๐ŸŽ๐’” + ๐Ÿ๐Ÿ๐Ÿ
๐’”(๐’”๐Ÿ + ๐Ÿ๐ŸŽ๐’” + ๐Ÿ•๐Ÿ’)
๐’˜(๐’•) = ๐’‚๐’†๐’ƒ๐’• + ๐’„๐’†๐’…๐’• ๐ฌ๐ข๐ง (๐’‡๐’• + ∅)
๐’‚=๐Ÿ‘
๐’ƒ=๐ŸŽ
๐’… = −๐Ÿ“
๐’‡=๐Ÿ•
3. The input flow to a water tank system is ๐‘„๐‘– . The equations that model the water heights
H1 and H2 and the flow Q between the tanks are as follows:
๐‘ธ๐’Š − ๐‘ธ − ๐Ÿ’๐‘ฏฬ‡๐Ÿ = ๐ŸŽ
๐‘ฏ๐Ÿ (๐ŸŽ− ) = ๐Ÿ๐ŸŽ
๐‘ธ − ๐Ÿ”๐‘ฏฬ‡๐Ÿ = ๐ŸŽ
๐‘ฏ๐Ÿ (๐ŸŽ− ) = ๐Ÿ
๐‘ฏ๐Ÿ − ๐‘ฏ๐Ÿ = ๐Ÿ๐ŸŽ๐ŸŽ๐‘ธฬ‡ + ๐Ÿ๐ŸŽ๐‘ธ
๐‘ธ(๐ŸŽ− ) = ๐ŸŽ
Qi
H1 (t )
H 2 (t )
Q
(a) (3%) What are the unknowns? ๐ป1 , ๐ป2 , ๐‘Ž๐‘›๐‘‘ ๐‘„
(b) (6%) Define state variables for this system of equations.
๐‘ฅ1 = ๐ป1 ๐‘ฅ2 = ๐ป2 ๐‘ฅ3 = ๐‘„
(c) (3%) What are the initial conditions for your state variables?
๐‘ฅ1 (0− ) = 10 , ๐‘ฅ2 (0− ) = 2 , ๐‘ฅ3 (0− ) = 0
(d) (10%) Write the derivative equations for your state variables in terms of the
input ๐‘„๐‘– .
๐‘ฅฬ‡ 1 = 0.25๐‘„๐‘– − 0.25๐‘ฅ3
๐‘ฅ3
๐‘ฅฬ‡ 2 =
6
๐‘ฅฬ‡ 3 = 0.01๐‘ฅ1 − 0.01๐‘ฅ2 − 0.1๐‘ฅ3
(e) (10%) Express your state variable equations in matrix format assuming Q is the output
of interest.
0
0
−0.25
0.25
๐ด=[ 0
0
0.166 ] ๐ต = [ 0 ] ๐ถ = [0 0 1] ๐ท = [0]
0.01 −0.01 −0.1
0
337
4. (20%) Find ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ฃ(๐‘ก)๐‘ก→∞
๐‘ฃฬˆ + 5๐‘ฃฬ‡ + 13๐‘ฃ = 26๐‘“(๐‘ก)
๐‘“(๐‘ก) = 20sin (5๐‘ก)
26
๐‘ ๐‘–๐‘›(5๐‘ก + ∅)
|
+ 5๐‘  + 13 ๐‘ =๐‘—5
26
= 20
๐‘ ๐‘–๐‘›(5๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’(26 + ๐‘—0) − ๐‘Ž๐‘›๐‘”๐‘™๐‘’[−12 + ๐‘—25])
|−12 + ๐‘—25|
= 18.75๐‘ ๐‘–๐‘›(5๐‘ก + 0 − ๐œ‹ + ๐‘ก๐‘Ž๐‘›−1 2.1)
= 18.75๐‘ ๐‘–๐‘›(5๐‘ก − 2)
๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ฃ(๐‘ก)๐‘ก→∞ = 20 |
๐‘ 2
Exam 4.c
1.
A. Use the Laplace transform to solve the following differential equations for w(t).
B. In each case, check W(s) using the initial and final value theorems.
C. Also, for (a) using your final equation for w(t), check using w(t) at t = 0 and at t = ∞.
D. Also, in each case determine the time constant(s).
(a) (15 pts) ๐Ÿ’๐’˜ฬ‡ + ๐Ÿ’๐ŸŽ๐’˜ = ๐ŸŽ
๐’˜(๐ŸŽ− ) = ๐Ÿ“
(b) (15 pts) ๐Ÿ๐’˜ฬˆ + ๐Ÿ๐Ÿ๐’˜ฬ‡ + ๐Ÿ“๐ŸŽ๐’˜ = ๐Ÿ๐Ÿ๐’–ฬ‡ + ๐Ÿ“๐ŸŽ๐’–
๐’˜(๐ŸŽ− ) = ๐ŸŽ
๐’˜ฬ‡(๐ŸŽ− ) = ๐ŸŽ
u(t)
2
0
t
๐’˜(๐’•) = ๐’‚๐’†−๐’ƒ๐’• + ๐’„๐’†−๐’…๐’• ๐ฌ๐ข๐ง (๐’‡๐’• + ∅)
a=?
b=?
d=?
f=?
2. A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity
156.2 m/s.
The differential eqn for the vertical displacement is ๐‘ฆฬˆ + 0.005๐‘‰๐‘ฆฬ‡ ≈ −10 ๐‘ฆ(0− ) = 2 ๐‘š ๐‘ฆฬ‡ (0− ) = 100 ๐‘š/๐‘ 
and the equation for the horizontal displacement is ๐‘คฬˆ + 0.005๐‘‰๐‘คฬ‡ = 0
๐‘ค(0− ) = 0 ๐‘š ๐‘คฬ‡ (0− ) = 120 ๐‘š/๐‘ 
where ๐‘‰ = √๐‘ฆฬ‡ 2 + ๐‘คฬ‡ 2
338
y
w
(a) (15 pts) Express these equations in state variable format for an ode45 simulation.
(b) (10 pts) Complete the MATLAB code below for ode45 m-files to simulate these equations.
[t,x]=ode45(@Exam3Eqns,[0 10],[
y=
;
w=
;
]);
plot(w,y)
xlabel( ‘
‘)
ylabel( ‘
‘)
function dx=Exam3Eqns(t,x)
dx=zeros( , 1);
dx(1)=
End
(c) (5 pts) Draw a sketch of what you think the plot will look like.
3. (5 pts) The Z transform transfer function relating W(z) to the input U(z) for problem 1(b)
above for T=0.02 and u(t) piecewise constant is shown below. What is the discrete time
solution to this this differential equation, i.e. wk = ?
0.1177๐‘ง − 0.1083
๐‘Š(๐‘ง) = [ 2
] ๐‘ˆ(๐‘ง)
๐‘ง − 1.878๐‘ง + 0.8869
339
4. (15 pts) For the differential equation in 1(b) above, what are the MATLAB commands
for generating a plot of w(t) using the ‘impulse’ command?
๐‘{๐‘“(๐‘ก)) = ๐น(๐‘ง)
๐‘{๐‘“(๐‘ก + ๐‘‡)} = ๐‘ง๐น(๐‘ง)
๐‘{(๐‘“(๐‘ก + 2๐‘‡)} = ๐‘ง 2 ๐น(๐‘ง)
๐‘{๐‘“(๐‘ก − ๐‘‡)} = ๐‘ง −1 ๐น(๐‘ง)
๐‘(๐‘“(๐‘ก − 2๐‘‡)} = ๐‘ง −2 ๐น(๐‘ง)
5. (20 pts) Express the following differential equation in state variable format assuming ๐‘คฬ‡ is
the output of interest. What are the initial conditions for the state variables?
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
A=? B=? C=?
D = ? state variable initial conditions = ?
๐‘ค(0− ) = 0
2๐‘คฬˆ + 12๐‘คฬ‡ + 50๐‘ค = 12๐‘ขฬ‡ + 50๐‘ข
๐‘คฬ‡ (0− ) = 0
๐‘ข(0− ) = 0
Exam 4.c Solution
1. A. Use the Laplace transform to solve the following differential equations for w(t).
E. In each case, check W(s) using the initial and final value theorems.
F. Also, for (a) using your final equation for w(t), check using w(t) at t = 0 and at t = ∞.
G. Also, in each case determine the time constant(s).
(a) (15 pts) 4๐‘คฬ‡ + 40๐‘ค = 0
๐‘พ(๐’”) =
๐‘ค(0− ) = 5
๐Ÿ“
๐’” + ๐Ÿ๐ŸŽ
๐’˜(๐’•) = ๐Ÿ“๐’†−๐Ÿ๐ŸŽ๐’•
๐‘ญ๐‘ฝ๐‘ป ๐’ˆ๐’Š๐’—๐’†๐’” ๐ŸŽ
๐’˜(∞) = ๐ŸŽ
๐‘ฐ๐‘ฝ๐‘ป ๐’ˆ๐’Š๐’—๐’†๐’” ๐Ÿ“
๐’˜(๐ŸŽ) = ๐Ÿ“
๐’•๐’Š๐’Ž๐’† ๐’„๐’๐’๐’”๐’•๐’‚๐’๐’• = ๐ŸŽ. ๐Ÿ ๐’”๐’†๐’„.
340
(b) (15 pts) ๐Ÿ๐’˜ฬˆ + ๐Ÿ๐Ÿ๐’˜ฬ‡ + ๐Ÿ“๐ŸŽ๐’˜ = ๐Ÿ๐Ÿ๐’–ฬ‡ + ๐Ÿ“๐ŸŽ๐’–
๐’˜(๐ŸŽ− ) = ๐ŸŽ
๐’˜ฬ‡(๐ŸŽ− ) = ๐ŸŽ
u(t)
2
0
๐‘Š(๐‘ ) = [
๐‘ 2
t
6๐‘  + 25
2
12๐‘  + 50
] =
+ 6๐‘  + 25 ๐‘  ๐‘ [(๐‘  + 3)2 + 42 ]
๐น๐‘‰๐‘‡ ๐‘”๐‘–๐‘ฃ๐‘’๐‘  2
๐ผ๐‘‰๐‘‡ ๐‘”๐‘–๐‘ฃ๐‘’๐‘  0
๐’˜(๐’•) = ๐’‚๐’†−๐’ƒ๐’• + ๐’„๐’†−๐’…๐’• ๐ฌ๐ข๐ง (๐’‡๐’• + ∅)
a= 2
b=0
d=3
f=4
Time constant = 0.333 sec.
2. A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity
156.2 m/s.
The differential eqn for the vertical displacement is ๐‘ฆฬˆ + 0.005๐‘‰๐‘ฆฬ‡ ≈ −10 ๐‘ฆ(0− ) = 2 ๐‘š ๐‘ฆฬ‡ (0− ) = 100 ๐‘š/๐‘ 
and the equation for the horizontal displacement is ๐‘คฬˆ + 0.005๐‘‰๐‘คฬ‡ = 0
๐‘ค(0− ) = 0 ๐‘š ๐‘คฬ‡ (0− ) = 120 ๐‘š/๐‘ 
2
2
where ๐‘‰ = √๐‘ฆฬ‡ + ๐‘คฬ‡
y
w
(a) (15 pts) Express these equations in state variable format for an ode45 simulation.
๐‘ฅ1 = ๐‘ฆ
๐‘ฅ2 = ๐‘ฆฬ‡
๐‘ฅ3 = ๐‘ค
๐‘ฅ4 = ๐‘คฬ‡
๐‘‰ = √๐‘ฅ22 + ๐‘ฅ42
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −10 − .005๐‘‰๐‘ฅ2
๐‘ฅฬ‡ 3 = ๐‘ฅ4
๐‘ฅฬ‡ 4 = −0.005๐‘‰๐‘ฅ4
(b) (10 pts) Complete the MATLAB code below for ode45 m-files to simulate these equations.
[t,x]=ode45(@Exam3Eqns,[0 10],[ 0 100 0 120 ]);
y= X(:,1) ;
w= X(:,3) ;
plot(w,y)
xlabel( ‘ horizontal distance, m ‘ )
ylabel( ‘ vertical distance, m ‘ )
341
function dx=Exam3Eqns(t,x)
dx = zeros( 4 , 1);
dx(1) = x(2);
V = sqrt(x(2)^2 +x(4)^2);
dx(2) = - 10 - 0.005*V*x(2);
dx(3) = x(4);
dx(4 )= - 0.0005*V*x(4);
end
(c) (5 pts) Draw a sketch of what you think the plot will look like.
y
2
0
w
3. (5 pts) The Z transform transfer function relating W(z) to the input U(z) for problem 1(b)
above for T=0.02 and u(t) piecewise constant is shown below. What is the discrete time
solution to this this differential equation, i.e. wk = ?
0.1177๐‘ง − 0.1083
๐‘Š(๐‘ง) = [ 2
] ๐‘ˆ(๐‘ง)
๐‘ง − 1.878๐‘ง + 0.8869
๐‘ค๐‘˜+2 − 1.878๐‘ค๐‘˜−1 + 0.8869๐‘ค๐‘˜ = 0.1177๐‘ข๐‘˜+1 − 0.1083๐‘ข๐‘˜
๐‘ค๐‘˜ = 1.878๐‘ค๐‘˜−1 − 0.8869๐‘ค๐‘˜−2 + 0.1177๐‘ข๐‘˜−1 − 0.1083๐‘ข๐‘˜−2
4. (15 pts) For the differential equation in 1(b) above, what are the MATLAB commands
for generating a plot of w(t) using the ‘impulse’ command?
12s + 50
2
24s + 100
W(s) = [ 2
] = 3
2s + 12s + 50 s 2s + 12s 2 + 50s + 0
12๐‘  + 50
= 3
๐‘  + 6๐‘  2 + 25๐‘  + 0
>> wd = tf([24 100],[2 12 50 0]); or wd = tf([12 50],[1 6 25 0]);
>> impulse(wd)
5. (20 pts) Express the following differential equation in state variable format assuming ๐‘คฬ‡
is the output of interest. What are the initial conditions for the state variables?
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
A = ? B = ? C = ? D = ? st. var. initial conditions: ๐‘ฅ1 (0− ) = ๐‘ฅ2 (0− ) = 0
2๐‘คฬˆ + 12๐‘คฬ‡ + 50๐‘ค = 12๐‘ขฬ‡ + 50๐‘ข
๐‘ค(0− ) = 0 ๐‘คฬ‡ (0− ) = 0
๐‘ข(0− ) = 0
342
๐‘คฬˆ + 6๐‘คฬ‡ + 25๐‘ค = 6๐‘ขฬ‡ + 25๐‘ข ๐‘คฬˆ − 6๐‘ข = −6๐‘คฬ‡ − 25๐‘ค + 25๐‘ข
๐‘ฅ1 = ๐‘ค ๐‘ฅ2 = ๐‘คฬ‡ − 6๐‘ข ๐‘ฅฬ‡ 1 = ๐‘ฅ2 + 6๐‘ข ๐‘ฅฬ‡ 2 = −25๐‘ฅ1 − 6(๐‘ฅ2 + 6๐‘ข) + 25๐‘ข
0
๐ด=[
−25
1
]
−6
๐ต=[
6
] ๐ถ = [0 1]
−11
๐ท = [6]
Exam 5.a
1. The differential equation for y in terms of the input u is as follows:
๐‘ฆ(0− ) = 0.5 ๐‘ฆฬ‡ (0− ) = 1
4๐‘ฆฬˆ + 24๐‘ฆฬ‡ + 100๐‘ฆ = 32๐‘ข + 8๐‘ขฬ‡
u(t)
2
0
t
(a)
(b)
(c)
(d)
(e)
(10%) What is the transfer function for y?
(10%) What are the eigenvalues?
(10%) What is the undamped natural frequency? What is the damping ratio?
(5%) What is U(s), the Laplace transform of u(t)?
(10%) Find an equation for Y(s), the Laplace transform of y(t). Check your answer using the final
value theorem and the initial value theorem.
(f) (5%) Draw a sketch of your estimate of y(t).
y(t)
0
t
2. The modelling equations for the mass spring damper system are shown below in terms of the
force input F.
343
(a) (6%) List the unknowns in these equations.
(b) (10%) Laplace transform these equations assuming all initial conditions are zero.
(c) (14%) Solve for the transfer function for x.
๐‘ +2
3. Consider the following function of s: ๐‘Ž = ๐‘ +4
(a) (10%) For s = -2+j4, what is |๐‘Ž| ?
(b) (10%) For s=-2+j4, what is the angle(a)?
Exam 5.a Solution
1. The differential equation for y in terms of the input u is as follows:
๐‘ฆ(0− ) = 0.5 ๐‘ฆฬ‡ (0− ) = 1
4๐‘ฆฬˆ + 24๐‘ฆฬ‡ + 100๐‘ฆ = 32๐‘ข + 8๐‘ขฬ‡
u(t)
2
0
t
(a) (10%) What is the transfer function for y?
2๐‘ +8
๐‘ 2 +6๐‘ +25
(b) (10%) What are the eigenvalues? ๐‘  2 + 6๐‘  + 25 = (๐‘  + 3 + ๐‘—4)(๐‘  + 3 − ๐‘—4)
Eigenvalues = −3 ± ๐‘—4
(c) (10%) What is the undamped natural frequency? What is the damping ratio?
๐œ”๐‘› = √25 = 5 ๐‘Ÿ๐‘Ž๐‘‘/ sec
2๐›ฟ๐œ”๐‘› = 6
๐‘‡โ„Ž๐‘ข๐‘ , ๐‘‘๐‘Ž๐‘š๐‘๐‘–๐‘›๐‘” ๐‘Ÿ๐‘Ž๐‘ก๐‘–๐‘œ = 0.6
(d) (5%) What is U(s), the Laplace transform of u(t)? U(s) = 2/s
(e) (10%) Find an equation for Y(s), the Laplace transform of y(t). Check your answer using
the final value theorem and the initial value theorem.
(๐‘  2 ๐‘Œ − 0.5๐‘  − 1) + 6(๐‘ ๐‘Œ − 0.5) + 25๐‘Œ = (2๐‘  + 8)๐‘ˆ
2
(๐‘  2 + 6๐‘  + 25)๐‘Œ(๐‘ ) = (2๐‘  + 8) + 0.5๐‘† + 4
๐‘†
0.5๐‘  2 + 8๐‘  + 16
๐‘ฆ(๐‘ ) =
๐‘ (๐‘  2 + 6๐‘  + 25)
344
16
= 0.64
25
0.5
=
= 0.5
1
๐น๐‘‰๐‘‡:
๐‘ ๐‘Œ(๐‘ )๐‘ =0 =
๐ผ๐‘‰๐‘‡:
๐‘ ๐‘Œ(๐‘ )๐‘ =∞
(f) (5%) Draw a sketch of your estimate of y(t).
y(t)
0.64
0.5
0
t
1.66
4. The modelling equations for the mass spring damper system are shown below in terms of the
force input F.
(a) (6%) List the unknowns in these equations. ๐น๐‘  , ๐‘ฅ, ๐น๐‘‘
(b) (10%) Laplace transform these equations assuming all initial conditions are zero.
20
+ 100๐‘‹
๐‘ 
๐น๐‘‘ = 5๐‘ ๐‘‹
20
2๐‘  2 ๐‘‹ + ๐น๐‘  + ๐น๐‘‘ − ๐น −
=0
๐‘ 
(c) (14%) Solve for the transfer function for x.
๐น๐‘  =
1
] ๐น(๐‘ )
+ 5๐‘  + 100
1
๐‘‡๐‘Ÿ๐‘Ž๐‘›๐‘ ๐‘“๐‘’๐‘Ÿ ๐‘“๐‘ข๐‘›๐‘๐‘ก๐‘–๐‘œ๐‘› = [ 2
]
2๐‘  + 5๐‘  + 100
๐‘‹(๐‘ ) = [
2๐‘  2
345
5. Consider the following function of s: ๐‘Ž =
๐‘ +2
๐‘ +4
−2+๐‘—4+2
(1) (10%) For s = -2+j4, what is |๐‘Ž| ? |−2+๐‘—4+4| =
√๐‘—4
√2+๐‘—4
=
4
√20
= 0.894
(2) (10%) For s=-2+j4, what is the angle(a)?
๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
−2+๐‘—4+2
−2+๐‘—4+4
๐œ‹
) = ๐‘Ž๐‘›๐‘”๐‘™๐‘’(๐‘—4) − ๐‘Ž๐‘›๐‘”๐‘™๐‘’(2 + ๐‘—4) = − 1.107 = 0.464 ๐‘Ÿ๐‘Ž๐‘‘
2
Exam 5.b
1. (25%) The differential equation for a system is 2๐‘ฆฬˆ + 2.02๐‘ฆฬ‡ + 18๐‘ฆ = 2.02๐‘ขฬ‡ + 18๐‘ข
If the input is ๐‘ข(๐‘ก) = 2sin (2.91๐‘ก), we know that y(t) will eventually become a sine function. i.e.
๐‘ฆ(๐‘ก) = ๐ด๐‘ ๐‘–๐‘›(๐œ”๐‘ก + ∅) The MATLAB code below was used to generate the bode plot also shown.
What are A, ๐œ”, and ∅?
>> g=tf([2.02 18],[2 2.02 18]);
>> bode(g,{1,5})
Bode Diagram
15
Magnitude (dB)
10
System: g
Frequency (rad/s): 2.91
Magnitude (dB): 10
5
0
Phase (deg)
-5
0
-45
System: g
Frequency (rad/s): 2.91
Phase (deg): -62.1
-90
-135
10
0
Frequency (rad/s)
2. (25%) Suppose you are going to solve the differential equation in part 1 using ode45. Also,
assume that the input in this case is a step with magnitude 0.2 and the initial conditions are y(0-)
= 2 and ๐‘ฆฬ‡ (0− ) = 0.3. We know that two M-files are needed to perform an ode45 simulation.
Complete the two M-files below to get a plot of y(t).
M-file #1
[t,x]=ode45(@exam2,[? ?],[? ?]);
346
y = ?;
plot(t,y)
xlabel(‘time, sec.’)
ylabel((‘y(t)’)
M-file #2
function dx = exam2(t,x)
dx=zeros(?,1);
?
?
?
end
3. The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 (0− ) = 2
๐ป2 (0− ) = 5
๐ป1 − ๐ป2 = 250๐‘„ฬ‡ + 25๐‘„
H1
๐‘„(0− ) = 0
H2
Q
(a) (5%) List the unknowns in these equations. Do the number of equations match the number
of unknowns?
(b) (10%) Laplace transform each of these equations.
(c) (15%) Simplify these equations to a single equation for H2(s). Check your answer using the
initial value theorem.
(d) (5%) Use the final value theorem to solve for the final value of H2(t). Does this value make
sense?
(e) (5%) Draw an estimate plot of H2(t). Showing initial and final values and time to final value.
(f) (10%) Suppose instead of Laplace transforming the original three equations, express them in
state variable format. Define the state variables and write their derivative equations. What
are the initial conditions of the state variables?
M in dB is 20Log10M
๐ฟ{๐‘“ฬ‡ (๐‘ก)} = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
347
Exam 5.b Solution
(25%) The differential equation for a system is 2๐‘ฆฬˆ + 2.02๐‘ฆฬ‡ + 18๐‘ฆ = 2.02๐‘ขฬ‡ + 18๐‘ข
If the input is ๐‘ข(๐‘ก) = 2sin (2.91๐‘ก), we know that y(t) will eventually become a sine function. i.e.
๐‘ฆ(๐‘ก) = ๐ด๐‘ ๐‘–๐‘›(๐œ”๐‘ก + ∅) The MATLAB code below was used to generate the bode plot also shown.
What are A, ๐œ”, and ∅?
>> g=tf([2.02 18],[2 2.02 18]);
>> bode(g,{1,5})
1.
A= 2*10(10/20) = 2√10 = 6.325
๐œ” = 2.91 ๐‘Ÿ๐‘Ž๐‘‘๐‘ 
∅ = −62.1 deg (−1.0838 ๐‘Ÿ๐‘Ž๐‘‘)
Bode Diagram
15
Magnitude (dB)
10
System: g
Frequency (rad/s): 2.91
Magnitude (dB): 10
5
0
Phase (deg)
-5
0
-45
System: g
Frequency (rad/s): 2.91
Phase (deg): -62.1
-90
-135
10
0
Frequency (rad/s)
2. (25%) Suppose you are going to solve the differential equation in part 1 using ode45. Also,
assume that the input in this case is a step with magnitude 0.2 and the initial conditions are y(0-)
= 2 and ๐‘ฆฬ‡ (0− ) = 0.3. We know that two M-files are needed to perform an ode45 simulation.
Complete the two M-files below to get a plot of y(t).
๐‘ฅ1 = ๐‘ฆ ๐‘ฅ2 = ๐‘ฆฬ‡ − 1.01๐‘ข
๐‘ฅฬ‡ 1 = ๐‘ฅ2 + 1.01๐‘ข
๐‘ฅฬ‡ 2 = −9๐‘ฅ1 − 1.01๐‘ฅ2 + 7.98๐‘ข
Time constant = 2 sec
M-file #1
[t,x]=ode45(@exam2,[0 10],[2 0.3]);
y = x(:,1);
plot(t,y)
xlabel(‘time, sec.’)
ylabel((‘y(t)’)
M-file #2
function dx = exam2(t,x)
dx=zeros(2,1);
348
u=0.2;
dx(1)=x(2)+1.01*u;
dx(2)=-9*x(1)-1.01*x(2)+7.98*u
end
3. The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 (0− ) = 2
๐ป2 (0− ) = 5
๐ป1 − ๐ป2 = 250๐‘„ฬ‡ + 25๐‘„
๐‘„(0− ) = 0
5
H1
H2
4
H2
Q
t
50,000
(a) (5%) List the unknowns in these equations. Do the number of equations match the
number of unknowns? H1, H2, and Q
3 equations and 3 unknowns
(b) (10%) Laplace transform each of these equations.
-Q - 20(sH1 - 2)=0
Q - 40(sH2 - 5)=0
H1 - H2 = 250sQ + 25Q
(c) (15%) Simplify these equations to a single equation for H2(s). Check your answer
using the initial value theorem.
๐ป2 (๐‘ ) =
800∗1250๐‘ 2 +800∗125๐‘ +240
๐‘ (800∗250๐‘ 2 +800∗25๐‘ +60)
=
5๐‘ 2 +0.5๐‘ +0.0012
๐‘ (๐‘ 2 +0.1๐‘ +0.0003)
๐ผ๐‘‰๐‘‡: ๐‘ ๐ป2 (๐‘ )๐‘ =∞ = 5 correct
(d) (5%) Use the final value theorem to solve for the final value of H2(t). Does this make
sense?
๐น๐‘‰๐‘‡: ๐‘ ๐ป2 (๐‘ )๐‘ =0 = 4 makes sense since between initial tank levels.
(e) (5%) Draw an estimate plot of H2(t). Showing initial and final values and time to
final value.
Largest time constant = 10,000 sec. So, time to steady state = 50,000 sec. See above.
(f) (10%) Suppose instead of Laplace transforming the original three equations, express
them in state variable format. Define the state variables and write their derivative
equations. What are the initial conditions of the state variables?
349
๐‘ฅ1 = ๐ป1 ๐‘ฅ1 (0) = 2 ๐‘ฅ2 = ๐ป2 ๐‘ฅ2 (0) = 5 ๐‘ฅ3 = ๐‘„ ๐‘ฅ3 (0) = 0
๐‘ฅ3
๐‘ฅ3
๐‘ฅฬ‡ 1 = −
๐‘ฅฬ‡ 2 =
๐‘ฅฬ‡ 3 = 0.004๐‘ฅ1 − 0.004๐‘ฅ2 − 0.1๐‘ฅ3
20
40
Exam 5.c
1.
(15%) Use Laplace transform to solve the following differential equation for y(t). Be sure to
check your solution at t = 0 and at t = ∞.
2๐‘ฆฬ‡ + 20๐‘ฆ = 40
๐‘ฆ(0− ) = 1
2. Consider the differential equation for w(t) shown below with input u(t).
๐‘ค
โƒ› + 18๐‘คฬˆ + 105๐‘คฬ‡ + 250๐‘ค = 75๐‘ขฬ‡ + 500๐‘ข
(a) (5%) What is the transfer function relating W(s) to U(s)?
(b) (10%) Assume
๐‘  3 + 18๐‘  2 + 105๐‘  + 250 = (๐‘  + 10)[(๐‘  + 4)2 + 32 ]
What are the eigenvalues? What are the time constants? Damping ratio?
(c) (10%) Suppose u(t) is a step input with magnitude of 3.
Also, assume ๐‘ค(0− ) = 0, ๐‘คฬ‡ (0− ) = 0, ๐‘คฬˆ (0− ) = 2.
Find an equation for W(s); check your answer using the initial value and final value
theorems.
(d) (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the
following form:
๐‘ค(๐‘ก) = ๐‘Ž + ๐‘๐‘’ −๐‘๐‘ก + ๐‘‘๐‘’ −๐‘“๐‘ก sin (๐‘”๐‘ก + โ„Ž)
๐‘Ž =?
๐‘ =?
๐‘ =?
๐‘“ =?
๐‘” =?
(e) (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without
first finding an equation for w(t).
(f) (15%) Use the ‘simulation diagram’ approach to express the differential equation in state
variable format, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข Note, ๐‘คฬˆ is the output of interest.
What are the initial conditions for your state variables if
๐‘ค(0− ) = 0
๐‘คฬ‡ (0− ) = 0
๐‘คฬˆ (0− ) = 2
๐‘ข(0− ) = 0
3. The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 (0− ) = 2
๐ป2 (0− ) = 5
350
๐ป1 − ๐ป2 = 25๐‘„
H1
H2
Q
a. (5%) List the unknowns in these equations. Do the number of equations match the
number of unknowns?
b. (10%) Laplace transform each of these equations.
c. (10%) Simplify these equations to a single equation for Q(s). Check your answer using
the initial and final value theorems.
Exam 5.c Solution
1. (15%) Use Laplace transform to solve the following differential equation for y(t). Be sure to
check your solution at t = 0 and at t = ∞.
2๐‘ฆฬ‡ + 20๐‘ฆ = 40
๐‘Œ(๐‘ ) =
20 + ๐‘ 
๐‘ (๐‘  + 10)
๐‘ฆ(0− ) = 1
๐‘ฆ(๐‘ก) = 2 − ๐‘’ −10๐‘ก
๐‘ฆ(0) = 1
๐‘ฆ(∞) = 2
1. Consider the differential equation for w(t) shown below with input u(t).
๐‘ค
โƒ› + 18๐‘คฬˆ + 105๐‘คฬ‡ + 250๐‘ค = 75๐‘ขฬ‡ + 500๐‘ข
(a) (5%) What is the transfer function relating W(s) to U(s)?
75๐‘  + 500
๐‘  3 + 18๐‘  2 + 105๐‘  + 250
3
๐‘  + 18๐‘  2 + 105๐‘  + 250 = (๐‘  + 10)[(๐‘  + 4)2 + 32 ]
๐บ(๐‘ ) =
(b) (10%) Assume
What are the eigenvalues? What are the time constants? Damping ratio?
Eigenvalues = -10 and -4 ±๐‘—3
Time constants = 0.1 and 0.25
Damping ratio = 0.8
(c) (10%) Suppose u(t) is a step input with magnitude of 3.
Also, assume ๐‘ค(0− ) = 0, ๐‘คฬ‡ (0− ) = 0, ๐‘คฬˆ (0− ) = 2.
351
Find an equation for W(s); check your answer using the initial value and final value
theorems.
227๐‘  + 1500
๐‘ ๐‘Š(๐‘ )๐‘ =0 = 6
๐‘ ๐‘Š(๐‘ )๐‘ =∞ = 0
๐‘ (๐‘  3 + 18๐‘  2 + 105๐‘  + 250)
(d) (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of
the following form:
๐‘Š(๐‘ ) =
๐‘ค(๐‘ก) = ๐‘Ž + ๐‘๐‘’ −๐‘๐‘ก + ๐‘‘๐‘’ −๐‘“๐‘ก sin (๐‘”๐‘ก + โ„Ž)
๐‘Ž=6
๐‘=
−10(227) + 1500
−770
=
= 1.7111
−10((−10 + 4)2 + 32 ) −450
๐‘ = 10
๐‘“=4
๐‘”=3
(e) (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t)
without first finding an equation for w(t).
>> num = [227 1500];
>> den = [1 18 105 250 0];
>> G = tf(num,den);
>> impulse(G)
(f) (15%) Use the ‘simulation diagram’ approach to express the differential equation in
state variable format, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
Note, ๐‘คฬˆ is the output of
interest.
๐‘ฅ1 = ๐‘ค
๐‘ฅ2 = ๐‘คฬ‡
๐‘ฅ3 = ๐‘คฬˆ − 75๐‘ข
0
1
0
0
๐ด=[ 0
๐ต = [ 75 ]
๐ถ = [0 0 1]
0
1 ]
−250 −105 −18
−850
What are the initial conditions for your state variables if
๐‘ค(0− ) = 0
๐‘คฬ‡ (0− ) = 0
๐‘คฬˆ (0− ) = 2
๐‘ข(0− ) = 0
−
−
๐‘ฅ1 (0 ) = 0
๐‘ฅ2 (0 ) = 0
๐‘ฅ3 (0− ) = 2
๐ท = [75]
2. The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 (0− ) = 2
๐ป2 (0− ) = 5
๐ป1 − ๐ป2 = 25๐‘„
352
H1
H2
Q
(a) (5%) List the unknowns in these equations. Do the number of equations match the
number of unknowns? H1, H2, Q
(b) (10%) Laplace transform each of these equations.
−๐‘„ − 20(๐‘ ๐ป1 − 2) = 0
๐‘„ − 40(๐‘ ๐ป2 − 5) = 0
๐ป1 − ๐ป2 = 25๐‘„
(c) (10%) Simplify these equations to a single equation for Q(s). Check your answer
using the initial value and final value theorems. The theorems confirm the equation for
Q(s).
−120
๐‘„(๐‘ ) =
๐‘„(๐‘ก)๐‘ก=∞ = ๐‘ ๐‘„(๐‘ )๐‘ =0 = 0
๐‘„(๐‘ก)๐‘ก=0 = ๐‘ ๐‘„(๐‘ )๐‘ =∞ = −0.1
1000๐‘  + 3
Exam 6.a
1. The differential equation for y in terms of the input u is as follows:
4๐‘ฆฬˆ + 24๐‘ฆฬ‡ + 100๐‘ฆ = 32๐‘ข + 8๐‘ขฬ‡
u(t)
2
0
(a)
(b)
(c)
(d)
(e)
๐‘ฆ(0− ) = 0.5 ๐‘ฆฬ‡ (0− ) = 1
t
(10%) What is the transfer function for y?
(10%) What are the eigenvalues?
(10%) What is the undamped natural frequency? What is the damping ratio?
(5%) What is U(s), the Laplace transform of u(t)?
(10%) Find an equation for Y(s), the Laplace transform of y(t). Check your answer using the
final value theorem and the initial value theorem.
(f) (5%) Draw a sketch of your estimate of y(t).
353
y(t)
0
t
2. The modelling equations for the mass spring damper system are shown below in terms of the
force input F.
(a) (6%) List the unknowns in these equations.
(b) (10%) Laplace transform these equations assuming all initial conditions are zero.
(c) (14%) Solve for the transfer function for x.
๐‘ +2
(d) Consider the following function of s: ๐‘Ž = ๐‘ +4
(d.1) (10%) For s = -2+j4, what is |๐‘Ž| ?
(d.2) (10%) For s=-2+j4, what is the angle(a)?
๐ฟ(๐‘“) = ๐น(๐‘ )
๐ฟ(๐‘“ฬ‡ ) = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ(๐‘“ฬˆ ) = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“(0− )
FVT: ๐‘“(∞) = ๐‘ ๐น(๐‘ )๐‘ =0
IVT: ๐‘“(0+ ) = ๐‘ ๐น(๐‘ )๐‘ =∞
Exam 6.a Solution
(a) The differential equation for y in terms of the input u is as follows:
4๐‘ฆฬˆ + 24๐‘ฆฬ‡ + 100๐‘ฆ = 32๐‘ข + 8๐‘ขฬ‡
๐‘ฆ(0− ) = 0.5 ๐‘ฆฬ‡ (0− ) = 1
354
u(t)
2
0
t
(b) (10%) What is the transfer function for y?
2๐‘ +8
๐‘ 2 +6๐‘ +25
(c) (10%) What are the eigenvalues? ๐‘  2 + 6๐‘  + 25 = (๐‘  + 3 + ๐‘—4)(๐‘  + 3 − ๐‘—4)
Eigenvalues = −3 ± ๐‘—4
(d) (10%) What is the undamped natural frequency? What is the damping ratio?
๐œ”๐‘› = √25 = 5 ๐‘Ÿ๐‘Ž๐‘‘/ sec
2๐›ฟ๐œ”๐‘› = 6 ๐‘‡โ„Ž๐‘ข๐‘ , ๐‘‘๐‘Ž๐‘š๐‘๐‘–๐‘›๐‘” ๐‘Ÿ๐‘Ž๐‘ก๐‘–๐‘œ = 0.6
(e) (5%) What is U(s), the Laplace transform of u(t)? U(s) = 2/s
(f) (10%) Find an equation for Y(s), the Laplace transform of y(t). Check your answer using the final
value theorem and the initial value theorem.
(๐‘  2 ๐‘Œ − 0.5๐‘  − 1) + 6(๐‘ ๐‘Œ − 0.5) + 25๐‘Œ = (2๐‘  + 8)๐‘ˆ
2
(๐‘  2 + 6๐‘  + 25)๐‘Œ(๐‘ ) = (2๐‘  + 8) + 0.5๐‘† + 4
๐‘†
0.5๐‘  2 + 8๐‘  + 16
๐‘ฆ(๐‘ ) =
๐‘ (๐‘  2 + 6๐‘  + 25)
16
๐น๐‘‰๐‘‡: ๐‘ ๐‘Œ(๐‘ )๐‘ =0 =
= 0.64
25
0.5
๐ผ๐‘‰๐‘‡: ๐‘ ๐‘Œ(๐‘ )๐‘ =∞ =
= 0.5
1
(g) (5%) Draw a sketch of your estimate of y(t).
y(t)
0.64
0.5
0
1.66
t
(h) The modelling equations for the mass spring damper system are shown below in terms of the
force input F.
355
(i) (6%) List the unknowns in these equations. ๐น๐‘  , ๐‘ฅ, ๐น๐‘‘
(j) (10%) Laplace transform these equations assuming all initial conditions are zero.
20
+ 100๐‘‹
๐‘ 
๐น๐‘‘ = 5๐‘ ๐‘‹
20
2๐‘  2 ๐‘‹ + ๐น๐‘  + ๐น๐‘‘ − ๐น −
=0
๐‘ 
๐น๐‘  =
(k) (14%) Solve for the transfer function for x.
1
] ๐น(๐‘ )
+ 5๐‘  + 100
1
๐‘‡๐‘Ÿ๐‘Ž๐‘›๐‘ ๐‘“๐‘’๐‘Ÿ ๐‘“๐‘ข๐‘›๐‘๐‘ก๐‘–๐‘œ๐‘› = [ 2
]
2๐‘  + 5๐‘  + 100
๐‘‹(๐‘ ) = [
2๐‘  2
๐‘ +2
(l) Consider the following function of s: ๐‘Ž = ๐‘ +4
−2+๐‘—4+2
(1) (10%) For s = -2+j4, what is |๐‘Ž| ? |−2+๐‘—4+4| =
√๐‘—4
√2+๐‘—4
=
4
√20
= 0.894
(2) (10%) For s=-2+j4, what is the angle(a)?
๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
−2+๐‘—4+2
−2+๐‘—4+4
๐œ‹
) = ๐‘Ž๐‘›๐‘”๐‘™๐‘’(๐‘—4) − ๐‘Ž๐‘›๐‘”๐‘™๐‘’(2 + ๐‘—4) = − 1.107 = 0.464 ๐‘Ÿ๐‘Ž๐‘‘
2
Exam 6.b
1.
(25%) The differential equation for a system is 2๐‘ฆฬˆ + 2.02๐‘ฆฬ‡ + 18๐‘ฆ = 2.02๐‘ขฬ‡ + 18๐‘ข
If the input is ๐‘ข(๐‘ก) = 2sin (2.91๐‘ก), we know that y(t) will eventually become a sine function. i.e.
๐‘ฆ(๐‘ก) = ๐ด๐‘ ๐‘–๐‘›(๐œ”๐‘ก + ∅) The MATLAB code below was used to generate the bode plot also shown.
What are A, ๐œ”, and ∅?
>> g=tf([2.02 18],[2 2.02 18]);
>> bode(g,{1,5})
356
Bode Diagram
15
Magnitude (dB)
10
System: g
Frequency (rad/s): 2.91
Magnitude (dB): 10
5
0
Phase (deg)
-5
0
-45
System: g
Frequency (rad/s): 2.91
Phase (deg): -62.1
-90
-135
10
0
Frequency (rad/s)
2. (25%) Suppose you are going to solve the differential equation in part 1 using ode45. Also,
assume that the input in this case is a step with magnitude 0.2 and the initial conditions are y(0-)
= 2 and ๐‘ฆฬ‡ (0− ) = 0.3. We know that two M-files are needed to perform an ode45 simulation.
Complete the two M-files below to get a plot of y(t).
M-file #1
[t,x]=ode45(@exam2,[? ?],[? ?]);
y = ?;
plot(t,y)
xlabel(‘time, sec.’)
ylabel((‘y(t)’)
M-file #2
function dx = exam2(t,x)
dx=zeros(?,1);
?
357
?
?
end
3. The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 (0− ) = 2
๐ป2 (0− ) = 5
๐ป1 − ๐ป2 = 250๐‘„ฬ‡ + 25๐‘„
H1
๐‘„(0− ) = 0
H2
Q
3.1 (5%) List the unknowns in these equations. Do the number of equations match the number of
unknowns?
3.2 (10%) Laplace transform each of these equations.
3.3 (15%) Simplify these equations to a single equation for H2(s). Check your answer using the initial
value theorem.
3.4 (5%) Use the final value theorem to solve for the final value of H2(t). Does this value make
sense?
3.5 (5%) Draw an estimate plot of H2(t). Showing initial and final values and time to final value.
3.6 (10%) Suppose instead of Laplace transforming the original three equations, express them in
state variable format. Define the state variables and write their derivative equations. What are
the initial conditions of the state variables?
M in dB is 20Log10M
๐ฟ{๐‘“ฬ‡ (๐‘ก)} = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
Exam 6.b Solution
1.
(25%) The differential equation for a system is 2๐‘ฆฬˆ + 2.02๐‘ฆฬ‡ + 18๐‘ฆ = 2.02๐‘ขฬ‡ + 18๐‘ข
If the input is ๐‘ข(๐‘ก) = 2sin (2.91๐‘ก), we know that y(t) will eventually become a sine function. i.e.
๐‘ฆ(๐‘ก) = ๐ด๐‘ ๐‘–๐‘›(๐œ”๐‘ก + ∅) The MATLAB code below was used to generate the bode plot also shown.
What are A, ๐œ”, and ∅?
>> g=tf([2.02 18],[2 2.02 18]);
>> bode(g,{1,5})
358
Bode Diagram
15
Magnitude (dB)
10
System: g
Frequency (rad/s): 2.91
Magnitude (dB): 10
5
0
Phase (deg)
-5
0
-45
System: g
Frequency (rad/s): 2.91
Phase (deg): -62.1
-90
-135
10
0
Frequency (rad/s)
A= 2*10(10/20) = 2√10 = 6.325
๐œ” = 2.91 ๐‘Ÿ๐‘Ž๐‘‘๐‘ 
∅ = −62.1 deg (−1.0838 ๐‘Ÿ๐‘Ž๐‘‘)
2. (25%) Suppose you are going to solve the differential equation in part 1 using ode45. Also,
assume that the input in this case is a step with magnitude 0.2 and the initial conditions are y(0-)
= 2 and ๐‘ฆฬ‡ (0− ) = 0.3. We know that two M-files are needed to perform an ode45 simulation.
Complete the two M-files below to get a plot of y(t).
๐‘ฅ1 = ๐‘ฆ ๐‘ฅ2 = ๐‘ฆฬ‡ − 1.01๐‘ข
๐‘ฅฬ‡ 1 = ๐‘ฅ2 + 1.01๐‘ข
๐‘ฅฬ‡ 2 = −9๐‘ฅ1 − 1.01๐‘ฅ2 + 7.98๐‘ข
Time constant = 2 sec
M-file #1
[t,x]=ode45(@exam2,[0 10],[2 0.3]);
y = x(:,1);
plot(t,y)
xlabel(‘time, sec.’)
ylabel((‘y(t)’)
M-file #2
function dx = exam2(t,x)
dx=zeros(2,1);
u=0.2;
dx(1)=x(2)+1.01*u;
dx(2)=-9*x(1)-1.01*x(2)+7.98*u
end
3. The equations for the water flowing through a long line between two tanks and the height of
the water in the tanks are as follows:
359
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 (0− ) = 2
๐ป2 (0− ) = 5
๐ป1 − ๐ป2 = 250๐‘„ฬ‡ + 25๐‘„
๐‘„(0− ) = 0
5
H1
H2
4
H2
Q
t
50,000
3.1 (5%) List the unknowns in these equations. Do the number of equations match the number
of unknowns? H1, H2, and Q 3 equations and 3 unknowns
3.2 (10%) Laplace transform each of these equations.
-Q - 20(sH1 - 2)=0
Q - 40(sH2 - 5)=0
H1 - H2 = 250sQ + 25Q
3.3 (15%) Simplify these equations to a single equation for H2(s). Check your answer using the
initial value theorem.
๐ป2 (๐‘ ) =
800∗1250๐‘ 2 +800∗125๐‘ +240
๐‘ (800∗250๐‘ 2 +800∗25๐‘ +60)
5๐‘ 2 +0.5๐‘ +0.0012
= ๐‘ (๐‘ 2 +0.1๐‘ +0.0003)
๐ผ๐‘‰๐‘‡: ๐‘ ๐ป2 (๐‘ )๐‘ =∞ = 5 correct
3.4 (5%) Use the final value theorem to solve for the final value of H2(t). Does this make sense?
๐น๐‘‰๐‘‡: ๐‘ ๐ป2 (๐‘ )๐‘ =0 = 4 makes sense since between initial tank levels.
3.5 (5%) Draw an estimate plot of H2(t). Showing initial and final values and time to final value.
Largest time constant = 10,000 sec. So, time to steady state = 50,000 sec. See above.
3.6 (10%) Suppose instead of Laplace transforming the original three equations, express them in
state variable format. Define the state variables and write their derivative equations. What
are the initial conditions of the state variables?
๐‘ฅ1 = ๐ป1 ๐‘ฅ1 (0) = 2 ๐‘ฅ2 = ๐ป2 ๐‘ฅ2 (0) = 5 ๐‘ฅ3 = ๐‘„ ๐‘ฅ3 (0) = 0
๐‘ฅ3
๐‘ฅ3
๐‘ฅฬ‡ 1 = −
๐‘ฅฬ‡ 2 =
๐‘ฅฬ‡ 3 = 0.004๐‘ฅ1 − 0.004๐‘ฅ2 − 0.1๐‘ฅ3
20
40
Exam 6.c
1. (15%) Use Laplace transform to solve the following differential equation for y(t). Be sure to
check your solution at t = 0 and at t = ∞.
2๐‘ฆฬ‡ + 20๐‘ฆ = 40
๐‘ฆ(0− ) = 1
2. Consider the differential equation for w(t) shown below with input u(t).
๐‘ค
โƒ› + 18๐‘คฬˆ + 105๐‘คฬ‡ + 250๐‘ค = 75๐‘ขฬ‡ + 500๐‘ข
360
(a) (5%) What is the transfer function relating W(s) to U(s)?
(b) (10%) Assume
๐‘  3 + 18๐‘  2 + 105๐‘  + 250 = (๐‘  + 10)[(๐‘  + 4)2 + 32 ]
What are the eigenvalues? What are the time constants? Damping ratio?
๐ฟ{๐‘“} = ๐น(๐‘ )
๐ฟ{๐‘“ฬ‡ } = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ{๐‘“ฬˆ} = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡(0− )
๐ฟ{๐‘“โƒ›} = ๐‘  3 ๐น(๐‘ ) − ๐‘  2 ๐‘“(0− ) − ๐‘ ๐‘“ฬ‡(0− ) − ๐‘“ฬˆ(0− )
(c) (10%) Suppose u(t) is a step input with magnitude of 3.
Also, assume ๐‘ค(0− ) = 0, ๐‘คฬ‡ (0− ) = 0, ๐‘คฬˆ (0− ) = 2.
Find an equation for W(s); check your answer using the initial value and final value
theorems.
(d) (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the
following form:
๐‘ค(๐‘ก) = ๐‘Ž + ๐‘๐‘’ −๐‘๐‘ก + ๐‘‘๐‘’ −๐‘“๐‘ก sin (๐‘”๐‘ก + โ„Ž)
๐‘Ž =?
๐‘ =?
๐‘ =?
๐‘“ =?
๐‘” =?
(e) (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without
first finding an equation for w(t).
(f) (15%) Use the ‘simulation diagram’ approach to express the differential equation in state
variable format, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข Note, ๐‘คฬˆ is the output of interest.
What are the initial conditions for your state variables if
๐‘ค(0− ) = 0
๐‘คฬ‡ (0− ) = 0
๐‘คฬˆ (0− ) = 2
๐‘ข(0− ) = 0
3. The equations for the water flowing through a long line between two tanks and the height
of the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 (0− ) = 2
๐ป2 (0− ) = 5
๐ป1 − ๐ป2 = 25๐‘„
361
H1
H2
Q
3.a (5%) List the unknowns in these equations. Do the number of equations match the
number of unknowns?
3.b (10%) Laplace transform each of these equations.
3.c (10%) Simplify these equations to a single equation for Q(s). Check your answer
using the initial and final value theorems.
Exam 6.c Solution
1. (15%) Use Laplace transform to solve the following differential equation for y(t). Be sure to
check your solution at t = 0 and at t = ∞.
2๐‘ฆฬ‡ + 20๐‘ฆ = 40
๐‘Œ(๐‘ ) =
20 + ๐‘ 
๐‘ (๐‘  + 10)
๐‘ฆ(0− ) = 1
๐‘ฆ(๐‘ก) = 2 − ๐‘’ −10๐‘ก
๐‘ฆ(0) = 1
๐‘ฆ(∞) = 2
2. Consider the differential equation for w(t) shown below with input u(t).
๐‘ค
โƒ› + 18๐‘คฬˆ + 105๐‘คฬ‡ + 250๐‘ค = 75๐‘ขฬ‡ + 500๐‘ข
a. (5%) What is the transfer function relating W(s) to U(s)?
๐บ(๐‘ ) =
๐‘ 3
75๐‘  + 500
+ 18๐‘  2 + 105๐‘  + 250
b. (10%) Assume
๐‘  3 + 18๐‘  2 + 105๐‘  + 250 = (๐‘  + 10)[(๐‘  + 4)2 + 32 ]
What are the eigenvalues? What are the time constants? Damping ratio?
Eigenvalues = -10 and -4 ±๐‘—3
Time constants = 0.1 and 0.25
Damping ratio = 0.8
c. (10%) Suppose u(t) is a step input with magnitude of 3.
Also, assume ๐‘ค(0− ) = 0, ๐‘คฬ‡ (0− ) = 0, ๐‘คฬˆ (0− ) = 2.
Find an equation for W(s); check your answer using the initial value and final value
theorems.
๐‘Š(๐‘ ) =
227๐‘  + 1500
๐‘ (๐‘  3 + 18๐‘  2 + 105๐‘  + 250)
๐‘ ๐‘Š(๐‘ )๐‘ =0 = 6
๐‘ ๐‘Š(๐‘ )๐‘ =∞ = 0
d. (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the
following form:
๐‘ค(๐‘ก) = ๐‘Ž + ๐‘๐‘’ −๐‘๐‘ก + ๐‘‘๐‘’ −๐‘“๐‘ก sin (๐‘”๐‘ก + โ„Ž)
362
๐‘Ž=6
๐‘=
−10(227) + 1500
−770
=
= 1.7111
2
2
−10((−10 + 4) + 3 ) −450
๐‘ = 10
๐‘“=4
๐‘”=3
e. (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without
first finding an equation for w(t).
>> num = [227 1500];
>> den = [1 18 105 250 0];
>> G = tf(num,den);
>> impulse(G)
f.
(15%) Use the ‘simulation diagram’ approach to express the differential equation in state
variable format, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข Note, ๐‘คฬˆ is the output of interest.
๐‘ฅ1 = ๐‘ค
๐‘ฅ2 = ๐‘คฬ‡
๐‘ฅ3 = ๐‘คฬˆ − 75๐‘ข
0
1
0
0
๐ด=[ 0
๐ต = [ 75 ]
๐ถ = [0 0 1]
0
1 ]
−250 −105 −18
−850
What are the initial conditions for your state variables if
๐‘ค(0− ) = 0
๐‘คฬ‡ (0− ) = 0
๐‘คฬˆ (0− ) = 2
๐‘ข(0− ) = 0
๐‘ฅ1 (0− ) = 0
๐‘ฅ2 (0− ) = 0
๐‘ฅ3 (0− ) = 2
๐ท = [75]
3. The equations for the water flowing through a long line between two tanks and the height
of the water in the tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
๐ป1 (0− ) = 2
๐ป2 (0− ) = 5
๐ป1 − ๐ป2 = 25๐‘„
H1
H2
Q
a. (5%) List the unknowns in these equations. Do the number of equations match the
number of unknowns? H1, H2, Q
b. (10%) Laplace transform each of these equations.
−๐‘„ − 20(๐‘ ๐ป1 − 2) = 0
๐‘„ − 40(๐‘ ๐ป2 − 5) = 0
๐ป1 − ๐ป2 = 25๐‘„
c. (10%) Simplify these equations to a single equation for Q(s). Check your answer using
the initial value and final value theorems. The theorems confirm the equation for Q(s).
363
๐‘„(๐‘ ) =
−120
1000๐‘  + 3
๐‘„(๐‘ก)๐‘ก=∞ = ๐‘ ๐‘„(๐‘ )๐‘ =0 = 0
๐‘„(๐‘ก)๐‘ก=0 = ๐‘ ๐‘„(๐‘ )๐‘ =∞ = −0.1
Exam 7.a
1. A spring-mass–damper system is shown below; the displacement of the mass is x.
x
spring
damper
mass
input
force
Fi
Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this
system are as follows:
(1) Force balance on mass equation:
(2) Spring force equation:
(3) Damper force equation:
10๐‘ฅฬˆ + ๐น๐‘  + ๐น๐‘‘ − ๐น๐‘– = 0 ๐‘ฅ(0− ) = 0 ๐‘ฅฬ‡ (0− ) = 0
๐น๐‘  = 1000๐‘ฅ
๐น๐‘‘ = 100๐‘ฅฬ‡
(a) (5%) List the unknowns in the equations. __________ Are there enough equations?____
(b) (5%) Assume the input Fi is an impulse 100๐›ฟ(๐‘ก). Fi(s) = ?
(c) (10%) Laplace transform each of the equations using Fi(s) from part b.
(d) (10%) Solve the three equations for X(s).
๐ฟ{๐‘“} = ๐น(๐‘ )
๐ฟ{๐‘“ฬ‡ } = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
๐ฟ{๐‘“ฬˆ} = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡(0− )
2. The equations for an inverted pendulum are shown below. The force Fi is used to move the
cart in order to keep the pendulum mass vertical. The pendulum angle ๐œƒ is continuously
measured and used to generate the force Fi on the cart. Assuming small angles, the differential
equations for the pendulum and cart are
๐œƒฬˆ + 0.5๐‘งฬˆ − 4.9๐œƒ = 0
๐‘งฬˆ + 0.18๐œƒฬˆ + 0.09๐น๐‘– = 0
And the differential equation for the force Fi is
๐น๐‘–ฬ‡ + 8๐น๐‘– = −149.6[๐œƒฬ‡ + 6๐œƒ]
364
Ms
๏ฑ
L
z
Mc
Fi
Assume if you Laplace transform these three equations with all initial conditions zero except
๐œƒฬ‡(0− ) = 0.01 and then solve for ๐œƒ(๐‘ ) you get
๐œƒ(๐‘ ) ≈
0.01๐‘  + 0.08
(๐‘  + 7.8)[(๐‘  + 0.12)2 + (0.39)2 ]
(a) (6%) What are the poles of ๐œƒ(๐‘ )?
(b) (3%) What are the zeros of ๐œƒ(๐‘ )?
(c) (8%) Pretend that the Laplace transform above is a transfer function with a unit
impulse input. Write the MATLAB commands for getting a plot of ๐œƒ(๐‘ก).
3. Consider the following transfer function relating the output Y(s) to the input F(s)
10๐‘  2 + 40๐‘  + 250
๐‘Œ(๐‘ ) = [
] ๐น(๐‘ )
(๐‘  + 2)[2๐‘  2 + 16๐‘  + 50]
(a) (9%) What are the eigenvalues?
(b) (6%) What are the time constants?
(c) (3%) What is the damped natural frequency?
(d) (3%) What is the undamped natural frequency?
(e) (3%) What is the damping ratio?
4. (a) (5%) Assuming that x will become a constant as t→ ∞, find the final value of x(t) for the
differential equation below.
2๐‘ฅฬˆ + 4๐‘ฅฬ‡ + 2๐‘ฅ 3 = 16
๐‘ฅ(0− ) = 3
๐‘ฅฬ‡ (0− ) = 0
(b) (10%) Obtain a linear approximation for the differential equation by approximating x3 with a
straight line approximation.
(c) (10%) Solve for X(s), the Laplace transform of x(t).
(d) (4%) Check your equation for X(s) using the initial and final value theorems; if it doesn’t
check, go back to part e and find your mistake!
๐ผ๐‘‰๐‘‡ ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐น(๐‘ )๐‘ =∞
๐น๐‘‰๐‘‡ ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐น(๐‘ )๐‘ =0
365
Exam 7.a Solution
1. A spring-mass–damper system is shown below; the displacement of the mass is x.
x
spring
damper
mass
input
force
Fi
Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this
system are as follows:
(1) Force balance on mass equation: 10๐‘ฅฬˆ + ๐น๐‘  + ๐น๐‘‘ − ๐น๐‘– = 0 ๐‘ฅ(0− ) = 0 ๐‘ฅฬ‡ (0− ) = 0
(2) Spring force equation:
๐น๐‘  = 1000๐‘ฅ
(3) Damper force equation:
๐น๐‘‘ = 100๐‘ฅฬ‡
(a)(5%) List the unknowns in the equations. x, Fs, and Fd. Are there enough equations? yes
(b) (5%) Assume the input Fi is an impulse 100๐›ฟ(๐‘ก). Fi(s) = 100
(c) (10%) Laplace transform each of the equations using Fi(s) from part b.
10๐‘  2 ๐‘‹ + ๐น๐‘  + ๐น๐‘‘ − 100 = 0 ๐น๐‘  = 1000๐‘‹ ๐น๐‘‘ = 100๐‘ ๐‘‹
(d) (10%) Solve the three equations for X(s).
100
๐‘‹(๐‘ ) =
2
10๐‘  + 100๐‘  + 1000
2. The equations for an inverted pendulum are shown below. The force Fi is used to move the
cart in order to keep the pendulum mass vertical. The pendulum angle ๐œƒ is continuously
measured and used to generate the force Fi on the cart. Assuming small angles, the differential
equations for the pendulum and cart are
๐œƒฬˆ + 0.5๐‘งฬˆ − 4.9๐œƒ = 0
๐‘งฬˆ + 0.18๐œƒฬˆ + 0.09๐น๐‘– = 0
And the differential equation for the force Fi is
๐น๐‘–ฬ‡ + 8๐น๐‘– = −149.6[๐œƒฬ‡ + 6๐œƒ]
Ms
๏ฑ
L
z
Mc
Fi
366
Assume if you Laplace transform these three equations with all initial conditions zero except
๐œƒฬ‡(0− ) = 0.01 and then solve for ๐œƒ(๐‘ ) you get
๐œƒ(๐‘ ) ≈
0.01๐‘  + 0.08
(๐‘  + 7.8)[(๐‘  + 0.12)2 + (0.39)2 ]
(a) (6%) What are the poles of ๐œƒ(๐‘ )? -7.8, -0.12±๐‘—0.39
(b) (3%) What are the zeros of ๐œƒ(๐‘ )? -8
(c) (8%) Pretend that the Laplace transform above is a transfer function with a unit
impulse input. Write the MATLAB commands for getting a plot of ๐œƒ(๐‘ก).
>> G=zpk([-8],[-7.8 -0.12+j*0.39 -0.12-j*0.39], 0.01);
>> impulse(G)
3. Consider the following transfer function relating the output Y(s) to the input F(s)
10๐‘  2 + 40๐‘  + 250
๐‘Œ(๐‘ ) = [
] ๐น(๐‘ )
(๐‘  + 2)[2๐‘  2 + 16๐‘  + 50]
(a) (9%) What are the eigenvalues? -2, -4±๐‘—3
(b) (6%) What are the time constants? 0.5 and 0.25 sec
(c) (3%) What is the damped natural frequency? 3 rad/sec
(d) (3%) What is the undamped natural frequency? 5 rad/sec
(e) (3%) What is the damping ratio? 0.8
4. (a) (5%) Assuming that x will become a constant as t→ ∞, find the final value of x(t) for the
differential equation below.
2๐‘ฅฬˆ + 4๐‘ฅฬ‡ + 2๐‘ฅ 3 = 16
๐‘ฅ(0− ) = 3
0 + 0 + 2๐‘ฅ 3 = 16 ๐‘กโ„Ž๐‘ข๐‘ 
๐‘ฅฬ‡ (0− ) = 0
๐‘ฅ(∞) = 2
(b) (10%) Obtain a linear approximation for the differential equation by approximating x3 with a
straight line approximation. Two points: (x,x3), (3,27) and (2,8) gives: ๐‘ฅ 3 ≈ 19๐‘ฅ − 30
2๐‘ฅฬˆ + 4๐‘ฅฬ‡ + 2(19๐‘ฅ − 30) = 16
๐‘œ๐‘Ÿ ๐‘ฅฬˆ + 2๐‘ฅฬ‡ + 19๐‘ฅ = 38
(c) (10%) Solve for X(s), the Laplace transform of x(t).
38
3๐‘  2 + 6๐‘  + 38
๐‘  2 ๐‘‹ − 3๐‘  + 2(๐‘ ๐‘‹ − 3) + 19๐‘‹ =
๐‘œ๐‘Ÿ ๐‘‹(๐‘ ) =
๐‘ 
๐‘ (๐‘  2 + 2๐‘  + 19)
(d) (4%) Check your equation for X(s) using the initial and final value theorems; if it doesn’t
check, go back to part e and find your mistake!
๐ผ๐‘‰๐‘‡ ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘‹(๐‘ )๐‘ =∞ = 3
๐น๐‘‰๐‘‡ ๐‘™๐‘–๐‘š๐‘–๐‘ก ๐‘ ๐‘‹(๐‘ )๐‘ =0 = 2
Both of these give the correct value.
367
Exam 7.b
1. Obtain a linear approximation for the following differential equation by obtaining a straight
line approximation for √๐‘ฅ. Note, realizing that x will become a constant as t→ ∞, what is the
final value of x?
๐‘ฅ(0− ) = 4.01
2๐‘ฅฬˆ + 4๐‘ฅฬ‡ + 2√๐‘ฅ = 4
๐‘ฅฬ‡ (0− ) = 0
Ans: (8%) final value of x ______________?
Ans: (8%) linear differential equation ______________________?
๐‘“(๐‘ฅ) ≈ ๐‘“(๐‘ฅ๐‘œ ) + [
๐‘‘๐‘“
(๐‘ฅ − ๐‘ฅ๐‘œ )
]
๐‘‘๐‘ฅ ๐‘ฅ=๐‘ฅ๐‘œ
2. (12%) Use the integral definition shown below of the Laplace transform to find the Laplace
transform of the unit pulse shown below. Then, take the limit as b goes to zero to get the
Laplace transform of a unit impulse.
f(t)
f(t)
1
b
0
limit as b → 0
0
t
b
unit pulse
t
unit impulse
∞
๐น(๐‘ ) = ∫ ๐‘“(๐‘ก)๐‘’ −๐‘ ๐‘ก ๐‘‘๐‘ก
0
3. (12%) Fill in the table below for the inverse Laplace of the following
๐‘Œ(๐‘ ) =
(๐‘  + 5)(6๐‘  + 18)
๐‘ (๐‘  + 0.1)[(๐‘  + 3)2 + 22 ]
๐‘ฆ(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘๐‘’ −๐‘‘๐‘ก + ๐‘“๐‘’ −๐‘”๐‘ก sin (โ„Ž๐‘ก + ∅)
a
b
c
d
g
h
368
4. A spring-mass–damper system is shown below; the displacement of the mass is z.
z
spring
mass
damper
input
force
Fi
Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this
system are as follows (SI units):
(1) Force balance on mass equation:
(2) Spring force equation:
(3) Damper force equation:
10๐‘งฬˆ + ๐น๐‘  + ๐น๐‘‘ − ๐น๐‘– = 0 ๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 0
๐น๐‘  = 890๐‘ง
๐น๐‘‘ = 100๐‘งฬ‡
(a) (8%) What is the transfer function relating Z(s) to the input Fi(s)?
(b) (5%) What are the eigenvalues of the system?
(c) (8%) If the input force Fi is a step with magnitude 10 N, write some MATLAB code that
will produce a plot of z(t).
5. The differential equation for the speed ๐‘ฃ of a sphere with aerodynamic drag is given below
(SI units). Assume the sphere, initially at a height h of zero, is initially tossed upward and then
falls to the earth; assume that the speed reaches the terminal speed before it hits the ground.
๐‘ฃฬ‡ + 20|๐‘ฃ|๐‘ฃ = −50,000
๐‘ฃ(0− ) = 60 ๐‘š/๐‘ 
(a) (8%) Draw pictures of what you think the speed and height will look like as functions of
time. Note, be sure to show initial and final values; you can guess the final time. Note,
speed and height are positive upward.
v(t )
h(t)
v
0
t
0
t
369
(b) (14%) Complete the two M-files shown below for an ode45 numerical simulation to
obtain plots of h(t) and ๐‘ฃ (t). Note, โ„Žฬ‡ = ๐‘ฃ.
% first M-file
[t,x]=ode45(@testEqns,[0 ?],[
plot(
?)
figure
plot(
?)
?]);
% second M-file
function dx=testEqns(t,x);
dx = zeros(
dx(1) =
?,1);
?
?
End
6. The transfer function in SI units for the bending stress P in an airplane wing associated
with vertical movement u at the wing connection point is given below.
vertical
displacement, u
๏ƒฉ 3.5 x109 s 2 ๏ƒน
P( s) = ๏ƒช 2
๏ƒบU ( s )
๏ƒซ s + 12 s + 900 ๏ƒป
bending
stress, P
The bode plot of this transfer function is shown below. If the input u(t) is sinusoidal with
an amplitude of 0.1 m, at what input frequency will the stress be maximum and what will
be the amplitude of the stress? M dB =20Log10(M)
370
Bode Diagram
200
Magnitude (dB)
195
190
185
180
175
170
180
Phase (deg)
135
90
45
0
10
1
10
2
Frequency (rad/s)
(5%) frequency of stress _________________
(10%) amplitude of stress ____________________
Exam 7.b Solution
1. Obtain a linear approximation for the following differential equation by obtaining a straight
line approximation for √๐‘ฅ. Note, realizing that x will become a constant as t→ ∞, what is the
final value of x?
2๐‘ฅฬˆ + 4๐‘ฅฬ‡ + 2√๐‘ฅ = 4
๐‘ฅ(0− ) = 4.01 ๐‘ฅฬ‡ (0− ) = 0
Ans: (8%) final value of x
๐‘ฅ(∞) = 4
Ans: (8%) linear differential equation
2๐‘ฅฬˆ + 4๐‘ฅฬ‡ + 0.5๐‘ฅ = 2
0 + 0 + 2√๐‘ฅ = 4
๐‘กโ„Ž๐‘ข๐‘  ๐‘ฅ(∞) = 4
1
Since x is always in the neighborhood of 4, √๐‘ฅ ≈ √4 + 2√4 (๐‘ฅ − 4) = 0.25๐‘ฅ + 1
Thus, 2๐‘ฅฬˆ + 4๐‘ฅฬ‡ + 2(0.25๐‘ฅ + 1) = 4
๐‘œ๐‘Ÿ 2๐‘ฅฬˆ + 4๐‘ฅฬ‡ + 0.5๐‘ฅ = 2
371
2. (12%) Use the integral definition shown below of the Laplace transform to find the Laplace
transform of the unit pulse shown below. Then, take the limit as b goes to zero to get the
Laplace transform of a unit impulse.
f(t)
f(t)
1
b
0
limit as b → 0
t
b
unit pulse
0
t
unit impulse
∞
๐น(๐‘ ) = ∫ ๐‘“(๐‘ก)๐‘’ −๐‘ ๐‘ก ๐‘‘๐‘ก
0
∞
1 −๐‘ ๐‘ก
1 −๐‘ ๐‘ก ๐‘
1
1
−๐‘ ๐‘ก
๐น(๐‘ ) = ∫ ๐‘’ ๐‘‘๐‘ก + ∫ 0๐‘’ ๐‘‘๐‘ก = − [ ๐‘’ ] =
− ๐‘’ −๐‘๐‘ 
๐‘๐‘ 
๐‘๐‘  ๐‘๐‘ 
0
0 ๐‘
๐‘
๐‘
๐‘™๐‘–๐‘š๐‘–๐‘ก๐‘→0 =
0
๐‘๐‘’ −๐‘๐‘ 
๐‘œ๐‘Ÿ [
]
=1
0
๐‘ ๐‘→0
3. (12%) Fill in the table below for the inverse Laplace of the following
๐‘Œ(๐‘ ) =
(๐‘  + 5)(6๐‘  + 18)
๐‘ (๐‘  + 0.1)[(๐‘  + 3)2 + 22 ]
๐‘ฆ(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘๐‘’ −๐‘‘๐‘ก + ๐‘“๐‘’ −๐‘”๐‘ก sin (โ„Ž๐‘ก + ∅)
a 69.23
b 0
c -68.7
d 0.10
g 3
h 2
4. A spring-mass–damper system is shown below; the displacement of the mass is z.
z
spring
damper
mass
input
force
Fi
Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this
system are as follows (SI units):
(4) Force balance on mass equation: 10๐‘งฬˆ + ๐น๐‘  + ๐น๐‘‘ − ๐น๐‘– = 0 ๐‘ง(0− ) = 0 ๐‘งฬ‡ (0− ) = 0
(5) Spring force equation:
๐น๐‘  = 890๐‘ง
(6) Damper force equation:
๐น๐‘‘ = 100๐‘งฬ‡
(a) (8%) What is the transfer function relating Z(s) to the input Fi(s)?
372
10๐‘  2
1
+ 100๐‘  + 890
(b) (5%) What are the eigenvalues of the system?
−5 ± ๐‘—8
(c) (8%) If the input force Fi is a step with magnitude 10 N, write some MATLAB code that
will produce a plot of z(t).
>> G = tf(1,[10 100 890]);
>> step(10*G)
5. The differential equation for the speed ๐‘ฃ of a sphere with aerodynamic drag is given below
(SI units). Assume the sphere, initially at a height h of zero, is initially tossed upward and then
falls to the earth; assume that the speed reaches the terminal speed before it hits the ground.
๐‘ฃ(0− ) = 60 ๐‘š/๐‘ 
๐‘ฃฬ‡ + 20|๐‘ฃ|๐‘ฃ = −50,000
(a) (8%) Draw pictures of what you think the speed and height will look like as functions of
time. Note, be sure to show initial and final values; you can guess the final time Note, speed
and height are positive upward. A realistic first guess at the final time is 10 sec.
When the speed becomes constant (terminal) 0 + 20|๐‘ฃ|๐‘ฃ = −50,000 gives v = -50 m/s
v(t )
h(t)
60
0
v
t
10
-50
0
t 10
(b) (14%) Complete the two M-files shown below for an ode45 numerical simulation to
obtain plots of h(t) and ๐‘ฃ (t). Note, โ„Žฬ‡ = ๐‘ฃ.
๐‘ฅ1 = โ„Ž ๐‘ฅ2 = ๐‘ฃ ๐‘ฅฬ‡ 1 = ๐‘ฅ2 ๐‘ฅฬ‡ 2 − 20|๐‘ฅ2 |๐‘ฅ2 − 50000
๐‘ฅ1 (0− ) = 0 ๐‘ฅ2 (0− ) = 60
% first M-file
[t,x]=ode45(@testEqns,[0 10],[ 0
plot( t,x(:,1))
figure
plot( t,x(:,2))
60]);
% second M-file
function dx=testEqns(t,x);
dx = zeros(2,1);
373
dx(1) = x(2);
dx(2)=-20*abs(x(2))*x(2)-50000;
end
6. The transfer function in SI units for the bending stress P in an airplane wing associated
with vertical movement u at the wing connection point is given below.
vertical
displacement, u
๏ƒฉ 3.5 x109 s 2 ๏ƒน
P( s) = ๏ƒช 2
๏ƒบU ( s )
๏ƒซ s + 12 s + 900 ๏ƒป
bending
stress, P
The bode plot of this transfer function is shown below. If the input u(t) is sinusoidal with
an amplitude of 0.1 m, at what input frequency will the stress be maximum and what will
be the amplitude of the stress? M dB =20Log10(M)
Bode Diagram
200
Magnitude (dB)
195
190
185
180
175
170
180
Phase (deg)
135
90
45
0
10
1
10
2
Frequency (rad/s)
(5%) frequency of stress
≈ 31 ๐‘Ÿ๐‘Ž๐‘‘/๐‘ 
200
(10%) amplitude of stress 0.1 ∗ 10 20 = 0.1 ∗ 1010 = 109 ๐‘/๐‘š2
374
Exam 7.c
1. The equations for the height H of the water in a tank and exit flow Q through a long line
are listed below for SI units. Qi is an input flow into the tank.
๐‘„๐‘– − ๐‘„ = 4๐ปฬ‡
๐ป = 2๐‘„
๐ป(0− ) = 10 ๐‘š
๐‘„(0− ) = 0
Qi
H
Q
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(4%)There are 2 equations. What are the unknowns?
(6%) Laplace transform these equations; solve for H(s) assuming Qi is a constant of 10 m3/s.
(6%) Check your equation for H(s) using the initial and final value theorems.
(6%) Write the MATLAB commands for getting a plot of H(t) using the ‘impulse’ command.
(3%) How long will it take for H to reach its final value within 1%?
(6%) Draw an estimate of the plot of H(t).
(5%) Use the residue theorem to find an equation for H(t).
(h) (4%) Substitute t = 0 and t = ∞ into your equation for H(t) to check your equation for H(t).
(i) (6%) Draw a SIMULINK diagram for getting a plot of H(t).
(2%) Explain how to enter the initial condition for H.
(3%) Considering the name of your workspace, what commands are needed in the
Command Window for getting the plot of H(t)?
2. A ball is dropped from a high altitude. The differential equation for the velocity of the ball
before it hits the ground for SI units is shown below.
๐‘ฃฬ‡ + 2๐‘ฃ|๐‘ฃ| = 0.5
๐‘ฃ(0− ) = 0 ๐‘š/๐‘ 
(a) (3%) What is the terminal value of the velocity (final value)?
(b) (5%) Obtain a linear approximation for ๐‘ฃ|๐‘ฃ| and estimate the time required to reach the
terminal velocity within 1%.
(c) (8%) Complete the ode45 commands below to get a plot of the original nonlinear
differential equation.
375
function exam3
[t,x]=ode45(@exam3eqns,[0 10],[ ?
plot(
?
)
xlabel(
? )
ylabel(
?
)
function dx = exam3eqns(t,x)
dx=zeros( ? ,1)
]);
?
end
end
6๐‘ +15
3. ๐‘Œ(๐‘ ) = [๐‘ 2 +2๐‘ +5] ๐‘ˆ(๐‘ )
(a) (9%) Express this system in state variable format, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข ๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
A=? B=? C=? D=?
(b) (8%) Assume the input u(t) is a step input with magnitude 10. We know that the
inverse Laplace will be of the form
๐‘ฆ(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘๐‘’ −๐‘‘๐‘ก sin (๐‘“๐‘ก + ๐‘”)
๐‘Ž =? ๐‘ =? ๐‘‘ =? ๐‘“ =?
(c) (6%) Assume u(t) = 10sin(2t). After all transients have died out, y(t) = ?
4. (10%) Common sense tells us that the inverted pendulum shown below will fall from the vertical position if
disturbed even slightly while at rest in the vertical position. Using the differential equation for ๐œƒ, explain
mathematically why it will fall. ๐œƒฬˆ − 64๐œƒ = 0
๏ฑ
๐ฟ(๐‘“ฬ‡ ) = ๐‘ ๐น(๐‘ ) − ๐‘“(0− );
๐‘’ −๐‘Ÿ๐‘ก ๐‘(๐‘ )
๐‘(๐‘ )
|
| sin [๐œ”๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
; ๐‘  = 0 ๐‘“๐‘œ๐‘Ÿ ๐น๐‘‰๐‘‡, ๐‘  = ∞๐‘“๐‘œ๐‘Ÿ ๐ผ๐‘‰๐‘‡
)]
๐œ” ๐ท(๐‘ )
๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
376
Exam 7.c Solution
1. The equations for the height H of the water in a tank and exit flow Q through a long line are
listed below for SI units. Qi is an input flow into the tank.
๐‘„๐‘– − ๐‘„ = 4๐ปฬ‡
๐ป = 2๐‘„
๐ป(0− ) = 10 ๐‘š
๐‘„(0− ) = 0
Qi
H
Q
(a) (4%) There are 2 equations. What are the unknowns? Q and H
(b) (6%) Laplace transform these equations; solve for H(s) assuming Qi is a constant of 10
m3/s.
10
− ๐‘„ = 4(๐‘ ๐ป − 10)
๐‘ 
๐ป = 2๐‘„
Solving for H gives
10๐‘  + 2.5
๐ป(๐‘ ) =
๐‘ (๐‘  + 0.125)
(c) (6%) Check your equation for H(s) using the initial and final value theorems.
FVT: sH(s)s=0 = 2.5/0.125 = 20
IVY: ๐‘ ๐ป(๐‘ )๐‘ =∞ = 10
(d) (6%) Write the MATLAB commands for getting a plot of H(t) using the ‘impulse’
command.
>> G=tf([10 2.5],[1 0.125 0]);
>> impulse(G)
(e) (3%) How long will it take for H to reach its final value within 1%? 5*8 = 40 s
(f) (6%) Draw an estimate of the plot of H(t).
H, m
20
10
0
40
t, s
377
(g) (5%) Use the residue theorem to find an equation for H(t).
๐ป(๐‘ก) = 20 − 10๐‘’ −0.125๐‘ก
(h) (4%) Substitute t = 0 and t = ∞ into your equation for H(t) to check your equation for H(t).
H(0)=10 H(∞)=20
(i) (6%) Draw a SIMULINK diagram for getting a plot of H(t).
(2%) Explain how to enter the initial condition for H. Double click on integrator and
enter the initial condition of 10.
clock
initial
condition
10
Qi
10
+-
H๏€ฆ
0.25
๏ƒฒ
H
0.5
Q
Y
mux
workspace
(3%) Considering the name of your workspace, what commands are needed in the
Command Window for getting the plot of H(t)?
>> plot(Y(:,1),Y(:,2))
2. A ball is dropped from a high altitude. The differential equation for the velocity of
the ball before it hits the ground for SI units is shown below.
๐‘ฃฬ‡ + 2๐‘ฃ|๐‘ฃ| = 0.5
๐‘ฃ(0− ) = 0 ๐‘š/๐‘ 
(a) (3%) What is the terminal value of the velocity (final value)?
0 + 2๐‘ฃ|๐‘ฃ| = 0.5 ๐‘กโ„Ž๐‘ข๐‘  ๐‘ฃ = √0.25 = 0.5 ๐‘š/๐‘ 
(b) (5%) Obtain a linear approximation for ๐‘ฃ|๐‘ฃ| and estimate the time required to reach
the terminal velocity within 1%.
The velocity starts at 0 and ends at 0.5; so, a 2-point straight line is ๐‘ฃ|๐‘ฃ| ≈ 0.5๐‘ฃ + 0
The differential equation becomes ๐‘ฃฬ‡ + ๐‘ฃ = 0.5 thus the time constant is 1 s. So, it will
take about 5 s to reach terminal velocity.
(c) (8%) Complete the ode45 commands below to get a plot of the original nonlinear
differential equation.
function exam3
[t,x]=ode45(@exam3eqns,[0 10],[ 0 ]);
plot( t,x(:,1))
xlabel( ‘time, s’ )
ylabel( ‘velocity, m/s’)
function dx = exam3eqns(t,x)
dx=zeros( 1 ,1);
dx(1)=0.5-2*x(1)*abs(x(1));
end
end
378
6๐‘ +15
3. ๐‘Œ(๐‘ ) = [๐‘ 2 +2๐‘ +5] ๐‘ˆ(๐‘ )
(a) (9%) Express this system in state variable format, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
A=? B=? C=? D=?
๐ด=[
0
1
0
] ๐ต=[ ]
−5 −2
1
๐ถ = [15
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
6] ๐ท = [0]
(b) (8%) Assume the input u(t) is a step input with magnitude 10. We know that the
inverse Laplace will be of the form
๐‘ฆ(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘๐‘’ −๐‘‘๐‘ก sin (๐‘“๐‘ก + ๐‘”)
๐‘Œ(๐‘ ) = [
6๐‘  + 15 10
60๐‘  + 150
]
=
+ 2๐‘  + 5 ๐‘ 
๐‘ [(๐‘  + 1)2 + 22 ]
๐‘ 2
๐‘Ž=3 ๐‘=0 ๐‘‘=1 ๐‘“=2
(c) (6%) Assume u(t) = 10sin(2t). After all transients have died out, y(t) = ?
6๐‘  + 15
๐‘ฆ(๐‘ก) = 10 | 2
|
sin(2๐‘ก + ∅)
๐‘  + 2๐‘  + 5 ๐‘ =๐‘—2
6(๐‘—2) + 15
= 10 |
| sin(2๐‘ก + ∅)
(๐‘—2)2 + 2(๐‘—2) + 5
15 + ๐‘—12
15 + ๐‘—12
))
= 10 |
| sin (2๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
1 + ๐‘—4
1 + ๐‘—4
= 10√
241
12
4
sin (2๐‘ก + ๐‘ก๐‘Ž๐‘›−1 ( ) − ๐‘ก๐‘Ž๐‘›−1 ( ))
17
15
1
= 46.59sin (2๐‘ก − 0.651)
4. (10%) Common sense tells us that the inverted pendulum shown below will fall from the vertical position if
disturbed even slightly while at rest in the vertical position. Using the differential equation for ๐œƒ, explain
mathematically why it will fall. ๐œƒฬˆ − 64๐œƒ = 0 The characteristic polynomial has real roots = ±8. So, the
solution ๐œƒ(๐‘ก) = ๐‘Ž๐‘’ 8๐‘ก + ๐‘๐‘’ −8๐‘ก will increase to infinity theoretically but in reality only till the pendulum hits the
ground.
๏ฑ
379
Exam 8.a
1. H(s) is the Laplace transform of the height h of the water in a tank within a complex water
system.
8๐‘  + 24
๐ป(๐‘ ) =
(๐‘  + 2)(๐‘  + 4)
(a) Use initial value theorem to determine the height at t = 0.
(b) Use the final value theorem to get a plot of the final value of the water height.
(c) Estimate a plot of h(t).
h(t)
t
0
(d) Use the residue theorem to get an equation for h(t).
(e) Substitute t = 0 into your equation for h(t) and determine if you get the same as found in (a).
(f) Substitute t = ∞ into your equation for h(t) and determine if you get the same as found in (b).
IVT ๐‘ ๐‘‹(๐‘ )๐‘ =∞
FVT ๐‘ ๐‘‹(๐‘ )๐‘ =0
{Residue of a 1st order pole –p} = [(s+p)X(s)est]s = -p
2. Consider the following differential equation for the position y of a mass in a suspension
system.
2๐‘ฆฬˆ + 2.4๐‘ฆฬ‡ + 18๐‘ฆ = 90 ๐‘ฆ(0− ) = 0 ๐‘ฆฬ‡ (0− ) = 2
(a) What are the eigenvalues?
(b) What is the undamped natural frequency ๐œ”๐‘› ?
(c) What is the damping ratio?
(d) Estimate a plot of y(t).
y(t)
0
t
380
(e) Laplace transform the differential equation and solve for Y(s).
(f) Check your answer in (e) using the IVT and the FVT.
3. The differential equation for the downward velocity ๐‘ฃ of a sphere dropped from a tower is
๐‘ฃฬ‡ + 0.2๐‘ฃ|๐‘ฃ| = 20
๐‘ฃ(0− ) = 0
(a) What is the terminal (final) velocity?
(b) Draw an estimate of the plot of ๐‘ฃ|๐‘ฃ| vs. ๐‘ฃ ; then obtain a straight line approx. for ๐‘ฃ|๐‘ฃ|, i.e.
๐‘ฃ|๐‘ฃ| ≈ ๐‘Ž๐‘ฃ + ๐‘
๐‘Ž =?
๐‘ =?
vv
v
0
(c) Replace ๐‘ฃ|๐‘ฃ| in the differential equation with your ๐‘Ž๐‘ฃ + ๐‘ to get a linear differential
equation.
(d) Does your linear differential equation give the correct terminal velocity?
(e) Using your linear differential equation, determine approximately how long it will take to
obtain terminal velocity within 1%.
(f) Estimate a plot of v(t).
v(t)
0
t
Exam 8.a Solution
Exam 1
Solution
MAE 3360
Sept. 21, 2017
1. H(s) is the Laplace transform of the height h of the water in a tank within a complex water
system.
8๐‘  + 24
๐ป(๐‘ ) =
(๐‘  + 2)(๐‘  + 4)
(a) (5%) Use initial value theorem to determine the height at t = 0.
381
8๐‘  2 + 24๐‘ 
๐‘ ๐ป(๐‘ ) = [
]
=8
(๐‘  + 2)(๐‘  + 4) ๐‘ =∞
(b) (5%) Use the final value theorem to get a plot of the final value of the water height.
8๐‘  2 + 24๐‘ 
๐‘ ๐ป(๐‘ ) = [
]
=0
(๐‘  + 2)(๐‘  + 4) ๐‘ =0
(c) (9%) Estimate a plot of h(t).
h(t)
8
2.5
0
t
(d) (10%) Use the residue theorem to get an equation for h(t).
8(−2) + 24 −2๐‘ก 8(−4) + 24 −4๐‘ก
โ„Ž(๐‘ก) =
๐‘’
+
๐‘’
= 4๐‘’ −2๐‘ก + 4๐‘’ −4๐‘ก
−2 + 4
−4 + 2
(e) (5%) Substitute t = 0 into your equation for h(t) and determine if you get the same as found
in (a).
โ„Ž(0) = 4 + 4 = 8
(f) (5%) Substitute t = ∞ into your equation for h(t) and determine if you get the same as found
in (b). โ„Ž(∞) = 0 + 0 = 0
IVT ๐‘ ๐‘‹(๐‘ )๐‘ =∞
FVT ๐‘ ๐‘‹(๐‘ )๐‘ =0
{Residue of a 1st order pole –p} = [(s+p)X(s)est]s = -p
2. Consider the following differential equation for the position y of a mass in a suspension
system.
2๐‘ฆฬˆ + 2.4๐‘ฆฬ‡ + 18๐‘ฆ = 90 ๐‘ฆ(0− ) = 0 ๐‘ฆฬ‡ (0− ) = 2
(a) (8%) What are the eigenvalues? −0.6 ± ๐‘—√8.64 = −0.6 ± ๐‘—2.939
(b) (3%) What is the undamped natural frequency ๐œ”๐‘› ? ๐œ”๐‘› = 3
(c) (3%) What is the damping ratio? 2๐›ฟ๐œ”๐‘› = 1.2 ๐‘กโ„Ž๐‘ข๐‘  ๐›ฟ = 0.2
(d) (6%) Estimate a plot of y(t).
y(t)
5
0
8.33 t
(e) (7%) Laplace transform the differential equation and solve for Y(s).
382
90
4๐‘  + 90
๐‘Œ(๐‘ ) =
2
๐‘ 
๐‘ (2๐‘  + 2.4๐‘  + 18)
(f) (6%) Check your answer in (e) using the IVT and the FVT.
IVT ๐‘ ๐‘Œ(๐‘ )๐‘ =∞ = 0
FVT ๐‘ ๐‘Œ(๐‘ )๐‘ =0 = 0
3. The differential equation for the downward velocity ๐‘ฃ of a sphere dropped from a tower is
๐‘ฃฬ‡ + 0.2๐‘ฃ|๐‘ฃ| = 20
๐‘ฃ(0− ) = 0
(a) (5%) What is the terminal (final) velocity?
0 + 0.2๐‘ฃ|๐‘ฃ| = 20 ๐‘ ๐‘–๐‘›๐‘๐‘’ ๐‘ฃ > 0, ๐‘ฃ = √100 = 10
(b) (7%) Draw an estimate of the plot of ๐‘ฃ|๐‘ฃ| vs. ; then obtain a straight line approx. for ๐‘ฃ|๐‘ฃ|,
i.e.
๐‘ฃ|๐‘ฃ| ≈ ๐‘Ž๐‘ฃ + ๐‘
๐‘Ž =? ๐‘ =? v starts at 0 and ends at 10, a =10 and b = 0
2(๐‘ ๐‘Œ − 2) + 2.4๐‘ ๐‘Œ + 18๐‘Œ =
vv
v v ๏‚ป 10v
100
10
0
v
(c) (5%) Replace ๐‘ฃ|๐‘ฃ| in the differential equation with your ๐‘Ž๐‘ฃ + ๐‘ to get a linear differential
equation. ๐‘ฃฬ‡ + 0.2(10๐‘ฃ) = 20
(d) (2%) Does your linear differential equation give the correct terminal velocity? Yes
(e) (2%) Using your linear differential equation, determine approximately how long it will take
to obtain terminal velocity within 1%.
Time constant = 0.5. Thus it will take about 2.5 s.
(f) (7%) Estimate a plot of v(t).
v(t)
10
0
2.5
t
Exam 8.b
1. Consider the following differential equation for y(t). Be sure to check your solution at t = 0 and
at t = ∞.
2๐‘ฆฬ‡ + 20๐‘ฆ = 60
๐‘ฆ(0− ) = 5
383
(a) (5%) Draw an estimate of the plot of y(t).
(b) (5%) Find the Laplace transform for y(t), Y(s). Check your answer for Y(s) using the initial and
final value theorems.
(c) (5%) Find the inverse Laplace of Y(s). Check your equation for y(t) by setting t = 0 and t = ∞.
2. Consider the differential equation for w(t) shown below with input u(t).
๐‘ค
โƒ› + 104๐‘คฬˆ + 429๐‘คฬ‡ + 2900๐‘ค = 25๐‘ขฬ‡ + 5800๐‘ข
(a) (5%) What is the transfer function relating W(s) to U(s)?
(b) (10%) Assume
๐‘  3 + 104 + 429๐‘  + 2900 = (๐‘  + 100)[(๐‘  + 2)2 + 52 ]
What are the eigenvalues? What are the time constants? Damping ratio?
(c) (10%) Suppose u(t) is a step input with magnitude of 4.
Also, assume ๐‘ค(0− ) = 0, ๐‘คฬ‡ (0− ) = 0, ๐‘คฬˆ (0− ) = 20 ๐‘ข(0− ) = 0.
Find an equation for W(s); check your answer using the initial value and final value
theorems.
(d) (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the
following form:
๐‘ค(๐‘ก) = ๐‘Ž + ๐‘๐‘’ −๐‘๐‘ก + ๐‘‘๐‘’ −๐‘“๐‘ก sin (๐‘”๐‘ก + โ„Ž)
๐‘Ž =?
๐‘ =?
๐‘“ =?
๐‘” =?
(e) (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without
first finding an equation for w(t).
(f) (12%) Express the differential equation in state variable format, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข Note, ๐’˜ฬˆ is the output of interest.
๐‘ค
โƒ› + 104๐‘คฬˆ + 429๐‘คฬ‡ + 2900๐‘ค = 25๐‘ขฬ‡ + 5800๐‘ข
๐‘ค(0− ) = 0 ๐‘คฬ‡ (0− ) = 0 ๐‘คฬˆ (0− ) = 20 ๐‘ข(0− ) = 0
(3%) What are the initial conditions for your state variables?
(g) The equations for the water flowing through a long line between two tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
√๐ป1 − ๐ป2 = 25๐‘„
๐ป1 (0− ) = 10
๐ป2 (0− ) = 2
๐‘“๐‘œ๐‘Ÿ ๐ป1 ≥ ๐ป2
384
H1
H2
Q
3.a (5%) List the unknowns in these equations. Do the number of equations match the
number of unknowns?
3.b (16%) Realizing that this system has 2 first order differential equations, it is obvious
that two state variables will be needed to perform an ode45 simulation of this system.
What are the state variables and what are their derivative equations?
3.c (4%) When performing your ode45 simulation, what are the initial conditions for your
state variables?
Exam 8.b Solution
1. Consider the following differential equation for y(t). Be sure to check your solution at t = 0 and
at t = ∞.
2๐‘ฆฬ‡ + 20๐‘ฆ = 60
(a) (5%) Draw an estimate of the plot of y(t).
๐‘ฆ(0− ) = 5
5
3
0
0.5
t
(b) (5%) Find the Laplace transform for y(t), Y(s). Check your answer for Y(s) using the initial and
final value theorems.
5๐‘  + 30
๐‘Œ(๐‘ ) =
๐ผ๐‘‰๐‘‡: ๐‘ ๐‘Œ(๐‘ )๐‘ =∞ = 5 ๐น๐‘‰๐‘‡: ๐‘ ๐‘Œ(๐‘ )๐‘ =0 = 3
๐‘ (๐‘  + 10)
(c) (5%) Find the inverse Laplace of Y(s). Check your equation for y(t) by setting t = 0 and t = ∞.
๐‘ฆ(๐‘ก) = 3 + 2๐‘’ −10๐‘ก ๐‘ฆ(0) = 3 + 2 = 5 ๐‘ฆ(∞) = 3
2. Consider the differential equation for w(t) shown below with input u(t).
๐‘ค
โƒ› + 104๐‘คฬˆ + 429๐‘คฬ‡ + 2900๐‘ค = 25๐‘ขฬ‡ + 5800๐‘ข
(a) (5%) What is the transfer function relating W(s) to U(s)?
385
๐‘ 3
(b) (10%) Assume
25๐‘  + 5800
+ 104๐‘  2 + 429๐‘  + 2900
๐‘  3 + 104๐‘  2 + 429๐‘  + 2900 = (๐‘  + 100)[(๐‘  + 2)2 + 52 ]
What are the eigenvalues? What are the time constants? Damping ratio?
๐ธ๐‘‰ ′ ๐‘  = −100, −2 ± ๐‘—5 ๐‘‡๐‘–๐‘š๐‘’ ๐‘๐‘œ๐‘›๐‘ ๐‘ก๐‘Ž๐‘›๐‘ก๐‘  = 0.01, 0.5
๐‘‘๐‘Ž๐‘š๐‘๐‘–๐‘›๐‘” ๐‘Ÿ๐‘Ž๐‘ก๐‘–๐‘œ = 0.371
(c) (10%) Suppose u(t) is a step input with magnitude of 4.
Also, assume ๐‘ค(0− ) = 0, ๐‘คฬ‡ (0− ) = 0, ๐‘คฬˆ (0− ) = 20 ๐‘ข(0− ) = 0.
Find an equation for W(s); check your answer using the initial value and final value
theorems.
120๐‘  + 23,200
๐‘Š(๐‘ ) =
๐ผ๐‘‰๐‘‡: 0 ๐น๐‘‰๐‘‡: 8
๐‘ (๐‘  + 100)[(๐‘  + 2)2 + 52 ]
(d) (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the
following form:
๐‘ค(๐‘ก) = ๐‘Ž + ๐‘๐‘’ −๐‘๐‘ก + ๐‘‘๐‘’ −๐‘“๐‘ก sin (๐‘”๐‘ก + โ„Ž)
๐‘Ž=8
๐‘ = 100
๐‘“=2
๐‘”=5
(e) (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without
first finding an equation for w(t).
>> n=[120 23200];
>> d=[1 104 429 2900 0];
>> g=tf(n,d);
>> impulse(g)
(f) (12%) Express the differential equation in state variable format, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข Note, ๐’˜ฬˆ is the output of interest.
๐‘ค
โƒ› + 104๐‘คฬˆ + 429๐‘คฬ‡ + 2900๐‘ค = 25๐‘ขฬ‡ + 5800๐‘ข
๐‘ค(0− ) = 0 ๐‘คฬ‡ (0− ) = 0 ๐‘คฬˆ (0− ) = 20 ๐‘ข(0− ) = 0
๐‘ฅ1 = ๐‘ค ๐‘ฅ2 = ๐‘คฬ‡ ๐‘ฅ3 = ๐‘คฬˆ − 25๐‘ข
0
1
0
0
๐ด=[ 0
๐ต
=
]
[
0
1
25 ] ๐ถ = [0 0 1] ๐ท = [25]
−2900 −429 −104
3200
(3%) What are the initial conditions for your state variables?
๐‘ฅ1 (0− ) = 0 ๐‘ฅ2 (0− ) = 0 ๐‘ฅ3 (0− ) = 20
(g) The equations for the water flowing through a long line between two tanks are as follows:
−๐‘„ − 20๐ปฬ‡1 = 0
๐‘„ − 40๐ปฬ‡2 = 0
√๐ป1 − ๐ป2 = 25๐‘„
๐ป1 (0− ) = 10
๐ป2 (0− ) = 2
๐‘“๐‘œ๐‘Ÿ ๐ป1 ≥ ๐ป2
386
H1
H2
Q
3.a (5%) List the unknowns in these equations. Do the number of equations match the
number of unknowns? Q, H1, H2
yes
3.b (16%) Realizing that this system has 2 first order differential equations, it is obvious
that two state variables will be needed to perform an ode45 simulation of this system.
What are the state variables and what are their derivative equations?
๐‘ฅ1 = ๐ป1
๐‘ฅ2 = ๐ป2
๐‘ฅฬ‡ 1 = −0.002√๐ป1 − ๐ป2
๐‘ฅฬ‡ 2 = 0.001√๐ป1 − ๐ป2
3.c (4%) When performing your ode45 simulation, what are the initial conditions for your
state variables?
๐‘ฅ1 (0− ) = 10
๐‘ฅ2 (0− ) = 2
Exam 8.c
1. The equations for the height H of the water in a tank and exit flow Q through a long line are
listed below for SI units. Qi is an input flow into the tank.
๐‘„๐‘– − ๐‘„ = 4๐ปฬ‡
๐ป = 2๐‘„
๐ป(0− ) = 10 ๐‘š
๐‘„(0− ) = 0
Qi
H
Q
(a) (4%)There are 2 equations. What are the unknowns?
(b) (6%) Laplace transform these equations; solve for H(s) assuming Qi is a constant of 10 m3/s.
(c)
(d)
(e)
(f)
(g)
(6%) Check your equation for H(s) using the initial and final value theorems.
(6%) Write the MATLAB commands for getting a plot of H(t) using the ‘impulse’ command.
(3%) How long will it take for H to reach its final value within 1%?
(6%) Draw an estimate of the plot of H(t).
(5%) Use the residue theorem to find an equation for H(t).
(h) (4%) Substitute t = 0 and t = ∞ into your equation for H(t) to check your equation for H(t).
(i) (6%) Draw a SIMULINK diagram for getting a plot of H(t).
(2%) Explain how to enter the initial condition for H.
(3%) Considering the name of your workspace, what commands are needed in the
Command Window for getting the plot of H(t)?
387
2. A ball is dropped from a high altitude. The differential equation for the velocity of the ball
before it hits the ground for SI units is shown below.
๐‘ฃฬ‡ + 2๐‘ฃ|๐‘ฃ| = 0.5
๐‘ฃ(0− ) = 0 ๐‘š/๐‘ 
(a) (3%) What is the terminal value of the velocity (final value)?
(b) (5%) Obtain a linear approximation for ๐‘ฃ|๐‘ฃ| and estimate the time required to reach
the terminal velocity within 1%.
(c) (8%) Complete the ode45 commands below to get a plot of the original nonlinear
differential equation.
function exam3
[t,x]=ode45(@exam3eqns,[0 10],[ ? ]);
plot(
?
)
xlabel(
? )
ylabel(
?
)
function dx = exam3eqns(t,x)
dx=zeros( ? ,1)
?
end
end
6๐‘ +15
3. ๐‘Œ(๐‘ ) = [๐‘ 2 +2๐‘ +5] ๐‘ˆ(๐‘ )
(a) (9%) Express this system in state variable format, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข ๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
A=? B=? C=? D=?
(b) (8%) Assume the input u(t) is a step input with magnitude 10. We know that the
inverse Laplace will be of the form
๐‘ฆ(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘๐‘’ −๐‘‘๐‘ก sin (๐‘“๐‘ก + ๐‘”)
๐‘Ž =? ๐‘ =? ๐‘‘ =? ๐‘“ =?
(c) (6%) Assume u(t) = 10sin(2t). After all transients have died out, y(t) = ?
4. (10%) Common sense tells us that the inverted pendulum shown below will fall from the vertical position if
disturbed even slightly while at rest in the vertical position. Using the differential equation for ๐œƒ, explain
mathematically why it will fall. ๐œƒฬˆ − 64๐œƒ = 0
๏ฑ
388
Exam 8.c Solution
1. The equations for the height H of the water in a tank and exit flow Q through a long line are
listed below for SI units. Qi is an input flow into the tank.
๐‘„๐‘– − ๐‘„ = 4๐ปฬ‡
๐ป = 2๐‘„
๐ป(0− ) = 10 ๐‘š
๐‘„(0− ) = 0
Qi
H
Q
(a) (4%) There are 2 equations. What are the unknowns? Q and H
(b) (6%) Laplace transform these equations; solve for H(s) assuming Qi is a constant of
10 m3/s.
10
− ๐‘„ = 4(๐‘ ๐ป − 10)
๐‘ 
๐ป = 2๐‘„
Solving for H gives
10๐‘  + 2.5
๐ป(๐‘ ) =
๐‘ (๐‘  + 0.125)
(c) (6%) Check your equation for H(s) using the initial and final value theorems.
FVT: sH(s)s=0 = 2.5/0.125 = 20
IVY: ๐‘ ๐ป(๐‘ )๐‘ =∞ = 10
(d) (6%) Write the MATLAB commands for getting a plot of H(t) using the ‘impulse’
command.
>> G=tf([10 2.5],[1 0.125 0]);
>> impulse(G)
(e) (3%) How long will it take for H to reach its final value within 1%? 5*8 = 40 s
(f) (6%) Draw an estimate of the plot of H(t).
H, m
20
10
0
40
t, s
(g) (5%) Use the residue theorem to find an equation for H(t).
๐ป(๐‘ก) = 20 − 10๐‘’ −0.125๐‘ก
389
(h) (4%) Substitute t = 0 and t = ∞ into your equation for H(t) to check your equation for
H(t).
H(0)=10 H(∞)=20
(i) (6%) Draw a SIMULINK diagram for getting a plot of H(t).
(2%) Explain how to enter the initial condition for H. Double click on integrator and
enter the initial condition of 10.
(3%) Considering the name of your workspace, what commands are needed in the
Command Window for getting the plot of H(t)?
>> plot(Y(:,1),Y(:,2))
2. A ball is dropped from a high altitude. The differential equation for the velocity of
the ball before it hits the ground for SI units is shown below.
๐‘ฃฬ‡ + 2๐‘ฃ|๐‘ฃ| = 0.5
๐‘ฃ(0− ) = 0 ๐‘š/๐‘ 
(a) (3%) What is the terminal value of the velocity (final value)?
0 + 2๐‘ฃ|๐‘ฃ| = 0.5 ๐‘กโ„Ž๐‘ข๐‘  ๐‘ฃ = √0.25 = 0.5 ๐‘š/๐‘ 
(b) (5%) Obtain a linear approximation for ๐‘ฃ|๐‘ฃ| and estimate the time required to reach
the terminal velocity within 1%.
The velocity starts at 0 and ends at 0.5; so, a 2-point straight line is ๐‘ฃ|๐‘ฃ| ≈ 0.5๐‘ฃ + 0
The differential equation becomes ๐‘ฃฬ‡ + ๐‘ฃ = 0.5 thus the time constant is 1 s. So, it will
take about 5 s to reach terminal velocity.
(c) (8%) Complete the ode45 commands below to get a plot of the original nonlinear
differential equation.
function exam3
[t,x]=ode45(@exam3eqns,[0 10],[ 0 ]);
plot( t,x(:,1))
xlabel( ‘time, s’ )
ylabel( ‘velocity, m/s’)
function dx = exam3eqns(t,x)
dx=zeros( 1 ,1);
dx(1)=0.5-2*x(1)*abs(x(1));
end
end
6๐‘ +15
3. ๐‘Œ(๐‘ ) = [๐‘ 2 +2๐‘ +5] ๐‘ˆ(๐‘ )
390
(a) (9%) Express this system in state variable format, i.e. ๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
A=? B=? C=? D=?
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
0
1
0
Using phase variables: ๐ด = [
] ๐ต = [ ] ๐ถ = [15 6] ๐ท = [0]
−5 −2
1
0
1
6
Using simulation diagram: ๐ด = [
] ๐ต = [ ] ๐ถ = [1 0] ๐ท = [0]
−5 −2
3
(b) (8%) Assume the input u(t) is a step input with magnitude 10. We know that the
inverse Laplace will be of the form
๐‘ฆ(๐‘ก) = ๐‘Ž๐‘’ −๐‘๐‘ก + ๐‘๐‘’ −๐‘‘๐‘ก sin (๐‘“๐‘ก + ๐‘”)
๐‘Œ(๐‘ ) = [
6๐‘  + 15 10
60๐‘  + 150
]
=
+ 2๐‘  + 5 ๐‘ 
๐‘ [(๐‘  + 1)2 + 22 ]
๐‘ 2
๐‘Ž = 30 ๐‘ = 0 ๐‘‘ = 1 ๐‘“ = 2
(c) (6%) Assume u(t) = 10sin(2t). After all transients have died out, y(t) = ?
6๐‘  + 15
๐‘ฆ(๐‘ก) = 10 | 2
|
sin(2๐‘ก + ∅)
๐‘  + 2๐‘  + 5 ๐‘ =๐‘—2
6(๐‘—2) + 15
= 10 |
| sin(2๐‘ก + ∅)
(๐‘—2)2 + 2(๐‘—2) + 5
15 + ๐‘—12
15 + ๐‘—12
))
= 10 |
| sin (2๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
1 + ๐‘—4
1 + ๐‘—4
= 10√
241
12
4
sin (2๐‘ก + ๐‘ก๐‘Ž๐‘›−1 ( ) − ๐‘ก๐‘Ž๐‘›−1 ( ))
17
15
1
= 46.59sin (2๐‘ก − 0.651)
4. (10%) Common sense tells us that the inverted pendulum shown below will fall from the vertical position if
disturbed even slightly while at rest in the vertical position. Using the differential equation for ๐œƒ, explain
mathematically why it will fall. ๐œƒฬˆ − 64๐œƒ = 0 The characteristic polynomial has a positive real root = 8.
๏ฑ
391
Exam 9a
1.
Consider the following differential equation for y(t).
4๐‘ฆฬˆ + 40๐‘ฆฬ‡ + 400๐‘ฆ = 800
๐‘ฆ(0− ) = 1
๐‘ฆฬ‡ (0− ) = 0
(a) (2%) What is the order of the differential equation? ______
(b) (2%) What is the input to the differential equation? _______
(c) (2%) What is the value of y(t) at time t = 0- ? _______
(d) (2%) Is the equation linear or nonlinear? __________
(e) (3%) What is the value of y(t) as t → ∞ ? ________
(f) (4%) What is the characteristic polynomial? ______________________________
(g) (6%) What are the eigenvalues? ____________________________ (Check your answer!)
(h) (4%) What is the damping ratio? _______________________
(i) (3%) What is the undamped natural frequency? _____________
(j) (3%) What is the time constant? _____________
(k) (8%) Sketch an estimate of the solution y(t) of the equation below including the effects of
the damping ratio and the time constant.
y(t)
0
t
๐‘  2 + 2๐›ฟ๐œ”๐‘› ๐‘  + ๐œ”๐‘›2 = 0
(๐‘  + ๐‘Ÿ)2 + ๐œ”๐‘‘2 = 0
2. The input to the following differential equation is a unit impulse denoted by ๐›ฟ(๐‘ก).
๐‘ฆฬˆ + 7๐‘ฆฬ‡ + 10๐‘ฆ = 5๐›ฟ(๐‘ก) ๐‘ฆ(0− ) = 2
๐‘ฆฬ‡ (0− ) = 0
(a) (5%) What are the eigenvalues of this differential equation? ___________________
(b) (6%) Sketch below an estimate of the plot of y(t).
y(t)
0
t
(c) (4%) What is the Laplace transform of the unit impulse ๐›ฟ(๐‘ก)? ______________
(d) (10%) Laplace transform the differential equation and solve for Y(s).
(e) (6%) Use the initial value theorem (IVT) and the final value theorem (FVT) and your plot in
part (b) to check your equation for Y(s).
392
(f) (10%)Use the residue theorem to find the inverse Laplace transform of Y(s) to get an
equation for y(t). Substitute t = 0 and t = ∞ in your equation for y(t) to check your equation
for y(t).
๐ฟ{๐‘“ฬ‡} = ๐‘ ๐น(๐‘ ) − ๐‘“(0− ) ๐ฟ{๐‘“ฬˆ } = ๐‘  2 ๐น(๐‘ ) − ๐‘ ๐‘“(0− ) − ๐‘“ฬ‡ (0− )
FVT: lim ๐‘“(๐‘ก) = ๐‘ ๐น(๐‘ )๐‘ =0
IVT: lim
๐‘“(๐‘ก) = ๐‘ ๐น(๐‘ )๐‘ =∞
+
๐‘ก→∞
0 ←๐‘ก
3. The input to the differential equation below is u(t) = 2sin(5t). The Laplace transform for u(t) is
also shown below.
10
๐‘ฆฬ‡ + 10๐‘ฆ = ๐‘ข
๐‘ฆ(0− ) = 0 ๐‘ˆ(๐‘ ) = 2
๐‘  + 52
(a) (6%) Find and equation for Y(s).
(b) (4%) Write MATLAB commands for getting a plot of y(t).
4. A car initially moving with a speed of 10 m/s starts coasting up a hill. The equations defining the
dynamics of the forward motion of the moving car are as follows:
1000๐‘ฃฬ‡ + ๐‘“๐‘‘ + ๐‘“๐‘” = 0
sum of forces on the car
๐‘“๐‘‘ = 20๐‘ฃ
aerodynamic drag force
๐‘“๐‘” = 10,000
gravity force due to hill
(a) (6%) Laplace transform each of the equations.
(b) (4%) Solve for the Laplace transform of the drag force Fd(s).
Exam 9a Solution
393
394
Exam 9b
1. A schematic of a vertical pendulum is shown below. The angle ๐œƒ is measured from the
vertical and is positive clockwise. The differential equation for ๐œƒ assuming small angles
is
๐œƒฬˆ − 5๐œƒ = 0
๐œƒฬ‡(0− ) = 0
๐œƒ(0− ) = 0.1
(a) (15%) Laplace transform the equation and then use the inverse Laplace to get ๐œƒ(๐‘ก).
When you substitute t = 0, does your equation for ๐œƒ(๐‘ก) give the correct value?
(b) (5%) Common sense tells us that if the pendulum starts at a non-zero angle, it will fall.
Using your equations in (a), prove mathematically that it will fall.
๐œƒ
๐ฟ{๐‘ฆ} = ๐‘Œ(๐‘ )
๐ฟ{๐‘ฆฬ‡ } = ๐‘ ๐‘Œ(๐‘ ) − ๐‘ฆ(0− )
๐ฟ{๐‘ฆฬˆ } = ๐‘  2 ๐‘Œ(๐‘ ) − ๐‘ ๐‘ฆ(0− ) − ๐‘ฆฬ‡ (0− )
2. In order to keep the pendulum vertical and return it to vertical from an initial non-zero angle, as
shown below, the pendulum is attached to a cart that moves laterally with displacement z. The
lateral movement results from a force Fi acting on the cart; see the differential equation for the
cart displacement shown below. The pendulum angle ๐œƒ is continuously measured and used for
the input to the differential equation for the force Fi; see the differential equation for Fi shown
below. Thus, assuming small angles, the differential equations for the pendulum and cart are
๐œƒฬˆ − 5๐œƒ = −0.5๐‘งฬˆ ๐‘›๐‘’๐‘ค ๐‘’๐‘ž๐‘ข๐‘Ž๐‘ก๐‘–๐‘œ๐‘› ๐‘“๐‘œ๐‘Ÿ ๐‘๐‘’๐‘›๐‘‘๐‘ข๐‘™๐‘ข๐‘š ๐‘๐‘œ๐‘›๐‘ ๐‘–๐‘‘๐‘’๐‘Ÿ๐‘–๐‘›๐‘” ๐‘ง
๐‘งฬˆ = −0.2๐œƒฬˆ − 0.1๐น๐‘– ๐‘‘๐‘–๐‘“๐‘“๐‘’๐‘Ÿ๐‘’๐‘›๐‘ก๐‘–๐‘Ž๐‘™ ๐‘’๐‘ž๐‘ข๐‘Ž๐‘ก๐‘–๐‘œ๐‘› ๐‘“๐‘œ๐‘Ÿ ๐‘กโ„Ž๐‘’ ๐‘๐‘Ž๐‘Ÿ๐‘ก ๐‘‘๐‘–๐‘ ๐‘๐‘™๐‘Ž๐‘๐‘’๐‘š๐‘’๐‘›๐‘ก
๐น๐‘–ฬ‡ + 8๐น๐‘– = −150[๐œƒฬ‡ + 6๐œƒ] ๐‘‘๐‘–๐‘“๐‘“๐‘’๐‘Ÿ๐‘’๐‘›๐‘ก๐‘–๐‘Ž๐‘™ ๐‘’๐‘ž๐‘ข๐‘Ž๐‘ก๐‘–๐‘œ๐‘› ๐‘“๐‘œ๐‘Ÿ ๐‘กโ„Ž๐‘’ ๐‘“๐‘œ๐‘Ÿ๐‘๐‘’ ๐‘œ๐‘› ๐‘กโ„Ž๐‘’ ๐‘๐‘Ž๐‘Ÿ๐‘ก
Ms
๏ฑ
L
z
Mc
Fi
395
(d) (6%) What are the three unknowns in these three equations?
(e) (9%) Convert these equations to algebraic equations by Laplace transforming each of the three
equations assuming all initial conditions are zero except ๐œƒ(0− ) = ๐œƒ๐‘œ .
(f) (5%) Write symbolic math MATLAB commands for solving for ๐œƒ(๐‘ ).
3. The equations for a vehicle suspension are shown below. The input is the displacement u(t).
The output of interest is y = v – u. We want to express the equations for this system in state
variable format, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ + ๐ต๐‘ข
๐‘ฆ = ๐ถ๐‘‹ + ๐ท๐‘ข
(a) (8%) Define a set of state variables for this system. Do not write their derivative equations.
(b) (12%) Suppose you are able to find the transfer function G(s) for w; that is W(s) = G(s)U(s). You
then have generated the frequency response for G(s) using the MATLAB command bode to get
the plot shown below. What is the DC gain of the transfer function?_____ Explain why value of
DC gain makes sense.
What is the approximate gain of the transfer function at the sinusoidal input frequency of 7 rad/s?
__________
Magnitude (dB)
40
Bode Diagram
20LogM=M in dB
20
0
-20
-40
Phase (deg)
-60
0
-90
-180
-270
-360
0
10
1
10
Frequency (rad/s)
2
10
396
4. (20%)
5. (20%) Two water tanks are connected by a pipe. The input to the system is flow rate Qi. HL is
the height of the water in the tank on the left and HR is the height of the water in the tank on
the right.
Qi
HR
HL
Q
The equations for this system are
๐‘„๐‘– − ๐‘„ − 4๐ปฬ‡๐ฟ = 0
๐ป๐ฟ (0− ) = 3 ๐‘š
๐‘„ − 4๐ปฬ‡๐‘… = 0
๐ป๐‘… (0− ) = 5 ๐‘š
๐‘„ = 0.025(๐ป๐ฟ − ๐ป๐‘… )
Define state variables for this system of equations and write the derivative equations, i.e.
๐‘ฅ1 =?
๐‘ฅ2 =?
:
โˆถ
๐‘ฅฬ‡ 1 =?
๐‘ฅฬ‡ 2 =?
โˆถ
โˆถ
397
Exam 9b Solution
398
399
400
Exam 9c
1. The differential equation for the bending stress p in SI units at the connection point of an
airplane wing associated with vertical movement u of the fuselage is
2๐‘ฬˆ + 24๐‘ฬ‡ + 1872๐‘ = 7๐‘ฅ109 ๐‘ขฬˆ
(a) (5%) What is the transfer function for P(s)? That is, P(s) = G(s)U(s), G(s) = ?
(b) (5%) Suppose u(t) is a step input with magnitude 0.5. Write MATLAB commands
for getting a plot of p(t) using the command ‘step’.
(5%) For the same step input, write MATLAB commands for getting a plot of p(t)
using the command ‘impulse’.
(c) (6%) What are the eigenvalues of this stress model? __________________________
401
(d) (4%) Check your answer to part (c); otherwise, your answers in (e) will be wrong.
(e) (16%) Suppose the input u(t) is a step with magnitude 0.5 m. It can be shown that the
inverse Laplace transform solution to the differential equation above is of the
following form:
๐‘(๐‘ก) = ๐‘Ž๐‘’ ๐‘๐‘ก sin (๐‘๐‘ก + ∅)
๐‘Ž =?
๐‘ =?
๐‘ =? ∅ =?
Note, if your P(s) doesn’t give this p(t), stop and go back and find your error before
proceeding.
๐‘’ −๐‘Ÿ๐‘ก ๐‘(๐‘ )
|
|
sin(๐œ”๐‘ก + ๐œƒ)
๐œ” ๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
๐‘(๐‘ )
)
๐œƒ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’ {(
}
๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
(f) The frequency response plot of the transfer function for p is shown below. At what
input frequency of u(t) will the stress have the greatest amplification? (4%) ________
What is the amplification at this frequency? (4%) __________ (M dB = 20Log10M)
If ๐‘ข(๐‘ก) = 0.1 sin(50๐‘ก), what will be the amplitude and frequency of p(t)? (8%)_____
Bode Diagram
Magnitude (dB)
200
190
180
170
160
Phase (deg)
150
180
135
90
45
0
10
1
10
2
Frequency (rad/s)
(g) (5%) Suppose the PSD of u(t), ๐บ๐‘ข๐‘ข (๐‘“), is a zero-mean-band-limited white noise with
magnitude A for 0 ≤ ๐‘“ ≤ 100 โ„Ž๐‘ง. If the mean square value is ฬ…ฬ…ฬ…
๐‘ข2 = 0.04, what is A?
Draw a sketch of ๐บ๐‘ข๐‘ข (๐‘“).
(h) (10%) Suppose we want to generate values of u(kH) corresponding to the PSD in (g)
to be used for the input to the differential equation in a simulation to get values of
๐‘(๐‘˜๐ป). Suggest and justify values for H and N where N is the number of values of
1
๐‘ข(๐‘˜๐ป) to be generated for the simulation. Recall, 2๐ป is the maximum frequency in
hz that will be generated and NH will be the total simulation time.
2. A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity
๐‘‰(0− ) = √1002 + 1202 = 156.2 m/s.
The differential equation for the vertical displacement can be shown to be
402
๐‘ฆฬˆ + 0.005๐‘‰๐‘ฆฬ‡ ≈ −10 ๐‘ฆ(0− ) = 2 ๐‘š ๐‘ฆฬ‡ (0− ) = 100 ๐‘š/๐‘ 
and the differential equation for the horizontal displacement can be shown to be
๐‘คฬˆ + 0.005๐‘‰๐‘คฬ‡ = 0
๐‘ค(0− ) = 0 ๐‘š ๐‘คฬ‡ (0− ) = 120 ๐‘š/๐‘ 
where the velocity V of the ball is ๐‘‰ = √๐‘ฆฬ‡ 2 + ๐‘คฬ‡ 2
(d) (12%) Define state variables xi and write the ๐’™ฬ‡ ๐’Š equations for an ode45 numerical
simulation to get plots of y(t) and w(t).
y
w
(e) (13%) Complete the MATLAB code below for an ode45 simulation of these equations.
[t,x]=ode45(@eqns,[0 10],[
]);
y=
;
w=
;
plot(t , w , ’r’ , t , y , ’k:’ ) % plot y(t) and w(t)
xlabel( ‘ time, s’ )
ylabel( ‘ displacements, m’ )
legend(‘w(t)’,’y(t)’)
function dx=eqns(t,x)
dx=zeros(
, 1);
V=
dx(1)=
end
(f) (3%) Draw a sketch of what you think the plot of y(t) v. w(t) will look like.
w(t)
403
Exam 3 Solution
MAE 3360
Nov. 26, 2019
1. The differential equation for the bending stress p in SI units at the connection point of an
airplane wing associated with vertical movement u of the fuselage is
2๐‘ฬˆ + 24๐‘ฬ‡ + 1872๐‘ = 7๐‘ฅ109 ๐‘ขฬˆ
2
7๐‘’9๐‘ 
(a)(5%) What is the transfer function for P(s)? That is, P(s) = G(s)U(s), ๐บ(๐‘ ) = 2๐‘ 2 +24๐‘ +1872
(b)(5%) Suppose u(t) is a step input with magnitude 0.5. Write MATLAB commands for
getting a plot of p(t) using the command ‘step’.
>> G=tf(0.5*[7e9 0 0],[2 24 1872]);
>> step(G)
(5%) For the same step input, write MATLAB commands for getting a plot of p(t)
using the command ‘impulse’.
Considering that U(s)=0.5/s and thus, P(s)=G(s)U(s)
>> P=tf(0.5*[7e9 0],[2 24 1872]);
>> impulse(P)
(c)(6%) What are the eigenvalues of this stress model?
2(๐‘  2 + 12๐‘  + 936) = 2(๐‘  + 6 + ๐‘—30)(๐‘  + 6 − ๐‘—30)
๐ธ๐‘‰ ′ ๐‘  = −6 ± ๐‘—30
(d)(4%) Check your answer to part (c); otherwise, your answers in (e) will be wrong.
(e)(16%) Suppose the input u(t) is a step with magnitude 0.5 m. It can be shown that the
inverse Laplace transform solution to the differential equation above is of the following
form:
๐‘(๐‘ก) = ๐‘Ž๐‘’ ๐‘๐‘ก sin (๐‘๐‘ก + ∅)
๐‘Ž =?
๐‘ =?
๐‘ =? ∅ =?
Note, if your P(s) doesn’t give this p(t), stop and go back and find your error before
proceeding.
๐‘’ −6๐‘ก 0.5 ∗ 7๐‘’9๐‘ 
๐‘ 
๐‘(๐‘ก) =
|
|
sin(30๐‘ก + ๐œƒ)
๐œƒ = ๐‘Ž๐‘›๐‘”๐‘™๐‘’ {[ ]
}
30
2
1 ๐‘ =−6+๐‘—30
๐‘ =−6+๐‘—30
๐‘(๐‘ก) = (1.7847๐‘’9)๐‘’ −6๐‘ก sin (30๐‘ก + 1.7682)
404
(f) The frequency response plot of the transfer function for p is shown below. At what input
frequency of u(t) will the stress have the greatest amplification?(4%) ≈ 30
๐‘Ÿ๐‘Ž๐‘‘
๐‘ 
What is the
amplification at this frequency? (4%) 200 dB, gain = 10200⁄20 = 1010
If ๐‘ข(๐‘ก) = 0.1 sin(50๐‘ก), what will be the amplitude and frequency of p(t)? (8%)
amplitude = 0.1*1010 = 109 , frequency = 50 rad/s
Bode Diagram
Magnitude (dB)
200
190
180
170
160
Phase (deg)
150
180
135
90
45
0
10
1
10
2
Frequency (rad/s)
(g) (5%) Suppose the PSD of u(t), ๐บ๐‘ข๐‘ข (๐‘“), is a zero-mean-band-limited white noise with
magnitude A for 0 ≤ ๐‘“ ≤ 100 โ„Ž๐‘ง. If the mean square value is ฬ…ฬ…ฬ…
๐‘ข2 = 0.04, what is A?
Draw a sketch of ๐บ๐‘ข๐‘ข (๐‘“). 100A=0.04 Thus, A = 0.0004
Guu(f)
A
0
100
f, hz
(h) (10%) Suppose we want to generate values of u(kH) corresponding to the PSD in (g) to
be used for the input to the differential equation in a simulation to get values of ๐‘(๐‘˜๐ป).
Suggest and justify values for H and N where N is the number of values of ๐‘ข(๐‘˜๐ป) to be
1
generated for the simulation. Recall, 2๐ป is the maximum frequency in hz that will be
generated and NH will be the total simulation time.
1
๐‘ก๐‘œ ๐‘–๐‘›๐‘๐‘™๐‘ข๐‘‘๐‘’ ๐‘Ž๐‘™๐‘™ ๐‘–๐‘›๐‘๐‘ข๐‘ก ๐‘“๐‘Ÿ๐‘’๐‘ž๐‘ข๐‘’๐‘›๐‘๐‘–๐‘’๐‘ ,
≥ 100 ๐‘‡โ„Ž๐‘ข๐‘ , ๐ป ≤ 0.005 ๐‘ 
2๐ป
1
But, to be more conservative, it is recommended that ๐ป ≤ 10∗100 = 0.001
1
๐‘ก๐‘œ ๐‘ ๐‘Ž๐‘ก๐‘–๐‘ ๐‘“๐‘ฆ ๐‘กโ„Ž๐‘’ ๐‘’๐‘–๐‘”๐‘’๐‘›๐‘ฃ๐‘Ž๐‘™๐‘ข๐‘’ ๐‘Ÿ๐‘’๐‘ž๐‘ข๐‘–๐‘Ÿ๐‘’๐‘š๐‘’๐‘›๐‘ก๐‘ ,
๐ป≤
= 0.003269
10√936
So, H = 0.001 satisfies both requirements. The time required for a simulation to reach the
stationary portion of p(t) is about 5*(1/6) = 0.83 s. So, the simulation should last at least 2 s
which means N > 2/0.001 = 2000. But N must be a power of 2; so, N = 2048 or 4096, etc.
2. A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity
๐‘‰(0− ) = √1002 + 1202 = 156.2 m/s.
The differential equation for the vertical displacement can be shown to be
๐‘ฆฬˆ + 0.005๐‘‰๐‘ฆฬ‡ ≈ −10 ๐‘ฆ(0− ) = 2 ๐‘š ๐‘ฆฬ‡ (0− ) = 100 ๐‘š/๐‘ 
and the differential equation for the horizontal displacement can be shown to be
๐‘คฬˆ + 0.005๐‘‰๐‘คฬ‡ = 0
๐‘ค(0− ) = 0 ๐‘š ๐‘คฬ‡ (0− ) = 120 ๐‘š/๐‘ 
405
where the velocity V of the ball is ๐‘‰ = √๐‘ฆฬ‡ 2 + ๐‘คฬ‡ 2
(a) (12%) Define state variables xi and write the ๐‘ฅฬ‡ ๐‘– equations for an ode45 numerical
simulation to get plots of y(t) and w(t). x1 = y x2 = ๐‘ฆฬ‡ x3=w x4 = ๐‘คฬ‡
๐‘‰ = √๐‘ฅ22 + ๐‘ฅ42
๐‘ฅฬ‡ 1 = ๐‘ฅ2
๐‘ฅฬ‡ 2 = −10 − 0.005๐‘‰๐‘ฅ2
๐‘ฅฬ‡ 3 = ๐‘ฅ4
๐‘ฅฬ‡ 4 = −0.005๐‘‰๐‘ฅ4
(b)(13%) Complete the MATLAB code below for an ode45 simulation of these equations.
[t,x]=ode45(@eqns,[0 10],[ 2 100 0 120]);
y= x(:,1);
w= x(:,3);
plot(t , w , ’r’ , t , y , ’k:’ ) % plot y(t) and w(t)
xlabel( ‘ time, s’ )
ylabel( ‘ displacements, m’ )
legend(‘w(t)’,’y(t)’)
function dx=eqns(t,x)
dx = zeros( 4 , 1);
V = sqrt(x(2)^2+x(4)^2);
dx(1) = x(2);
dx(2)= -10 - 0.005*V*x(2);
dx(3) = x(4);
dx(4) = -0.005*V*x(4);
end
(c)(3%) Draw a sketch of what you think the plot of y(t) v. w(t) will look like.
y(t)
2
0
w(t)
406
Exam #1
MAE 3360
Oct 8, 2020
1. The 2-mass system shown below with force input Fi is defined by the
following two simultaneous equations shown below.
๐Ÿ“๐ฒฬˆ + ๐Ÿ’๐Ÿ๐ฒฬ‡ + ๐Ÿ‘๐Ÿ”๐ŸŽ๐ฒ = ๐Ÿ—๐ŸŽ๐ณ + ๐Ÿ”๐ณฬ‡ ๐ˆ๐‚′๐ฌ: ๐ฒ(๐ŸŽ− ) = ๐Ÿ’ ๐ฒฬ‡ (๐ŸŽ− ) = ๐ŸŽ
๐Ÿ๐ŸŽ๐ณฬˆ + ๐Ÿ”๐ณฬ‡ + ๐Ÿ—๐ŸŽ๐ณ = ๐Ÿ—๐ŸŽ๐ฒ + ๐Ÿ”๐ฒฬ‡ + ๐…๐ข ๐ˆ๐‚′๐ฌ: ๐ณ(๐ŸŽ− ) = ๐ŸŽ ๐ณฬ‡ (๐ŸŽ− ) = ๐Ÿ
y
z
force
input
Fi
(a) (2%) What does it mean for the two equations to be ‘simultaneous’?
______________________________________________________________
(b) (2%) What are the unknown variables in these equations? ____________
(c) (2%) Are the equations algebraic or differential? ________
(d) (2%) How many state variables are needed to simulate this system? ______
(e) (2%) Is the system linear or nonlinear? __________
(f) (6%) If the input Fi is a constant equal to 90, solve for the final values of z and y?
z final = ____________
y final = _____________
Equations:
Final Value Theorem: sF(s)s=0
Initial Value Theorem: sF(s)s=∞
๐’…๐’‡
๐’‡(๐’›) ≈ ๐’‡(๐’›๐’ ) + [ ] (๐’› − ๐’›๐’ )
๐’…๐’› ๐’›๐’
๐‘ณ{๐’š(๐’•)} = ๐’€(๐’”) ๐‘ณ{๐’šฬ‡ (๐’•)} = ๐’”๐’€(๐’”) − ๐’š(๐ŸŽ− ) ๐‘ณ{๐’šฬˆ (๐’•)}
= ๐’”๐Ÿ ๐’€(๐’”) − ๐’”๐’š(๐ŸŽ− ) − ๐’šฬ‡ (๐ŸŽ− )
2. (a) (4%) What are the MATLAB commands for entering the following
transfer function into MATLAB? Y(s) = G(s) U(s) where
407
๐Ÿ๐’”๐Ÿ + ๐Ÿ๐Ÿ”
๐‘ฎ= ๐Ÿ’
๐Ÿ‘๐’” + ๐Ÿ–๐’”๐Ÿ‘ + ๐Ÿ๐Ÿ“๐’”๐Ÿ + ๐Ÿ๐Ÿ’๐’” + ๐Ÿ”๐Ÿ’
(b) (2%) What is the DC gain of this transfer function? _______________
(c) (2%) What is the meaning of the DC gain? ________________________________
______________________________________________
3. (6%) Get the coefficient in front of ๐ฏฬˆ equal to 1 and then express the following
differential equation in state variable format for an ode45 simulation; don’t
forget, there can’t be an input derivative in the ๐ฑฬ‡ equations. The input is u(t) = 4.
Determine the initial conditions for the state variables.
๐Ÿ๐ฏฬˆ + ๐Ÿ’๐ฏฬ‡ + ๐Ÿ๐ŸŽ๐ฏ = ๐Ÿ๐ŸŽ๐ฎ + ๐Ÿ’๐ฎฬ‡
๐ฏ(๐ŸŽ− ) = ๐Ÿ’ ๐ฏฬ‡ (๐ŸŽ− ) = ๐ŸŽ. ๐Ÿ“ ๐ฎ(๐ŸŽ− ) = ๐Ÿ’
๐ฑ ๐Ÿ = _____ ๐ฑ ๐Ÿ = _____ ๐ฑฬ‡ ๐Ÿ = ____ ๐ฑฬ‡ ๐Ÿ = ________ ๐ฑ ๐Ÿ (๐ŸŽ− ) = ____ ๐ฑ ๐Ÿ (๐ŸŽ− ) = __
4. The following differential equation has been expressed in state variable format
๐’—ฬˆ + ๐Ÿ๐’—ฬ‡ + ๐Ÿ‘๐Ÿ”๐’— = ๐ŸŽ
๐’—(๐ŸŽ − ) = ๐Ÿ‘
๐’—ฬ‡ (๐ŸŽ− ) = ๐Ÿ
408
๐’™๐Ÿ = ๐’—
๐’™๐Ÿ = ๐’—ฬ‡
๐’™ฬ‡ ๐Ÿ = ๐’™๐Ÿ
๐’™ฬ‡ ๐Ÿ = −๐Ÿ‘๐Ÿ”๐’™๐Ÿ − ๐Ÿ๐’™๐Ÿ
The following ode45 file has been written to simulate, solve, and plot an output-of-interest
for this differential equation. Note, an output-of-interest is any variable that we want
plotted.
function testproblem
[t,x]=ode45(@eqns,[0 3],[3 1]);
plot(t,x(:,1))
xlabel('time, s')
ylabel('output of interest')
grid
function dx = eqns(t,x)
dx = zeros(2,1);
dx(1) = x(2);
dx(2) = - 36*x(1) - 2*x(2);
end
end
(6%) Draw an estimate of the plot that will be generated using this MATLAB code;
be sure to label the axes. Be specific: put numbers on the axes for (a) initial and
final values (b) approximate time to final value (c) estimate the degree of oscillation
if any using the damping ratio.
5. Consider the following differential equation for y with input u:
๐Ÿ‘๐’šฬˆ + ๐Ÿ๐Ÿ’๐’šฬ‡ + ๐Ÿ•๐Ÿ“๐’š = ๐Ÿ๐Ÿ’๐’–ฬ‡ + ๐Ÿ•๐Ÿ“๐’–
409
(a) (4%) What is the characteristic polynomial for this differential equation?___________
(b) (4%) What are the eigenvalues? ______________________
(c) (2%) What is the undamped natural frequency? ____
(d) (2%) What is the damping ratio? ____
(e) (2%) What is the time constant? ______
410
6. The schematic of a spring and mass system is shown below.
z
u
The displacement of the mass at the top end of the spring is z and the input
displacement at the bottom of the spring is u. The equations for this system are as
follows:
(๐Ÿ) ๐Ÿ๐ŸŽ๐ณฬˆ + ๐…๐ฌ = ๐ŸŽ
(๐Ÿ) ๐…๐ฌ = ๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ(๐ณ − ๐ฎ)
(a) ((4%) What are the unknowns? ____________
(b) (8%) Find the transfer function for Fs. That is,
๐‘ฎ(๐’”) =
๐‘ต(๐’”)
๐‘ซ(๐’”)
N(s) = _____________
๐…๐ฌ (๐ฌ) = ๐†(๐ฌ)๐”(๐ฌ)
D(s) = ______________
411
7. The schematic of a spring-mass-damper system is shown below.
z
u
The displacement of the mass is z and the input displacement is u. The Laplace
transform for Z(s) is
๐Ÿ๐ŸŽ๐ฌ + ๐Ÿ๐ŸŽ๐ŸŽ
๐™(๐ฌ) = [ ๐Ÿ
] ๐”(๐ฌ)
๐Ÿ๐ฌ + ๐Ÿ๐Ÿ๐ฌ + ๐Ÿ๐Ÿ”
(a) (4%) Assume the input is a step with magnitude of 4 at t = 0. What is the
equation for Z(s) after inserting the U(s) for the step input?
๐™(๐ฌ) =
๐(๐ฌ)
๐ƒ(๐ฌ)
N(s) = _________________ D(s) = __________________
(b) (8%) Use the residue theorem to find the inverse Laplace transform of Z(s)
to get an equation for z(t).
๐’›(๐’•) = ___________________________________
(c) (2%) Substitute t = ∞ into your equation for z(t) found in (b).
๐’š(๐’•)๐’•=∞ =______________
(d) (2%) Does your z(t) with t = ∞ give the same answer as the final value
theorem? ___________
8. The schematic of a spring-mass-damper system is shown below.
412
z
u
The displacement of the mass is z and the input displacement u(t) = 4sin(10t). The Laplace
transform of u(t) is
๐‘ผ(๐’”) = ๐Ÿ’
๐‘(๐‘ ) = [
๐’”๐Ÿ
๐Ÿ๐ŸŽ
+ ๐Ÿ๐ŸŽ๐Ÿ
10๐‘  + 200
] ๐‘ˆ(๐‘ )
5๐‘  2 + 35๐‘  + 50
(a) (8%) What are the MATLAB commands for generating a plot of z(t) using the
command impulse?
(b) (2%) Explain why this provides the plot of z(t) without having to find the inverse
Laplace of Z(s).
9. The schematic of a suspension system is shown below. At time t = 0, the mass
is setting at rest on the spring and damper. At time t = 0, someone strikes the
413
top of the mass with a hammer producing the input force F(t) shown below
causing the mass to move with displacement z(t) which is positive down.
(a) (6%) Considering the initial and final values of z as determined by the equations
below, estimate a plot of the resulting z(t) on the graph shown below.
Hint: What is F for t → ∞?
F
F(t) (hammer strike)
0
t
z
0
Time t
z(t)
๐Ÿ๐ŸŽ๐’›ฬˆ + ๐‘ญ๐’… + ๐‘ญ๐’” − ๐‘ญ − ๐Ÿ–๐ŸŽ = ๐ŸŽ ๐’›(๐ŸŽ− ) = ๐Ÿ ๐’›ฬ‡ (๐ŸŽ− ) = ๐ŸŽ Force balance on mass
๐‘ญ๐’… = ๐Ÿ๐Ÿ’๐’›ฬ‡
damper force
๐Ÿ‘
๐‘ญ๐’” = ๐Ÿ๐ŸŽ๐’›
spring force
(b) (8%) Draw a sketch of z3 v. z and then obtain an appropriate straight-line
approximation for z3 to use for z3 in the equation for Fs.
z3
0
z
414
Exam #2
MAE 3360
Nov. 24, 2020
1. Consider the following differential equation with input r(t):
๐‘ฆฬˆ + 4๐‘ฆฬ‡ + 25๐‘ฆ = 50๐‘Ÿ
(a) (5%) What is the transfer function for y?
transfer function =
r(t)
(b) (4%) What is R(s)?
___________
2
1
0
t
∞
Note, ๐‘…(๐‘ ) = ∫0 ๐‘Ÿ(๐‘ก)๐‘’ −๐‘ ๐‘ก ๐‘‘๐‘ก
(c) (7%) What are the MATLAB commands for getting a plot of y(t) using the
impulse command?
2. (7%) Consider the following differential equation with input r(t) and zero
initial conditions:
415
๐‘ฆฬ‡ + 2๐‘ฆ = 10๐‘Ÿ
๐‘Ÿ(๐‘ก) = 0.5๐‘ ๐‘–๐‘›(2๐‘ก)
๐‘…(๐‘ ) = 0.5
2
๐‘ 2 + 4
What is the equation for y(t) for t > 3 s?
๐‘’ −๐‘Ÿ๐‘ก ๐‘(๐‘ )
๐‘(๐‘ )
๐‘ ๐‘–๐‘› [๐œ”๐‘ก + ๐‘Ž๐‘›๐‘”๐‘™๐‘’ (
|
|
)
]
๐œ” ๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
๐ท(๐‘ ) ๐‘ =−๐‘Ÿ+๐‘—๐œ”
3. Consider the following differential equation with input r(t).
2๐‘ฆฬ‡ + 4๐‘ฆ = 8๐‘Ÿฬ‡ + 12๐‘Ÿ
๐‘ฆ(0− ) = 1
r(t)
3
416
(a) (7%) Solve for the Laplace transform of y(t), Y(s).
๐ฟ{๐‘“ฬ‡ (๐‘ก)} = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
0
t
(b) (5%) Apply the final value theorem. Does it give the correct final value?
FVT: sF(s)s=0
(c) (5%) Apply the initial value theorem. Explain why it doesn’t give a
number that agrees with the initial value, y(0-) = 1. IVT: ๐‘ ๐น(๐‘ )๐‘ =∞
4. (8%) Use the residue theorem to solve for w(t) if ๐‘ค(๐‘ ) = [
the FVT and the IVT to check your answer. [(๐‘  +
12๐‘ +18
].
๐‘ (2๐‘ +4)
๐‘)๐น(๐‘ )๐‘’ ๐‘ ๐‘ก ]๐‘ =−๐‘
Use
417
5. Assume the eigenvalues for a system are −3 ± ๐‘—4 ๐‘Ž๐‘›๐‘‘ − 10 ± ๐‘—√300.
The PSD of a stochastic input u(t) to a system is shown below. u(t) is to be
generated using the MATLAB function SochInput.m.
๐บ๐‘ข๐‘ข (๐‘“)
10
4
0
2
Freq. increment โˆ†๐‘“ =
10
1
๐‘๐ป
max freq. =
f, hz
1
2๐ป
Total time = NH
1
10๐‘€
(a) (3%) Based on the eigenvalues, the time increment H should be less
than or equal to what value when generating u(t)? ______________
418
Be sure to explain your answer showing all calculations.
(b) (3%) Based on the input PSD, the time increment H should be less than
or equal to what value when generating u(t)? ___________
Be sure to explain your answer and show all calculations.
(c) (3%) Realizing that the number of data points to be generated for the
stochastic input u(t) must be a power of 2, what is the smallest value of N
that should be considered in order to observe and evaluate the stationary
response of this system due to the input u(t)? _________
Be sure to explain your answer and show all calculations.
(d) (2%) Realizing that 1/(NH) will be the frequency increment, โˆ†๐‘“, how
many points between 2 and 10 hz (frequency range shown on PSD plot)
will be generated using your N and H? _____
419
(e) (2%) Is the answer in (d) enough points for an accurate representation
of the PSD when generating u(t)? ______ Why?
(f) (3%) Based on the plot of the PSD, what is the mean square value of
u(t)? ______________
(g) (3%) Based on the plot of the PSD, what is the mean value of u(t)?
___________
6. A very hot steel ball is placed in a pan of cold water. The equations that
define the thermal dynamics of this system are shown below. q is the heat
transfer rate from the ball at temperature TB to the water at temperature
TW. Note, this is an initial condition response problem since there is no
input.
−10−3 ๐‘ž = ๐‘‡ฬ‡๐ต
10−4 ๐‘ž = ๐‘‡ฬ‡๐‘Š
๐‘‡๐ต (0− ) = 60
๐‘‡๐‘Š (0− ) = 5
๐‘‡๐ต − ๐‘‡๐‘Š = ๐‘ž
(a) (12%) Express these equations in state variable format assuming q is the
output of interest, i.e.
๐‘‹ฬ‡ = ๐ด๐‘‹ ๐‘ฆ = ๐ถ๐‘‹
๐ด =? ๐ถ =?
420
(b) (4%) What are the initial conditions for the state variables?
๐‘ฅ1 (0− ) =
๐‘ฅ2 (0− ) =
7. The schematic of a suspension system is shown below. The road profile u(t)
is the input.
(8%) Define state variables for this system; you do not need to write the
state variable derivative equations.
x1 =
x2 =
x3 =
x4 =
(5%) Assume the output of interest y is the acceleration ๐‘คฬˆ . In terms of your
state variable definitions above, what are C and D if the output of interest
is y = CX + Du ?
C=
D=
421
(4%) Assume the system is initially at rest. If u(t) is a step input at t = 0,
draw an estimate of the decrease in gap size y(t) = v(t) – w(t) as a function
of time.
y(t)
0
t
422
Exam 1
MAE 3360
March 2, 2021
1. The initial height H of the water in a tank is defined by the equations shown below.
At time = 0, water starts flowing out of the tank through a hole in the bottom.
H(t)
H
0
time
Q
(๐Ÿ) ๐Ÿ๐ŸŽ๐‘ฏฬ‡ = −๐‘ธ ๐‘ฏ(๐ŸŽ− ) = ๐Ÿ’ ๐’Ž
(๐Ÿ) ๐‘ธ = ๐Ÿ√๐‘ฏ ๐’Ž๐Ÿ‘ /๐’”
(a) (2%) What are the unknowns in the equations? _______
(b) (4%) On the graph above, estimate a plot of the height H(t) of the water as a function of time.
(c) (2%) What is the order of this system? ________
(d) (2%) Is the system linear or nonlinear? ________
(e) (4%) Using Euler’s integration with a time increment of 0.1 seconds, determine H at time
t = 0.1 seconds, i.e. H(0.1) = ?
4.0__ 3.99___ 3.98___ 3.97___ 3.96___ 3.95___ 3.94___ 3.93___ 3.92___ 3.91___
(f) (5%) Using separation of variables, determine the solution H(t) to these equations for t ≥ 0
and for H(t) ≥ 0.
H(t)=? (2−0.5t)2___
(2−0.1t)2___ (2−0.2t)2___ (4−0.1t) ___ (4−0.2t)___ 4(1−0.1t)2___
423
(g) (2%) Using your solution in (f), does H(t) give the correct value at t=0?
(h) (4%) Using your separation of variables solution in (f), what is H(t) at t = 0.1 s?
3.99__
3.98__
(1.99)2__
(1.98)2__
(1.97)2___
(1.96)2___
(1.95)2___
(1.94)2___
2. At time t =0 the height H of water in a tank is 4 m. At t=0 water starts flowing into the tank at
a constant rate of 6 m3/s and flowing out with a flow rate of Qo. The equations for this system
are
(1) 10๐ปฬ‡ = 6 − ๐‘„๐‘œ ๐ป(0− ) = 4
(2) ๐‘„๐‘œ = 2√๐ป
10 m3/s
H(t)
H
0
time
(a) (5%) The height of the water in the tank will eventually reach a constant level
(final value); what is this constant level?
H(∞) = 1__
2__ 3__
5__
6__
7__
8__
9___ 10___
(b) (3%) On the graph above, draw a sketch of an estimate of H(t) for ๐‘ก ≥ 0.
(b) (5%) If the final value of H(t) was 16 (it’s not), what would be a good straight-line
approximation for √๐ป? That is √๐ป ≈?
1
12
๐ป+
_____
7
7
1
10
๐ป+
_____
7
7
1
4
๐ป + _____
6
3
1
6
๐ป + _____
5
5
424
3. At time t =0 the height H of water in a tank is 4 m. At t=0 water starts flowing into the tank at
a constant rate of Qi(s) = 2 m3/s and flowing out with a flow rate of Qo. The equations for this
system are
(1) 10๐ปฬ‡ = ๐‘„๐‘– − ๐‘„๐‘œ ๐ป(0− ) = 4
(2) ๐‘„๐‘œ = 0.2๐ป
2 m3/s
H(t)
H
0
time
(a) (3%) Draw an estimate of H(t) on the graph above.
(b) (7%) Laplace transform the equations and solve for H(s).
42
_____
10๐‘  + 0.2
0.4๐‘  + 0.2
_____
๐‘ (๐‘  + 0.02)
4๐‘  + 0.2
_____
๐‘ (๐‘  + 0.02)
6
_____
10๐‘  + 0.2)
(c) (5%) Use the final value theorem on your answer to part (a) as a check to see if your answer
in (a) is correct. lim ๐ป(๐‘ก) = lim ๐‘ ๐ป(๐‘ )
๐‘ก→∞
If
๐‘ =0
๐‘ณ{๐‘“(๐‘ก)} โ‰œ ๐น(๐‘ ) then ๐ฟ{๐‘“ฬ‡ (๐‘ก)} = ๐‘ ๐น(๐‘ ) − ๐‘“(0− )
425
4. A mass is placed on a platform supported by a spring. The equations for the system
are listed below.
mass
time
0
y
y
๐‘ฐ๐‘ช′ ๐’”:
๐Ÿ๐’šฬˆ + ๐‘ญ๐’… + ๐‘ญ๐’” = ๐Ÿ๐ŸŽ
๐’š(๐ŸŽ− ) = ๐ŸŽ ๐’Ž
๐‘ญ๐’… = ๐ŸŽ. ๐Ÿ–๐’šฬ‡
๐‘ญ๐’” = ๐Ÿ๐ŸŽ๐ŸŽ๐’š
๐’šฬ‡ (๐ŸŽ− ) = ๐ŸŽ๐’Ž/๐’”
๐’…๐’‚๐’Ž๐’‘๐’Š๐’๐’ˆ ๐’‡๐’๐’“๐’„๐’†
๐’”๐’‘๐’“๐’Š๐’๐’ˆ ๐’‡๐’๐’“๐’„๐’†
(a) (3%) Determine the damping ratio of this system.
0.1 ___
0.02___
0.50___
0.8___
1.0___
1.5____
−0.1___
−0.5____ −0.02___
(b) (3%) What is the time constant of this system in seconds?
2____
0.2____
0.5____
5____
10_____
25_____
(c) (4%) Considering the initial and final values, the damping ratio ๐œน, the damped natural
frequency ๐Ž๐’… and the time constant ๐‰, on the graph above, draw an estimate of y(t).
Equations:
๐’”๐Ÿ + ๐Ÿ๐œน๐Ž๐’ ๐’” + ๐Ž๐Ÿ๐’ = (๐’” + ๐œน๐Ž๐’ + ๐’‹๐Ž๐’… )(๐’” + ๐œน๐Ž๐’ − ๐’‹๐Ž๐’… )
๐Ž๐’… = ๐Ž๐’ √๐Ÿ − ๐œน๐Ÿ
๐Ÿ
๐‰ = ๐œน๐Ž
๐’
426
๐Ÿ‘๐Ÿ”๐’”+๐Ÿ๐Ÿ“๐ŸŽ
5. (5%) For ๐’€(๐’”) = ๐’”(๐Ÿ‘๐’”๐Ÿ +๐Ÿ๐Ÿ–๐’”+๐Ÿ•๐Ÿ“) , which of the following inverse Laplace transforms
qualify for y(t)? Note: sin(−0.9273) = −0.8 and ๐ฅ๐ข๐ฆ
๐’‡(๐’•) = ๐ฅ๐ข๐ฆ ๐’”๐‘ญ(๐’”)
+
๐’”=∞
๐ŸŽ ←๐’•
๐Ÿ + ๐Ÿ. ๐Ÿ“๐’†−๐Ÿ‘๐’• ๐’”๐’Š๐’(๐Ÿ’๐’• − ๐ŸŽ. ๐Ÿ—๐Ÿ๐Ÿ•๐Ÿ‘)____
๐Ÿ‘ + ๐Ÿ. ๐Ÿ“๐’†−๐Ÿ‘๐’• ๐’”๐’Š๐’(๐Ÿ’๐’• − ๐ŸŽ. ๐Ÿ—๐Ÿ๐Ÿ•๐Ÿ‘)____
๐Ÿ + ๐Ÿ. ๐Ÿ“๐’†−๐Ÿ’๐’• ๐’”๐’Š๐’(๐Ÿ‘๐’• − ๐ŸŽ. ๐Ÿ—๐Ÿ๐Ÿ•๐Ÿ‘)____
๐Ÿ’ + ๐Ÿ. ๐Ÿ“๐’†−๐Ÿ’๐’• ๐’”๐’Š๐’(๐Ÿ‘๐’• − ๐ŸŽ. ๐Ÿ—๐Ÿ๐Ÿ•๐Ÿ‘)____
๐Ÿ. ๐Ÿ“๐’†−๐Ÿ’๐’• ๐’”๐’Š๐’(๐Ÿ‘๐’• − ๐ŸŽ. ๐Ÿ—๐Ÿ๐Ÿ•๐Ÿ‘)____
For
๐Ÿ. ๐Ÿ“๐’†−๐Ÿ‘๐’• ๐’”๐’Š๐’(๐Ÿ’๐’• − ๐ŸŽ. ๐Ÿ—๐Ÿ๐Ÿ•๐Ÿ‘)____
−๐‘Ÿ ± ๐‘—๐œ”, sum of residues equals
๐‘’ −๐‘Ÿ๐‘ก
๐œ”
๐‘€๐‘ ๐‘–๐‘›(๐œ”๐‘ก + ๐œƒ)
427
6. The ball with radius r shown below rolls without slip up and down the inner walls of a
stationary barrel with radius R. The equations for the angular position of the ball ๐œฝ are
๐œฝฬˆ + ๐ŸŽ. ๐Ÿ๐œฝฬ‡ + ๐Ÿ—๐’”๐’Š๐’๐œฝ = ๐ŸŽ
๐‘ฐ๐‘ช′ ๐’”: ๐œฝ(๐ŸŽ− ) = ๐Ÿ. ๐Ÿ“๐’“๐’‚๐’…. (≈ ๐Ÿ—๐ŸŽ๐’…๐’†๐’ˆ. )
๐œฝฬ‡(๐ŸŽ− ) = ๐ŸŽ ๐’“๐’‚๐’…./๐’”
๐œƒ
r
R
(a) (8%) The differential equation for ๐œฝ is 2nd order and thus, for a numerical simulation, two
first order state variable differential equations for the derivatives of the state variables will
be required in terms of the two state variables ๐’™๐Ÿ and ๐’™๐Ÿ , i.e.
๐ฑ๐Ÿ =? _______
๐ฑ๐Ÿ =? _______
๐ฑ๐Ÿ (๐ŸŽ− ) =? ________
๐ฑ๐Ÿ (๐ŸŽ− ) =? ________
๐ฑฬ‡ ๐Ÿ = ๐Ÿ๐ฎ๐ง๐œ๐ญ๐ข๐จ๐ง ๐จ๐Ÿ ๐ฑ๐Ÿ & ๐ฑ๐Ÿ =? ______________
๐ฑฬ‡ ๐Ÿ = ๐Ÿ๐ฎ๐ง๐œ๐ญ๐ข๐จ๐ง ๐จ๐Ÿ ๐ฑ๐Ÿ & ๐ฑ๐Ÿ =? ________________________
(b) Complete the ode45 MATLAB code below for simulating this system.
(1) (4%) [t,x]=ode45(@eqns,[0 50], [ ?
(2) (6%) function dx = eqns(t,x)
dx = zeros(? , 1);
dx(1) = ?
dx(2) = ?
end
?]) ____
_____
_______________
________________
________________
428
7. (5%) Use the residue theorem to express the following Laplace transform in partial
fraction format.
๐Ÿ‘๐Ÿ’๐ฌ๐Ÿ + ๐Ÿ‘๐Ÿ๐Ÿ–๐ฌ + ๐Ÿ๐ŸŽ๐ŸŽ
๐ฌ(๐Ÿ๐ฌ + ๐Ÿ’)(๐ฌ + ๐Ÿ๐ŸŽ)
5
10
2
+
+
______
๐‘  ๐‘  + 10 ๐‘  + 2
10
5
2
+
+
______
๐‘ 
๐‘  + 10 ๐‘  + 2
5
2
10
+
+
______
๐‘  ๐‘  + 10 ๐‘  + 2
2
10
5
+
+
______
๐‘  ๐‘  + 10 ๐‘  + 2
5
10
5
+
+
______
๐‘  ๐‘  + 10 ๐‘  + 2
The residue for a 1st order pole -p of Y(s) is
(s+p)Y(s)s = -p
429
8. (a) (3%) y(t) is shown on the graph to the right. What is the Laplace transform Y(s) = ?
y(t)
๐Ÿ
๐’”
____
๐Ÿ
๐’”+๐Ÿ
____
๐Ÿ
๐’”+๐Ÿ
___ 2___
๐Ÿ
๐’”
____ 1___
๐Ÿ
๐’”+๐Ÿ
๐’†−๐Ÿ๐’” ____
2
1
0
t
(b) (3%) z(t) is shown in the graph to the right. What is the Laplace transform Z(s) = ?
z(t)
๐Ÿ
____
๐’”
๐Ÿ
๐’”+๐Ÿ
____
๐Ÿ
๐’”+๐Ÿ
___ 2___
๐Ÿ
๐’”
____ 1___
๐Ÿ
๐’”+๐Ÿ
๐’†−๐Ÿ๐’” ____
๐Ÿ๐œน(๐’•)
0
(c) (3%) ๐’—(๐’•) = ๐Ÿ๐’†−๐Ÿ๐’•
๐Ÿ
๐’”
____
๐Ÿ
๐’”+๐Ÿ
____
๐Ÿ
๐’”+๐Ÿ
t
V(s) = ?
___ 2___
๐Ÿ
๐’”
____ 1___
๐Ÿ
๐’”+๐Ÿ
๐’†−๐Ÿ๐’” ____
∞
๐ฟ{๐‘“(๐‘ก)} = ∫ ๐‘“(๐‘ก)๐‘’ −๐‘ ๐‘ก ๐‘‘๐‘ก
0
430
Exam #2
MAE3360
April 27, 2021
1. The barrier design specifications are to stop a car with a maximum deceleration not
greater than 4 g’s while avoiding a total collapse of the barrier (D=10 m). If the barrier
totally collapses before the forward velocity goes to zero, there will likely be very high g’s
and damage to the car. Obviously, the possibility of satisfying the design specifications
depends on the size and speed of the car.
y
D
K
b
Impact Barrier System
The differential equation for the displacement of the car y(t) if y(0-) is zero at the position
of the car when it hits the bumper is shown below for ๐’š(๐’•) < ๐Ÿ๐ŸŽ & ๐’šฬ‡ (๐’•) > ๐ŸŽ
๐Ÿ๐ŸŽ๐ŸŽ๐ŸŽ๐ฒฬˆ + ๐Ÿ‘๐ŸŽ, ๐ŸŽ๐ŸŽ๐ŸŽ๐ฒฬ‡ + ๐Ÿ—๐ŸŽ๐ŸŽ, ๐ŸŽ๐ŸŽ๐ŸŽ๐ฒ = ๐ŸŽ
๐’š(๐ŸŽ− ) = ๐ŸŽ
๐’šฬ‡ (๐ŸŽ− ) = ๐Ÿ‘๐ŸŽ
(10%) What is the Laplace transform for ๐’šฬˆ (๐’•)?
30
30๐‘ 
30๐‘  2
30
(๐‘Ž) 2
(๐‘) 2
(๐‘) 2
(๐‘‘)
๐‘  + 30๐‘  + 900
๐‘  + 30๐‘  + 900
๐‘  + 30๐‘  + 900
๐‘ (๐‘  2 + 30๐‘  + 900)
431
2. A pile driver is used to drive the pile shown below into the ground. The input is the pounding
force F on the top of the pile. The frequency response for the transfer function for the force f at the
ground is shown below.
F
M /2
z
2K
b
Bode Diagram
20
M
10
w
M /2
Magnitude (dB)
0
K
-10
-20
-30
-40
-50
0
-45
b
-90
Phase (deg)
2K
-135
-180
-225
-270
-315
1
10
f
2
3
10
10
Frequency (rad/s)
(10%) If the pounding force is a sine wave with amplitude of 1000 N, what is the largest possible peak
amplitude of the ground force? ________
(a) 1000 N
(b) 20,000 N
(c) 10,000 N
(d) 100 N
(e) 2000 N
(f) 200,000 N
432
3. The forward moving mass contacts the bumper compressing water in the cylinder and
forcing water out through the orifice. Denote the pressure in the cylinder by Pc and the
displacement of the mass by y; y(0-)=0 and ๐’šฬ‡ (๐ŸŽ− ) = ๐‘ฝ๐’.
Q
do
Initial
Velocity Vo
M
D
L
The equations for this system assuming the mass is in contact with the bumper at t=0 are:
๐Ÿ
๐‘ธ = ๐‘ช๐’… ๐‘จ๐’ √ ๐‘ท๐’„ ๐‘ท๐’„ ≥ ๐ŸŽ
๐†
๐‘จ(๐‘ณ − ๐’š)
๐‘ทฬ‡๐’„ ๐๐œ (๐ŸŽ− ) = ๐ŸŽ
๐œท๐’†
๐‘ด๐’šฬˆ + ๐‘จ๐‘ท๐’„ = ๐ŸŽ ๐ฒ(๐ŸŽ− ) = ๐ŸŽ ๐ฒฬ‡ (๐ŸŽ− ) = ๐ŸŽ
−๐‘ธ + ๐‘จ๐’šฬ‡ =
(1) (3%) This system of equations is linear ______ or nonlinear. _______
(2) (8%) What are the state variables for an ode45 simulation? _________
(๐’‚) ๐’š, ๐‘ท๐’„ , ๐‘ธ
(๐’ƒ) ๐’š, ๐‘ธ, ๐‘ทฬ‡๐’„
(๐’„) ๐’š, ๐’šฬ‡ , ๐’šฬˆ
(๐’…) ๐’šฬˆ , ๐‘ท๐’„ , ๐‘ธ
(๐’†) ๐’š, ๐’šฬ‡ , ๐‘ท๐’„
(๐’‡) ๐’š, ๐’šฬ‡ , ๐‘ท๐’„ , ๐‘ธ
433
4. A hot steel ball with initial temperature 100 โ„ƒ is placed in a large pan of cold water with
a temperature Tw that remains approximately constant at 20 โ„ƒ. A simple model for the
thermodynamics in terms of the heat transfer q in J/s from the ball to the water is given
below.
q
−๐’’ = ๐Ÿ“๐ŸŽ๐ŸŽ๐‘ปฬ‡๐’ƒ
๐Ÿ๐Ÿ“(๐‘ป๐’ƒ − ๐‘ป๐’˜ ) = ๐’’
(1) (5%) What will be the final temperature of the ball? _____
(a) 100 โ„ƒ
(b) 120 โ„ƒ
(c) 20 โ„ƒ
(d) 60 โ„ƒ
(e) 25 โ„ƒ
(2) (5%) Approximately how long will it take for the ball temperature to
become constant? ______
(a) 100 s
(b) 500 s
(c) 25 s
(d) 20 s
(e) 1000 s
434
5. (8%) Consider the following differential equation for z(t) with input u(t). Assuming the
output of interest is ๐’š = ๐’– − ๐’› , which set of matrices are valid for the state variable
equations?
๐‘ฟฬ‡ = ๐‘จ๐‘ฟ + ๐‘ฉ๐’–
๐’š = ๐‘ช๐‘ฟ + ๐‘ซ๐’–
๐Ÿ๐ŸŽ๐’›ฬˆ + ๐Ÿ“๐ŸŽ๐’›ฬ‡ + ๐Ÿ”๐ŸŽ๐’› = ๐Ÿ“๐ŸŽ๐’–ฬ‡ + ๐Ÿ”๐ŸŽ๐’–
(๐’‚)
๐ŸŽ
๐‘จ=[
−๐Ÿ”
(๐’ƒ)
๐‘จ=[
(๐’„)
(๐’…)
(๐’†)
(๐’‡)
๐Ÿ
]
−๐Ÿ“
๐‘ฉ=[
๐ŸŽ
๐Ÿ
]
−๐Ÿ” −๐Ÿ“
๐ŸŽ
๐‘จ=[
−๐Ÿ”
๐ŸŽ
๐‘จ=[
−๐Ÿ”
๐‘จ=[
๐Ÿ
]
−๐Ÿ“
๐Ÿ
]
−๐Ÿ“
๐ŸŽ
๐Ÿ
]
−๐Ÿ”๐ŸŽ −๐Ÿ“๐ŸŽ
๐ŸŽ
๐‘จ=[
−๐Ÿ”๐ŸŽ
๐Ÿ
]
−๐Ÿ“๐ŸŽ
๐Ÿ“
]
−๐Ÿ๐Ÿ—
๐ŸŽ
๐‘ฉ=[ ]
๐Ÿ
๐‘ฉ=[
๐Ÿ“
]
−๐Ÿ๐Ÿ—
๐ŸŽ
๐‘ฉ=[ ]
๐Ÿ
๐ŸŽ
๐‘ฉ=[ ]
๐Ÿ
๐‘ฉ=[
๐Ÿ“
]
−๐Ÿ๐Ÿ—
๐‘ช = [−๐Ÿ
๐‘ช = [๐Ÿ”
๐ŸŽ]
๐‘ซ = [๐Ÿ]
๐Ÿ“]
๐‘ซ = [๐ŸŽ]
๐‘ช = [๐Ÿ ๐ŸŽ]
๐‘ช = [−๐Ÿ
๐‘ซ = [−๐Ÿ]
๐ŸŽ]
๐‘ช = [๐Ÿ”๐ŸŽ
๐‘ช = [−๐Ÿ
๐‘ซ = [๐Ÿ]
๐Ÿ“๐ŸŽ]
๐ŸŽ]
๐‘ซ = [๐ŸŽ]
๐‘ซ = [๐Ÿ]
435
6. (8%) The PSD of a stochastic process y(t) is shown below. Plots for estimates of y(t) are
shown in the 2nd figure. Which plot in the 2nd figure most likely corresponds to the PSD?
________
Gyy(f)
9๐›ฟ(๐‘“)
9๐›ฟ(๐‘“ − 1)
0
1
frequency f, hz
8
a
b
c
d
e
6
4
y(t)
2
0
-2
-4
-6
0
0.2
0.4
0.6
0.8
1
Time, s
1.2
1.4
1.6
1.8
2
7. (8%) A random process x has a uniform probability density function between 0 and 100.
What is the probability that a sample of x is some value between 40 and 60? ______
(a) 10%
(b) 20%
(c) 40%
(d) 60%
(e) 80%
(f) 90%
8. (8%) A band limited white noise has a single sided PSD of 100 over the frequency range
of 1 to 26 hz. What is the standard deviation of this stochastic process?
(a) 2500
(b) 5
(c) 25
(d) 50
(e) 100
(f) 10
436
9. (10%) Which of the plots below is the solution to the following differential equation?
Legend is hard to read. Mark correct plot with an arrow.
๐Ÿ๐’šฬˆ + ๐Ÿ. ๐Ÿ’๐’šฬ‡ + ๐Ÿ๐Ÿ–๐’š = ๐Ÿ‘๐Ÿ” ๐’š(๐ŸŽ− ) = ๐Ÿ
๐’šฬ‡ (๐ŸŽ− ) = ๐ŸŽ
Impulse Response
3
2.5
Amplitude
2
1.5
1
(a)
(b)
(c)
(d)
(e)
0.5
0
0
0.5
1
1.5
2
2.5
3
3.5
4
Time (seconds)
10. (3%) A zero-order-hold is an algorithm for A/D conversion? True ___
11. (3%) The inverse Z-transform of z-KX(z) is x(t – KT)? True _____
False _____
False _____
437
12, (3%) The Laplace transform is used to convert linear and nonlinear differential
equations into algebraic equations. True _______ False _________
13. For days, the water flow into a tank has been constant. The differential equation for
the height H of the water in the tank is
๐Ÿ๐ŸŽ๐ŸŽ๐‡ฬ‡ + ๐Ÿ’๐ŸŽ√๐‡ = ๐Ÿ๐Ÿ๐ŸŽ
H
4
3
16
9
H
H
H
3
9
H
(1) (3%) After several days, what is the height of the water in the tank? ______
(a) 3 m
(b) 9 m
(c) 40 m
(d) 120 m
(e) 200 m (f) 5 m
(2) (5%) Assume the level H has been constant for several days (part (1) above) when
someone pours a cup of water into the tank. Approximately how long will it take for H(t)
to return to the level prior to the additional cup of water?
(a) 150 s
(b) 3 s
(c) 200 s
(d) 30 s
(e) 60 s
(f) 1000 s
438
Download