# a very simple ODE for exponential transition from 0 to 1: y'=1-y, y(0)=0
frhs=function(t, y, param, psens) 1-y
ti=seq(0, 5, length.out=101)
y0=0
res_exp=r2sundials::r2cvodes(y0, ti, frhs)
plot(ti, res_exp[1,], t="l", xlab="Time", ylab="Y")
Run the code above in your browser using DataLab