Info

This question is closed. Reopen it to edit or answer.

Change from continuous model to discrete model

2 views (last 30 days)
Ivan Dwi Putra
Ivan Dwi Putra on 24 Jun 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
This is my code describe continuous system
%Parameter Massa
m1 = 8095; % massa train set 1 dalam kg
m2 = 8500; % massa train set 2 dalam kg
g = 10;
%Parameter Gaya
f1 = 205.10^3; % dalam N
f2 = 302.10^3; % dalam N
c_0_1 = 0.01176;
c_1_1 = 0.00077616;
c_2_1 = 4.48 ;
c_0_2 = 0.01176 ;
c_1_2 = 0.00077616;
c_2_2 = 4.48;
v_0 = 300;
hstar = 120;
a_1 = -1./m1.*(c_1_1 + 2.*c_2_1.*v_0);
a_2 = -1./m2.*(c_1_2 + 2.*c_2_2.*v_0);
a_1_head = 1-(a_1.*hstar);
a_2_head = 1-(a_2.*hstar);
b = 1;
p_1 = -1./m1.*(c_0_1 - c_2_1.*(v_0).^2);
p_2 = -1./m2.*(c_0_2 - c_2_2.*(v_0).^2);
A = [0 a_1_head 0 0;
0 0 0 0;
0 (a_2_head - 1) 0 a_2_head;
0 0 0 0
];
B = [-b.*hstar 0;
b 0;
0 -b.*hstar;
-b b
];
U_t = [f1; f2;];
C = [1 0 0 0;
0 1 0 0;
0 0 1 0;
0 0 0 1;];
W = [((a_1 - 1).*v_0) - (p_1.*hstar);
0;
((a_2 - 1).*v_0) - (p_2.*hstar);
((a_1 - 1).*v_0) - (p_1.*hstar);
];
W in my continuous system i assume as D
i want to change to discrete use this code
first i find the ss_model
ss_model = ss(double(A),double(B),C,W);
But there is an error
Error using ss (line 345)
The values of the "b" and "d" properties must be matrices with the same number of columns.
Error in AREtrial2 (line 66)
ss_model = ss(double(A),double(B),C,W);
The plan after i get the ss_model i use c2d to convert to discrete model
d_sys = c2d(ss_model,0.1);
But before i use c2d i need help about the error
and is that right my methode to change from continuous model to discrete model

Answers (0)

This question is closed.

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!