Skip to content

Allow energy not served to be forbidden rather than penalised - #169

Merged
erikfilias merged 1 commit into
masterfrom
feature/zero-ens-option
Aug 30, 2026
Merged

Allow energy not served to be forbidden rather than penalised#169
erikfilias merged 1 commit into
masterfrom
feature/zero-ens-option

Conversation

@erikfilias

@erikfilias erikfilias commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Change

Adds an IndHardZeroENS option that fixes vENS at zero, so unserved energy is forbidden rather
than penalised.

No existing case needs to change. The column is optional: par.get('pIndHardZeroENS', 0)
defaults it to off when absent, oT_Data_Option is declared UNPIVOT_SINGLE_ROW in the schema and
so carries no required-column list, and none of the ten shipped cases has the column. The full test
suite passes on this branch, including all 27 solve cases, every one of them reading an option table
written before this option existed.

Rationale

vENS is a free non-negative variable penalised at pENSCost, with no upper bound beyond demand.
A system that cannot meet its demand therefore still returns a solution, and whether it was adequate
has to be judged afterwards by inspecting vENS. That works for costing, but it cannot answer
whether a configuration is adequate at all: a small non-zero value and a genuinely infeasible system
look alike until someone reads the output and picks a threshold.

Fixing the variable at zero asks the question directly. The model is then infeasible exactly when
the demand cannot be served, which is what an adequacy screen wants to establish, and the answer
comes from the solver rather than from a post-hoc rule.

Placement

In the option table with the other modelling indicators rather than in the environment, since it
changes the feasible set rather than how the solver is driven.

If it would be more useful to toggle this per run without touching case data — an adequacy screen
over many cases is the obvious use — a --zero-ens flag in the manner of --threads could be added
on top, with the option table remaining the default. Happy to add that if preferred.

Effect

None by default. +11 across the configuration and variable set-up. Full test suite passes,
including the solve cases.

Energy not served is a free variable penalised at pENSCost, so a system that
cannot meet its demand still returns a solution and has to be screened after the
fact on the value of vENS. That is fine for costing, but it cannot answer
whether a configuration is adequate at all: a small non-zero value and a
genuinely infeasible system look the same until someone inspects the output.

IndHardZeroENS fixes the variable at zero, so the model is infeasible exactly
when the demand cannot be served. The option sits in the option table with the
other modelling indicators rather than in the environment, and defaults to zero
when absent, so cases written before it exists load unchanged.

A --zero-ens flag turns it on for a single run without touching case data,
following --threads: the flag sets OTEPES_ZERO_ENS and the variable wins over
the option table. Screening many cases for adequacy otherwise means editing each
one's option file.
@erikfilias
erikfilias force-pushed the feature/zero-ens-option branch from 1db58c3 to e3305e3 Compare August 30, 2026 12:47
@erikfilias
erikfilias merged commit 363b61c into master Aug 30, 2026
15 checks passed
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

Successfully merging this pull request may close these issues.

1 participant