step - Step response of LTI systems

Syntax

step
step(sys)
step(sys,t)
step(sys1,sys2,...,sysN)
step(sys1,sys2,...,sysN,t)
y = step(sys,t)
[y,t] = step(sys)
[y,t,x] = step(sys) % for state-space models only

Description

step calculates the unit step response of a linear system. For the state space case, zero initial state is assumed. When it is invoked with no output arguments, this function plots the step response on the screen.

step(sys) plots the step response of an arbitrary LTI model sys. This model can be continuous or discrete, and SISO or MIMO. The step response of multi-input systems is the collection of step responses for each input channel. The duration of simulation is determined automatically, based on the system poles and zeros.

step(sys,t) sets the simulation horizon explicitly. You can specify either a final time t = Tfinal (in seconds), or a vector of evenly spaced time samples of the form t = 0:dt:Tfinal.

For discrete systems, the spacing dt should match the sample period. For continuous systems, dt becomes the sample time of the discretized simulation model (see Algorithm), so make sure to choose dt small enough to capture transient phenomena.

To plot the step response of several LTI modelssys1,..., sysN on a single figure, use

step(sys1,sys2,...,sysN)

step(sys1,sys2,...,sysN,t)

All of the systems plotted on a single plot must have the same number of inputs and outputs. You can, however, plot a mix of continuous- and discrete-time systems on a single plot. This syntax is useful to compare the step responses of multiple systems.

You can also specify a distinctive color, linestyle, marker, or all three for each system. For example,

step(sys1,'y:',sys2,'g--')

plots the step response of sys1 with a dotted yellow line and the step response of sys2 with a green dashed line.

When invoked with output arguments,

y = step(sys,t)

[y,t] = step(sys)

[y,t,x] = step(sys) % for state-space models only

return the output response y, the time vector t used for simulation, and the state trajectories x (for state-space models only). No plot generates on the screen. For single-input systems, y has as many rows as time samples (length of t), and as many columns as outputs. In the multi-input case, the step responses of each input channel are stacked up along the third dimension of y. The dimensions of y are then

and y(:,:,j) gives the response to a unit step command injected in the jth input channel. Similarly, the dimensions of x are

Example 1

Plot the step response of the following second-order state-space model.

a = [-0.5572   -0.7814;0.7814  0];
b = [1 -1;0 2];
c = [1.9691  6.4493];
sys = ss(a,b,c,0);
step(sys)

The left plot shows the step response of the first input channel, and the right plot shows the step response of the second input channel.

Example 2

Create a feedback loop with delay and plot its step response by typing

G = exp(-s) * (0.8*s^2+s+2)/(s^2+s);
T = feedback(ss(G),1);
step(T)

Algorithm

Continuous-time models without internal delays are converted to state space and discretized using zero-order hold on the inputs. The sampling period, dt, is chosen automatically based on the system dynamics, except when a time vector t = 0:dt:Tf is supplied (dt is then used as sampling period). The resulting simulation time steps t are equisampled with spacing dt.

For systems with internal delays, Control System Toolbox™ software uses variable step solvers. As a result, the time steps t are not equisampled.

References

[1] L.F. Shampine and P. Gahinet, "Delay-differential-algebraic equations in control theory," Applied Numerical Mathematics, Vol. 56, Issues 3–4, pp. 574–588.

See Also

impulse, initial, lsim, ltiview

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS