You are on page 1of 16

EE 5307 Homeworks

Fall 2013


Updated: Tuesday, November 26, 2013


- For full credit, show all work.

- Some problems require hand calculations. In those cases, do not use MATLAB except to
check your answers.

- It is OK to talk to people before you start work. After you start work, you are expected to

WORK ALONE on the homework WITH NO ASSISTANCE


DO NOT DO HOMEWORK UNTIL IT IS ASSIGNED.
THE ASSIGNMENTS MAY CHANGE UNTIL ANNOUNCED.



EE 5307 Homework 1
Fall 2013

MATLAB, Computer Simulation

1. Simulate the van der Pol oscillator
0 ' ) 1 ( "
2
= + + y y y y o
using MATLAB. Plot y(t) vs. t and also the phase plane plot y'(t) vs. y(t). Use y(0)=0, y'(0)=
0.5.

a. For o=0.1.
b. For o=0.8.


2. Do MATLAB simulation of the Lorenz Attractor chaotic system. Run for 150 sec. with all
initial states equal to 0.3. Plot states versus time, and also make 3-D plot of x
1
, x
2
, x
3
using
PLOT3(x1,x2,x3).

2 1 3 3
3 1 2 1 2
2 1 1
) (
x x bx x
x x x rx x
x x x
+ =
=
=

o


use o=10, r=28, b=8/3.

3. A system has transfer function
13 4
4
) (
2
+ +
+
=
s s
s
s H

a. Use MATLAB to make a 3-D plot of the magnitude of H(s)
b. Use MATLAB to make a 3-D plot of the phase of H(s)
c. Use MATLAB to draw magnitude and phase Bode plots



EE 5307 Homework 2
Fall 2013

State-Space Analysis

1. Show all work, do by hand. Make plots with MATLAB.
| | Cx x y Bu Ax u x x = = + =
(

+
(


= 1 3 ,
1
0
6 8
1 0

a. Find poles.
b. Find u(s) and |(t)=e
At
.
c. Find transfer function.
d. Find impulse response. Use MATLAB to plot impulse response.
e. Find step response. Use MATLAB to plot step response.
f. Find output y(t) if | |
T t
x t u e t u 1 1 ) 0 ( ), ( 3 ) (
1
3
= =

.

2.

a. Find state-space representation for the circuit in terms of L, R1, R2, R3, C1, C2.

Now, set L=2H, C1=2F, C2=1F and all resistors to 1 ohm:

b. Find transfer function from A,B,C,D. Use MATLAB function ss2tf
c. Find poles and zeros for these values of components. Use MATLAB, not by hand.
d. Simulate on MATLAB-- Plot the output y(t). Set input u(t)=unit step and initial
conditions equal to zero

3.
Cx x y Bu Ax u x x =
(


= + =
(

+
(


=
2 4
1 2
,
1 1
0 1
6 8
1 0


a. Find poles and MV zeros
b. Find transfer function.
c. Is system minimal?
d. Find minimal realization (A,B,C,D).


EE 5307 Homework 3
Fall 2013

Analysis of Different Systems

The state-space models of four systems are below. For each system:

a. Find poles and natural modes.

b. Find transfer function H(s).

c. Find zeros.

d. Make Bode plots of open-loop system.

e. Plot step response if the system is stable.



1. Inverted pendulum.
| | 0 0 0 1 1 ,
1 . 0
0
1 . 0
0
1 ,
0 10 0 0
1 0 0 0
0 1 0 0
0 0 1 0
1 =
(
(
(
(

=
(
(
(
(

= C B A

2. Ball balancer.
| | 0 0 0 1 2 ,
1 . 0
0
0
0
2 ,
0 0 0 1
1 0 0 0
0 9 0 0
0 0 1 0
2 =
(
(
(
(

=
(
(
(
(

= C B A

3. Flexible-joint system.
| | 0 1 0 0 3 ,
0
0
1
0
3 ,
1 . 2 10 2 . 0 1
1 0 0 0
2 . 0 1 2 . 0 1
0 0 1 0
3 =
(
(
(
(

=
(
(
(
(



= C B A

4. Flexible-link system.
| | 0 0 0 1 4 ,
0
0
1
0
4 ,
3 . 0 23 1 . 0 1
1 0 0 0
1 . 0 1 1 . 0 1
0 0 1 0
4 =
(
(
(
(

=
(
(
(
(



= C B A
EE 5307 Homework 4
Fall 2013

CT System Analysis System Zeros, Reachability, Observability, Stability, Minimality

1. Given the system described by the equations

0 1 1 2
3 4 0 0
3 1
6 2
x x u
y x
( (
= +
( (


(
=
(



a. Draw the block diagram of the system.
b. Calculate the poles of the system.
c. Calculate the transfer function matrix of the system.
d. Calculate the transmission zeros of the system.
e. Calculate the input and output decoupling zeros.
f. Is the state space realization of the system minimal? If not, find a minimal realization for the
system. Draw the block diagram for the minimal realization.


2. Take the linear dynamical system described by

1 2 1
,
0 ( 2)
[1 1]
x x u a R
a a
y x
( (
= + e
( (
+

=



Make discussion below for all values of a R e .
a. Study the reachability and observability of the system.
For some values of a it may lose reachability or observability.
b. Calculate the transfer function matrix.
c. Find the poles of the system.
d. Find the transmission zeros and the decoupling zeros.

3. AS/BIBOS/Minimality
A CD reader system can be written in state-space form as

2 1 1
,
3 0 1
x x u
( (
= +
( (


| |x y 0 1 = .

a. Is the system Asymptotically stable?
b. Is the system BIBO stable?
c. find minimal realization (a,b,c,d)


EE 5307 Homework 5
Fall 2013

Discrete Time SV Systems

1. Compound Interest. Consider the scalar DT SV system
k k k
bu ax x + =
+1

Let initial condition be
0
x and the input be the unit step ,... 1 , 1 , 1 , 1 ) (
1
= =

k u u
k
The initial
condition is called the initial balance, and a constant input is known as an annuity deposit.
Find the state solution
k
x . (Find analytic solution.). This is the compound interest formula in
economics.

2. The DT SV is
1
0 1 0
1/ 6 5/ 6 1
k k k
x x u
+
( (
= +
( (


, | | 1 0
k k
y x =

a. Find poles and natural modes.
b. Find resolvent ) (z u and an analytic expression for the DT exponential
k
A k = ) ( |
c. Find transfer function
d. Find pulse response (analytic expression)
e. Find step response (analytic expression)
f. Find analytic expression for the state
k
x if | |
T
x 1 2
0
= and input is
) (
4
1
1
k u u
k
k
|
.
|

\
|
=
g. Find analytic expression for the output
k
y in this case.
h. Write the difference equation relating
k
y to
k
u .

3. For the system in problem 2,
a. Use iteration to compute
0 1 2 3
, , , x x x x and
0 1 2 3
, , , y y y y by hand for the case in Problem
2f.. Do they agree with the analytic solution found in Problem 2f?
b. Use the difference equation to compute
3 2 1
, , y y y by hand for the case in Problem 2f.
To start the difference equation, use your values of
0 1
, y y from 3a as the initial conditions.

4. a. Write a MATLAB program to compute output
k
y if

k k k k
u y y y = +
2 1
9925 . 0 9 . 1
Use zero initial conditions and unit step input. Plot output for k=1 to 500.
b. Find poles. Can you explain the behavior of
k
y ? Find natural frequency
n
e .
EE 5307 Homework 6
Fall 2013

Lyapunov Stability, Realization and Canonical Forms

Part A Lyapunov Stability
Solve Lyapunov equation to determine stability.

1.
4 2
1 1
x Ax x
(
= =
(



2.
0 1
0 4
x Ax x
(
= =
(



3.
1
0 1
0.09 1
k k k
x Ax x
+
(
= =
(




Part B Realization and Canonical Forms
8 14 7
3
) (
2 3
+ + +
+
=
s s s
s
s H
4. RCF
a. Write SV equations for reachable canonical form
b. Draw RCF block diagram

5. OCF
a. Write SV equations for observable canonical form
b. Draw OCF block diagram

6. Duality
Show that RCF SV matrices are the same as OCF SV matrices if you reorder the states
backwards and replace (A,B,C) by ) , , (
T T T
B C A .

7. Parallel Canonical Form.
a. Write SV equations for Parallel canonical form
b. Draw Parallel Form block diagram
EE 5307 Homework 7
Fall 2013

Discretization, Ackermann Formula

1. A continuous-time system is
| |
0 1 0
, 2 1
3 4 1
x x u Ax Bu y x Cx
( (
= + = + = =
( (




a. Find sampled system if sampling time is T=0.1 sec.

1
,
s s s
k k k k k
x A x B u y C x
+
= + =
Do BY HAND. It is practice for the exam.

b. find sampled system by MATLAB function c2d if T=0.1 sec.

c. Plot x(t) and y(t) using the continuous-time dynamics. Let u(t)=unit step and x(0)=0.
You can use either MATLAB ode23 or lsim or step.

d. Plot ,
k k
x y using DT dynamics. Use MATLAB dlsim, dstep, whatever.

e. Verify that the two plots are the same at the samples. Maybe you can plot the samples of
,
k k
x y on the same plots as x(t), y(t)?

2. A telescope pointing system is ,
2
1
1 2
1 0
u x x
(

+
(

=
| |
1 0 y x =
a. Find poles.
b. Use Ackermann to place the closed-loop poles at s= -1, -2. Do BY HAND.
c. Verify BY HAND that the closed-loop poles are where desired.
d. Use MATLAB to plot closed-loop step response. Check settling time and POV. Check
closed-loop poles.

EE 5307 Homework 8
Fall 2013

Ball Balancer SVFB Controller Design- LQR and Ackermann

1. The ball balancer is given by

| | 0 0 0 1 2 ,
1 . 0
0
0
0
2 ,
0 0 0 1
1 0 0 0
0 9 0 0
0 0 1 0
2 =
(
(
(
(

=
(
(
(
(

= C B A

with state | |
T
p p x u u

= . We are going to do 3 feedback control designs using MATLAB.

a. Use Ackermann to find SVFB to place the poles at 3 5 , 2 1 j j s = . Plot time
response over 15 seconds if | |
T
x 0 1 . 0 0 1 . 0 ) 0 ( = . (MATLAB routine is called place
or acker. Place is numerically more stable)

b. Use LQR to design SVFB. Select R=0.01, Q=diag{1, 1, 50, 50}. Find closed-loop
poles. Plot time response over 15 seconds if | |
T
x 0 1 . 0 0 1 . 0 ) 0 ( = .

b. Use LQR to design SVFB. Select R=1, Q=diag{1, 1, 50, 50}. Find closed-loop poles.
Plot time response over 15 seconds if | |
T
x 0 1 . 0 0 1 . 0 ) 0 ( = .

2. A telescope pointing system is ,
2
1
1 2
1 0
u x x
(

+
(

=
e. Find poles.
f. Use Ackermann to make settling time equal to sec and POV equal to 4%. Do BY
HAND.
g. Verify that the closed-loop poles are where desired.
h. Use MATLAB to plot closed-loop step response. Check settling time and POV. Check
closed-loop poles.

EE 5307 Homework 9
Design Project
Fall 2013

LQR/LQE Regulator Design

1. The inverted pendulum with position measurements is given by

| | 0 0 0 1 2 ,
1 . 0
0
0
0
2 ,
0 0 0 1
1 0 0 0
0 9 0 0
0 0 1 0
2 =
(
(
(
(

=
(
(
(
(

= C B A

with state | |
T
p p x u u

= .

a. Use LQR to design a SVFB K. Select R=0.01, Q=diag{1, 1, 50, 50}. Find closed-loop
poles. Use SVFB u=-Kx and plot time response over 15 seconds if | |
T
x 0 1 . 0 0 1 . 0 ) 0 ( = .
(You did this for hwk 8.)

b. Use LQE to design an observer L. Select R
o
=0.001, Q
o
=diag{1, 1, 50, 50}. Find observer
poles.

c. Use observer to design a regulator x K u = . Draw block diagram of the closed-loop system.
Use MATLAB to plot system response with estimated state FB and observer. One way to do this
is to write MATLAB M file with both the plant dynamics and the observer dynamics. Another is
to make a large augmented system with eight states.

d. Plot time response over 15 seconds if initial state is | |
T
x 0 1 . 0 0 1 . 0 ) 0 ( = and initial
estimation error is | |
T
x 0 05 . 0 0 05 . 0 ) 0 (
~
= . Compare to results of part a.


2. A system has the SV representation

,
1
0
6 5
1 0
u x x
(

+
(

= | |x y 1 1 = .

DO BY HAND

a. Find poles
b. Use Ackermann to find SVFB K to place the poles at s= -2, -3.
c. Use Ackermann to design an observer L with poles at s= -10, -20.
d. Write equations for the dynamic regulator

EE 5307 Homework 12
Fall 2013

Jordan Normal Form, Gilberts Method

1. Find eigenvalues and eigenvectors.
simple matrix
1 1 2
0 2 1
0 0 3
A
(
(
=
(
(


2. Find eigenvalues and eigenvectors.
eigenvector chain
3 1 1
0 1 1
2 1 1
A
(
(
=
(
(



3. Gilberts Method
(
(
(
(

+
+
+ +
+
+ + + +
+
=
4
2
12 7
1
2 3 3 4
2
) (
2
2
2
2
s
s
s s
s
s s
s
s s
s
s H
Find minimal SV realization.
EE 5307 Homework 12
Fall 2013

Discretization

1. A continuous-time systems is
| | Cx x y Bu Ax u x x = = + =
(

+
(


= 1 3 ,
1
0
6 8
1 0


a. Find sampled system if sampling time is T=0.1 sec.

1
,
s s s
k k k k k
x A x B u y C x
+
= + =
Do BY HAND. It is practice for the exam.

b. find sampled system by MATLAB function c2d if T=0.1 sec.

c. Plot x(t) and y(t) using the continuous-time dynamics. Let u(t)=unit step and x(0)=0.
You can use either MATLAB ode23 or lsim or step.

d. Plot ,
k k
x y using DT dynamics. Use MATLAB dlsim, dstep, whatever.

e. Verify that the two plots are the same at the samples. Maybe you can plot the samples of
,
k k
x y on the same plots as x(t), y(t)?


2. A CT transfer function is given by

3
( )
( 2)( 4)
s
H s
s s
+
=
+ +


a. Find discrete time transfer function by step invariance if sampling time is T=0.1 sec.
Do BY HAND. It is practice for the exam.

b. find sampled system by MATLAB function c2dm if T=0.1 sec. Use ZOH, step
invariance.

c. Plot x(t) and y(t) using the continuous-time dynamics. Let u(t)=unit step. You can use
either MATLAB lsim or step.

d. Plot ,
k k
x y using DT dynamics. Use MATLAB dlsim, dstep, whatever.

e. Verify that the two plots are the same at the samples. Maybe you can plot the samples of
,
k k
x y on the same plots as x(t), y(t)?



(Note that transfer function in problem 2 is the TF of the system in problem 1.)
EE 5307 Homework 14
Fall 2013

Digital PID Compensator Design

1. The longitudinal dynamics of an aircraft have a short period mode whose dynamics are
) (
) (
) (
2 2
2
s
s
s q
n
o
| o
e
+ +
=
with q(t) the pitch rate and o(t) the elevator deflection. Select 4 , 2 . 0 = = | o .

Use ODE23 in MATLAB to simulate the open-loop response. To do this, write the aircraft
dynamics in state-space form and write an M-file. (To write state equations you can first write
down the differential equation describing the system.). Use ICs of q(0)=1, q'(0)=0.


2. The short period mode can be given desired handling qualities by using a PID controller
) ( ) ( s e
s
k
k
s
s k
s
i
p
d
|
|
.
|

\
|
+ +
+
=
q
o
with e(t) the tracking error. Select the derivative filtering pole at -q=-20 and choose the PID
gains for PID zeros at j 3 3 .

a. Do a root locus versus the D gain. Using MATLAB is all right.

b. Select a good value of k
d
. Use MATLAB to simulate the closed-loop step response. Plot
versus time the pitch rate q(t), the tracking error e(t), and the control input o(t).


Discretization:

3. The aircraft mode time constant is 10 sec. Select a sampling period of T=100 msec (0.1 sec),
which is much faster than this. Convert the controller using the BLT to a digital PID tracking
controller. Simulate the digital closed-loop system for the same time interval as you did the
continuous system. Plot q
k
, e
k
, and o
k
. Show that the digital controller gives approximately the
samples every T sec of the response with the continuous controller.

(To simulate the digital controller, you will need to convert both the PID controller and the
aircraft dynamics to digital form using the BLT. Then, write difference equations and write a Do
Loop to plot the step response. Remember that t=kT.)
EE 5307 Homework 13
Fall 2013

Polynomial Rank Tests

1. A telescope pointing system can be written in state-space form as

,
2
1
1 2
1 0
u x x
(

+
(

= | |x y 1 3 = .

a. Use polynomial rank test to select a B matrix to make the stable mode unreachable.

b. Use polynomial rank test to select a C matrix to make the unstable mode unobservable.

EE 5307 Homework 14
Design Project
Fall 2013

Ball Balancer LQR/LQE Regulator Design

A. The inverted pendulum with position measurements is given by

| | 0 0 0 1 2 ,
1 . 0
0
0
0
2 ,
0 0 0 1
1 0 0 0
0 9 0 0
0 0 1 0
2 =
(
(
(
(

=
(
(
(
(

= C B A

with state | |
T
p p x u u

= .

1. Use LQR to design a SVFB K. Select R=0.01, Q=diag{1, 1, 50, 50}. Find closed-loop
poles. Use SVFB u= -Kx and plot time response over 15 seconds if
| |
T
x 0 1 . 0 0 1 . 0 ) 0 ( = . (You did this for hwk 8.)

2. Use LQE to design an observer L. Select R
o
=0.001, Q
o
=diag{1, 1, 50, 50}. Find
observer poles.

3. Use observer to design a regulator x K u = . Draw block diagram of the closed-loop
system. Use MATLAB to plot system response with estimated state FB and observer.
One way to do this is to write MATLAB M file with both the plant dynamics and the
observer dynamics. Another is to make a large augmented system with eight states.

4. Plot time response over 15 seconds if initial state is | |
T
x 0 1 . 0 0 1 . 0 ) 0 ( = and initial
estimation error is | |
T
x 0 05 . 0 0 05 . 0 ) 0 (
~
= . Compare to results of part a.

5. Use MATLAB to find the 2 DOF regulator polynomials ) ( ), ( ), ( s S s T s Z in
a. ) ( ) ( ) ( ) ( ) ( ) ( s Y s S s R s T s U s Z =
with r(t) the reference input. You can multiply polynomials in MATLAB using convolution
operator conv( )

You might also like