When ForwardDiff-ing through an ODE is unstable

With the super accurate computation, it works! norm(grad) = 0.0009. :slight_smile:

I should also note that

  1. it works with adjoint sensitivity analysis (with a normal Tsit5() solution)
  2. the numerical explosion in ForwardDiff doesn’t happen when I look at the L2 deviation of less ‘stiff’ species (i.e. Calcium, the second state, instead of voltage)

I’m not sure what the lesson is to take from this. Maybe that Forward mode can potentially diverge if your error tolerances are high on a stiff system?