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.
When running only the UC stage using single_stage flag to true in the simulation settings file,
Financestruct are sometimesNaNbecause the variablecet_achieved_ratio, which is used to update the carbon tax for each simulation year inrun_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 aNaNcarbon cost. ThisNaNvalue then propagates into the annual cashflow calculation, causing the entire cashflow to becomeNaN. To fix this, the code should be updated so thatcet_achieved_ratiouses 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.calculate_marginal_costandcalculate_carbon_emissionsdoes not handle cases where the generator output exceeds the maximum breakpoint defined in theheat_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.