@brynpickering Hi Bryn. I've now got things up and running w/ 0.6.3. I've implemented (separate from Calliope) the optimization method introduced by Poncelet (2017) to select representative days and their associated weights. I'd like to test these days out in the uk-calliope much like Stefan did in his similar paper. I've followed the directions outlined in the docs to load user-defined representative days. Some questions:
1) It's not clear to me how to set the timestep_weight values as an input parameter. My input file would ideally have columns of i) Timestep; Cluster Number; Weight.
2) It seems when I use the apply_clustering function (pointing to the file containing the representative days), all of the raw data is first read in during Calliope's first preprocessing step. This requires GBs worth of memory when only the data from the pre-selected representative days need be read in. Not the end of the world, just makes troubleshooting tedious.
Any tips would be helpful. Again, all I'm trying to do is take the output from the separate optimization model (i.e. clusters and their associated weights) and use that as an input to the Calliope-UK model. Thanks!
model._model_data
. Keep in mind that if timestep weights are updated and the sum of weights doesn't equal to the sum of all original timesteps, calculations further down the line will be erroneous.WSTR,MTKR:
techs:
hvdc_132:
constraints:
energy_cap_equals: 133183
one_way: true
distance: 0.52 # in hundreds of km
MTKR,WSTR:
techs:
hvdc_132_back:
constraints:
energy_cap_equals: 127868
one_way: true
distance: 1.13 # in hundreds of km
But i get the error:
"Index '('MTKR::hvdc_220_new:NBOR::power', Timestamp('2035-06-01 00:00:00'))' is not valid for indexed component 'carrier_prod'"
and I don't get it without "one_way: true", but I get one bidirectional line connecting the two regions with the second values inserted,
has anybody faced this problem before? Any hint will be super appreciated thanks everybody :)
Hi there,
I'm trying to set up a new model in Calliope to understand when it makes sense to connect two microgrids in a remote context. So far I'm just setting up a simple toy model with two nodes before starting to put in some more realistic data, and have been running into some errors.
I was wondering if anyone might have seen similar and be able to offer any advice?
$ ./run_single.sh
Attempting run...
Traceback (most recent call last):
File "/home/spf310/anaconda3/envs/calliope/bin/calliope", line 5, in <module>
from calliope.cli import cli
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/__init__.py", line 2, in <module>
from calliope.core import AttrDict, Model, read_netcdf, _logger, set_log_level
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/core/__init__.py", line 1, in <module>
from calliope.core.model import Model, read_netcdf
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/core/model.py", line 18, in <module>
from calliope.analysis import plotting, postprocess
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/analysis/plotting/__init__.py", line 1, in <module>
from calliope.analysis.plotting.plotting import plot_summary, ModelPlotMethods
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/analysis/plotting/plotting.py", line 21, in <module>
from calliope.analysis.plotting.transmission import plot_transmission
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/analysis/plotting/transmission.py", line 16, in <module>
from calliope.core.preprocess.util import vincenty
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/core/preprocess/__init__.py", line 2, in <module>
from calliope.core.preprocess.model_run import \
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/core/preprocess/model_run.py", line 24, in <module>
from calliope.core.preprocess import locations, sets, checks, constraint_sets, util
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/core/preprocess/locations.py", line 17, in <module>
from calliope.core.preprocess.checks import DEFAULTS, POSSIBLE_COSTS
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/core/preprocess/checks.py", line 31, in <module>
DEFAULTS = AttrDict.from_yaml(_defaults_files['defaults'])
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/core/attrdict.py", line 167, in from_yaml
loaded = cls(_yaml_load(src))
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/site-packages/calliope/core/attrdict.py", line 40, in _yaml_load
src = src.read()
File "/home/spf310/anaconda3/envs/calliope/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 3403: ordinal not in range(128)
Run finished
I've uploaded a minimal example of the model I've been running here https://drive.google.com/drive/folders/1EeHV9BNWP2Zvc6TeOOmBLq_p-m9ZFDeO?usp=sharing
Any advice much appreciated,
Sheridan
NBOR,MTKR:
techs:
hvdc_220_new:
constraints:
energy_cap_equals: 133183
one_way: true
MTKR,NBOR:
techs:
hvdc_220_new:
constraints:
energy_cap_equals: 127868
one_way: true
--save-plots
), then either use the Calliope plotting API or your own custom plotting functions in python interactively
carrier_prod(t) <= storage(t) * some_constant
). I can imagine that dependence being implementable.
Hi everyone. I'm currently learning to use Calliope to model renewable integration in some key areas in Portugal.
My question for the day is: after loading a "model" variable using calliope.read_netcdf(), where in that variable can I find the parent for each tech that was described in the .yaml?
Hi @FLomb. yes the system is overproducing electricity, but I am not sure from where/why. The electricity flows between nodes are higher than the electricity produced in the whole system. That is why the results are so weird to me. Let me introduce this toy model. I am actually using a reduced version of the urban scale model with only two nodes. The only differences are the following. First, as you suggested, I added a om_prod to the power_lines:
power_lines:
essentials:
name: 'Electrical power distribution'
color: '#6783E3'
parent: transmission
carrier: electricity
constraints:
energy_cap_max: 2000
energy_eff: 0.98
lifetime: 25
costs:
monetary:
interest_rate: 0.10
energy_cap_per_distance: 0.01
om_prod: -0.05 # the cost/profit are below the 10p/kWh electricity price of supply_grid_power
Second, I reduced the number and complexity of locations:
X1:
techs:
chp:
supply_grid_power:
supply_gas:
demand_electricity:
constraints.resource: file=demand_power.csv
available_area: 500
coordinates: {x: 2, y: 7}
X2:
techs:
supply_grid_power:
demand_electricity:
constraints.resource: file=demand_power.csv
coordinates: {x: 8, y: 7}
N1:
coordinates: {x: 5, y: 7}
links:
X1,X2:
techs:
power_lines:
This model does not produce meaningfull results. When I say meaningful, I mean that the energy produced match the demand and that I can identify the source/end of each flow in the results_carrier_con and results_carrier_prod outputs.
In this model, the power lines flows are equal to the energy_cap_max of the transmissions. The only explanation I find is that the same unit of electricity is continually being sold. Is it possible that in one period the same unit of electricity is traded as many times as posible between the two nodes until reaching the energy_cap_max of the power line? If yes, would not be an option to set an om_con in the power lines to solve the effect of this redundancy?