Skip to content

[BUG] LOCE calculation is incorrect when more than one time slice is present #246

@ahawkes

Description

@ahawkes

Describe the bug

A clear and concise description of what the bug is, including error messages.

Email from Sara G: "to calculate the lcoe, all the costs are calculated and then allocated to the timeslices. Installation-related capital, fixed, and variable costs are therefore distributed over the timeslices. The costs are summed up and then divided over the energy produced by timeslice. When there is zero production in a timeslice, to avoid zero division in the algorithm, a very small epsilon amount is used. This can cause the big number in the output."

This is an error because a zero output in a time slice is a common situation. E.g. solar power at night.

The "big number" result should only happen when total output over the whole year approaches zero.

To Reproduce

Steps to reproduce the behavior. Attache any input file that might be required.

Add a technology with zero output in a time slice. There needs to be more than one time slice.

Expected behavior

A clear and concise description of what you expected to happen.

The correct approach here is (I think - please feel free to pursue workable alterantives):

  1. calculate variable cost (fuel, variable O&M, CO2, etc) in each time slice
  2. calculate non-variable parts of cost (installation and fixed costs) and distribute across time slices in proportion to output. Note that if a time slice has zero output, none of these costs will be distributed to that time slice.
  3. divide resulting value for each time slice by the output in that time slice (except where output is zero, to avoid a divide by zero error - if it's zero then set LCOE to zero for that time slice)

In the above we would also need to check what happens for cases where output is very very small but not zero - could be unstable.

Screenshots

If applicable, add screenshots to help explain your problem.

Context

Please, complete the following to better understand the system you are using to run MUSE.

  • Operative system Windows 10 (probably all)
  • MUSE version 1.1.0
  • Installation method (eg. pipx, pip, development mode): All
  • Python version (you can get this running python --version): n/a

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions