Access variable costs or investment costs in the model result

Hi,

is it possible to access the variable costs or investment costs of the energy flows in the model results? This would simplify the analysis and evaluation of the model results and the calculation of different KPIs. For the creation of the optimisation model, this information is used, but I don’t know how to access it in the results.

BR Lukas

Hi Lukas,

I haven’t been developing actively within the last year but know that someone has added some functionality to add optimization parameters i.e. costs which is not prominent yet within the documentation.

You might have a look into the following file (choose the branch for your version): https://github.com/oemof/oemof/blob/dev/oemof/outputlib/processing.py

Something like “param_…” might help but I don’t guarantee. Good luck!

Cheers,
Cord

Hi,

I had a similar problem but I only needed the total costs, which can be accessed via:

energysystem.results[‘meta’] = outputlib.processing.meta_results(model)

Maybe that helps with your issue, too.

Best,
Lukas

Hi Lukas,

I wanted to calculate the “cost flows” for any flow where I have variable costs assigned. I could not extract the variable cost from the results, instead I used my excel sheet to extract variable costs for any flow together with outputlib.views.node(results, label) to calculate my results.

BR Lukas

Hi, and sorry for bumping this topic. But as I stumbled over a similar problem while modeling and finally found a solution I want to mention it in this thread.

The results of the solver do not contain the variable cost of your flows as these are (fix) parameter in your model (and not like variables → subject to optimization). At least I couldn’t access the parameter in the results. You need to refer to your model object to access the flows variable costs parameter. i.e.:

pp_wind = solph.Source(label="wind", outputs={b_el: solph.Flow(variable_costs=100)})
energysystem.add(pp_wind)
...
model = solph.Model(energysystem)
...
[b for a, b in model.flows.items() if a[0] == pp_wind][0].variable_costs

I hope this helps newbies in oemof modeling.

Cheers,
Till