summaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorSuraj Yerramilli2015-03-22 21:00:12 +0530
committerSuraj Yerramilli2015-03-22 21:00:12 +0530
commita74ce396b0dac33aee99737428f4efb041217ee0 (patch)
tree61f11c49590c269be46e89f1414d954bf5f02307 /R
parenta93a9661626862afd941996a1d5f27f3cc0138bf (diff)
downloadSysID-R-code-a74ce396b0dac33aee99737428f4efb041217ee0.tar.gz
SysID-R-code-a74ce396b0dac33aee99737428f4efb041217ee0.tar.bz2
SysID-R-code-a74ce396b0dac33aee99737428f4efb041217ee0.zip
Added documentation for the basic transfer function model
Diffstat (limited to 'R')
-rw-r--r--R/tf.R17
1 files changed, 15 insertions, 2 deletions
diff --git a/R/tf.R b/R/tf.R
index fb722fd..2338778 100644
--- a/R/tf.R
+++ b/R/tf.R
@@ -1,11 +1,24 @@
-# S3 class for defining transfer functions
+#' S3 class for transfer functions
+#'
+#' \code{tf} is an S3 class for defining transfer functions.
+#'
+#' @param num coefficients of the numerator plynomial in q^{-1}
+#' @param den coefficients of the denominator plynomial in q^{-1}
+#' @param Ts sampling time
+#'
+#' @return an object of class tf
+#' @export
tf <- function(num=c(1),den=c(1),Ts=1){
out <- list(num=num,den=den,Ts=Ts)
class(out) <- "tf"
return(out)
}
-# Display the Transfer Function
+#' Display the Transfer Function
+#'
+#' Printing method for objects inheriting from class \code{tf}
+#'
+#' @param G an object of class \code{tf}
print.tf <- function(G){
cat("Transfer Function \nG(q^{-1}) = B(q^{-1})/A(q^{-1}) \n\n")
cat("A(q^{-1}) = ")