Best way to implement and solve an ODE with a linearized RHS?

Say, I have a system \dot{u} = f(u(t),t). I want to linearize the RHS at u(t_{n}) and have \dot{u} = f(u(t_n),t_n) + f_{u}'(u(t_n),t_n)\cdot(u(t)-u(t_{n})).

In terms of DifferentialEquations.jl I can define f(u,p,t) where u corresponds to u(t). How can I pass u_n obtained at the previous step to f(u,p,t)?

That’s just a specific time stepper and not well-defined as a differential equation. I’m not 100% sure what you’re trying to ask.

I want to do the following:

  1. Fix timestep h, and t_(n+1) = t_n + h
  2. Linearize the RHS at u_n
  3. Solve linearized eq for u_(n+1)

The linearized RHS depends explicitly on u_n, which is basically a parameter which is obtained at the previous step. Using DiffEq interface, is it possible to update this parameter using a callback or anything else? In other words, take the result of the previous step and pass it to f(u,p,t) at the current step.