Function minimization with equality constraints in Mathematica 8

醉酒当歌 提交于 2019-12-05 04:52:09

Your syntax appears to be incorrect:

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

which asks to start x with a value of y. This doesn't make much sense to me.

Perhaps you are attempting to do:

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

Apparently your syntax is valid. Consider Minimize as shown above to be a possible work-around for your problem.

Daniel Lichtblau

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.}}

Which is to say, what you show above is a bug that has kindly fixed itself for a future release.

Daniel Lichtblau Wolfram Research

FreshApple
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 wonder how to force mma to keep on searching even if it encounters a infinite expression? Can anybody share your idea?

thanks ^_^

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!