[英]Python packages for multi-objective optimization using Successive Quadratic Programming (SQP)
Following are the characteristics of my problem:以下是我的问题的特点:
Objective function: two non-linear functions and one linear function目标函数:两个非线性函数和一个线性函数
Decision variable: two integer variables - can be relaxed as real (thus, problem can be INLP or NLP)决策变量:两个整数变量 - 可以放松为实数(因此,问题可以是 INLP 或 NLP)
Constraint: three (two bounding constraint and one relationship constraint)约束:三个(两个边界约束和一个关系约束)
Problem type: non-convex问题类型:非凸
Solution required: Global optimum所需解决方案:全局最优
Is there any python solvers to solve the above multi-objective optimization problem using Successive Quadratic Programming (SQP) or Interior Point Methods or other appropriate NLP solution methods?是否有任何 python 求解器可以使用连续二次规划 (SQP) 或内点方法或其他适当的 NLP 求解方法来解决上述多目标优化问题?
You could try one of these two:您可以尝试以下两种方法之一:
If unsure which one works best, you can model your problem with CasADi .如果不确定哪一个效果最好,您可以使用CasADi 为您的问题建模。 It has a convenient symbolic systems, and backend plugins for both of these solvers.
它有一个方便的符号系统,以及这两个求解器的后端插件。 Here is for instance a MINLP example with CasADi .
例如,这是一个带有 CasADi 的 MINLP 示例。
Here is a simple example of an MINLP solved with Python Gekko and the APOPT solver:下面是一个使用 Python Gekko 和 APPT 求解器求解的 MINLP 的简单示例:
from gekko import GEKKO
m = GEKKO() # create GEKKO model
# create binary variables
x1 = m.Var(integer=True,lb=0,ub=1)
x2 = m.Var(integer=True,lb=0,ub=1)
m.Minimize(4*x1**2-4*x2*x1**2+x2**2+x1**2-x1+1)
m.options.SOLVER = 1 # APOPT solver
m.solve()
print('x1: ' + str(x1.value[0]))
print('x2: ' + str(x2.value[0]))
Here is another example with equality and inequality constraints and integer variables (Hock Schittkowski #71 benchmark but with integer variables).这是另一个具有等式和不等式约束以及整数变量的示例(Hock Schittkowski #71 benchmark but with integer variables)。
from gekko import GEKKO
import numpy as np
m = GEKKO()
x = m.Array(m.Var,4,integer=True,value=1,lb=1,ub=5)
x1,x2,x3,x4 = x
# change initial values
x2.value = 5; x3.value = 5
m.Equation(x1*x2*x3*x4>=25)
m.Equation(x1**2+x2**2+x3**2+x4**2==40)
m.Minimize(x1*x4*(x1+x2+x3)+x3)
m.options.SOLVER=1
m.solve()
print('x: ', x)
print('Objective: ',m.options.OBJFCNVAL)
There is additional information in the Gekko documentation and on this page about MINLP Optimization . Gekko 文档和此页面上提供了有关MINLP 优化的其他信息。 The only requirement that it doesn't satisfy is to find a global optimum.
它不满足的唯一要求是找到全局最优值。 A multi-start method or a dedicated solver such as BONMIN or BARON are options.
可以选择多启动方法或专用求解器,例如 BONMIN 或 BARON。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.