Input Signal from state space model
조회 수: 20 (최근 30일)
이전 댓글 표시
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;
댓글 수: 0
답변 (1개)
Sam Chak
2022년 11월 12일
Hi @Justin
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dynamic System Models에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!