小编Ant*_*ouc的帖子

通过 pyomo 设置 iopt 选项

我在通过 pyomo 设置 iopt 选项时遇到问题。

对于某些选项,可以简单地使用

executable = os.getcwd()+'/Ipopt/Ipopt/build/bin/ipopt.exe'
opt = SolverFactory("ipopt", executable=executable,solver_io='nl')
opt.options['nlp_scaling_method'] = 'user-scaling'
Run Code Online (Sandbox Code Playgroud)

这很好用。如果我尝试设置“fixed_variable_treatment”选项,即:

opt.options['fixed_variable_treatment'] = 'make_parameter'
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

ERROR: "[base]\site-packages\pyomo\opt\base\solvers.py", 599, solve
        Solver (asl) returned non-zero return code (1)
ERROR: "[base]\site-packages\pyomo\opt\base\solvers.py", 604, solve
        Solver log:
        Unknown keyword "fixed_variable_treatment"
Run Code Online (Sandbox Code Playgroud)

我假设这是因为你无法通过 python 设置所有选项?

任何帮助或克服这个问题的方法将不胜感激。谢谢

python-3.x ipopt pyomo

5
推荐指数
1
解决办法
3186
查看次数

标签 统计

ipopt ×1

pyomo ×1

python-3.x ×1