SimpleIDSolve() solves an ImplicitDiscreteProblem() f(u_next, u, p, t) = 0 as SimpleImplicitDiscreteSolve.jl: the state is first made
consistent by solving f(u, u0, p, t0) = 0 from u0, then each step
from t0 to tf by dt (default 1, the times of the Julia range
t0:dt:tf) solves f(u_next, u_prev, p, t_next) = 0 with the simple
Newton Raphson iteration of SimpleNonlinearSolve (absolute tolerance
3e-13 on the largest residual, 1000 iterations). The Jacobian is the
problem's jac(u_next, u, p, t) when given, the exact derivative of the
traced function otherwise (central differences when the function cannot
be traced).
Details
The solution has retcode "Default" (as Julia's), "InitialFailure"
when the initial solve fails (the solution then holds u0 at t0) or
"ConvergenceFailure" when a step fails (the solution ends with the last
iterate at the time of the failed step). Options of solve(): dt,
save_everystep, save_start, save_end; adaptive and dense must
be FALSE.
Examples
f <- function(un, u, p, t) un + un * un * un - u
prob <- ImplicitDiscreteProblem(f, 2, c(0, 3))
sol <- solve(prob, SimpleIDSolve())
unlist(sol$u)
#> [1] 1.0000000 0.6823278 0.5318697 0.4442144