Rosenbrock Function

Author

Eric W. Weisstein
April 23, 2024

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Optimization/RosenbrockFunction.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/RosenbrockFunction.html.

©2024 Wolfram Research, Inc. except for portions noted otherwise

Problem

<<Optimization`UnconstrainedProblems`

p=GetFindMinimumProblem[Rosenbrock]

Plots

Along axes

With[{style=Directive[Black,Opacity[1],FontFamily->"Times"]},GraphicsRow[{With[{y=1},Plot[(1-x)^2+100(y-x^2)^2,{x,-1.5,1.5},PlotStyle->Red,AxesLabel->Thread@Style[{y,f[x,y]},14],PlotRange->{-1,101},BaseStyle->style,LabelStyle->style]],
With[{x=1},Plot[(1-x)^2+100(y-x^2)^2,{y,.5,1.5},PlotStyle->Red,AxesLabel->Thread@Style[{y,f[x,y]},14],BaseStyle->style,LabelStyle->style]]
}]]

3D

With[{style=Directive[Black,Opacity[1],FontFamily->"Times"]},GraphicsRow[{
Plot3D[(1-x)^2+100(y-x^2)^2,{x,-2,2},{y,-2,2},Mesh->False,ClippingStyle->None,AxesLabel->{x,y},BaseStyle->style],
ContourPlot[(1-x)^2+100(y-x^2)^2,{x,-3,3},{y,-3,3},ColorFunction->"AvocadoColors",ScalingFunctions->"Log10",PlotLegends->BarLegend[Automatic,Ticks->Table[{If[t<0,10.,10]^t,Superscript["10",t]},{t,-1,4}],LegendMarkerSize->160,BaseStyle->style],FrameLabel->{x,y},BaseStyle->style,LabelStyle->style]
},Alignment->Center,ImageSize->Large,Spacings->-20]]

DensityPlot[(1-x)^2+100 (y-x^2)^2,{x,-3,3},{y,-3,3},ColorFunction->"AvocadoColors",ScalingFunctions->"Log10",PlotLegends->BarLegend[Automatic,LegendMarkerSize->360]]

Solution

Minimize[(1-x)^2+100(y-x^2)^2,{x,y}]

FindMinimumPlot[p, Method->{"Newton", "StepControl"->"TrustRegion"}]

FindMinimumPlot[p, Method->"Newton"]

FindMinimum@@Take[List@@p,2]

Minimize[(1-x)^2+1005(y-x^2)^2,{x,y}]