我的目标是运行一个能源系统优化(LP),它在30个时间步内迭代地以最佳方式改变能源系统成本。我可以先改变一些参数,比如二氧化碳价格,然后改变整个模型的输入数据。现在,该模型在较低的二氧化碳价格下完美地完成了它的工作,但当我提高价格时,迭代在某个时间步失败。在每一个时间步,模型都会通过更改可变组件进行更新,然后进行求解(使用Gurobi)
这是我收到的输出:
Using license file /home/fr/fr_fr/fr_sb838/gurobi.lic
DONE: dispatch, year: 2020, objective: cost
DONE: pathway_expansion, year: 2020, objective: cost
DONE: pathway_expansion, year: 2021, objective: cost
DONE: pathway_expansion, year: 2022, objective: cost
DONE: pathway_expansion, year: 2023, objective: cost
DONE: pathway_expansion, year: 2024, objective: cost
DONE: pathway_expansion, year: 2025, objective: cost
DONE: pathway_expansion, year: 2026, objective: cost
DONE: pathway_expansion, year: 2027, objective: cost
Traceback (most recent call last):
File "/pfs/work7/workspace/scratch/fr_sb838-hiwi-0/simulation_2045/Master-Thesis-Robin-Krekeler/scripts/main.py", line 86, in <module>
system.pathway_transmission_linear_expansion(join(result_dir, 'pathway_expansion_cost'), scenario)
File "/pfs/work7/workspace/scratch/fr_sb838-hiwi-0/simulation_2045/Master-Thesis-Robin-Krekeler/scripts/optimisation.py", line 1028, in pathway_transmission_linear_expansion
result = OPT.solve(model, warmstart=True)
File "/home/fr/fr_fr/fr_sb838/.local/lib/python3.9/site-packages/pyomo/solvers/plugins/solvers/direct_solver.py", line 119, in solve
self._presolve(*args, **kwds)
File "/home/fr/fr_fr/fr_sb838/.local/lib/python3.9/site-packages/pyomo/solvers/plugins/solvers/direct_solver.py", line 62, in _presolve
self._set_instance(model, kwds)
File "/home/fr/fr_fr/fr_sb838/.local/lib/python3.9/site-packages/pyomo/solvers/plugins/solvers/gurobi_direct.py", line 251, in _set_instance
self._add_block(model)
File "/home/fr/fr_fr/fr_sb838/.local/lib/python3.9/site-packages/pyomo/solvers/plugins/solvers/gurobi_direct.py", line 268, in _add_block
DirectOrPersistentSolver._add_block(self, block)
File "/home/fr/fr_fr/fr_sb838/.local/lib/python3.9/site-packages/pyomo/solvers/plugins/solvers/direct_or_persistent_solver.py", line 237, in _add_block
self._set_objective(obj)
File "/home/fr/fr_fr/fr_sb838/.local/lib/python3.9/site-packages/pyomo/solvers/plugins/solvers/gurobi_direct.py", line 406, in _set_objective
gurobi_expr, referenced_vars = self._get_expr_from_pyomo_expr(obj.expr, self._max_obj_degree)
File "/home/fr/fr_fr/fr_sb838/.local/lib/python3.9/site-packages/pyomo/solvers/plugins/solvers/gurobi_direct.py", line 191, in _get_expr_from_pyomo_expr
repn = generate_standard_repn(expr, quadratic=True)
File "pyomo/repn/standard_repn.pyx", line 372, in pyomo.repn.standard_repn.generate_standard_repn
File "pyomo/repn/standard_repn.pyx", line 998, in pyomo.repn.standard_repn._generate_standard_repn
File "/home/fr/fr_fr/fr_sb838/.local/lib/python3.9/site-packages/pandas/core/generic.py", line 5465, in __getattr__
return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'is_constant'
我现在尝试了几种方法:
我正在使用pyomo6.0.1和pandas1.3.1(在一个带有Red Hat Enterprise Linux 8.2(Ootpa)的集群上)。我从Pyomo5.7.3和pandas 1.3.1(在一台装有Ubuntu20.04.1 LTS的机器上)收到了相同的错误。或者是pyomo5.6.9和pandas0.24.0的组合(在一台装有ubuntu18.04.5lts的机器上)
我非常感谢任何关于如何尝试解决问题的建议,提前谢谢大家
目前没有回答
相关问题 更多 >
编程相关推荐