You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a duplicate from here, but I thought it might be better to ask here in GitHub.
This question came up when I did some tests related to this post.
Imagine I have the code
using NonlinearSolve
functionf(u, p)
return u^2-2endfunctiondf(u, p)
println("Hey")
return2u
end
fn =NonlinearFunction(f, jac=df)
prob =NonlinearProblem(fn, 1.0)
sol =solve(prob, NewtonRaphson(; concrete_jac=true))
Running this code does not print "Hey" to the terminal, so I guess that automatic differentiation is being used to compute the jacobian instead of the given function. I noticed this behavior because in the post that I mentioned, there was an incompatible interaction between AD and QuadGK that was present even if you provide the analytical jacobian.
Is this intended behavior? How could I provide the analytical jacobian to a problem? Also, does it need to be given to NonlinearFunction always and cannot be an optional parameter to NonlinearProblem?
At least in a quick review of the documentation I did not see a clear explanation on how to provide analytical jacobians.
PD: I am using the version
[8913a72c] NonlinearSolve v3.13.1
The text was updated successfully, but these errors were encountered:
This is a duplicate from here, but I thought it might be better to ask here in GitHub.
This question came up when I did some tests related to this post.
Imagine I have the code
Running this code does not print
"Hey"
to the terminal, so I guess that automatic differentiation is being used to compute the jacobian instead of the given function. I noticed this behavior because in the post that I mentioned, there was an incompatible interaction between AD andQuadGK
that was present even if you provide the analytical jacobian.Is this intended behavior? How could I provide the analytical jacobian to a problem? Also, does it need to be given to
NonlinearFunction
always and cannot be an optional parameter toNonlinearProblem
?At least in a quick review of the documentation I did not see a clear explanation on how to provide analytical jacobians.
PD: I am using the version
The text was updated successfully, but these errors were encountered: