Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Find minimum of function using pattern search

`x = patternsearch(fun,x0)`

`x = patternsearch(fun,x0,A,b)`

`x = patternsearch(fun,x0,A,b,Aeq,beq)`

`x = patternsearch(fun,x0,A,b,Aeq,beq,lb,ub)`

`x = patternsearch(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon)`

`x = patternsearch(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)`

`x = patternsearch(problem)`

```
[x,fval]
= patternsearch(___)
```

```
[x,fval,exitflag,output]
= patternsearch(___)
```

finds
a local minimum, `x`

= patternsearch(`fun`

,`x0`

)`x`

, to the function handle `fun`

that
computes the values of the objective function. `x0`

is
a real vector specifying an initial point for the pattern search algorithm.

Passing Extra Parameters (Optimization Toolbox) explains how to pass extra parameters to the objective function and nonlinear constraint functions, if necessary.

defines
a set of lower and upper bounds on the design variables in `x`

= patternsearch(`fun`

,`x0`

,`A`

,`b`

,`Aeq`

,`beq`

,`lb`

,`ub`

)`x`

,
so that the solution is always in the range `lb `

≤` x `

≤` ub`

.
If no linear equalities exist, set `Aeq = []`

and ```
beq
= []
```

. If `x(i)`

has no lower bound, set ```
lb(i)
= -Inf
```

. If `x(i)`

has no upper bound, set ```
ub(i)
= Inf
```

.

finds
the minimum for `x`

= patternsearch(`problem`

)`problem`

, where `problem`

is
a structure described in Input Arguments.
Create the `problem`

structure by exporting a problem
from Optimization app, as described in Exporting Your Work (Optimization Toolbox).

By default, `patternsearch`

looks for a minimum
based on an adaptive mesh that, in the absence of linear constraints,
is aligned with the coordinate directions. See What Is Direct Search? and How Pattern Search Polling Works.

[1] Audet, Charles, and J. E. Dennis Jr. “Analysis
of Generalized Pattern Searches.” *SIAM Journal on
Optimization*. Volume 13, Number 3, 2003, pp. 889–903.

[2] Conn, A. R., N. I. M. Gould, and Ph. L.
Toint. “A Globally Convergent Augmented Lagrangian Barrier
Algorithm for Optimization with General Inequality Constraints and
Simple Bounds.” *Mathematics of Computation*.
Volume 66, Number 217, 1997, pp. 261–288.

[3] Abramson, Mark A. *Pattern Search Filter Algorithms
for Mixed Variable General Constrained Optimization Problems*.
Ph.D. Thesis, Department of Computational and Applied Mathematics,
Rice University, August 2002.

[4] Abramson, Mark A., Charles Audet, J. E. Dennis, Jr.,
and Sebastien Le Digabel. “ORTHOMADS: A deterministic MADS
instance with orthogonal directions.” *SIAM Journal
on Optimization*. Volume 20, Number 2, 2009, pp. 948–966.

[5] Kolda, Tamara G., Robert Michael Lewis, and Virginia
Torczon. “Optimization by direct search: new perspectives on
some classical and modern methods.” *SIAM Review*.
Volume 45, Issue 3, 2003, pp. 385–482.

[6] Kolda, Tamara G., Robert Michael Lewis, and Virginia Torczon. “A generating set direct search augmented Lagrangian algorithm for optimization with a combination of general and linear constraints.” Technical Report SAND2006-5315, Sandia National Laboratories, August 2006.

[7] Lewis, Robert Michael, Anne Shepherd, and Virginia Torczon.
“Implementing generating set search methods for linearly constrained
minimization.” *SIAM Journal on Scientific Computing*.
Volume 29, Issue 6, 2007, pp. 2507–2530.

`ga`

| `optimoptions`

| `paretosearch`

- Optimize Using the GPS Algorithm
- Coding and Minimizing an Objective Function Using Pattern Search
- Constrained Minimization Using Pattern Search
- Effects of Some Pattern Search Options
- Optimize an ODE in Parallel
- Pattern Search Climbs Mount Washington
- Optimization Workflow
- What Is Direct Search?
- Pattern Search Terminology
- How Pattern Search Polling Works
- Polling Types
- Search and Poll