# NOT RUN {
generate.1order(t0 = 2.5,y0 = 2)
test <- generate.1order(time = 0:49, excitation = c(rep(0,10),rep(1,40)))
plot(test$t,test$y)
lines(test$t,test$exc,col = 2)
### see the influence of tau
different_tau <- data.table::rbindlist(lapply(1:5*4,function(x){
tmp <- generate.1order(t0 = 0,
y0 = 2,
tau = x)
tmp[,tau := as.factor(x)][]
}))
ggplot2::ggplot(data = different_tau,
ggplot2::aes(t,y,color = tau))+
ggplot2::geom_line()
### effect of the gain
different_gain <- data.table::rbindlist(lapply(1:5,function(x){
tmp <- generate.1order(
time = 1:100,
excitation = as.numeric(1:100 > 50),
y0 = 0,
tau = 10,
k = x)
tmp[,k := as.factor(x)][]
}) )
ggplot2::ggplot(different_gain)+
ggplot2::geom_line(ggplot2::aes(t,y,color = k))+
ggplot2::geom_line(ggplot2::aes(t,exc,color = "excitation"))
# }
Run the code above in your browser using DataLab