Learn R Programming

sysid (version 1.0.4)

sim: Simulate response of dynamic system

Description

Simulate the response of a system to a given input

Usage

sim(model, input, addNoise = F, innov = NULL, seed = NULL)

Arguments

model
the linear system to simulate
input
a vector/matrix containing the input
addNoise
logical variable indicating whether to add noise to the response model. (Default: FALSE)
innov
an optional times series of innovations. If not supplied (specified as NULL), gaussian white noise is generated, with the variance specified in the model (Property: noiseVar)
seed
integer indicating the seed value of the random number generator. Useful for reproducibility purposes.

Value

a vector containing the simulated output

Details

The routine is currently built only for SISO systems. Future versions will include support for MIMO systems.

Examples

Run this code
# ARX Model
u <- idinput(300,"rgs")
model <- idpoly(A=c(1,-1.5,0.7),B=c(0.8,-0.25),ioDelay=1,
noiseVar=0.1)
y <- sim(model,u,addNoise=TRUE)

Run the code above in your browser using DataLab