How to use the Nelder Mead - Simplex Method to
solve many nonlinear problems
'fminsearch' in Matlab is used for strategic
optimization or utilized to solve, almost magically, a
number of nonlinear problems.
is the Nelder-Mead implementation of the simplex method,
which is utilized for the minimization of functions.
If you can formulate your problem in such a way that its minimum value
represents the solution to your problem,
then it's very likely that you can solve it by utilizing the
fminsearch built-in function, in Matlab. You can solve nonlinear
systems, curve fitting and optimization design, among others.
There are three steps that you have to include or elaborate to solve
these types of problems:
- You have to be able to run your parameterized function.
This can be a mathematical function or maybe you are running an
external simulator that's delivering a response that you need to
- Then, you have to prepare an objective function
(OF). This OF must be able to run the function, deliver new parameters
each time and somehow evaluate or measure the results. Maybe
you are trying to match two responses (a goal and the one that you're
working with) or maybe you need a maximum error in a particular range.
You could be working with a minimax algorithm, for example. I mean, you
could be minimizing the maximum error in a particular region of
- Now, you can use function fminsearch (the Nelder-Mead implementation
of the simplex algorithm)
to iteratively run your OF and automatically change the
parameters in order to deliver the minimum value possible.
It's important to mention that this strategic optimization method
delivers local minima, not global ones. This means that the algorithm
can give you a solution, but not necessarily the best one.
The article named Circuit
Simulator shows how you can run an electronic simulator
-it's Winspace- from Matlab. You can change parameters in the circuit
and read the different responses. This means that your function to be
optimized can be delivered from an external source, and you can use
Matlab to optimize it, as long as you can interact with the external
The article named Mathematical
Optimization shows how the fminsearch function
finds different minimum values, depending on your starting point. You
can get many different solutions and you must be aware of this
behavior. There's another useful function named fminbnd (using the
Golden Section search algorithm) that can be used for optimizations,
but it only accepts one variable.
I wrote an article to solve Nonlinear
where I show you how to implement the three steps mentioned above:
express your function(s), plan an OF (considered the goal) and use
fminsearch to iteratively modify the parameters to get the minimum
value of your OF. You must verify always how good your response is,
since you know now that you're working with local minima, which are not
always the best responses.
Another article is about Curve Fitting.
You have some empirical data and want to find an analytical expression
for those numbers. You also implement the three steps above and find
the correct expression, when you know in advance the type of function
that you want to fit.
Those are some of the applications
of this type of strategic
optimization that you may use for many purposes...
Optimization' to home
Optimization' to 'Basics of Computer Programming'