You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, I'm encountering an issue with how bimappings are handled in bioptim. In essence, I believe they are being applied globally across the entire Optimal Control Problem (OCP) when a per-phase approach is needed.
Context:
My problem involves transitioning between two different kinematic models across multiple phases.
Phase 1: Model has q_u, qdot_u, and tau associated with a certain number of degrees of freedom (DOFs).
Transition: The model changes to one with reduced DOFs (one less, specifically).
Phase 2: The model now has q and qdot, but the extra tau element is no longer present.
Problem:
I want to apply a mapping to the tau vector in the first phase, specifically to account for the extra DoF. However, I do not want to apply this mapping in the second phase because the DOF and the corresponding tau element no longer exist.
Currently, the applied mapping seems to be automatically applied to all phases, including the second phase where it's not valid and causing issues.
The automatic_multiple_phase attribute , currently in OptionDict, affects all its child classes. However, it seems solely relevant to Bimapping. I'm questioning whether this global scope is necessary, particularly regarding the default application of mappings across all phases. I propose relocating automatic_multiple_phase to Bimapping and changing the default behavior to a phase-by-phase application. @pariterre@EveCharbie, could you share your insights and the rationale behind the current implementation?"
The text was updated successfully, but these errors were encountered:
I totally agree !
I think it will be easier to fix once issue #717 (node_mapping / phase_mapping) is fixed.
If you can wait until the weekend, I can make a PR for #717 (aka clean up my own mess) before you start tackling the current issue.
Currently, I'm encountering an issue with how bimappings are handled in bioptim. In essence, I believe they are being applied globally across the entire Optimal Control Problem (OCP) when a per-phase approach is needed.
Context:
My problem involves transitioning between two different kinematic models across multiple phases.
Phase 1: Model has q_u, qdot_u, and tau associated with a certain number of degrees of freedom (DOFs).
Transition: The model changes to one with reduced DOFs (one less, specifically).
Phase 2: The model now has q and qdot, but the extra tau element is no longer present.
Problem:
I want to apply a mapping to the tau vector in the first phase, specifically to account for the extra DoF. However, I do not want to apply this mapping in the second phase because the DOF and the corresponding tau element no longer exist.
Currently, the applied mapping seems to be automatically applied to all phases, including the second phase where it's not valid and causing issues.
I found this line responsible for it :
bioptim/bioptim/optimization/optimal_control_program.py
Line 587 in 1e11152
And this,
bioptim/bioptim/misc/mapping.py
Lines 231 to 240 in 1e11152
The
automatic_multiple_phase
attribute , currently inOptionDict
, affects all its child classes. However, it seems solely relevant toBimapping
. I'm questioning whether this global scope is necessary, particularly regarding the default application of mappings across all phases. I propose relocatingautomatic_multiple_phase
to Bimapping and changing the default behavior to a phase-by-phase application. @pariterre @EveCharbie, could you share your insights and the rationale behind the current implementation?"The text was updated successfully, but these errors were encountered: