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
I determined how to compute the state transition matrix of dynamics using dual numbers. By semi-clever organization of the vector returned by the equation of motion, it is possible to generate the gradient of the EOM for the provided state.
The following proof of concept uses the dual space, and as such requires N calls to the EOMs, where N corresponds to the size of the state. However, if using a hyperdual space of size N, the EOMs only need to be computed once.
Proof of concept
Output
Note that the expected STM is computed through the analytical version, as done here
Despite novacrazy/dual_num#2 being merged, I still need to make Dual a na::Scalar in dual_num in order to support all the na::MatrixMN operations. This is important so that the definition of all the eoms are (almost?) identical whether autodifferentiation is used or not. The almost might be required for slicing the state vector.
Moreover, I would want the nabla function of dual_num to be using hyperdual space instead of "simulating" it so as to limit the number of calls to the eoms. Although I do not think this will reduce the mathematical complexity of the problem at hand (since the same number of operations is needed in both cases), it'll make the call stack smaller, and therefore probably provide some speed up of the gradient computation.
(And probably write a paper on this method)
Summary
I determined how to compute the state transition matrix of dynamics using dual numbers. By semi-clever organization of the vector returned by the equation of motion, it is possible to generate the gradient of the EOM for the provided state.
The following proof of concept uses the dual space, and as such requires N calls to the EOMs, where N corresponds to the size of the state. However, if using a hyperdual space of size N, the EOMs only need to be computed once.
Proof of concept
Output
Note that the expected STM is computed through the analytical version, as done here
main.rs
Cargo.toml
The text was updated successfully, but these errors were encountered: