Converting continuous time to discrete time with zero order hold
Show older comments
I am having trouble trying to figure out c2d. I have a continuous time system x_dot = Ac*x + Bc*u. y = Cx + Du
I need to convert this into a discrete time system with a zero order hold.
Also it can only be done in matlab. I am not allowed to use simulink.
%initial input
Ac = [0 0 0 1 0 0;
0 0 0 0 1 0;
0 0 0 0 0 1;
-2 1 0 -1.6 0.8 0;
1 -2 1 0.8 -1.6 0.8;
0 1 -1 0 0.8 -0.8];
Bc = [0 0 0;
0 0 0;
0 0 0;
1 0 0;
0 1 0;
0 0 1];
C = [1 0 0 0 0 0;
0 1 0 0 0 0;
0 0 1 0 0 0;
0 0 0 1 0 0;
0 0 0 0 1 0;
0 0 0 0 0 1];
D = 0;
%Initial x value
X0 = [1 2 3 0 0 0]';
%covariance
w = 0.2*eye(3);
Answers (1)
Sabin
on 16 Dec 2022
0 votes
This can be done using [Ad,Bd,Cd,Dd] = c2dm(Ac,Bc,C,D,Ts,'zoh')
Categories
Find more on Simulink in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!