How do I use the patternsearch function for constraints that must be computed after the objective function?

조회 수: 1 (최근 30일)
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?

답변 (1개)

Matt J
Matt J 2015년 8월 13일
편집: Matt J 2015년 8월 13일
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.

카테고리

Help CenterFile Exchange에서 Direct Search에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by