86 views

Uploaded by Cristian Giovanny Gomez Olarte

Encontrar mínimos para funciones de varias variables sin restricciones.

- Chapter 13 Heragu
- MELDAS 64
- ffsqp-manual.pdf
- Advanced ADAMS/View Training Guide
- BENSON Bi Criteria Linear Programming
- Au 25279287
- Optimal Load Dispatch Using Ant Lion Optimization
- Filetype PDF Multiple Criteria Linear Programming Model for Portfolio Selection
- Ship Confirm API
- 1-s2.0-S1359431108001294-main
- Process Design and Optimization of Natural Gas.pdf
- Lecture 10 Intensity Transformation Functions Using Matlab.pdf
- Optimization of EOQ Model with Limited Storage Capacity by Neutrosophic Geometric Programming
- 496457.pdf
- Improving Factory Layout Under a Mixed Floor and Overhead Materia
- Paper Contest Sharing
- A Real Life Case Study_SLA
- How_to_use_SGA
- A_Novel_Methodology_for_Multi-Year_Planning_of_Large-Scale_Distribution_Networks
- prescriptive treatment optimization using a genetic

You are on page 1of 5

Find minimum of unconstrained multivariable function using derivative-free method - MATLAB fminsearch

fminsearch

Find minimum of unconstrained multivariable function using derivative-free method

Equation

Finds the minimum of a problem specified by

min f (x)

x

x is a vector or a matrix; see Matrix Arguments.

Syntax

x = fminsearch(fun,x0)

x = fminsearch(fun,x0,options)

x = fminsearch(problem)

[x,fval] = fminsearch(...)

[x,fval,exitflag] = fminsearch(...)

[x,fval,exitflag,output] = fminsearch(...)

Description

fminsearch attempts to find a minimum of a scalar function of several variables, starting at an initial

Note: Passing Extra Parameters explains how to pass extra parameters to the objective function, if

necessary.

x = fminsearch(fun,x0) starts at the point x0 and returns a value x that is a local minimizer of the function

described in fun. fun is either a function handle to a file or is an anonymous function. x0 can be a scalar,

vector, or matrix.

x = fminsearch(fun,x0,options) minimizes with the optimization options specified in the structure options.

Use optimset to set these options.

x = fminsearch(problem) finds the minimum for problem, where problem is a structure described in Input

Arguments.

Create the structure problem by exporting a problem from Optimization app, as described in Exporting Your

Work.

[x,fval] = fminsearch(...) returns in fval the value of the objective function fun at the solution x.

[x,fval,exitflag] = fminsearch(...) returns a value exitflag that describes the exit condition of

fminsearch.

[x,fval,exitflag,output] = fminsearch(...) returns a structure output that contains information about

the optimization.

Input Arguments

Function Arguments contains general descriptions of arguments passed into fminsearch. This section

http://www.mathworks.com/help/optim/ug/fminsearch.html

1/5

11/2/2015

Find minimum of unconstrained multivariable function using derivative-free method - MATLAB fminsearch

fun

The function to be minimized. fun is a function handle for a function that accepts a vector x

and returns a scalar f, the objective function evaluated at x. The function fun can be

specified as a function handle for a file:

x = fminsearch(@myfun,x0)

where myfun is a MATLAB function such as

function f = myfun(x)

f = ...

% Compute function value at x

fun can also be a function handle for an anonymous function, such as

x = fminsearch(@(x)norm(x)^2,x0,A,b);

options

problem

objective

Objective function

x0

solver

'fminsearch'

options

Output Arguments

Function Arguments contains general descriptions of arguments returned by fminsearch. This section

provides function-specific details for exitflag and output:

exitflag

output

Integer identifying the reason the algorithm terminated. The following lists the

values of exitflag and the corresponding reasons the algorithm terminated.

1

of function evaluations exceeded options.MaxFunEvals.

-1

Structure containing information about the optimization. The fields of the structure

are

iterations

Number of iterations

funcCount

algorithm

message

Exit message

Options

http://www.mathworks.com/help/optim/ug/fminsearch.html

2/5

11/2/2015

Find minimum of unconstrained multivariable function using derivative-free method - MATLAB fminsearch

Optimization options used by fminsearch. You can use optimset to set or change the values of these fields

in the options structure options. See Optimization Options Reference for detailed information.

Display

Level of display:

'off' or 'none' displays no output.

'iter' displays output at each iteration.

'notify' displays output only if the function does not converge.

'final' (default) displays just the final output.

FunValCheck

Check whether objective function values are valid. 'on' displays an error

when the objective function returns a value that is complex, Inf, or NaN.

The default 'off' displays no error.

MaxFunEvals

default is 200*numberOfVariables.

MaxIter

value is 200*numberOfVariables.

OutputFcn

calls at each iteration, either as a function handle or as a cell array of

function handles. The default is none ([]). See Output Function.

PlotFcns

from predefined plots or write your own. Pass a function handle or a cell

array of function handles. The default is none ([]):

@optimplotx plots the current point.

@optimplotfunccount plots the function count.

@optimplotfval plots the function value.

TolFun

is 1e-4.

TolX

Examples

Example 1: Minimizing Rosenbrock's Function with fminsearch

A classic test example for multidimensional minimization is the Rosenbrock banana function:

(

)2

2

f (x) = 100 x2 x1 + (1 x1)2.

The minimum is at (1,1) and has the value 0. The traditional starting point is (-1.2,1). The anonymous

function shown here defines the function and returns a function handle called banana:

banana = @(x)100*(x(2)-x(1)^2)^2+(1-x(1))^2;

Pass the function handle to fminsearch:

http://www.mathworks.com/help/optim/ug/fminsearch.html

3/5

11/2/2015

This produces

x =

1.0000

1.0000

fval =

8.1777e-010

exitflag =

1

This indicates that the minimizer was found at [1 1] with a value near zero.

Example 2

You can modify the first example by adding a parameter a to the second term of the banana function:

(

)2

2

f (x) = 100 x2 x1 + (a x1)2.

This changes the location of the minimum to the point [a,a^2]. To minimize this function for a specific value

of a, for example a = sqrt(2), create a one-argument anonymous function that captures the value of a.

a = sqrt(2);

banana = @(x)100*(x(2)-x(1)^2)^2+(a-x(1))^2;

Then the statement

optimset('TolX',1e-8))

seeks the minimum [sqrt(2), 2] to an accuracy higher than the default on x. The result is

x =

1.4142

2.0000

fval =

4.2065e-018

exitflag =

1

Limitations

fminsearch solves nondifferentiable problems and can often handle discontinuity, particularly if it does not

occur near the solution. fminsearch might only give local solutions.

fminsearch only minimizes over the real numbers, that is, x must only consist of real numbers and f(x) must

only return real numbers. When x has complex variables, they must be split into real and imaginary parts.

http://www.mathworks.com/help/optim/ug/fminsearch.html

4/5

11/2/2015

Notes

fminsearch is not the preferred choice for solving problems that are sums of squares, that is, of the form

(

)

2

2

2

2

x

Instead use the lsqnonlin function, which has been optimized for problems of this form.

More About

collapse

all

Algorithms

fminsearch uses the simplex search method of [1]. This is a direct search method that does not use

Algorithm.

fminsearch is generally less efficient than fminunc for problems of order greater than two. However,

when the problem is highly discontinuous, fminsearch might be more robust.

function_handle

Anonymous Functions

References

[1] Lagarias, J. C., J. A. Reeds, M. H. Wright, and P. E. Wright, "Convergence Properties of the NelderMead Simplex Method in Low Dimensions," SIAM Journal of Optimization, Vol. 9, Number 1, pp. 112147,

1998.

See Also

fminbnd | fminunc | optimset | optimtool

http://www.mathworks.com/help/optim/ug/fminsearch.html

5/5

- Chapter 13 HeraguUploaded byCharmaine Ann Tagorita
- MELDAS 64Uploaded byWeng LOk
- ffsqp-manual.pdfUploaded bytamann2004
- Advanced ADAMS/View Training GuideUploaded byliphaell
- BENSON Bi Criteria Linear ProgrammingUploaded byHằng Bùi
- Au 25279287Uploaded byAnonymous 7VPPkWS8O
- Optimal Load Dispatch Using Ant Lion OptimizationUploaded byAnonymous 7VPPkWS8O
- Filetype PDF Multiple Criteria Linear Programming Model for Portfolio SelectionUploaded byEmily
- Ship Confirm APIUploaded bymohun123
- 1-s2.0-S1359431108001294-mainUploaded byAmirhosein Rad
- Process Design and Optimization of Natural Gas.pdfUploaded bydigeca
- Lecture 10 Intensity Transformation Functions Using Matlab.pdfUploaded byscribbyscrib
- Optimization of EOQ Model with Limited Storage Capacity by Neutrosophic Geometric ProgrammingUploaded byAnonymous 0U9j6BLllB
- 496457.pdfUploaded byVape Nation
- Improving Factory Layout Under a Mixed Floor and Overhead MateriaUploaded byravi
- Paper Contest SharingUploaded byica
- A Real Life Case Study_SLAUploaded bySaissi Nadia
- How_to_use_SGAUploaded byAnonymous TJRX7C
- A_Novel_Methodology_for_Multi-Year_Planning_of_Large-Scale_Distribution_NetworksUploaded byzpopov
- prescriptive treatment optimization using a geneticUploaded byapi-346237712
- Scilab_ Functions and PlottingUploaded byNishat Ahmad
- Assessmt QnUploaded byedmund forgoat
- Presentation Newest 3Uploaded byAddison Juttie
- [2] science directUploaded bySravan Kumar
- 00932285Uploaded byBalakrushna Sahu
- chap8Uploaded byaybik
- r2doc TutorialUploaded byTrina Miller
- Math for MLUploaded byAriyanto
- Spring 2009 Midterm Opkst Mth601Uploaded byKhurram Nadeem
- lect15Uploaded byShohagh Shosagh

- Understand Membrane FiltrationUploaded byCristian Giovanny Gomez Olarte
- Activities on OktoberfestUploaded byCristian Giovanny Gomez Olarte
- An Analysis of Water Management in Brazilian Petroleum Refineries Using Rationalization TechniquesUploaded byCristian Giovanny Gomez Olarte
- Present PerfectUploaded byCristian Giovanny Gomez Olarte
- ReverseOsmosis CheEng.magazineUploaded byCristian Giovanny Gomez Olarte
- Exergy_analysis (1).pdfUploaded byCristian Giovanny Gomez Olarte
- Use of Multiple Extractions to Thermodynamically Balance the Humidification Dehumidification Desalination SystemUploaded byCristian Giovanny Gomez Olarte
- Ecuaciones de EstadoUploaded byFarscha
- Articulo 1 Oper 2Uploaded byCristian Giovanny Gomez Olarte
- 1-s2.0-S096085241000996X-mainUploaded byCristian Giovanny Gomez Olarte
- La visualización de los procesos de degradación locales en metales revestidos por medio de microscopía de barridoUploaded byCristian Giovanny Gomez Olarte

- 6 Algorithms NCITUploaded bySukhachandra Thakur Bhumihaar
- ch06 altUploaded byKumarVelivela
- Stachel-New Light on the Einstein-Hilbert Priority QuestionUploaded byjblarap
- Comp-CFL-10Uploaded byAjay Das
- 1.Algebra1 Mar2013 ANSWERUploaded byKen Alcuizar
- DerivationUploaded byKtk Zad
- PGD in Actuarial ScienceUploaded byKsm Hanif
- Stata MataUploaded byoscarhmg
- Cs 171 07a Games MiniMaxUploaded byIlias Yahia
- Test 2 (for Printing)Uploaded byChrysler Duaso
- Math 157 (Limit, Continuity & Differentiability) Exercise Set 1Uploaded byIamIN
- MELJUN CORTES Tesda Tr Training Regulations Bookkeeping Nc III Updated EditedUploaded byMELJUN CORTES, MBA,MPA
- Optimization With More Than One Variable IIUploaded bythrphys1940
- Seriality SynchronicityUploaded byokatarineta
- 4989Uploaded byKamariah Sahalihudin
- Student learning outcomes (SLO's and assessments)Uploaded byfadhali
- Combining Like Terms Practice PDFUploaded byPriyanka
- 2017_10_math_sample_paper_sa1_solved_05_ques.pdfUploaded byjay
- eben end of year reportUploaded byapi-192082146
- 9781782173298_Mastering_QlikView_Sample_ChapterUploaded byPackt Publishing
- Lrk FamousUploaded byDaphne Torremocha
- QuestionUploaded byHardik Goyal
- Biography Sir Isaac NewtonUploaded bySatbir Singh
- C4 Chapter 2.pdfUploaded byOmar Hashem
- Solutions to Sample Midterm QuestionsUploaded byJung Yoon Song
- CCC3_Ch_1_SV_1Uploaded byngyncloud
- Computer Science Fundamentals.pdfUploaded byNouman Safdar
- A Novel Matching Strategy for Finger Vein RecognitionUploaded bypalanisamyam123
- Trigonometric EqnUploaded byPrashantcool1999
- GD&T (MECHANICAL ENGINEERS)Uploaded bySuman Ramsagar