pyOpt嵌套优化
pyOpt nested optimization
是否可以在pyOpt中进行嵌套优化?
例如:
- 设
x
为设计变量
- 让
f()
一个objective函数
- 让
max(h(x))< C
成为一个约束,h()
一个函数,已知常量C
,max(h(x))
通过另一个优化实例 找到
pyOpt 中的 "outer" objfunc 示例:
def __objfunc(x,**kwargs):
f=x**2
g=[0.0]
g[0]=maxValueViaOptimization(x)-10 #inequality constraint
fail=0
return f,g,fail
maxValueViaOptimization()
通过 pyOpt 执行单独优化的函数(找到 h(x)
的最大值),returns float
正是@Erwin Kalvelagen 所说的。
If the inner problem does not alter any of the outer variables (eg x) then >you may be able just calling a function and use some derivative free solver. >– @ErwinKalvelagen Jan 20 at 14:34
是否可以在pyOpt中进行嵌套优化?
例如:
- 设
x
为设计变量 - 让
f()
一个objective函数 - 让
max(h(x))< C
成为一个约束,h()
一个函数,已知常量C
,max(h(x))
通过另一个优化实例 找到
pyOpt 中的 "outer" objfunc 示例:
def __objfunc(x,**kwargs):
f=x**2
g=[0.0]
g[0]=maxValueViaOptimization(x)-10 #inequality constraint
fail=0
return f,g,fail
maxValueViaOptimization()
通过 pyOpt 执行单独优化的函数(找到 h(x)
的最大值),returns float
正是@Erwin Kalvelagen 所说的。
If the inner problem does not alter any of the outer variables (eg x) then >you may be able just calling a function and use some derivative free solver. >– @ErwinKalvelagen Jan 20 at 14:34