Reputation: 47
I'm working on implementing a trajectory optimization algorithm named DIRTREL, which is essentially direct transcription with an added cost function. However, the cost function incorporates the K matrices obtained by linearizing the system around the decision variables (x, u) and employing discrete time-varying LQR. My question is how to most efficiently and concisely express this in drake as my current approach describes the system symbolically and results in extremely lengthly symbolic equations (which will only increase in length with more timesteps) due to the recursive nature of the Riccati difference equation, and if this symbolic approach is even appropriate.
For more details:
Inside the cost function:
One side note is I am not sure of the most tractable way to compute an inverse symbolically, but I am most concerned with my methodology and whether this symbolic description is appropriate.
Upvotes: 2
Views: 176
Reputation: 2766
I think there are several details on DIRTREL worth discussion:
S[n]
depends on the linearized dynamics Ai, Bi
. I think in DIRTREL you will need to solve a nonlinear optimization problem, which requires the gradient of the cost. So to compute the gradient of of your cost, you will need the gradient of S[n]
, which requires the gradient of Ai, Bi
. Since Ai
and Bi
are gradient of the dynamics function f(x, u)
, you will need to compute the second order gradient of the dynamics.S
also as a decision variable, so our decision variables are x, u, S
, with the constraint include both the dynamics constraint x[n+1] = f(x[n], u[n])
, and the Riccati equation as constraint on S
. I think DIRTREL's approach scales better with less decision variables, but I haven't compared the numerical performance between the two approaches.Upvotes: 2