求解混合互补模型时出错 [英] Error when solving mixed complementarity model

查看:47
本文介绍了求解混合互补模型时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直接使用 PATH 求解器,我无法解决下面提出的问题.最初的问题来自 https://prod.sandia.gov/techlib-noauth/access-control.cgi/2015/155584.pdf ,似乎声称问题已解决.使用非线性地层可以解决.

Using the PATH solver directly, i fail to solve the problem presented below. The original problem was sourced from https://prod.sandia.gov/techlib-noauth/access-control.cgi/2015/155584.pdf , which seems to claim the problem was solved. Using a nonlinear formation it is possible to solve.

这是pyomo 还是PATH 中的版本问题,很难说.我正在运行 pyomo 5.5.x 和来自 http://pages.cs 的 pathampl.wisc.edu/~ferris/path.html

Whether this is a versioning issues in pyomo or PATH, it is difficult to tell. I am running pyomo 5.5.x and pathampl sourced from http://pages.cs.wisc.edu/~ferris/path.html

from pyomo.environ import *
from pyomo.mpec import *
model = ConcreteModel()
model.x1 = Var()
model.x2 = Var()
model.x3 = Var()
model.f1 = Complementarity(expr=complements(model.x1 >= 0,model.x1 + 2*model.x2 + 3*model.x3 >= 1))
model.f2 = Complementarity(expr=complements(model.x2 >= 0,model.x2 - model.x3 >= -1))

model.f3 = Complementarity(expr=complements(model.x3 >= 0,model.x1 + model.x2 >= -1))

from pyomo.opt import SolverFactory

opt = SolverFactory("pathampl")

results = opt.solve(model, load_solutions=True, tee=True)
#sends results to stdout
results.write()

对应的错误信息:

 *** EXIT - infeasible.

Major Iterations. . . . 0
Minor Iterations. . . . 0
Restarts. . . . . . . . 0
Crash Iterations. . . . 0
Gradient Steps. . . . . 0
Function Evaluations. . 0
Gradient Evaluations. . 0
Basis Time. . . . . . . 0.000000
Total Time. . . . . . . 0.000000
Residual. . . . . . . . inf
WARNING: Loading a SolverResults object with a warning status into
    model=unknown;
        message from solver=Path 4.7.01\x3a Infeasible.; 0 iterations (0 for
        crash); 0 pivots.; 0 function, 0 gradient evaluations.
# ==========================================================
# = Solver Results                                         =
# ==========================================================
# ----------------------------------------------------------
#   Problem Information
# ----------------------------------------------------------
Problem: 
- Lower bound: -inf
  Upper bound: inf
  Number of objectives: 1
  Number of constraints: 0
  Number of variables: 6
  Sense: unknown
# ----------------------------------------------------------
#   Solver Information
# ----------------------------------------------------------
Solver: 
- Status: warning
  Message: Path 4.7.01\x3a Infeasible.; 0 iterations (0 for crash); 0 pivots.; 0 function, 0 gradient evaluations.
  Termination condition: infeasible
  Id: 201
  Error rc: 0
  Time: 0.37000012397766113
# ----------------------------------------------------------
#   Solution Information
# ----------------------------------------------------------
Solution: 
- number of solutions: 0
  number of solutions displayed: 0

Displaying Solution

推荐答案

根据上面 Bethany Nicholson 的帖子,使用 PATH 4.7.04 将解决问题.由于某种原因,4.7.01 返回错误.

As per Bethany Nicholson's post above, using PATH 4.7.04 will solve the problem. For some reason 4.7.01 returns an error.

齐晨的回复会解决问题,但没有使用PATH.

Qi Chen's reply will solve the problem, but does not use PATH.

这篇关于求解混合互补模型时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆