Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 Pyomo 模型,最终会像这样解决:
solver = SolverFactory('ipopt') results = solver.solve(model,tee=False)
在放弃之前,模型当前运行了 3000 次迭代。
在我看来,必须有一种方法可以使用这两行之一来限制迭代次数。我怎样才能做到这一点?
这行得通吗?
solver = SolverFactory('ipopt') solver.options['max_iter'] = 10 results = solver.solve(model,tee=False)