I would like to be able to change constraint values defined in a SubModelComp as part of a DOE.
The SubModelComp in question is an entire Dymos Trajectory problem, and I want to run the cases in parallel under MPI.
It does not seem like there is an official way to do this. I have been trying to do this in a number of different ways but they don’t seem to work.
Since you can designate the inputs of a SubModelComp, I have created an IndepVarComp, as part of the SubModelComp, that holds the constraint values, and that can be connected to the DOE driver.
I override the compute() method of the SubModelComp to then read the constraints IVC with the get_val() method. I can see that for each DOE case the right values are getting written to the constraints IVC. Then I set the constraints with set_constraint_options(), call setup()
again on the subproblem.
This runs without errors being thrown, even in parallel mode under MPI, but the changed constraint values have no effect.
I strongly suspect that this is not working because I am doing things in the wrong order.
One option I considered was to cast all constraints into components, with inputs being the desired constraint value and the output value to be constrained, and constraining that difference to 0. Then you don’t actually need to change the constraint value itself. This would be pretty cumbersome however.
Is there a way to do this? Should I even be using a SubModelComp?