Search code examples
openmdao

Dymos tricky phase connection


I have 3 phases in my Dymos trajectory. In the first and last phases I am using angle of attack as control. In the second phase, I do not want to control but just let the angle of attack stay at the last value from the first phase. I turned off optimization of angle of attack in the middle phase with opt = False. I used add_link_constraint() to connect alpha between the first and second phases but that didn't work how I thought it would --- in the second phase alpha defaults to zero and forces alpha at end of first phase to zero. Not sure how to make it override.


Solution

  • In this case, since alpha is not dynamic in the second phase and you just want it to maintain its value, you should make it a parameter instead of a control.

    Let it's value be determined by the optimizer (by setting opt=True), and use a phase linkage constraint to force dymos to drive the difference between the value of alpha and the end of the first phase and the beginning of the second phase to zero.

    There's a test case that demonstrates this here. In the test case, the control angle u1 is a dynamic control in the first and third phases (when under propulsion) and maintains a constant value during the second phase (a coast).

    This test case uses the link_phases method on Trajectory to impose the continuity (linkage) constraints. Alternatively, the method add_linkage_constraint has more generality, but is more complicated to use.

    Note this capability is new to Dymos so I'd recommend using the latest release.

    Leaving it as an optimized control doesn't work in this case because the linkage would only try to link the value at the endpoints of the second phase. The interior values wouldn't have any bearing on the optimization.