Week 11 - Solution
Week 11 - Solution
dy
A) dt = t · x(t) − y(t)
dy
B) dt = x(t)2 + y(t)
𝐝𝐲
C) 𝐝𝐭 = −𝟑𝐲(𝐭) + 𝟐𝐱(𝐭)
dy
D) dt = −e𝑡 y(t) + x(t)
Q2: Consider the following first-order linear time-invariant (LTI) differential equation with an initial
condition:
𝐝𝐲(𝐭)
𝐝𝐭
+ 𝟑𝒚(𝒕) = 𝟔, with y(0) = 2
Which of the following MATLAB commands correctly uses dsolve to solve this equation
symbolically?
A/B/C options fail due to improper symbolic setup or missing functional definition.
Q3: Given the following differential equation for a linear time-invariant (LTI) system:
(𝑠+1)
B) 𝐻(𝑠) = 𝑠2 +4𝑠+5
(𝑠+2)
C) 𝐻(𝑠) = 𝑠2 +2𝑠+5
(s+2)
D) H(s) =
s2 +4s+6
Q5: For the transfer function obtained in Q3, which of the following MATLAB commands correctly
simulates and plots the time response of this system to an input u(t) = sin(t) over the interval t = 0
to 10?
B) t = 0:0.01:10;
u = sin(t);
sys = tf([1 2], [1 4 5]);
lsim(sys, t, u)
C) t = 0:0.01:10;
u = sin(t);
sys = tf([1 2], [1 4 5]);
lsim(sys, u, t)
D) t = linspace(0,10,100);
sys = tf([1 2], [1 2 5]);
lsim(sys, sin(t), t)
Q6: For the system in Q3 which of the following MATLAB commands correctly creates its state-
space model?
A) A = [0 1; -4 -5];
B = [1; 0];
C = [1 2];
D = 0;
sys = ss(A, B, C, D);
B) A = [0 1; -5 -4];
B = [0; 1];
C = [2 1];
D = 0;
sys = ss(A, B, C, D);
C) A = [0 1; -5 -4];
B = [0; 1];
C = [1 2];
D = 0;
sys = ss(A, B, C, D);
D) A = [0 1; -5 -4];
B = [0; 1];
C = [1 0];
D = 1;
sys = ss(A, B, C, D);
Q7: Given the state space system (sys = ss(A, B, C, D)) in Q6, which of the following commands
will correctly simulate the step response of magnitude 5 over the time interval t = 0 to 10? (Select
all that apply)?
A) t = 0:0.01:10;
u = ones(size(t));
lsim(sys, u, t);
B) t = 0:0.01:10;
u = 5 * ones(size(t));
lsim(sys, u, t);
C) t = 0:0.01:10;
u = 5 * step(t);
lsim(sys, u, t);
D) step(5 * sys);
Q8: Given the state space system (sys = ss(A, B, C, D)) in Q6, which of the following MATLAB
commands will correctly simulate a step input of magnitude 5 starting at t = 5 seconds over the
interval t = 0 to 10? (Select all that apply)?
A) t = 0:0.01:10;
u = zeros(size(t));
u(t >= 5) = 5;
lsim(sys, u, t);
B) t = 0:0.01:10;
u = 5 * (t >= 5);
lsim(sys, u, t);
C) t = 0:0.01:10;
u = 5 * ones(size(t));
u(t < 5) = 0;
lsim(sys, u, t);
D) step(sys, 5);
Mass (m) = 1 kg, Damping coefficient (c) = 3 Ns/m, Spring constant (k) = 2 N/m
Which of the following MATLAB code blocks correctly defines the state-space model and simulates
the displacement response of the system to a unit step force?
A) A = [0 1; -2 -3];
B = [0; 1];
C = [1 0];
D = 0;
sys = ss(A, B, C, D);
step(sys);
B) A = [0 1; -3 -2];
B = [0; 1];
C = [1 0];
D = 0;
sys = ss(A, B, C, D);
impulse(sys);
C) A = [0 1; -2 -3];
B = [1; 0];
C = [1 0];
D = 0;
sys = ss(A, B, C, D);
step(sys);
D) A = [0 1; -2 -3];
B = [0; 1];
C = [0 1];
D = 0;
sys = ss(A, B, C, D);
step(sys);
B: No step response
C: Incorrect B matrix
D: Incorrect C matrix
Which of the following MATLAB code blocks correctly defines the state-space model and simulates
the velocity response of the system to a unit step force?
A) A = [0 1; -2 -3];
B = [0; 1];
C = [1 0];
D = 0;
sys = ss(A, B, C, D);
step(sys);
B) A = [0 1; -3 -2];
B = [0; 1];
C = [1 0];
D = 0;
sys = ss(A, B, C, D);
impulse(sys);
C) A = [0 1; -2 -3];
B = [1; 0];
C = [1 0];
D = 0;
sys = ss(A, B, C, D);
step(sys);
D) A = [0 1; -2 -3];
B = [0; 1];
C = [0 1];
D = 0;
sys = ss(A, B, C, D);
step(sys);
A: Incorrect C matrix
B: No step response
C: Incorrect B matrix