It looks just like the ODE, except in this case there is a function h p,t which allows you to interpolate and grab previous values. The time vector is reproduced as the first output argument. We can convert the entire ode problem to symbolic form, optimize that symbolic form, and emit efficient native code to simulate it using de. See an example below. But the numeric integrator only enforces error tolerances on the equations that are explicitly modeled.
nest...