Menu

Decreasing integrator step size w/o increasing number of discretization points

2023-01-26
2023-01-27
  • Marc-Andre Beyer

    Hi Team,

    thank you for GRAMPC! It is a pleasure to work with it.

    Is there a quick way to decrease the integrator step size w/o increasing the problem size? Like intermediate integration points. Or is the only way to customize the integrator functions?

    Thank you
    Marc

     
  • Andreas Völz

    Andreas Völz - 2023-01-26

    Dear Marc,

    why is it not acceptable for you to increase the number of sampling points Nhor if you need smaller time steps for the integration? The computational effort and the memory of GRAMPC scale linearly with Nhor. Regarding the forward and backward integrations of the system and the adjoint system, the effort would be the same with higher Nhor or more intermediate integration steps. The only differences would be less evaluations of the constraints and the gradients w.r.t. u, p, T, which are typically cheap in comparison. Therefore, the only options I see are that you use a variable time-step integrator (ruku45 or rodas) or extend the code by your custom integration function. But I would still be interested in your motivation.

    Best regards,
    Andreas Völz

     
  • Marc-Andre Beyer

    Hi Andreas,

    thank you for your quick reply. My bad, I wasn't aware of the fact, that computional time does scale linearly with Nhor. I should have probably read the paper more carefully.

    I design controllers for maritime applications which can range from very slow to very fast dynamics, depending on the type of ship. So I need to be able to adjust the horizon, ideally w/o sacrificing solution accuracy and significantly increasing computational time.

    In LMPC approaches for ship control I used different integration times on the horizon (short, medium, long) to cover all relevant dynamics w/o increasing the problem size. That works pretty well. As for NMPC, I am looking for comparable approaches.

    Best,
    Marc

     
  • Andreas Völz

    Andreas Völz - 2023-01-26

    Dear Marc,

    do you have multiple ships with differently fast dynamics in one MPC problem or do you want to tune one MPC approach for multiple ships? In the former case, one could think of a problem-specific integrator that uses a different number of integration steps for each of the ships.

    Regarding the latter case, note that in GRAMPC, the parameters Thor, Nhor and dt are partially independent. Thor defines the length of the prediction horizon and Nhor the number of sampling steps along this horizon. Therefore, the sampling points are equally spaced at i * Thor/(Nhor-1) with i going from 0 to Nhor-1. Independent of this, dt is the sampling time of the MPC, that is, the duration during which the optimal solution is applied to the system before the optimization is repeated with the new measurement as initial state. In other words, the control is updated at time k * dt with k going from 0 to infinity (or to Tsim/dt in simulations). This is different from many other MPC tools that assume that dt is equal to Thor/(Nhor-1).

    The computational effort and memory of the algorithm depends linearly on Nhor and (if euler, modeuler or heun is chosen as integrator) is independent of Thor. Therefore, you could select a fixed Nhor for all your ships and just vary the horizon Thor (longer for slow dynamics and shorter for fast dynamics). Finally, it is also possible to use a non-uniform discretization along the horizon if it is important that the second sampling point on the horizon is placed exactly at dt.

    Best regards,
    Andreas Völz

     
  • Marc-Andre Beyer

    Dear Andreas,

    the latter is the case, one MPC approach for multiple ships and yes, your recommendation w/ fixed Nhor and varying Thor came also to my mind.

    Thank you,
    Marc

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.