Group Abstract Group Abstract

Message Boards Message Boards

2
|
2.7K Views
|
0 Replies
|
2 Total Likes
View groups...
Share
Share this post:

ParametricIPOPTMinimize, IPOPTMinimize and FindMinimum.

ParametricIPOPTMinimize is a nice feature which allows you to set up an optimization with parameters and then optimize many times with different values of the parameters. Curiously, it appears to run faster than IPOPTMinimize, even with only one call, and faster than FindMinimum, when using Method -> "IPOPT"

In[9]:= AbsoluteTiming @ 
 FindMinimum[{Cos[x + y]*Sin[x - y], 0 <= x <= 3, 0 <= y <= 3, 
   0 <= x^2 + y^2 <= 4}, {{x, 1}, {y, 1}}, Method -> "IPOPT"]

Out[9]= {0.0316208, {-0.780895, {x -> 1.89249, y -> 0.646894}}}

In[3]:= Needs["IPOPTLink`"]

In[10]:= AbsoluteTiming[
 sol = IPOPTMinimize[
   Cos[x + y]*Sin[x - y], {x, y}, {1, 
    1}, {{0, 3}, {0, 3}}, {x^2 + y^2}, {{0, 4}}];
 {IPOPTMinValue[sol], IPOPTArgMin[sol]}
 ]

Out[10]= {0.0257932, {-0.780896, {1.89249, 0.646894}}}

In[11]:= AbsoluteTiming[
 pf = ParametricIPOPTMinimize[
   Cos[x + y]*Sin[x - y], {x, y}, {p1, 
    p2}, {{0, 3}, {0, 3}}, {x^2 + y^2}, {{0, 4}}, {p1, p2}];
 sol = pf[1, 1];
 {IPOPTMinValue[sol], IPOPTArgMin[sol]}
 ]

Out[11]= {0.00679227, {-0.780896, {1.89249, 0.646894}}}
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard