(temoa-py3) (venv) C:\Users\ricca\PycharmProjects\TEMOApythonProject\temoa-energysystem>python temoa_model/ --config=temoa_model/config_sample
1 .db DD file(s) converted
-------------------------
Config file: C:\Users\ricca\PycharmProjects\TEMOApythonProject\temoa-energysystem\temoa_model\config_sample
Input file: C:\Users\ricca\PycharmProjects\TEMOApythonProject\temoa-energysystem\data_files\tuscany_res_BAU.dat
Output file: C:\Users\ricca\PycharmProjects\TEMOApythonProject\temoa-energysystem\data_files\tuscany_res_BAU.sqlite
Scenario: test_run
Spreadsheet output: True
Myopic scheme: False
Retain myopic databases: False
-------------------------
Citation output status: None
NEOS status: False
Version output status: False
-------------------------
Selected solver status: glpk
Solver LP write status: False
Pyomo LP write status: False
-------------------------
MGA slack value: None
MGA # of iterations: None
MGA weighting method: None
**NOTE: If you are performing MGA runs, navigate to the DAT file and make any modifications to the MGA sets before proceeding.
Please press enter to continue or Ctrl+C to quit.
Notice: Using the GLPK solver interface.
Continue Operation? [Press enter to continue or CTRL+C to abort]
[ 0.15] Reading data files.
[ ] Creating Temoa model instance.
Warning: ('Tuscany', 'DSL_VCS', 2000) specified as ExistingCapacity, but its LifetimeProcess parameter does not extend past the beginning of time_future. (i.e. useless parameter)
Lifetime: 20
First period: 2020
Warning: ('Tuscany', 'GSL_VCS', 2005) specified as ExistingCapacity, but its LifetimeProcess parameter does not extend past the beginning of time_future. (i.e. useless parameter)
Lifetime: 15
First period: 2020
Warning: ('Tuscany', 'LPG_VCS', 2005) has a specified Efficiency, but does not have any existing install base (ExistingCapacity).
ERROR: Rule failed when generating expression for constraint
ExistingCapacityConstraint with index ('Tuscany', 'DSL_VCS', 2000):
KeyError: "Index '('Tuscany', 'DSL_VCS', 2000)' is not valid for indexed
component 'V_Capacity'"
ERROR: Constructing component 'ExistingCapacityConstraint' from data=None
failed:
KeyError: "Index '('Tuscany', 'DSL_VCS', 2000)' is not valid for
indexed component 'V_Capacity'"
Exeception found in create_temoa_instance
"Index '('Tuscany', 'DSL_VCS', 2000)' is not valid for indexed component 'V_Capacity'""Index '('Tuscany', 'DSL_VCS', 2000)' is not valid for indexed component 'V_Capacity'"
Exiting Temoa ...
Traceback (most recent call last):
File "temoa_model\temoa_run.py", line 275, in createAndSolve
for k in self.solveWithoutMGA():
File "temoa_model\temoa_run.py", line 243, in solveWithoutMGA
for k in temoaInstance1.create_temoa_instance():
File "temoa_model\temoa_run.py", line 361, in create_temoa_instance
raise model_exc
File "temoa_model\temoa_run.py", line 349, in create_temoa_instance
self.instance = self.model.create_instance( modeldata )
File "C:\Users\ricca\anaconda3\envs\temoa-py3\lib\site-packages\pyomo\core\base\PyomoModel.py", line 723, in create_instance
profile_memory=profile_memory )
File "C:\Users\ricca\anaconda3\envs\temoa-py3\lib\site-packages\pyomo\core\base\PyomoModel.py", line 806, in load
profile_memory=profile_memory)
File "C:\Users\ricca\anaconda3\envs\temoa-py3\lib\site-packages\pyomo\core\base\PyomoModel.py", line 870, in _load_model_data
self._initialize_component(modeldata, namespaces, component_name, profile_memory)
File "C:\Users\ricca\anaconda3\envs\temoa-py3\lib\site-packages\pyomo\core\base\PyomoModel.py", line 925, in _initialize_component
declaration.construct(data)
File "C:\Users\ricca\anaconda3\envs\temoa-py3\lib\site-packages\pyomo\core\base\constraint.py", line 793, in construct
ndx)
File "C:\Users\ricca\anaconda3\envs\temoa-py3\lib\site-packages\pyomo\core\base\misc.py", line 57, in apply_indexed_rule
return rule(model, *index)
File "temoa_model\temoa_rules.py", line 228, in ExistingCapacity_Constraint
expr = M.V_Capacity[r, t, v] == M.ExistingCapacity[r, t, v]
File "C:\Users\ricca\anaconda3\envs\temoa-py3\lib\site-packages\pyomo\core\base\indexed_component.py", line 543, in __getitem__
index = self._validate_index(index)
File "C:\Users\ricca\anaconda3\envs\temoa-py3\lib\site-packages\pyomo\core\base\indexed_component.py", line 695, in _validate_index
KeyError: "Index '('Tuscany', 'DSL_VCS', 2000)' is not valid for indexed component 'V_Capacity'"
Hi Joe,
the error here seems to be related to the existing capacity constraint. Indeed I have imposed an existing capacity in some vintage years but due to lifetime parameter, this existing capacity needs to be replaced in the first future year. I have done it hoping that the program replaces this capacity in the simulation. I have also imposed an efficiency for all those years (I can see it thanks to SQLbrowser). However, the program gives me this error and I don't know why because I have understood that it is always related to a missing in the efficiency table that in this case seems to be to not exist. Can you help me? Maybe the program warnings need to be solved and bring errors?
I attach to you also the SQL and SQLite files.
Thank you.
(I have not calibrated with min/max activity anything due to the fact that I am not able to obtain any results using this strategy)