diff options
author | Suraj Yerramilli | 2015-06-08 13:56:06 +0530 |
---|---|---|
committer | Suraj Yerramilli | 2015-06-08 13:56:06 +0530 |
commit | ca74bb4173fcc24fea2644e18ca5544b337d0e6d (patch) | |
tree | e2ea1cbef61b1308169558018dad0d101f807889 | |
parent | 02f5322412dfbc4bea8ff8b14d6529eb53c51b2f (diff) | |
download | SysID-R-code-ca74bb4173fcc24fea2644e18ca5544b337d0e6d.tar.gz SysID-R-code-ca74bb4173fcc24fea2644e18ca5544b337d0e6d.tar.bz2 SysID-R-code-ca74bb4173fcc24fea2644e18ca5544b337d0e6d.zip |
updated documentation
-rw-r--r-- | R/sim.R | 28 | ||||
-rw-r--r-- | man/sim.arx.Rd | 6 | ||||
-rw-r--r-- | man/sim.idpoly.Rd | 35 |
3 files changed, 64 insertions, 5 deletions
@@ -25,8 +25,8 @@ sim.default <- function(model,input,sigma=0){ #' \code{\link{arx}} for defining ARX models #' #' @examples -#' u <- rnorm(100,1) -#' model <- arx(A=c(1,-1.5,0.7),B=c(0.8,-0.25)) +#' u <- rnorm(200,sd=1) +#' model <- arx(A=c(1,-1.5,0.7),B=c(0.8,-0.25),ioDelay=1) #' y <- sim(model,u,sigma=0.1) #' #' @export @@ -50,6 +50,30 @@ sim.arx <- function(model,input,sigma=0){ return(y[n+1:length(input)]) } +#' Simulate from a Polynomial Model +#' +#' Simulate the response of a system system governed by a polynomial model +#' , given the input +#' +#' @param model an object of class \code{idpoly} containing the coefficients +#' @param input a vector/matrix containing the input +#' @param sigma standard deviation of the innovations (Default= \code{0}) +#' +#' @return +#' a vector containing the output +#' +#' @details +#' The routine is currently built only for SISO systems. Future Versions will +#' include support for MIMO systems +#' +#' @seealso +#' \code{\link{idpoly}} for defining polynomial models +#' +#' @examples +#' u <- rnorm(200,sd=1) +#' model <- idpoly(A=c(1,-1.5,0.7),B=c(0.8,-0.25),C=1,D=1,F1=1,ioDelay=1) +#' y <- sim(model,u,sigma=0.1) +#' #' @export sim.idpoly <- function(model,input,sigma=1){ require(signal);require(polynom) diff --git a/man/sim.arx.Rd b/man/sim.arx.Rd index 848dd5f..8ad3ad9 100644 --- a/man/sim.arx.Rd +++ b/man/sim.arx.Rd @@ -24,9 +24,9 @@ The routine is currently built only for SISO systems. Future Versions will include support for MIMO systems } \examples{ -u <- rnorm(100,1) -model <- arx(A=c(1,-1.5,0.7),B=c(0.8,-0.25)) -y <- sim(model,u,sigma=3) +u <- rnorm(200,sd=1) +model <- arx(A=c(1,-1.5,0.7),B=c(0.8,-0.25),ioDelay=1) +y <- sim(model,u,sigma=0.1) } \seealso{ \code{\link{arx}} for defining ARX models diff --git a/man/sim.idpoly.Rd b/man/sim.idpoly.Rd new file mode 100644 index 0000000..2eb302a --- /dev/null +++ b/man/sim.idpoly.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/sim.R +\name{sim.idpoly} +\alias{sim.idpoly} +\title{Simulate from a Polynomial Model} +\usage{ +\method{sim}{idpoly}(model, input, sigma = 1) +} +\arguments{ +\item{model}{an object of class \code{idpoly} containing the coefficients} + +\item{input}{a vector/matrix containing the input} + +\item{sigma}{standard deviation of the innovations (Default= \code{0})} +} +\value{ +a vector containing the output +} +\description{ +Simulate the response of a system system governed by a polynomial model +, given the input +} +\details{ +The routine is currently built only for SISO systems. Future Versions will +include support for MIMO systems +} +\examples{ +u <- rnorm(200,sd=1) +model <- idpoly(A=c(1,-1.5,0.7),B=c(0.8,-0.25),C=1,D=1,F1=1,ioDelay=1) +y <- sim(model,u,sigma=0.1) +} +\seealso{ +\code{\link{idpoly}} for defining polynomial models +} + |