Errors with autodiff in a for loop

You need to make sure your caches accept dual numbers. See GitHub - SciML/PreallocationTools.jl: Speed at all costs as a tool to help with this.

2 Likes