Skip to content

Cashflow calculations if running only UC stage #27

Description

@purboday

When running only the UC stage using single_stage flag to true in the simulation settings file,

  • The annual cashflow values in the Finance struct are sometimes NaN because the variable cet_achieved_ratio, which is used to update the carbon tax for each simulation year in run_agent_simulation, is hardcoded to always use the ED (Economic Dispatch) output values. When the simulation is run in single-stage mode (i.e., when the single_stage flag is true), the ED output values may not exist, resulting in a NaN carbon cost. This NaN value then propagates into the annual cashflow calculation, causing the entire cashflow to become NaN. To fix this, the code should be updated so that cet_achieved_ratio uses the appropriate result variable depending on the value of the single_stage flag (i.e., using UC outputs in single-stage mode), ensuring that the carbon cost and annual cashflow are always calculated with valid data.
  • The current implementation of calculate_marginal_cost and calculate_carbon_emissions does not handle cases where the generator output exceeds the maximum breakpoint defined in the heat_rate_curve. If the output is greater than the largest value in the curve, the function does not assign a marginal cost, resulting in zeros for those time periods. This can lead to incorrect profit calculations for generators operating above their defined heat rate curve range. The function should be updated to use the last segment's heat rate for outputs above the maximum breakpoint, ensuring all outputs receive a valid marginal cost. Additionally, the code should check that the heat rate curve breakpoints are monotonically increasing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions