J = 1;
Bearings = 0.6;
K = 9;

%

A = [-Bearings / J, 1 / J; -K, 0]
B = [0; K]

%

[M, D] = eig(A)

%

dt = 0.2;
Phi = M * diag(exp(diag(D) * dt)) * inv(M)

%

u = 50;
x_fo = @(t) sum(Phi^(0:dt:t / dt) * B * u, 2);

%



%

sys = ss(A, B, eye(2), [0; 0]);
[x, t] = step(sys);
plot(t, 50 * x)

%

u = @(t) 5 * t;

%

t_vec = reshape(0:dt:10, 1, 1, []);
x_fo = reshape(cumsum(pagemtimes(pagemtimes(Phi.^(t_vec / dt), B), u(t_vec)), 3), 2, [])

%

plot(reshape(t_vec, 1, []) , x_fo(2,:))

%

t = 0:0.1:10
lsim(sys, 5 * t, t)