## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Bryn Pickering
@brynpickering
@luzgui Creating HTMLs of large problems will take a very long time, it's just the price paid for interactive plots. I would suggest not producing the HTML files automatically (i.e., no use of --save-plots), then either use the Calliope plotting API or your own custom plotting functions in python interactively
Alessandro-Barbieri95
@Alessandro-Barbieri95
Goodmorning, I'm Alessandro, a master thesis student at Politecnico di Milano.
I'm working on a water-energy-nexus model, integrating hydrological balance in hydroelectric technology implementation.
My focus is the Zambezi River basin, in which there are 4 cascade reservoirs. It means that the upstream turbined flows go into the downstream reservoirs.
I modeled the system describing the reservoir as storage tech, the inflow as supply tech and a conversion plus tech to model the electricity produced by the hydropower plant and
to track the turbined flow as a cascade inflow to the downstream reservoir (scheme attached).
The unit of measure of the storage has to be considered in m^3 of water that are converted in kWh through an energy efficiency in the conversion plus tech.
A more precise description wants the hydraulic head varying with the storage water level, it means that the energy efficiency should be a function of the storage variable.
Is it feasible to implement this dependance?
Bryn Pickering
@brynpickering
@Alessandro-Barbieri95 nice - certainly the kind of description hydropower systems should have! As to the question of hydraulic head, there is no way I can think of to link electricity generation efficiency with quantity of stored energy in a linear model (it would require multiplication of decision variables). But I also wouldn't expect the difference in hydraulic head to have such a large impact on output efficiency. Instead, it may noticeably impact the maximum power output (carrier_prod(t) <= storage(t) * some_constant). I can imagine that dependence being implementable.
Francesco Lombardi
@FLomb
@Alessandro-Barbieri95 I confirm what @brynpickering was suggesting, you cannot link the energy storage level with an efficiency without going non-linear. I have similar problems modelling thermal storage and power-to-heat conversion techs. There are ways you can escape that, and we did it for non-linear thermal modelling, but probably not ones that would make you happy and your problem easy to solve. And I also agree that the efficiency shouldn't be particularly pivotal here compared to other things, such as the maximum power output.
Rodrigo Amaro e Silva
@ramaroesilva

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?

Thanks
Bryn Pickering
@brynpickering
Hey @ramaroesilva, glad to hear you're getting stuck in. You want model.inputs.inheritance
Rodrigo Amaro e Silva
@ramaroesilva
Thanks @brynpickering!
My colleague Guilherme Luz (@luzgui) and I will be at the openmod workshop next week. Maybe we'll see each other there :)
Bryn Pickering
@brynpickering
Hi everyone, just to let you know that version 0.6.5 is now live! It's a minor release which mostly cleans up existing functionality, but with a couple of backwards-incompatible changes. If you're interested, check out our short release post. Happy modelling :)
jvValdes
@jvValdes
Hi everyone, I am Javier Valdes from TH Deggendorf. I just started using Calliope 0.6.5 -amazing tool- for modelling microgrids in a number of locations.
So far we are exploring the urban_scale model. We want to specify revenues for each node when the energy generated in that node is transmitted and consumed in a different node. I am not sure if this is the right place to ask this question, but here it goes:
I realized that for the transmission lines the allowed costs include om_pro. Which can represent the cost of consuming energy from one of the transmission links. If I am getting it right, these costs are associated to the end point, the location where the carrier is consumed. I thought that setting om_con as negative in the transmission line would represent the associated beneffit of sending the energy in the node where the it is generated. Nevertheless, the option om_con is not defined for the transmission tech. There's probably a reason for that, and something wrong with my logic.
Do you know what would be the best option to model this situation without using om_con for the transmission lines?
Francesco Lombardi
@FLomb
Hi @jvValdes , I guess that for transmission techs it would be a bit weird to have both om_con and om_prod, because of the bi-directionality of the flows. Anyway, nothing should prevent you from setting a negative om_prod for any technology (in the urban_scale example PV has a negative om_prod, for instance). This might work well enough for your case, 'cause basically you would have a revenue for each time an energy flow is transmitted from one location to another. You just have to take care when post-processing the results and be sure about which node is earning the revenue (if that is important to you). Let me know if that works
jvValdes
@jvValdes
Hi Francesco,
Thanks for your help! Yes, I am mainly interested in the energy flows between locations and the lcoe for each location. I followed your advice and modified the model including a negative cost for the om_prod in the transmission lines below the cost of the national_grid. To double check I also do the same in the urban_scale model including in transmission lines: om_prod = -0.099, which is slightly bellow the cost of the national grid. Is that what you meant?
I run the models and exported the results. When I examine the results_carrier_con for the power grid, the results are extraordinary high and negative for all locations, same for results_carrier_prod. Actually the transmission lines are used until the energy_cap_max is reached. I am not sure if that behaviour is normal. I expected to obtain (lower) negative values only for the locations where the carrier is consumed in the file results_carrier_con and (lower) positive values for the Locations where the carrier is produced in the results_carrier_prod. Finally, when I check the results_cost_var file the negative costs are also incurred in all Locations. I am fairly new to Calliope and I am not understanding these results. Do they make sense to you? Thanks!
Francesco Lombardi
@FLomb
Hi @jvValdes , it's hard to tell not knowing precisely the structure of your model, but clearly if it doesn't make sense to you then it is probably wrong. From what you say (e.g. "results are extraordinarily high") it seems that setting a revenue for transmission leads to a weird and unwanted behaviour. This could be due to the fact that overproducing electricity with some technology for the sake of trading it leads to revenues that exceed the costs of production; could that be?
jvValdes
@jvValdes

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
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}
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?

Francesco Lombardi
@FLomb
Ok, thanks for sharing some more details. First of all, even though this is not related to your main problem, I think you don't need anymore a supply_gas and
..and a node N1 if the heat pipes and the heat demand are removes
removed*
but maybe you were only sharing part of the techs? anyway, it seems plausible to me that what is happening is that the model is installing extra capacity to overproduce as much as possible and earn (i.e. mimimise total costs) from it. Hence you see flows across transmission lines that equal max transmission capacity in every time step because that is precisely what is happening: always overproducing as much as possible (i.e. as much as transmission cap allows).
Francesco Lombardi
@FLomb
so clearly my suggestion of setting a negative om_prod for transmission techs has not been very smart. And though it might maybe work better in a case in which supply capacity is more constrained, still I am realising that the model would try to move energy from one node to the other even before self-consuming (i.e. one node satisfies the demand of the other, instead of its own, to earn money), which is not what you wanted, I guess
to summarise, I think you would like to have trading with revenue only "after" self consumption, right? something like the "export" feature of PV in the example urban model, but between nodes instead of generic?
jvValdes
@jvValdes
Hi, yes, sorry. You are right, I did not used the N1. But I think I need to maintain supply_gas in X1 for running the chp.
jvValdes
@jvValdes
You are right, the model will always overproduce a small quantity of energy and trade it between nodes as many times as possible until the maximum capacity is reached. Please note that as the system tries to minimize costs, the quantity of energy overproduced is small compared to the quantity of energy traded. The only penalisation both nodes have is the energy_eff of the transmission lines set to 0.98.
jvValdes
@jvValdes
I would like to have a trade between nodes with revenues, that means that some nodes will compute a cost and other nodes a gain. The export feature is similar, but I am not sure if it would be a solution. With such kind of feature I would not be able to identfy the source of the flows and the required transmission capacities between nodes. Which is one of the features that makes Calliope so attractive. Moreover, it may be necessary to define an extra import feature?
hardcorejesus
@hardcorejesus
Hello everyone, student here writing my master's thesis. I am interested in demand response management using Calliope. Is it possible since demand is used as a fixed input?
Rodrigo Amaro e Silva
@ramaroesilva
@brynpickering, about a past error message reported by NicolĂ˛ Stevanato (@Stevogallo) regarding a one_way transmission technology
in his case "Index '('MTKR::hvdc_220_new:NBOR::power', Timestamp('2035-06-01 00:00:00'))' is not valid for indexed component 'carrier_prod'"
@luzgui and I tried out this one_way solution ourselves just recently, and in our case we got that error whenever we defined an om_prod or an om_con for the transmission tech
our interpretation is that the "one_way" makes the con and prod inexistent for the "blocked" direction and thus calliope cannot apply the costs (which are assumed for both directions)
Bryn Pickering
@brynpickering
thanks for the update @ramaroesilva, looks like a bug to create an issue from! I've done so here: calliope-project/calliope#316
Rodrigo Amaro e Silva
@ramaroesilva
Hi everyone. This review work might be of interest for the calliope community:
https://www.sciencedirect.com/science/article/pii/S1364032120302082
Rodrigo Amaro e Silva
@ramaroesilva
Question for the day: is there any configuration on Calliope where we can define that once a generator is turned on, it can only be turned off after N timesteps of operation?
Francesco Lombardi
@FLomb
hey Rodrigo, I think this is a feature that has been requested a couple of times already, and which is currently - unless I've overlooked some of the recent changes - not available
or perhaps not precisely, because what was asked before was a general constraint that may allow setting a number of "operating hours" for a given plant over the year, not a "minimum number of operating hours after switch on"
what you ask is something one could add to the MILP formulation, because clearly it requires having an integer description of generators to be able to figure out which one is on and which one is off
Rodrigo Amaro e Silva
@ramaroesilva
Thanks for the feedback Francesco ;)
Rodrigo Amaro e Silva
@ramaroesilva

Hi everyone.

Tried to create today a new calliope 0.6.5 environment and when everything was installed, running my code gave the following error:

"ImportError: pyutilib.enum has been removed.

Python 3 now has an enum implementation in the standard library (also available for older Python versions as the third-party enum34 PyPI package) that supersedes this library."

Rodrigo Amaro e Silva
@ramaroesilva
With the help of @luzgui, we found out that this happens for version 6.0.0 of pyutilib.
So I created my calliope environment specifically with pyutilib=5.8.0
Bryn Pickering
@brynpickering
Yeah, seems this is a dependency issue that has been flagged here calliope-project/calliope#318
We'll probably push a fixed minor release soon, to deal with this. For now, as you say @ramaroesilva, you can install a working environment with: conda create -n calliope -c conda-forge calliope=0.6.5 pyutilib=5.8.0
Rodrigo Amaro e Silva
@ramaroesilva
Thanks Bryn! Btw, I promise I'll start looking first at Calliope's issues to avoid redudant posts here O:)
Bryn Pickering
@brynpickering
haha, it wasn't my aim to guilt trip you into doing so ;)
It seems that some change in dependencies has led to everyone having this installation problem at the same time
Rodrigo Amaro e Silva
@ramaroesilva