pkg load control

clear all
A = [0 1; -5 -6]
B = [0; 1]
C = eye(2)
D = zeros(2, 1)

x0 = [2; 0]

t = linspace(0, 10, 1024);
u = ones(1, length(t));

x = lsim(ss(A, B, C, D), u, t, x0);

if true
  clf
  plot(t, x(:,1))
  hold
  plot(t, x(:,2))
  grid on
  legend("x_1", "x_2")
  xlabel("time [s]")
  ylabel("state vector")
  title("time response")
end

if false
  print("time_response_lsim.png", "-dpng");
end
