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:
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)