ParametricIPOPTMinimize[f,{x1,…},{x1i0,…},{{x1min,x1max},…},{g1,…},{{g1min,g1max},…},pars]
numerically searches for a local minimum of f in x, starting from x=x0, subject to constraints xj min≤xj≤xj max, gi min≤gi≤gi max, with parameters pars.
ParametricIPOPTMinimize
ParametricIPOPTMinimize[f,{x1,…},{x1i0,…},{{x1min,x1max},…},{g1,…},{{g1min,g1max},…},pars]
numerically searches for a local minimum of f in x, starting from x=x0, subject to constraints xj min≤xj≤xj max, gi min≤gi≤gi max, with parameters pars.
Details and Options
- To use ParametricIPOPTMinimize, you first need to load it using Needs["IPOPTLink`"].
- ParametricIPOPTMinimize gives results in terms of ParametricFunction objects.
- Parameters can be present in any of the arguments of ParametricIPOPTMinimize, including options. »
- ParametricIPOPTMinimize takes the same options and settings as IPOPTMinimize.
Examples
open all close allBasic Examples (2)
Find a local minimum of
in
with parameter
, starting from
:
Needs["IPOPTLink`"]Set up the parametric minimization problem and obtain a ParametricFunction object:
pf = ParametricIPOPTMinimize[x Cos[p x], {x}, {1}, {}, {}, {}, {p}]Since this problem has no constraints, the corresponding arguments were be replaced by {}.
Provide parameter values and obtain an instance of IPOPTData expression:
sol = pf[2]Extract the minimum value and position from the IPOPTData expression:
{IPOPTMinValue[sol], IPOPTArgMin[sol]}Minimize
, subject to
and
starting from
with parameters
.
Needs["IPOPTLink`"]Set up the parametric minimization problem and obtain a ParametricFunction object:
pf = ParametricIPOPTMinimize[p x ^ 2 + (y - 2) ^ 2, {x, y}, {2, 1}, {{-Infinity, Infinity}, {r, Infinity}}, {x ^ 2}, {{q, Infinity}}, {p, q, r}]Provide parameter values and obtain an instance of IPOPTData expression:
sol = pf[2, 1, 3]Extract the minimum value and position from the IPOPTData expression:
{IPOPTMinValue[sol], IPOPTArgMin[sol]}Options (3)
StepMonitor (1)
Steps taken by ParametricIPOPTMinimize in finding the minimum of a function:
Needs["IPOPTLink`"]pf = ParametricIPOPTMinimize[p x ^ 2 + (y - 2) ^ 2, {x, y}, {2., 1.}, {{-Infinity, Infinity}, {r, Infinity}}, {x ^ 2}, {{q, Infinity}}, {p, q, r}, StepMonitor :> Print[{"x" -> x, "y" -> y, "f" -> p x ^ 2 + (y - 2) ^ 2}]]sol = pf[2, 1, 3]IPOPTOptions (2)
Use IPOPTOptions to set options as described in the IPOPT library documentation options page.
Use "tol" to set the relative error tolerance to 10.^-p:
Needs["IPOPTLink`"]pf = ParametricIPOPTMinimize[ Cos[x + y] * Sin[x - y], {x, y}, {0, 1}, {{-1, 1}, {-1, 1}}, {}, {}, {p}, "IPOPTOptions" -> {"tol" -> 10. ^ -p}]sol = pf[4]Check that the relative error is below the goal of 10^-4:
{Abs[IPOPTMinValue[sol] - (-1)] / 1, Abs[IPOPTArgMin[sol] - {-Pi / 4, Pi / 4}] / (Pi / 4)}sol = pf[6]Check that the relative error is below the goal of 10^-6:
{Abs[IPOPTMinValue[sol] - (-1)] / 1, Abs[IPOPTArgMin[sol] - {-Pi / 4, Pi / 4}] / (Pi / 4)}Use "max_iter" to set the maximum number of iterations to 5:
Needs["IPOPTLink`"]pf = ParametricIPOPTMinimize[ Cos[x + y] * Sin[x - y], {x, y}, {0, 1}, {{-1, 1}, {-1, 1}}, {}, {}, {p}, "IPOPTOptions" -> {"max_iter" -> p}]The message below indicates that 5 iterations were insufficient to reach the default precision goal of 10^-8:
sol = pf[5]Setting the iteration limit to 10 gives a better result:
sol = pf[10]Check that the relative error is below the default goal of 10^-8:
{Abs[IPOPTMinValue[sol] - (-1)] / 1, Abs[IPOPTArgMin[sol] - {-Pi / 4, Pi / 4}] / (Pi / 4)}Applications (1)
Find a global minimum by solving a problem with different starting points using the initial point as a parameter in ParametricIPOPTMinimize.
Take a function with multiple local minima over a certain region:
f[x_, y_] := x Sin[10x] y ^ 2Cos[5y]Generate the desired amount of starting points:
ipts = RandomPoint[Disk[{-1, -1}], 1000];Plot the function with the initial points:
Show[plot = Plot3D[f[x, y], {x, y}∈Disk[{-1, -1}], PlotRange -> All, Mesh -> None], Graphics3D[Point[Map[Append[#, 0.25 + f@@#]&, ipts]]]]Load the package and set up the parametric problem:
Needs["IPOPTLink`"]pf = ParametricIPOPTMinimize[f[x, y], {x, y}, {x0, y0}, {{-2, 0}, {-2, 0}}, {(x + 1) ^ 2 + (y + 1) ^ 2}, {{0, 1}}, {x0, y0}]sols = pf@@@ipts;Extract the minimal values and their positions from all solution objects:
minvals = IPOPTMinValue /@ sols;
minpts = IPOPTArgMin /@ sols;Collect the solutions with the initial points and sort by the minimum value found to get the global minimum value and point:
pointData = Transpose[{minvals, minpts, ipts}];{gminval, gminpt, gipt} = First[Sort[pointData]]Group points by the minimum position. A lattice is used to account for small numerical differences:
latticePoint[{v_, p_, ip_}] := Round[1000 p] / 1000.;grouped = GatherBy[pointData, latticePoint];minValues = grouped[[All, 1, 1]];
minPoints = grouped[[All, 1, 2]];
groupedInit = grouped[[All, All, 3]];Show the initial points colored according to the minimum position. The local minima are pointed to by arrows. The global minimum is shown in red.
colors = Map[ColorData[58], Range[Length[grouped]]];Show[plot, Graphics3D[{MapThread[{#1, Arrow[{Append[#2, 4], Append[#2, #3]}]}&, {colors, minPoints, minValues}], MapThread[{#1, Point[Map[Append[#, 0.25 + f@@#]&, #2]]}&, {colors, groupedInit}], {PointSize[0.05], Red, Point[Append[gminpt, gminval]]}}]]Tech Notes
Related Guides
Text
Wolfram Research (2016), ParametricIPOPTMinimize, Wolfram Language function, https://reference.wolfram.com/language/IPOPTLink/ref/ParametricIPOPTMinimize.html.
CMS
Wolfram Language. 2016. "ParametricIPOPTMinimize." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/IPOPTLink/ref/ParametricIPOPTMinimize.html.
APA
Wolfram Language. (2016). ParametricIPOPTMinimize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/IPOPTLink/ref/ParametricIPOPTMinimize.html
BibTeX
@misc{reference.wolfram_2026_parametricipoptminimize, author="Wolfram Research", title="{ParametricIPOPTMinimize}", year="2016", howpublished="\url{https://reference.wolfram.com/language/IPOPTLink/ref/ParametricIPOPTMinimize.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_parametricipoptminimize, organization={Wolfram Research}, title={ParametricIPOPTMinimize}, year={2016}, url={https://reference.wolfram.com/language/IPOPTLink/ref/ParametricIPOPTMinimize.html}, note=[Accessed: 15-June-2026]}