在Python中找到多变量功能的最小值和最大值
我有一个功能,我想找到其最大值和最小值。我的功能是:
fuc = x * (4 - x * y)
我有一个x [-1,1]和y [2,10]的间隔。我想找到一种限制在此间隔的方法,以发现此功能的最大值和最小值。
I have a function and I would like to find its maximum and minimum values. My function is this:
fuc = x * (4 - x * y)
I have an interval for x [-1, 1] and y [2, 10]. I would like to find a way, limited to this interval, to discover the max and min values of this function.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 > :
输出:
感谢@Joni指出参数
bunds
应使用而不是简单的约束。Use
scipy.optimize.minimize
:Output:
Thank @joni for pointing out that the parameter
bounds
should be used instead of simple constraints.