Scipy优化最小化
我正在尝试用4个变量解决优化问题。 我必须在scipy.optimize
中给出约束 约束是x [1]< x [2]< x [3]< x [4]
。 是否有任何方法可以在scipy.optimise
中解决此问题
I am trying to solve the optimization problem with 4 variables.
I have to give constraint in the scipy.optimize
,
the constraint is x[1] < x[2] < x[3] < x[4]
.
Is there any methodology to solve this problem in scipy.optimise
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以进行变量转换,例如
y [1] = x [1]
y [2] = x [2] -x [1] -x [1]
y [3] = x [3] -x [2]
y [4] = x [4] -x [3]
然后您可以使用
y [ 2]&gt; 0
,y [3]&gt; 0
,等等。You can do a variable transformation, for example,
y[1]=x[1]
y[2] = x[2]-x[1]
y[3] = x[3]-x[2]
y[4] = x[4]-x[3]
Then you can use constraints like
y[2] > 0
,y[3] > 0
, etc.