Genetic Algorithm and Direct Search Toolbox Previous page   Next Page
patternsearch

Find the minimum of a function using a pattern search

Syntax

Description

patternsearch finds the minimum of a function using a pattern search.

x = patternsearch(@fun, x0) solves unconstrained problems of the form

where fun is a MATLAB function that computes the values of the objective function f(x), and x0 is an initial point for the pattern search algorithm. The function patternsearch accepts the objective function as a function handle of the form @fun or as an inline function. patternsearch returns a local minimum x to the objective function. The function fun accepts a vector input and returns a scalar function value.

x = patternsearch(@fun, x0, A, b) finds a local minimum x to the function fun, subject to the linear inequality constraints represented in matrix form by

If the problem has m linear inequality constraints and n variables, then

x = patternsearch(@fun, x0, A, b, Aeq, beq) finds a local minimum x to the function fun, subject to the constraints

where Aeq x = beq represents the linear equality constraints in matrix form. If the problem has r linear equality constraints and n variables, then

If there are no inequality constraints, pass empty matrices, [], for A and b.

x = patternsearch(@fun, x0, A, b, Aeq, beq, lb, ub) finds a local minimum x to the function fun subject to the constraints

where represents lower and upper bounds on the variables. If the problem has n variables, lb and ub are vectors of length n. If lb or ub is empty (or not provided), it is automatically expanded to -Inf or Inf, respectively. If there are no inequality or equality constraints, pass empty matrices for A, b, Aeq and beq.

x = patternsearch(@fun, x0, A, b, Aeq, beq, lb, ub, options) finds a local minimum x to the function fun, replacing the default optimization parameters by values in the structure options. You can create options with the function psoptimset. Pass empty matrices for A, b, Aeq, beq, lb, ub, and options to use the default values.

x = patternsearch(problem) finds the minimum for problem, a structure that has the following fields:

You can create the structure problem by exporting a problem from the Pattern Search Tool, as described in Importing and Exporting Options and Problems.

[x, fval] = patternsearch(@fun, x0, ...) returns the value of the objective function fun at the solution x.

[x, fval, exitflag] = patternsearch(@fun, x0, ...) returns exitflag, which describes the exit condition of patternsearch. If

[x, fval, exitflag, output] = patternsearch(@fun, x0, ...) returns a structure output containing information about the search. The output structure contains the following fields:

Example

Given the following constraints

the following code finds the minimum of the function, lincontest6, that is provided with the toolbox:

See Also

psearchtool, psoptimget, psoptimset


Previous page  gatool psearchtool Next page

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS