<< lqry | Control System functions | lyap >> |
lsim(sys, u, t) |
lsim(sys, u, t, x0) |
[y, tOut, x] = lsim(SYS, U, T, X0) |
a lti model.
Input signal: matrix or vector.
Time samples: vector.
Initial state values: vector.
Simulated response data: matrix or vector.
Time vector: vector.
State trajectories: matrix or vector.
The function lsim(sys, u, t) generates a plot illustrating the simulated time response of the dynamic system model sys to the input history (t, u).
The time samples for the simulation are specified by the vector t.
In the case of single-input systems, the input signal u is a vector with the same length as t.
For multi-input systems, u is an array with rows corresponding to time samples (length(t)) and columns corresponding to inputs to sys.
An additional usage of the function is demonstrated by the example lsim(sys, u, t, x0), where a vector x0 is provided to specify initial state values.
This is particularly relevant when sys is a state-space model.
A = [-10 -20 -30;1 0 0; 0 1 0];
B = [1; 0; 0];
C = [0 0 1];
D = 0;
T = [0:0.1:1];
U = zeros(size(T, 1), size(T, 2));
X0 = [0.1 0.1 0.1];
sys = ss(A, B, C, D);
lsim(sys, U, T, X0);
A = [-1.7 -0.3 1.1;
-0.2 -1.7 0.6;
1.0 0.6 -1.4];
B = [ 1.5 0.6;
-1.8 1.0;
0 0 ];
C = [ 0 -0.5 -0.1;
0.35 -0.1 -0.15
0.65 0 0.6];
D = [ 0.5 0;
0.05 0.75
0 0];
sys = ss(A,B,C,D);
Tf = 10;
Ts = 0.1;
[uSq,t] = gensig("square",4,Tf,Ts);
uP = gensig("pulse",3,Tf,Ts);
u = [uSq uP];
lsim(sys,u,t)
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET