Input Signal from state space model

조회 수: 2(최근 30일)
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 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

댓글을 달려면 로그인하십시오.

범주

Find more on Digital Filter Analysis in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by