# Is there a particular reason why one sense algorithm will give an error whereas other will not?

**URL:** https://discourse.julialang.org/t/is-there-a-particular-reason-why-one-sense-algorithm-will-give-an-error-whereas-other-will-not/123667
**Category:** New to Julia
**Tags:** adjoint, differentialequation
**Created:** [December 10, 2024, 3:41pm UTC](https://discourse.julialang.org/t/is-there-a-particular-reason-why-one-sense-algorithm-will-give-an-error-whereas-other-will-not/123667 "2024-12-10T15:41:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sunaina2821](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sunaina2821/32/213365_2.png) [@sunaina2821](https://discourse.julialang.org/u/sunaina2821)
#### Post date: [December 10, 2024, 3:41pm UTC](https://discourse.julialang.org/t/is-there-a-particular-reason-why-one-sense-algorithm-will-give-an-error-whereas-other-will-not/123667/1 "2024-12-10T15:41:22Z")

</div>

So, my script completely works when I use the `ForwardDiffSensitivity()` algorithm to solve the ODE but it does not work when I use `QuadratureAdjoint(autojacvec=ZygoteVJP(true))`. I will probably update this with a MWE later on but I am curious if this is common knowledge of the difference between optimize-and-discretize versus discretize-and-optimize methods work. (For instance, I am solving a logistic equation and coupling it with UDE.) I am getting the same error for the different optimize-and-discretize methods such as BackAdjoint and QuadratureAdjoint.

The error is something like “Bounds error for accessing a 61-vector at 0th position”.

Thank you. It might be a little vague but I was just wondering if it was common knowledge because I only get the error when I change the algorithm.
