Consider the model of the eye shown below (we will consider rotations in the horizontal plane only). The elements K3 and B3 represent the restoring forces of tendons and other structures attached to the eye (these are rotational elements, the torque they generate is proportional to angular position and velocity). The eye's moment of inertia is J (all other elements are massless). To the left and the right of the eye are two muscles, the medial rectus (moves the eye toward the body's centerline) and the lateral rectus (moves the eye away from the centerline). The muscles (and associated connective tissue) are modeled by a parallel force generator and friction, which are in series with a spring -- these elements are translational. Rotational elements are in capital letters, and blue; translational elements are in lowercase and green.

Develop a state space model with two inputs (f_{1} and f_{2})
and one output (θ). Choose as state variables, x_{1}, x_{2},
θ and ω. The equations of motion are given by:

Consider the circuit shown below:

a) Derive a state space model using energy storage variables (i.e., inductor currents and capacitor voltages) as the state variables.

b) Use impedances to derive the transfer function H(s)=E_{out}(s)/E_{in}(s).

c) Use the transfer function to derive a second state space model.

a)

b)

c) One possible result is given below. Other answers are possible.

The diagram below shows a simple model of a building. Each floor has a
mass, and the walls connecting the floors are modeled as a spring and dashpot.
The bottom of the building may move (due to an earthquake, for example) - the
position x_{in} is the input to the system..

a) Draw free body diagrams of the building and write equations of motion

b) Assume you have access to both x_{in}(t) and v_{in}(t)
(v is velocity, i.e., derivative of the input). Develop a state
space model with two inputs x_{in} and v_{in}, and three
outputs: x_{1}, x_{2}, and x_{3}. Choose as
state variables the position and velocities of the floors.

a)

b)

Find the controllable canonic form of a system described by the transfer function (CCF form is described here)

Check with MATLAB

>> sys=ss([0 1 0; 0 0 1; -1 -1 -2],[0 0 1]',[-2 -2 -6],3); >> [n,d]=tfdata(sys,'v') n = 3.0000 -0.0000 1.0000 1.0000 d = 1.0000 2.0000 1.0000 1.0000

a) Find the transfer function of the system defined by:

Recall that the inverse of a 2x2 matrix is given by:

b) Find the transfer function of the system defined by:

a)

>> syms s >> A=[-5 -2; 2 0]; B=[2 1]'; C=[3 2]; D=0; >> s*eye(2)-A ans = [ s + 5, 2] [ -2, s] >> Phi=inv(ans) Phi = [ s/(s^2 + 5*s + 4), -2/(s^2 + 5*s + 4)] [ 2/(s^2 + 5*s + 4), (s + 5)/(s^2 + 5*s + 4)] >> H=simple(C*Phi*B+D) H = (8*s + 12)/(s^2 + 5*s + 4)

b)

>> A=[0 2; -2 -5]; B=[1 2]'; C=[2 3]; D=0; >> H=simple(C*inv(s*eye(2)-A)*B+D) H = (8*s + 12)/(s^2 + 5*s + 4)

Note: Systems are the same, but state variables are switched.

Given a system with the state space model

a) Find the state transition matrix in the Laplace domain,
**Φ**(s).

b) Find the state transition matrix in the time domain,
**φ**(t).

c) Find an expression for the output if the input is zero and the initial conditions are and plot it for 7 seconds.

d) For the initial conditions given previously, plot y(t) using Matlab (and the "initial" command).

e) Plot the impulse response of the system using Matlab (and the "impulse" command).

Recall that the inverse of a 2x2 matrix is given by:

a)

>> syms s >> A=[-5 -2; 2 0;]; B=[2 0]'; C=[1 3/4]; D=0; >> Phi=simple(inv(s*eye(2)-A)); >> pretty(Phi) +- -+ | s 2 | | ------------, - ------------ | | 2 2 | | s + 5 s + 4 s + 5 s + 4 | | | | 2 s + 5 | | ------------, ------------ | | 2 2 | | s + 5 s + 4 s + 5 s + 4 | +- -+

b)

>> phi=simple(ilaplace(Phi)); >> pretty(phi) +- -+ | 4 1 2 2 | | ---------- - --------, ---------- - -------- | | 3 exp(4 t) 3 exp(t) 3 exp(4 t) 3 exp(t) | | | | 2 2 4 1 | | -------- - ----------, -------- - ---------- | | 3 exp(t) 3 exp(4 t) 3 exp(t) 3 exp(4 t) | +- -+

or

c)

>> q0=[1 -1]'; >> q=simple(phi*q0); >> pretty(q) +- -+ | exp(3 t) + 2 | | ------------ | | 3 exp(4 t) | | | | 2 exp(3 t) + 1 | | - -------------- | | 3 exp(4 t) | +- -+

or

>> y=simple(C*q); >> pretty(y) 5 1 ----------- - -------- 12 exp(4 t) 6 exp(t)

or

>> t=linspace(0,4,1000); >> plot(t,eval(y)); >> title('Output of zero input problem'); ylabel('y(t)'); xlabel('t');

d)

>> sys=ss(A,B,C,D); >> initial(sys,q0);

e) >> impulse(sys)

The system shown below is from an article entitled "Effects of Muscle
Fatigue on the Ground Reaction Force and Soft-Tissue Vibrations During
Running: A Model Study," by Nikooyan and Zadpoor in *IEEE Transactions on
Biomedical Engineering*, Vol 59, No. 3, page 797, March 2012. The
model is that of the human body as it comes in contact with the ground.
The paper examines fatigue as indicated by the amount of shaking of m2 and
m4.

The paper describes the model as follows "Two of these masses represent
the upper body rigid (m_{3}) and wobbling (m_{4}) masses,
and the other two represent the lower body rigid (m_{1}) and wobbling (m_{2})
masses. The springs and dampers represent the stiffness and damping
properties of the human body hard and soft tissues." As the foot
hits the ground, there is an opposing force determined by the "ground
reaction model" that depends in a complex way on the kind of turf and the
kind of shoes being worn, and is too complex to consider here.

We will simplify the model by assuming that m_{1} is in direct contact with
the ground (so x_{1}(t)=0). The simplified model is
redrawn below.

a) Derive equations of motion.

b) Derive a state space model with three outputs, x_{2}, x_{3}
and x_{4}. Note there is no input, so you don't need a **
B** or **D** matrix.

c) The paper gives model values as m_{1}=6.15 kg, m_{2}=6 kg, m_{3}=12.6
kg, m_{4}=50.3 kg, k_{1}=k_{2}=6000 N/m, k_{3}=k_{4}=10000
N/m, k_{5}=18000 N/m, b_{1}=300 kg/s, b_{2}=650 kg/s
and b_{4}=1900 kg/s. Examine the roots of the
characteristic equation (Matlab's "damp"
and "pzmap" can be used) and state whether
or not you think the system will exhibit oscillatory behavior.

d) During a run, just as the foot strikes the ground, initial conditions
are given in the paper for the velocities v_{2}(0)=0.96 m/s, and v_{3}(0)=v_{4}(0)=2.0
m/s. Assume initial positions are all zero. Plot x_{2}(t),
x_{3}(t) and x_{4}(t). Matlab's "initial"
command may be used.

a) the two spring attached to mass 4 act as one larger spring so let k_{4}+k_{5}=k_{45}=28000
N/m.

b)

c) Some of the roots of the characteristic equation are complex, so we expect some oscillation (ζ=0.33).

```
%% Matlab commands
% Define constants
m2=6; m3=12.6; m4=50.3;
k1=6000; k2=6000; k3=10000; k45=28000;
b1=300; b2=650; b4=1900;
% Define state matrices
A = [[0 1 0 0 0 0];
[-k2-k3 -b2 k3 0 0 0]/m2;
[0 0 0 1 0 0];
[k3 0 -k1-k3-k45 -b1-b4 k45 b4]/m3;
[0 0 0 0 0 1];
[0 0 k45 b4 -k45 -b4]/m4];
B=[0 0 0 0 0 0]';
C=[1 0 0 0 0 0;
0 0 1 0 0 0;
0 0 0 0 1 0];
D=0;
sys=ss(A,B,C,D);
damp(sys)
```

` `**%% Matlab output**
Eigenvalue Damping Freq. (rad/s)
-3.91e+000 + 1.11e+001i 3.32e-001 1.18e+001
-3.91e+000 - 1.11e+001i 3.32e-001 1.18e+001
-1.52e+001 1.00e+000 1.52e+001
-4.39e+001 1.00e+000 4.39e+001
-6.57e+001 1.00e+000 6.57e+001
-1.88e+002 1.00e+000 1.88e+002

d)

q0=[0 0.96 0 2.0 0 2.0]'; initial(sys,q0)

Consider a state space system given by:

For systems with two variables it is often convenient to know the system response as a represented by the difference between the variables and the average of the variables (called "difference mode" and "common mode," respectively).

a) Find the transformation matrices **P** and **T**
such that:

b) Find the matrices in the new state variable equations

Recall that the inverse of a 2x2 matrix is given by:

a)

b)

Check with Matlab

>> A=[-5 -3; 2 0;]; B=[1 0]'; C=[1 0.5]; D=0; >> sys=ss(A,B,C,D); >> T=[1 -1; 0.5 0.5]; >> sysnew=ss2ss(sys,T) a = x1 x2 x1 -2 -10 x2 0 -3 b = u1 x1 1 x2 0.5 c = x1 x2 y1 0.25 1.5 d = u1 y1 0