Skip to content

Refactor of MultinodePenalties #966

@EveCharbie

Description

@EveCharbie

For now there are multiple concepts referring to the same idea: we want to use variables from different nodes in a penalty.

  1. Since PhaseTransition are just a special case of MultinodeConstraints (but are handled differently in the back ground), we could uniformized and formalize them as a MultinodeConstraint

  2. MultinodePenalties can only be used with PhaseDynamics.SHARED_DURING_THE_PHASE if there are 3 nodes or less defined. There is no technical limitation preventing us from using more nodes. So instead of defining 3 cx (hard coded: cx_start, cx_mid and cx_end), we should adapt the number of cx to the number of nodes used in the multinode penalty. This would allow to use PhaseDynamics.SHARED_DURING_THE_PHASE with all multinode penalties. for In addition, this would prevent from defining 3 cx when only one or two are needed, reducing RAM and computational time.

  3. The multinodes are handled differently for OdeSolver.COLLOCATION because cx_intermediates_list must be defined. This refactor would allow to uniformize implementation across ode solvers, reducing error risks on the dev and user sides.

  4. penalty.derivative and penalty.explicit_derivative indicate to compute the difference between the output of a penalty between two nodes, which is the definition of a MultinodePenalty. This is an artefact from before MultinodePenalties were introduced. Introducing these as formal MultinodePenalties would greatly simplify penalty_option.py and interface_utils.py, which are a nightmare to maintain, thus error-prone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions