initial obtains the time response of the linear system:
dx/dt = Ax + Bu
y = Cx + Du
to an initial condition.
LTI system of transfer-function, state-space and zero-pole classes
initial conditions as a column vector. Should have as many rows as the rows of A. where x0 is not specified, random values are assigned
regularly spaced time vector. If not provided, it is automatically set.
For calls to
initial produces the time response of linear systems to initial conditions using
initialplot produces the time response to initial conditions as a plot againts time.
The functions can handle both SISO and MIMO (state-space) models.
Other possible calls using
A list is returned by calling
x Individual response of each x variable
y Response of the system
t Time vector
y has as many rows as there are outputs, and columns of the same size of
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
A plot of
t is returned by calling
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
res <- initial(tf(1, c(1,2,1))) res$y res$t A <- rbind(c(-2, -1), c(1,0)); B <- rbind(1,0); C <- cbind(0,1); D <- as.matrix(0); x0 <- matrix(c( 0.51297, 0.98127)) initialplot(ss(A,B,C,D), x0) initialplot(tf(1, c(1,2,1)), t = 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)) res <- initial(ss(A,B,C,D)) res$y # has two rows, i.e. for two outputs initialplot(ss(A,B,C,D))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.