the vector-to-scalar objective function
the dimension of the search space
Calculate the centroid of the best-side of the simplex (excluding h=0), returning it and its functional value.
Contract: compute the inner contraction point between x_h and x_c.
Contract: compute the inner contraction point between x_h and x_c.
the best-side centroid of the simplex
the reflection point
Contract: compute the outer contraction point between x_r and x_c.
Contract: compute the outer contraction point between x_r and x_c.
the best-side centroid of the simplex
the reflection point
Expand: compute the expansion point beyond the reflection point.
Expand: compute the expansion point beyond the reflection point.
the best-side centroid of the simplex
the reflection point
The objective function f plus a weighted penalty based on the constraint function g.
The objective function f plus a weighted penalty based on the constraint function g. Override for constrained optimization and ignore for unconstrained optimization.
the coordinate values of the current point
Show the flaw by printing the error message.
Show the flaw by printing the error message.
the method where the error occurred
the error message
Improve the simplex by replacing the worst/highest vertex (x_h) with a a better one found on the line containing x_h and the centroid (x_c).
Improve the simplex by replacing the worst/highest vertex (x_h) with a a better one found on the line containing x_h and the centroid (x_c). Try the reflection, expansion, outer contraction and inner contraction points, in that order. If none succeeds, shrink the simplex and iterate. Return both distance and difference between x_h (worst) and x_l (best).
the tolerence used for termination
Initialize the search simplex by setting n + 1 vertices and computing their functional values.
Initialize the search simplex by setting n + 1 vertices and computing their functional values.
the given starting point
the step size
Perform an exact (e.g., GoldenSectionLS) or inexact (e.g., WolfeLS) line search.
Perform an exact (e.g., GoldenSectionLS) or inexact (e.g., WolfeLS) line search. Search in direction 'dir', returning the distance 'z' to move in that direction. Currently NOT USED, but may be used to find a better point to add to simplex.
the current point
the direction to move in
the initial step size
Reflect: compute the reflection point of the worst point (h=0) across the centroid.
Reflect: compute the reflection point of the worst point (h=0) across the centroid.
the best-side centroid of the simplex
Replace the worst vertex (h=0) in the simplex with the new point.
Replace the worst vertex (h=0) in the simplex with the new point.
the new replacement point
Shrink: fixing the best/lowest point (l=n), move the rest of the points toward it.
Solve the Non-Linear Programming (NLP) problem using the Nelder-Mead Simplex algorithm.
Solve the Non-Linear Programming (NLP) problem using the Nelder-Mead Simplex algorithm.
the given starting point
the initial step size
the tolerence used for termination
Sort the vertices in non-increasing order (high to low).
Sort the vertices in non-increasing order (high to low). Then the key indices are worst/highest (h=0), second worst (s=1), and best/lowest (l=n).
This class solves unconstrained Non-Linear Programming (NLP) problems using the Nelder-Mead Simplex algorithm. Given a function 'f' and its dimension 'n', the algorithm moves a simplex defined by n + 1 points in order to find an optimal solution. The algorithm is derivative-free.
minimize f(x)