# Direct Search

Pattern search solver for derivative-free optimization, constrained or unconstrained

Direct search is an efficient algorithm for solving smooth or nonsmooth optimization problems. Try `patternsearch` first for most nonsmooth problems.

## Functions

expand all

 `patternsearch` Find minimum of function using pattern search
 `optimoptions` Create optimization options `resetoptions` Reset options

 Optimize Optimize or solve equations in the Live Editor

## Topics

### Problem-Based Direct Search

Optimize Nonsmooth Function Using patternsearch, Problem-Based

Basic example minimizing a nonsmooth function in the problem-based approach.

Constrained Minimization Using Pattern Search, Problem-Based

Use `patternsearch` to minimize an objective function subject to bounds and nonlinear constraints.

Effects of Pattern Search Options, Problem-Based

Visualize and tune direct search in the problem-based approach.

Search and Poll, Problem-Based

Examples showing the utility of search in addition to poll methods in the problem-based approach.

### Solver-Based Direct Search Basics

Optimize Using the GPS Algorithm

Provides an example of solving an optimization problem using pattern search.

Coding and Minimizing an Objective Function Using Pattern Search

Shows how to write an objective function including extra parameters or vectorization.

Constrained Minimization Using patternsearch and Optimize Live Editor Task

Example using linear constraints and nonlinear constraints in `patternsearch`.

Constrained Minimization Using Pattern Search, Solver-Based

Use constraints in direct search.

Effects of Pattern Search Options

Visualize and tune direct search.

Set Options

Shows how to set and examine options for `patternsearch`.

Optimization of Stochastic Objective Function

Pattern search can minimize a function even in the presence of noise.

Search and Poll

Examples showing the utility of search in addition to poll methods.

Polling Types

Examines the effects of polling options, including the `UseCompletePoll` option.

Set Mesh Options

Examines the effect of different mesh expansion and contraction factors.

Custom Plot Function

Shows how to write and use a plot function for `patternsearch`.

Pattern Search Climbs Mount Washington

Shows the steps `patternsearch` takes by using custom plot functions.

Optimization of Stochastic Objective Function

Pattern search can minimize a function even in the presence of noise.

Vectorize the Objective and Constraint Functions

How to gain speed using vectorized function evaluations.

Optimize an ODE in Parallel

Optimizing an objective given by the solution to an ODE using `patternsearch` or `ga` in serial or parallel.

### Direct Search Background

What Is Direct Search?

Introduces direct search and pattern search.

Pattern Search Terminology

Explains some basic pattern search terminology.

How Pattern Search Polling Works

Provides an overview of direct search algorithms.

Searching and Polling

Describes how search methods work with polling steps.

Setting Solver Tolerances

Stopping conditions and their associated options.

Nonlinear Constraint Solver Algorithm

Explains the Augmented Lagrangian Pattern Search (ALPS).

Pattern Search Options

Explore the options for pattern search.

Get trial now