summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Yerramilli2016-03-08 17:36:47 +0530
committerSuraj Yerramilli2016-03-08 17:36:47 +0530
commit341d9b493b0858fc377ca49f15b3f0ba9bb6830a (patch)
tree78a4ab22929f08646edeedc214581184aa10ad26
parent258f5fdc96543e7c0f8176545cb0b5589cf5c50a (diff)
downloadSysID-R-code-341d9b493b0858fc377ca49f15b3f0ba9bb6830a.tar.gz
SysID-R-code-341d9b493b0858fc377ca49f15b3f0ba9bb6830a.tar.bz2
SysID-R-code-341d9b493b0858fc377ca49f15b3f0ba9bb6830a.zip
adding provision to incorporate delay implicitly in the B input
-rw-r--r--R/poly.R3
1 files changed, 3 insertions, 0 deletions
diff --git a/R/poly.R b/R/poly.R
index 338ce69..516bd35 100644
--- a/R/poly.R
+++ b/R/poly.R
@@ -35,6 +35,9 @@
idpoly <- function(A=1,B=1,C=1,D=1,F1=1,ioDelay=0,Ts=1,
noiseVar=1,unit = c("seconds","minutes",
"hours","days")[1]){
+ Bindex <- which.max(B!=0)
+ ioDelay <- ifelse(Bindex==1,ioDelay,Bindex)
+ B <- B[Bindex:length(B)]
out <- list(A= A,B=B,C=C,D=D,F1=F1,ioDelay = ioDelay,Ts=Ts,
noiseVar=noiseVar,unit=unit)
out$type <- typecheck(out)