# Julia ode: Jacobi function does not get called

**URL:** <https://discourse.julialang.org/t/julia-ode-jacobi-function-does-not-get-called/90389>\
**Category:** General Usage\
**Tags:** ode\
**Created:** [November 17, 2022, 8:56am UTC](https://discourse.julialang.org/t/julia-ode-jacobi-function-does-not-get-called/90389 "2022-11-17T08:56:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![c\_sell](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c_sell/32/38854_2.png) [@c\_sell](https://discourse.julialang.org/u/c_sell)\
**Post date:** [November 17, 2022, 8:56am UTC](https://discourse.julialang.org/t/julia-ode-jacobi-function-does-not-get-called/90389/1 "2022-11-17T08:56:58Z")

</div>

Hello, I have a problem with the following example. It just represents he problem from another code i wrote. I want to use the function f\_jac to supply the jacobian to the ode solver. But somehow the function does not get called. And changes in the jacobi function have no impact on the solution.  
The code:

```nohighlight

function f(du,u,p,t)
    du[1] = 2.0 * u[1] - 1.2 * u[1]*u[2]
    du[2] = -3 * u[2] + u[1]*u[2]
  end

  function f_jac(J,u,p,t)
    println("JAC")
    J[1,1] = 2.0 - 1.2 * u[2]
    J[1,2] = -1.2 * u[1]
    J[2,1] = 1 * u[2]
    J[2,2] = -3 + u[1] 
    nothing
  end

  ff = ODEFunction(f,jac = f_jac)

  prob = ODEProblem(ff,ones(2),(0.0,10.0))

  Solution = solve(prob)

  p = plot(Solution)
  display(p)
```

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [November 17, 2022, 9:25am UTC](https://discourse.julialang.org/t/julia-ode-jacobi-function-does-not-get-called/90389/2 "2022-11-17T09:25:39Z")

</div>

That’s a non-stiff ODE, so it probably just didn’t need to use it.

---

<div class="post-metadata">

**Author:** ![c\_sell](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c_sell/32/38854_2.png) [@c\_sell](https://discourse.julialang.org/u/c_sell)\
**Post date:** [November 17, 2022, 10:21am UTC](https://discourse.julialang.org/t/julia-ode-jacobi-function-does-not-get-called/90389/3 "2022-11-17T10:21:36Z")

</div>

Thank you. Sometimes the solution is really simple^^
