I would like to terminate ODE solver when the dependent variable exceeded certain value. Consider a simple ODE model
library("deSolve")
dModel<- function(t, y, parms) {list(c(y))}
out<-ode(c(1),seq(0,100,1),dModel, parms=NULL)
I want to stop solver when y>100
and display output. I know there is an event of ODE but after reading documentations, I did not understand how to implement in my situation. Could you please provide solution to this problem?