To understand and learn how ode23s method work in R, I used a simple system from a numerical analysis book and implemented. I encountered an error
Error in t + y[1]^2 : non-numeric argument to binary operator
Here is my code
#x'=t+x^2-y
#y'=t^2-x+y^2
#x(0)=3, y(0)=2
model <- function(t,y) as.matrix(c(t+y[1]^2-y[2], t^2-y[1]+y[2]^2))
sol <- ode23s(model, 0, 20, c(3,2), jac = NULL, hmax = 0)
It looks to me that t is not numeric and I also used as.numeric(t) but did not work either. Could you please explain, how to fix this error?