lsim
Function File: lsim (sys, u)
Function File: lsim (sys1, sys2, ..., sysN, u)
Function File: lsim (sys1, style1, ..., sysN, styleN, u)
Function File: lsim (sys1, ..., u, t)
Function File: lsim (sys1, ..., u, t, x0)
Function File: [y, t, x] = lsim (sys, u)
Function File: [y, t, x] = lsim (sys, u, t)
Function File: [y, t, x] = lsim (sys, u, t, x0)
Function File: [...] = lsim (..., method)
Simulate LTI model response to arbitrary inputs. If no output arguments are given, the system response is plotted on the screen.
Inputs
length(t) rows and as many columns
as there are inputs. If sys is a single-input system, row vectors u
of length length(t) are accepted as well.tsam = t/(rows(u)-1). If sys is a discrete-time system and t
is not specified, vector t is assumed to be 0 : tsam : tsam*(rows(u)-1).help plot for details.Outputs
length (t) rows and as many columns as states.Remarks
[A,b,c,d] = ssdata (G); T = obsv (A, c); G_ss = ss2ss (ss (G), T); initial (G_ss, x0); |
Note that, in general, the states of are only equal to the output and its first time derivaties if , which is the case for the initial conditions immediately before .
itemize
See also: impulse, initial, step
Source Code: lsim
clf;
A = [-3 0 0;
0 -2 1;
10 -17 0];
B = [4 0;
0 -1;
0 -1];
C = [0 0 1;
1 2 0];
D = [ 0 0;
0 0 ];
S = ss(A,B,C,D);
t = 0:0.01:6;
u = [ 0.2+0.3*sin(1.3*t') , cos(2*t') ];
x0 = [0 0.1 0];
lsim(S, u, t, x0);