Hello dear support team!
I’m trying to build a model using GAMSpy environment.
e1=Equation(container=cep, name="e1", type="regular", domain=[tech_demand], description=" variable cost for demand technology",)
e1=Equation(container=cep, name="e1", type="regular", domain=[impact, tech_demand])
e1["var", impact, tech_demand]=COST[impact, tech_demand]==sign_generation* Sum([t,k,node],
GEN[tech_demand,carrier_demand , t,k,node ]
*ts_weights[k]*ts_deltas[t,k]*costs[tech_demand, node, year, "var", impact])*scale[':GEN']/scale[':COST']
Without defining the “e1” equation, the code doesn’t display an error. But the following error appears in debugging mode when I define the equation:
Traceback (most recent call last):
File “c:\Users\Lere\Codes\InvestmentPY\main.py”, line 41, in
cep_result = run_opt(ts_input_data, cep_data, optimizer, descriptor=“simple storage”, transmission=True, storage_type=“simple”, conversion=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “c:\Users\Lere\Codes\InvestmentPY\opt_problems\run_opt.py”, line 34, in run_opt
run_opt_main(ts_data, opt_data, config, optimizer)
File “c:\Users\Lere\Codes\InvestmentPY\opt_problems\run_opt.py”, line 158, in run_opt_main
e1[tech_demand]=COST[impact, tech_demand]==sign_generation* Sum([t,k,node],
~~^^^^^^^^^^^^^
File “C:\Users\Lere\anaconda3\Lib\site-packages\gamspy_symbols\equation.py”, line 215, in setitem
self.container._run(is_implicit=True)
File “C:\Users\Lere\anaconda3\Lib\site-packages\gamspy_container.py”, line 327, in _run
self._job = GamsJob(
^^^^^^^^
File “C:\Users\Lere\anaconda3\Lib\site-packages\gams\control\execution.py”, line 876, in init
file.write(source)
File “C:\Users\Lere\anaconda3\Lib\encodings\cp1252.py”, line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: ‘charmap’ codec can’t encode character ‘\u2212’ in position 276: character maps to
What could be the main cause ? Thank you!