-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compute Hessian of MbP dynamics function #13586
Comments
Since f is a vector function, ∂f / ∂q is a matrix. That makes ∂²f / ∂q² a hypermatrix. Is that what you're looking for? |
I should have been more clear, I mean ∂²f(i) / ∂q², namely the second order derivative of the i'th entry of |
We don't have a way to calculate just a single generalized force f(i) so the nested AutoDiff calculation would give { ∂²f(i)/∂q² | i ∈ 0..n-1 }. (That's a way to represent the 3D hypermatrix.) I'm not seeing an easier way to get that though. You don't have u in the functional dependence of f. Should it be there? |
Yes
Makes sense. I think if we use nested autodiff, we can still return |
Yes, each entry would contain its value, gradient, and Hessian. BTW @edrumwri wrote a document on AutoDiffing that has a Hessian section. Assigning to @rpoyner-tri for now as vaguely related to #10991 -- this is an application that would really stretch AutoDiff performance! |
Given where our thinking about autodiff is going, I'm handing this back to @hongkai-dai for further consideration. |
If I have a function f(u, q, v, v̇, λ) = M * v̇ + C(q, v) - Bu - J'λ, I wish to compute the Hessian of this function
f
w.r.tu, q, v, v̇, λ
. Some of the Hessian terms are easy to compute, but to compute ∂² f / ∂ q², it requires computing the Hessian of ∂² M / ∂ q² and ∂² C / ∂ q², which I don't know how to do yet.I guess the easiest solution might be to instantiate MBP with nested AutoDiffScalar.
@sherm1
The text was updated successfully, but these errors were encountered: