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

[RTM] Restoring bounds on graphs #724

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bioptim/examples/getting_started/pendulum.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def main():

# --- Solve the ocp --- #
sol = ocp.solve(Solver.IPOPT(show_online_optim=platform.system() == "Linux"))
# sol.graphs()
# sol.graphs(show_bounds=True)

# --- Show the results in a bioviz animation --- #
sol.print_cost()
Expand Down
6 changes: 3 additions & 3 deletions bioptim/optimization/optimal_control_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,10 +1138,10 @@ def update_bounds(

for nlp in self.nlp:
for key in nlp.states.keys():
if f"{key}_states" in nlp.plot and key in nlp.x_bounds:
if f"{key}_states" in nlp.plot and key in nlp.x_bounds.keys():
nlp.plot[f"{key}_states"].bounds = nlp.x_bounds[key]
for key in nlp.controls:
if f"{key}_controls" in nlp.plot and key in nlp.u_bounds:
for key in nlp.controls.keys():
if f"{key}_controls" in nlp.plot and key in nlp.u_bounds.keys():
nlp.plot[f"{key}_controls"].bounds = nlp.u_bounds[key]

def update_initial_guess(
Expand Down
Loading