summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2015-06-08 13:56:06 +0530
committerSuraj Yerramilli2015-06-08 13:56:06 +0530
commitca74bb4173fcc24fea2644e18ca5544b337d0e6d (patch)
treee2ea1cbef61b1308169558018dad0d101f807889
parent02f5322412dfbc4bea8ff8b14d6529eb53c51b2f (diff)
downloadSysID-R-code-ca74bb4173fcc24fea2644e18ca5544b337d0e6d.tar.gz
SysID-R-code-ca74bb4173fcc24fea2644e18ca5544b337d0e6d.tar.bz2
SysID-R-code-ca74bb4173fcc24fea2644e18ca5544b337d0e6d.zip
updated documentation
-rw-r--r--R/sim.R28
-rw-r--r--man/sim.arx.Rd6
-rw-r--r--man/sim.idpoly.Rd35
3 files changed, 64 insertions, 5 deletions
diff --git a/R/sim.R b/R/sim.R
index b29d712..5090d7d 100644
--- a/R/sim.R
+++ b/R/sim.R
@@ -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
+}
+