Updating system dynamics for each stage in python

Hello,

I believe that you could find what you’re looking for in the chain mass example. As Jonathan mentioned here, you will need to define a parameter (e.g., u_offset) and set it to the desired value before solving the OCP.

An example of adding a parameter to the dynamics can be found here and changing it online can be found here.

To set it only for the first stage, you should add the stage number as shown here, i.e. <your_solver>.set(0, "p", <desired_value>).

Hope this helps!

1 Like