Varying Capex

73 views
Skip to first unread message

Avinasshini Seran

unread,
Nov 26, 2021, 12:51:03 PM11/26/21
to MUSE
Hi all,

As an additional detail to our intensive decarbonisation scenario, we wanted to subject the capital costs of dirty stoves to an additional tax (envisioned as a way the government would try to curb purchase of dirty stoves), compounding every five years. 

The way we have tried to implement this varying Capex in the Technodata file is by repeating rows of technologies under different years within the Time column and a different value of Capex each time. However, this is causing us to run into an error which doesn't occur without these repeated rows, keeping everything else the same.

Are we missing any other changes that need to be made?

Many thanks,
Mia and Avi

Alexander Kell

unread,
Nov 26, 2021, 12:54:28 PM11/26/21
to Avinasshini Seran, MUSE
Hi Both,

What’s the error? 

It may be that you are only adding new rows for the technologies that you want to change. 

If you add a new row for a new year, you have to do this for every single technology, even if their capex doesn’t change over time.

Best wishes,
Alex 

On 26 Nov 2021, at 17:51, Avinasshini Seran <avina...@gmail.com> wrote:

Hi all,
--
You received this message because you are subscribed to the Google Groups "MUSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to muse-model+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/muse-model/20d89f72-a815-4d86-9325-9c03d51267c2n%40googlegroups.com.

Mia McLachlan

unread,
Nov 27, 2021, 7:37:00 AM11/27/21
to MUSE
The model runs until 2040 and we get this error message:

Traceback (most recent call last):
  File "C:\Users\mrmia\anaconda3\envs\muse\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\mrmia\anaconda3\envs\muse\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\users\mrmia\muse\src\muse\__main__.py", line 54, in <module>
    muse_main()
  File "C:\Users\mrmia\anaconda3\envs\muse\lib\site-packages\click\core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\mrmia\anaconda3\envs\muse\lib\site-packages\click\core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "C:\Users\mrmia\anaconda3\envs\muse\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\mrmia\anaconda3\envs\muse\lib\site-packages\click\core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "c:\users\mrmia\muse\src\muse\__main__.py", line 51, in muse_main
    MCA.factory(settings).run()
  File "c:\users\mrmia\muse\src\muse\mca.py", line 319, in run
    _, new_market, self.sectors = self.find_equilibrium(new_market)
  File "c:\users\mrmia\muse\src\muse\mca.py", line 200, in find_equilibrium
    equilibrium=self.equilibrium,
  File "c:\users\mrmia\muse\src\muse\mca.py", line 494, in find_equilibrium
    market, equilibrium_sectors = single_year_iteration(market, sectors)
  File "c:\users\mrmia\muse\src\muse\mca.py", line 412, in single_year_iteration
    market[["supply", "consumption", "prices"]]  # type:ignore
  File "c:\users\mrmia\muse\src\muse\sectors\sector.py", line 233, in next
    technologies, market, time_period=time_period, current_year=current_year
  File "c:\users\mrmia\muse\src\muse\sectors\subsector.py", line 73, in invest
    technologies, market, time_period, current_year=current_year
  File "c:\users\mrmia\muse\src\muse\sectors\subsector.py", line 113, in aggregate_lp
    forecast=self.forecast,
  File "c:\users\mrmia\muse\src\muse\demand_share.py", line 104, in demand_share
    return function(agents, market, technologies, **keyword_args)
  File "c:\users\mrmia\muse\src\muse\registration.py", line 172, in decorated
    result = inner_decorated(*args, **kwargs)
  File "c:\users\mrmia\muse\src\muse\demand_share.py", line 260, in new_and_retro
    retro_capacity, demands.retrofit.sel(region=region), decommissioning
  File "c:\users\mrmia\muse\src\muse\demand_share.py", line 333, in _inner_split
    for key, capacity in assets.items()
  File "c:\users\mrmia\muse\src\muse\demand_share.py", line 333, in <dictcomp>
    for key, capacity in assets.items()
  File "C:\Users\mrmia\anaconda3\envs\muse\lib\site-packages\xarray\core\common.py", line 697, in groupby
    self, group, squeeze=squeeze, restore_coord_dims=restore_coord_dims
  File "C:\Users\mrmia\anaconda3\envs\muse\lib\site-packages\xarray\core\groupby.py", line 317, in __init__
    raise ValueError(f"{group.name} must not be empty")
ValueError: technology must not be empty

Best,
Avi and Mia

Alex Kell (Kell)

unread,
Nov 27, 2021, 7:49:47 AM11/27/21
to Mia McLachlan, MUSE
I would try adding a small capacity (e.g. 0.01) in the ExistingCapacity.csv file for the entries which are 0. 

Let us know if this problem continues after this.

Best wishes,
Alex

Mia McLachlan

unread,
Nov 27, 2021, 8:08:19 AM11/27/21
to MUSE
The model ran successful but this is the resulting capacity output (attached). It only seems to be considerering technology installed in 2020 and therefore cannot meet demand. There is a warning message: 'Check growth constraints for cook' which we haven't seen before. We're not sure how change growth constrains for cook.

Best wishes,
Avi and Mia

MCACapacity.csv

sara giarola

unread,
Nov 28, 2021, 3:11:32 AM11/28/21
to MUSE
The fact that it "seems to be considering technology installed in 2020" is quite generic to be commented. The capacity only retires after the end of the lifetime, but then it is added just to meet demand growth from previous period and the decommissioned capacity. Basically the capacity trend needs to be checked with the demand trend. If the model is not installing anymore than the problem is somewhere else, rather than the growth constraints. You can try and recollect what change you made before causing the error.

The "check growth" is the warning about not meeting demand of a service. The suggestions below about how to change the growth constraints work only if the problem is "stated correctly from the agents' perspectives, which I am not able to judge but I am inclined to assume if the model des not install capacity after 2020 (if true).
Re: growth constraints: if the model is so constrained that it cannot meet the demand. First thing I would try a sensitivity on the three growth parameters (MaxCapacityLimit, MaximumCapacityAddition, and MaximumCapacityGrowth) for the technologies service cook. In order to do so, you must check that the total capacity limit is higher than the max demand you are seving divided by the utilisation factor. The max capacity addition needs could be estimated as a fraction of the TotalCapacity addition: if you consider the period where the demand ncreases the most, the max addition * maxgrowth needs to be comparable with this demand. If you apply this number equally for all the technologies, this would quite relax your problem; you can decide to reduce it divinding it by the number of technologies available and here you may considerable reduce the cpacity you can install. For the MaximumGrowth you can start with 1 in a first instance meaning that the no further restricitions applies on top of the addition constraint, if smaller than you are restricting the addition further.
This process is a trial and error process, so make sure you try a wider range of alternatives until you see any sort of change, modifying each single parameter at a time.

Mia McLachlan

unread,
Nov 29, 2021, 4:35:00 AM11/29/21
to MUSE
Hi Sara, what is the different between a growth contraint on a technology, say, 'wood' and a growth constraint on a service, say, 'cook'?
So far I have had no joy carrying out a sensitivity analysis which makes me think that like you said the problem is somewhere else rather than the growth constraints.

sara giarola

unread,
Nov 29, 2021, 6:38:10 PM11/29/21
to MUSE
Growth constraints only apply to technologies. When MUSE raises a warning that the demand of a commodity is not met, it asks to check the growth on a certain commodity, but this means that the technologies producing the selected commodity have insufficient growth. In fact the insufficient capacity installed causes the demand to not be met.

When you add the "excluded_commodities", this serves to distinguish between commodities produced from those outside a sector. The convenience to exclude commodities from the market comes from the fact that they are not produced in the sector/s of study. For example, "wood" is not produced within the residential sector which you are modelling. "cook" is a service produced from the residential sector. For this reason, it is worth checking a growth constraint on the latter commodity only (which is produced in the sector of study), rahter than on the former (which is outside the studied system boundaries).
Reply all
Reply to author
Forward
0 new messages