Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs in KOW_generation_limits #313

Open
HunterTracer opened this issue Oct 5, 2023 · 0 comments
Open

Bugs in KOW_generation_limits #313

HunterTracer opened this issue Oct 5, 2023 · 0 comments

Comments

@HunterTracer
Copy link

HunterTracer commented Oct 5, 2023

In line 305-306 in model_library/unit_commitment/generation_limits.py, the coef is set as max((Pmax - SD - SD_time_limit * RD) - (Pmax - SU - (SU_time_limit+1) * RU), 0). However, I think there is a mistake in its order and it should be reversed. The correct one should be max((Pmax - SU - (SU_time_limit + 1) * RU) - (Pmax - SD - SD_time_limit * RD), 0).

Consider that UnitOn(t) = 1, UnitStart(t - SU_time_limit - 1) = 1 and meanwhile UnitStop(t + 1 + SD_time_limit) = 1, then the maximum power of Pg(t) should be min((SU + (SU_time_limit+1) * RU), (SD + SD_time_limit * RD)). However, in the current program, if UnitOn(t) = 1, UnitStart(t - SU_time_limit - 1) = 1 and meanwhile UnitStop(t + 1 + SD_time_limit) = 1 and (SU + (SU_time_limit+1) * RU) > (SD + SD_time_limit * RD), then the upper bound will be (SD + SD_time_limit * RD) - ((SU + (SU_time_limit+1) * RU) - (SD + SD_time_limit * RD)) instead of the true value (SD + SD_time_limit * RD), which is invalid.

I also check the generation limits in KOW_production_costs_super_tight in production_cost.py and find the order is right. Since we already subtract sd_step[SD_time_limit]*m.UnitStop[g,t+1+SD_time_limit] in line 276, then it is correct to subtract max(su_step[j]-sd_step[SD_time_limit],0)*m.UnitStart[g,t-j] in line 280. I also find that at first the order in KOW_production_costs_super_tight was also wrong and get fixed in d21d5d7. Unfortunately, it seems that the bugs in generation_limits.py are not considered in this code.

Is it a bug? I already submit my code at #312. Many thanks! @bknueven

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant