summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--R/tf.R44
1 files changed, 0 insertions, 44 deletions
diff --git a/R/tf.R b/R/tf.R
deleted file mode 100644
index f556e15..0000000
--- a/R/tf.R
+++ /dev/null
@@ -1,44 +0,0 @@
-#' 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)
-}
-
-#' @export
-print.tf <- function(G){
- cat("Transfer Function \nG(q^{-1}) = B(q^{-1})/A(q^{-1}) \n\n")
- cat("A(q^{-1}) = ")
- for(i in seq_along(G$den)){
- if(i-1==0){
- cat(G$den[i])
- } else{
- if(G$den[i]>0)
- cat("+")
- cat(G$den[i],"q^{-",i-1,"}",sep="")
- }
- cat("\t")
- }
- cat("\n")
- cat("B(q^{-1}) = ")
- for(i in seq_along(G$num)){
- if(i-1==0){
- cat(G$num[i])
- } else{
- if(G$num[i]>0)
- cat("+")
- cat(G$num[i],"q^{-",i-1,"}",sep="")
- }
- cat("\t")
- }
-}
-