Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Mapping in Plot.py #705

Open
AnaisFarr opened this issue Jun 29, 2023 · 1 comment
Open

Error Mapping in Plot.py #705

AnaisFarr opened this issue Jun 29, 2023 · 1 comment

Comments

@AnaisFarr
Copy link
Contributor

We run simulations in three phases with different numbers of q and qdot per phase (phase 0 and 2 = 7 q and 7 qdot, phase 1: 5 q, 5 qdot).
It is not possible to display graphs with the sol.graphs() command.
The problem has been solved by removing line 337 from plot.py

if nlp.plot[key].phase_mappings is None:

and line 357

else:
        size = len(nlp.plot[key].phase_mappings.to_second.map_idx)

Can we remove these two lines, which have a mapping? @EveCharbie

@EveCharbie
Copy link
Collaborator

  1. Have you added a mapping in your phase transition ? Something like this (examples/torque_driven/phase_transition_uneven_variable_number_by_mapping.py):
    phase_transitions = PhaseTransitionList()
    phase_transitions.add(
        PhaseTransitionFcn.CONTINUOUS, phase_pre_idx=0, states_mapping=BiMapping([0, 1, 2, 3, 4, 5, 6], [2, 3, 4, 5, 6])
    )
  1. Do the states appear in the right order on the plots when you remove these lines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants