In MATLAB, I'm attempting to transform my model from continuous state space to discrete state space. The error occurred is "Matrix is Singular to working precision." Please, someone assist me.
A =[0 1.0000 0 0;
51.6923 0 0 0.0221;
0 0 0 1.0000;
-51.6923 0 0 -0.5361]
B =[0;
-0.3412;
0;
8.2597]
Q=[1 0 0 0;
0 1 0 0;
0 0 1 0;
0 0 0 1]
C=[1 0 0 0;
0 0 1 0]
D=[0;0]
R=1;
K=lqr(A,B, Q, R)
q1_int=0.01;
q1_dot_int=0;
q2_int=0;
q2_dot_int=0.01;
%converting our continuous state space model to discrete-time
fs=20;
T=1/fs;
Ad=expm(A*T)
Bd=(Ad-eye(4))/A*B