# Numerical simulation of nonlinear dynamics not encoded into the NLP or its QP subproblem?

I read your paper with great care and I’m still not entirely sure about one aspect. Without going into to much detail about implicit/explicit Runge-Kutta methods, condensing, discretization of the constraints (that are not related to the system dynamics), I still did not get wheter the simulation of the nonlinear dynamics is done in a module, that itself has nothing to do with an optimization.

The simulation module solves the IVP of the discretized dynamics, given x_0 and the input trajectory U = [u_0,…,u_{N-1}]. Given the computed state trajectory (and stages trajectory for IRK methods) we can linearize the nonlinear dynamcis around the state and input trajectory. The resulting DT LTV system is then used in the QP subproblem (5) in the paper. We then compute U_new = U + dU, solve the IVP and so on and so on until a termination cirterion (of the original NLP) is met. Is this reasoning correct?

Regards,
Markus

Hi Markus,

this is not really correct.
The simulation module (we call it integrator) rather solves the IVP given x_i, u_i .
There are N integrators that solve the IVP for each shooting interval.
What you wrote rather sounds like single shooting.

So it is rather “given the current primal iterate (state and control values over the horizon), we can linearize the nonlinear dynamics around this state and input trajectory.”

Best,
Jonathan

This kind of answers my question. I agree, my question sounded more like I was talking about single shooting, rather then multiple shooting.

I’ve never seen or heard that the integration is not done inside the NLP solver. What I have done so far is setting up a nonlinear OCP (/NLP) like (3) including the continuity constraints (i.e. enforcing a dynamically feasible state sequence) (3b) and then use an NLP solver (using IP or SQP algorithms) to solve it.

This can lead to an immense blow up in the problem size when using IRK methods with s stages because you have to introduce N * n_x * s optimization variables that represent the stages and additional equality constraints that represent the implicit stage equations (zero finding problem). Furthermore, condensing (of the states) does not really make sense, because you cannot eliminate the stage variables and eq. constraints.

If an SQP algorithm is used, linearizing the constraints (of the above described NLP) to obtain a QP is done in the background. In contrast, you linearize the continuity constraints by hand – as far as I understood – like this:

This would allow to eliminate the stage variables (in the QP) and their corresponding equality constraints.

Do you have some references that discuss and investigate this decoupling in detail? I would be really interested in a comparison of these two approaches.

Thank you,
Markus

Hi Markus,

The integration is done in the NLP solver, the integrators are part of the acados NLP solver (in case continuous dynamics are given).

As far as I know it, this is the difference between

• “direct multiple shooting”: state and control variables (at the shooting nodes) are optimization variables
• “direct collocation”: state, control variables (at the shooting nodes) AND all integration variables (typically called k for Runge-Kutta methods) are optimization variables.

The PhD thesis of Rien Quirynen is a very good reference for this and describes those concepts already in the abstract.
It also introduces the concept of lifted integrators, which are shown to be equivalent to direct collocation.

It would be nice if you add the source when you refer to a book/paper.

Hi Jonathan,