Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Formulating daefh for system with huge symbolic expression of dynamics #158

Open
rodrigo-carnier opened this issue Sep 7, 2020 · 0 comments

Comments

@rodrigo-carnier
Copy link

rodrigo-carnier commented Sep 7, 2020

Hello! First of all, thank you very much for your contribution of a free source encapsulation of Casadi and IPOPT into an optimization toolbox.

About the issue: I am having trouble with the translation of my own implementation of evaluation of dynamics into your toolbox, in particular how to formulate the ocl.DaeHandler for a robotic system with many DOF and huge symbolic expressions for its dynamics. As far as I understood, this ocl.DaeHandler is a Casadi symbolic expression that needs to be provided to the ocl.Problem. However, my study is the optimization of a 6 DOF planar walking robot, and the symbolic expression of its dynamics cannot be provided directly because it is huge, due to the inversion of its inertia matrix M in symbolic expression. In my previous studies I implemented an evaluation where I took the usual route of first formulating the symbolic expressions of the terms of the equation of motion (inertia matrix M, coriolis vector C, etc), then evaluating their values in runtime, and only then evaluating the direct dynamics with an inverted value of M. I implemented all this in MATLAB, using the function LINSOLVE in the last step to "perform" the inversion of M and find the acceleration of joint angles.

Is there any way for me to do something similar in your toolbox? I am trying to study Casadi to see a way, but I am new to your toolbox and still clueless about Casadi, so I have not seen a way so far. I tried to just call my evaluation function from inside the @(daeh, x, z, u, p), but the Casadi SX variables were passed on until they crashed the function LINSOLVE, which can only accept numerical inputs. Sorry if there is a basic misunderstanding of Casadi symbolic expressions and evaluations that I am not seeing. It seems like Automatic Differentiation in Casadi has something to do with this problem but it is my first time hearing and studying about it and I did not figure it out yet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant