Rory McDonald
Rory McDonald

Reputation: 273

Dymos: Is it possible to optimise a design_parameter?

Such as in the 'racecar' example, could I set a lower and upper limit for the 'mass' design_parameter and then optimise the vehicle mass while solving the optimal control problem?

I see that there is an "opt" argument for phase.add_design_parameter() but when I run the problem with opt=True the value stays static. Do I need another layer to the solver that optimises this value?

This feature would be useful for allocating budgets to design decisions (e.g. purchasing a lighter chassis), and tuning parameters such as gear ratio.

Upvotes: 1

Views: 172

Answers (1)

Rob Falck
Rob Falck

Reputation: 2704

It's absolutely possible, and in fact that is the intent of the opt flag on design parameters.

Just to make sure things are working as expected, when you have a design parameter with opt=True, make sure it shows up as one of the optimizer's design variables by invoking list_problem_vars on the problem instance after run_model. The documentation for list_problem_vars is here.

If it shows up as a design variable but the optimizer is refusing to change it, it could be that it sees no sensitivity wrt that variable. This could be due to

  • incorrectly defined derivatives in the model (wrong partials)
  • poor scaling (the sensitivity of the objective/constraints wrt the design parameter may be miniscule in the optimizer's units
  • sometimes by nature of the problem, a certain input has little to no impact on the result (this is probably the least likely here).

Things you can try:

  • run problem.check_totals (make sure to call problem.run_model first) and see if any of the total derivatives appear to be incorrect.
  • run problem.driver.scaling_report and verify that the values are not negligible in the units in which the optimizer sees them. If they're really small at the starting point, then it may be appropriate to scale the design parameter smaller (set ref to a smaller number like 0.01) so that a small change from the optimizer's perspective results in a larger change within the model.

If things don't appear to be working after trying this and I'll work with you to figure this out.

Upvotes: 1

Related Questions