CHS359 - Solution To Quiz 3
CHS359 - Solution To Quiz 3
s =
-1.0000 + 5.0000i
-1.0000 - 5.0000i
-2.0000
The three roots are 1 = 1 + 5j, 2 = 1 5i and 3 = 2. The solution has the
form
y(t) = C1 e1 t + C2 e2 t + C3 e3 t
where C1 , C2 , C3 can be found from the initial conditions. To this end, we need to find
the first and second derivatives of y(t).
y(t) = 1 C1 e1 t + 2 C2 e2 t + 3 C3 e3 t
y(t) = 21 C1 e1 t + 22 C2 e2 t + 23 C3 e3 t
Evaluate y(t), y(t), y(t) at t = 0 and then we have
y(0) C1 + C2 + C3 1 1 1 C1
y(0) = 1 C1 + 2 C2 + 3 C3 = 1 2 3 C2 .
y(0) 21 C1 + 22 C2 + 23 C3 21 22 23 C3
This is a linear equation Ax = b where x is the vector of C1 , C2 , C3 , so they can be
solved by
C =
0.5000 + 1.0000i
0.5000 - 1.0000i
1.0000 - 0.0000i
1
Therefore, C1 = 0.5 + j, C2 = 0.5 j, C3 = 1. The solution to ODE is
y(t) = (0.5 + j)et (cos 5t + j sin 5t) + (0.5 j)et (cos 5t j sin 5t) + e2t
= e2t + et (cos 5t 2 sin 5t)
2. (2 points.) Write the ODE (1) in a state-space form, x = f (x). What is the dimension
of x ?
Solution. The equation is a 3rd-order ODE, so we need 3 components in a state
[ ]T
variables. Define x = x1 x2 x3 and x1 = y, x2 = y, x3 = y. The state-space
equation is obtained by
x1 x2
x2 = x3 .
x3 4x3 30x2 52x1
3. (3 points.) Write the ODE description (the function f (x)) as a user-defined function
which returns a value of x at given values of t and x. The function format must be
[dx] = odequiz3(t,x). Save this file in D:\CHS359\idxxx.
Solution.
function dx = odequiz3(t,x)
dx = zeros(3,1);
dx(1) = x(2);
dx(2) = x(3);
dx(3) = -4*x(3)-30*x(2)-52*x(1);
1.5
1.5
0 2 4 6 8 10