Input Signal from state space model

19 次查看(过去 30 天)
Justin
Justin 2022-11-12
回答: Sam Chak 2022-11-12
im just wondering how can i plot the input signal of a state space model? and also how do i include a step reference signal for my input channel?
A = [ 0 0 0 1.0000 0 0
0 0 0 0 1.0000 0
0 0 0 0 0 1.0000
0 6.5000 -10.0000 -17.5000 0 0
-21.1185 18.1040 5.1540 -3.6920 -2.8128 0.3159
5.0000 -3.6000 0 0 0 -10.9545];
B =[ 0 0
0 0
0 0
26.5000 11.2000
5.5907 -1.6525
40.0000 57.3000];
C = [1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0];
D = 0;

回答(1 个)

Sam Chak
Sam Chak 2022-11-12
You can try using the lsim() function. Search Google/Documentation for details. Example is shown below:
A = [ 0 0 0 1.0000 0 0;
0 0 0 0 1.0000 0;
0 0 0 0 0 1.0000;
0 6.5000 -10.0000 -17.5000 0 0;
-21.1185 18.1040 5.1540 -3.6920 -2.8128 0.3159;
5.0000 -3.6000 0 0 0 -10.9545];
B = [ 0 0;
0 0;
0 0;
26.5000 11.2000;
5.5907 -1.6525;
40.0000 57.3000];
C = [1 0 0 0 0 0;
0 1 0 0 0 0;
0 0 1 0 0 0];
D = 0;
sys = ss(A, B, C, D);
Tp = 1; % 1 cycle period
Tf = 1; % final time simulation
Ts = 1e-4; % sample time
[u, t] = gensig('sine', Tp, Tf, Ts);
lsim(sys, [heaviside(t - 0.25), -2*u], t) % 1st input is step, 2nd input is sine

类别

Help CenterFile Exchange 中查找有关 Dynamic System Models 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by