How do I use the patternsearch function for constraints that must be computed after the objective function?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have an objective function and a nonlinear unequality constraint whome both are computed by seperate simulation models. Some of the output of the objective function simulation model works as input to the constraint simulation model. How do I formulate the calls with the patternsearch function for such optimization problems?
0 Kommentare
Antworten (1)
Matt J
am 13 Aug. 2015
Bearbeitet: Matt J
am 13 Aug. 2015
You can't control whether objective function will be called first, so you must move the "objective function simulation" to its own a separate function doFirstSim() which both your objective and constraint functions can call when needed. If the constraint function is called first, it needs to be the one to trigger that simulation.
However, using the technique discussed here,
you can at least make sure that the simulation is not repeated unnecessarily and can be re-used by other functions that are considering the same point x.
In your case, the "ImportantQuantity" mentioned in the thread is the output of doFirstSim(). Using the technique in the thread, it will only get regenerated when a refresh of the simulation is needed.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Direct Search finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!