lsimplot function

Plot time response of an LTI system

Plot time response of an LTI system

lsimplot Plots the time response of a Linear system described by: [REMOVE_ME]x=Ax+Bu[REMOVEME2] x = Ax + Bu [REMOVE_ME_2]

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

to the input time history u.

lsimplot(sys, u, t, x0)

Arguments

  • sys: An LTI system of tf, ss and zpk class
  • u: A row vector for single input systems. The input u must have as many rows as there are inputs in the system. Each column of u corresponds to a new time point. u could be generated using a signal generator such as gensig
  • t: time vector which must be regularly spaced. e.g. seq(0,4,0.1)
  • x0: a vector of initial conditions with as many rows as the rows of sys$A

Returns

Returns a plot for the response of the system

Description

lsimplot Plots the time response of a Linear system described by:

x=Ax+Bu x = Ax + Bu y=Cx+Du y = Cx + Du

to the input time history u.

Details

lsimplot(sys, u, t) plots the time history of the linear system with zero-initial conditions.

lsimplot(sys, u, t, x0) plots the time history of the linear system with given initial conditions.

If the linear system is represented as a model of tf or zpk

it is first converted to state-space before linear simulation is performed. This function depends on c2d and ltitr

Examples

signal <- gensig('square',4,10,0.1) H <- tf(c(2, 5, 1),c(1, 2, 3)) lsimplot(H, signal$u, signal$t) ## Not run: MIMO system response 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)) lsimplot(ss(A,B,C,D), cbind(signal$u, signal$u), signal$t)

See Also

lsim stepplot rampplot

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

Useful links