Minimizing Functions with Equality Constraints in Mathematica 8

When using constraints with simple equality in Mathematica 8, minimization does not work. For example.

FindMinimum[{x^2 + y^2, y == 1}, {x, y}] 

works fine in Mathematica 6, but gives errors in version 8. Can anyone else confirm (or explain) this? It seems that fixing one of the parameters with the restriction confuses version 8. Entering xy==1 in order, also any inequality.

Any simple workaround? I tried changing Method , no luck. I would like to keep all the parameters in the parameter list, but keep some of them with a simple restriction instead of removing the parameter name from the list. I have working code in version 6 that no longer works in 8.

+7
source share
3 answers

Your syntax seems wrong:

 FindMinimum[{x^2 + y^2, y == 1}, {x, y}] 

which asks to start x with value y . It doesn't really matter to me.

Perhaps you are trying to do:

 Minimize[{x^2 + y^2, y == 1}, {x, y}] 
  Out: {1, {x -> 0, y -> 1}} 

Obviously your syntax is valid. Consider Minimize , as shown above, as a possible problem for your problem.

+2
source

Another workaround would be to use version 9.

 In[1]:= FindMinimum[{x^2 + y^2, y == 1}, {x, y}] Out[1]= {1., {x -> 0., y -> 1.}} 

What you show above is a bug that has been kindly fixed for a future version.

Daniel Lichtblow Wolfram Research

+3
source
 In[31]:= NMinimize[{x^2 + y^2, y == 1}, {x, y}] Out[31]= {1., {x -> -3.20865*10^-9, y -> 1.}} In[32]:= FindMinimum[{x^2 + y^2, 1 - 10^-10 <= y <= 1 + 10^-10}, {x, y}] Out[32]= {1., {x -> 0., y -> 1.}} 

However, I am wondering how to get mma to continue searching even if it encounters an infinite expression? Can anyone share their idea?

thanks ^ _ ^

+1
source

All Articles