1 ## Copyright (C) 2009 Lukas F. Reichlin
3 ## This file is part of LTI Syncope.
5 ## LTI Syncope is free software: you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation, either version 3 of the License, or
8 ## (at your option) any later version.
10 ## LTI Syncope is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>.
19 ## @deftypefn{Function File} {[@var{y}, @var{t}, @var{x}] =} step (@var{sys})
20 ## @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} step (@var{sys}, @var{t})
21 ## @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} step (@var{sys}, @var{tfinal})
22 ## @deftypefnx{Function File} {[@var{y}, @var{t}, @var{x}] =} step (@var{sys}, @var{tfinal}, @var{dt})
23 ## Step response of LTI system.
24 ## If no output arguments are given, the response is printed on the screen.
31 ## Time vector. Should be evenly spaced. If not specified, it is calculated by
32 ## the poles of the system to reflect adequately the response transients.
34 ## Optional simulation horizon. If not specified, it is calculated by
35 ## the poles of the system to reflect adequately the response transients.
37 ## Optional sampling time. Be sure to choose it small enough to capture transient
38 ## phenomena. If not specified, it is calculated by the poles of the system.
44 ## Output response array. Has as many rows as time samples (length of t)
45 ## and as many columns as outputs.
49 ## State trajectories array. Has @code{length (t)} rows and as many columns as states.
52 ## @seealso{impulse, initial, lsim}
55 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
56 ## Created: October 2009
59 function [y_r, t_r, x_r] = step (sys, tfinal = [], dt = [])
61 ## TODO: multiplot feature: step (sys1, "b", sys2, "r", ...)
63 if (nargin == 0 || nargin > 3)
67 [y, t, x] = __time_response__ (sys, "step", ! nargout, tfinal, dt, [], inputname (1));