step function

Step Response for Linear Systems

Step Response for Linear Systems

step obtains the time response of the linear system:

[REMOVE_ME]dx/dt=Ax+Bu[REMOVEME2] dx/dt = Ax + Bu [REMOVE_ME_2]

[REMOVE_ME]y=Cx+Du[REMOVEME2] y = Cx + Du [REMOVE_ME_2]

step(sys, t, input) stepplot(sys, t, input)

Arguments

  • sys: LTI system of transfer-function, state-space and zero-pole classes

  • t: Time vector. If not provided, it is automatically set.

  • input: For calls to step, input is a number specifying an input for a MIMO state-space system. If the system has 3 inputs, then input would be set to 1, set to 2 and then to 3 to obtain the step response from input 1, 2, and 3 to the outputs. For single input systems, input is always set to 1.

    For calls to stepplot, input is a vector or range for a MIMO state-space system. For example, input <- 1:3 for a system with 3-inputs

Returns

A list is returned by calling step containing:

x Individual response of each x variable

y Response of the system

t Time vector

The matrix y has as many rows as there are outputs, and columns of the same size of length(t). The matrix X has as many rows as there are states. If the time vector is not specified, then the automatically set time vector is returned as t

A plot of y vs t is returned by calling stepplot

Description

step obtains the time response of the linear system:

dx/dt=Ax+Bu dx/dt = Ax + Bu y=Cx+Du y = Cx + Du

Details

step produces the step response of linear systems using lsim

stepplot produces the step response as a plot againts time.

The functions can handle both SISO and MIMO (state-space) models.

Other possible calls using step and stepplot are:

step(sys)

step(sys, t)

stepplot(sys)

stepplot(sys, t)

Examples

res <- step(tf(1, c(1,2,1))) res$y res$t step(tf(1, c(1,2,1)), seq(0, 10, 0.1)) stepplot(tf(1, c(1,2,1))) stepplot(tf(1, c(1,2,1)), seq(0, 10, 0.1)) ## Not run: State-space MIMO systems A <- rbind(c(0,1), c(-25,-4)); B <- rbind(c(1,1), c(0,1)); C <- rbind(c(1,0), c(0,1)); D <- rbind(c(0,0), c(0,0)) res1 <- step(ss(A,B,C,D), input = 1) res2 <- step(ss(A,B,C,D), input = 2) res1$y # has two rows, i.e. for two outputs res2$y # has two rows, i.e. for two outputs stepplot(ss(A,B,C,D), input = 1:2) # OR stepplot(ss(A,B,C,D), input = 1:ncol(D))

See Also

initial impulse ramp

  • Maintainer: Ben C. Ubah
  • License: GPL-2
  • Last published: 2017-12-12

Useful links