summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--R/tf.R17
-rw-r--r--man/print.tf.Rd15
-rw-r--r--man/tf.Rd22
3 files changed, 52 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}) = ")
diff --git a/man/print.tf.Rd b/man/print.tf.Rd
new file mode 100644
index 0000000..cc0ea03
--- /dev/null
+++ b/man/print.tf.Rd
@@ -0,0 +1,15 @@
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/tf.R
+\name{print.tf}
+\alias{print.tf}
+\title{Display the Transfer Function}
+\usage{
+\method{print}{tf}(G)
+}
+\arguments{
+\item{G}{an object of class \code{tf}}
+}
+\description{
+Printing method for objects inheriting from class \code{tf}
+}
+
diff --git a/man/tf.Rd b/man/tf.Rd
new file mode 100644
index 0000000..b0055b5
--- /dev/null
+++ b/man/tf.Rd
@@ -0,0 +1,22 @@
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/tf.R
+\name{tf}
+\alias{tf}
+\title{S3 class for transfer functions}
+\usage{
+tf(num = c(1), den = c(1), Ts = 1)
+}
+\arguments{
+\item{num}{coefficients of the numerator plynomial in q^{-1}}
+
+\item{den}{coefficients of the denominator plynomial in q^{-1}}
+
+\item{Ts}{sampling time}
+}
+\value{
+an object of class tf
+}
+\description{
+\code{tf} is an S3 class for defining transfer functions.
+}
+