Finding the minimum of a multimodal function

Finding the minimum of a multimodal function

Level: Intermediate

Topic: Optimization

Can you find the global minimum of this multimodal function? Where in the design space does this occur and what is the corresponding function value? How would you explore this design space?

Please don’t look at the function definition and use your math smarts to know where the minimum is. Heck, if you can do that, that’s impressive, but that’s not really the point of this exercise.

In the example code provided we solve an optimization problem and get an answer which points to a local minimum. However, we’re trying to find the global minimum of this multimodal function. Please see how low of a function value you can obtain and identify where in the 2D design space this occurs.

import openmdao.api as om
import numpy as np


prob = om.Problem()

comp = om.ExecComp('obj = 0.1*(x+y) -abs(sin(x) * cos(y) * exp(abs(1 - (x**2 + y**2)**0.5/pi)))')

prob.model.add_subsystem('blackbox', comp, promotes=['*'])

prob.driver = om.ScipyOptimizeDriver()
prob.driver.options['optimizer'] = 'SLSQP'

prob.model.add_design_var('x', lower=-10, upper=10)
prob.model.add_design_var('y', lower=-10, upper=10)
prob.model.add_objective('obj')

prob.setup()

prob.run_driver();
Optimization terminated successfully    (Exit mode 0)
            Current function value: -1.6115904097239777
            Iterations: 7
            Function evaluations: 7
            Gradient evaluations: 7
Optimization Complete
-----------------------------------