impulse: Impulse Response for Linear Systems

Description Usage Arguments Details Value See Also Examples

Description

impulse obtains the impulse response of the linear system:

dx/dt = Ax + Bu

y = Cx + Du

to an impulse applied to the input

Usage

1
2
impulse(sys, t, input)
impulseplot(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 impulse, 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 impulse response from input 1, 2, and 3 to the outputs. For single input systems, input is always set to 1.

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

Details

impulse produces the impulse response of linear systems using lsim

impulseplot produces the impulse response as a plot against time.

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

Other possible calls using impulse and impulseplot are:

impulse(sys)

impulse(sys, t)

impulseplot(sys)

impulseplot(sys, t)

Value

A list is returned by calling impulse containing:

t Time vector

x Individual response of each x variable

y Response of the system

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 impulseplot

See Also

initial step ramp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
res <- impulse(tf(1, c(1,2,1)))
res$y
res$t
impulse(tf(1, c(1,2,1)), seq(0, 10, 0.1))
impulseplot(tf(1, c(1,2,1)))
impulseplot(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 <- impulse(ss(A,B,C,D), input = 1)
res2 <- impulse(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
impulseplot(ss(A,B,C,D), input = 1:2) # OR
impulseplot(ss(A,B,C,D), input = 1:ncol(D))
impulseplot(ss(A,B,C,D), seq(0,3,0.01), 1:2)

control documentation built on May 1, 2019, 7:33 p.m.