PowerSimulations.jl icon indicating copy to clipboard operation
PowerSimulations.jl copied to clipboard

Bug in Compact UC

Open sourabhdalvi opened this issue 1 year ago • 1 comments

The Compact UC formulation with Linear $/MWh variable cost has a error in calculating the cost at no-load. This exists in both the current main and the psy4 re-factor of cost functions

https://github.com/NREL-Sienna/PowerSimulations.jl/blob/1d8e8574e472a607d98b71baec45c1a4aae7044f/src/devices_models/devices/thermal_generation.jl#L119C61-L119C78 on main no_load_cost(cost::PSY.VariableCost{Float64}, ::OnVariable, d::PSY.ThermalGen, ::AbstractThermalFormulation) = PSY.get_cost(cost) * PSY.get_active_power_limits(d).min * PSY.get_base_power(d) on psy4 no_load_cost(cost::PSY.LinearFunctionData, ::OnVariable, d::PSY.ThermalGen, ::AbstractThermalFormulation) = PSY.get_proportional_term(cost) * PSY.get_active_power_limits(d).min * PSY.get_base_power(d)

The cost is multiplied by device base rather than system base, I couldn't find a way to get system other than PSY.get_internal(d).units_info.base_value maybe there is another method to do this.

sourabhdalvi avatar Feb 28 '24 03:02 sourabhdalvi

The Compact UC formulation with Linear $/MWh variable cost has a error in calculating the cost at no-load. This exists in both the current main and the psy4 re-factor of cost functions

https://github.com/NREL-Sienna/PowerSimulations.jl/blob/1d8e8574e472a607d98b71baec45c1a4aae7044f/src/devices_models/devices/thermal_generation.jl#L119C61-L119C78 on main no_load_cost(cost::PSY.VariableCost{Float64}, ::OnVariable, d::PSY.ThermalGen, ::AbstractThermalFormulation) = PSY.get_cost(cost) * PSY.get_active_power_limits(d).min * PSY.get_base_power(d) on psy4 no_load_cost(cost::PSY.LinearFunctionData, ::OnVariable, d::PSY.ThermalGen, ::AbstractThermalFormulation) = PSY.get_proportional_term(cost) * PSY.get_active_power_limits(d).min * PSY.get_base_power(d)

The cost is multiplied by device base rather than system base, I couldn't find a way to get system other than PSY.get_internal(a).units_info.base_value maybe there is another method to do this.

We can apply this fix temporarily while we refactor the cost functions

jd-lara avatar Feb 28 '24 15:02 jd-lara

Can we get a intermediate fix for this for v.27.x ?

sourabhdalvi avatar Mar 18 '24 16:03 sourabhdalvi