feat(utbygging): build out solution T in modules and add S48-S54

utbyggingsplan_trinnvis follows chapter 17.1: the grid balance of the
first stage, the payment condition for a module's power plants, S49,
and in T-K the two stocks of chips and the queue for replacements.
tidslinje gives MW IT in operation per type of power (S50). S48-S54
are pure functions in ligninger.py, and Inndata carries the new
quantities, the scenarios for the loss of demand and the paths of
u_alt. lag_plan returns a Trinnvisplan for T-F and T-K; regn_program
refuses T until it is taken through the cash flow.

Tested on made-up numbers only (59 new tests, hand-computed build-outs).
Nothing is computed for the hypothesis.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-11-12 23:55:57 +01:00
commit bca6496c0a
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
12 changed files with 1271 additions and 31 deletions

View file

@ -155,6 +155,15 @@ GRUNNVERDIER: Mapping[str, float] = {
"u_vann": 0.004,
"u_H": 1000.0,
"eta_N": 3e-6,
# the addition to the direction (chapter 17): modules, first stage, own machines, water
"P_m": 100.0,
"tau_1": 2.0,
"n_1": 150.0,
"eps_d": 1.0,
"w_D_uttak": 0.1,
"w_N_uttak": 150.0,
"w_N_forbruk": 0.0,
"w_D_sjo": 100.0,
}
"""Round, invented values in the units of the equations (kr, MW, MWh, kr/MWh, years)."""
@ -191,6 +200,13 @@ def lag_inndata(*, u_eksport: tuple[float, ...] | None = None, **endringer: floa
eierformer=EIERFORMER,
areal={"kjernekraft": 0.1e-6, "vind_direkte": 1.5e-6, "vind_plan": 30e-6, "tomt": 0.001},
petroleum_median=250e9,
bortfall={"lavt": (0.1, 0.2), "hoyt": (0.3, 0.6)},
u_alt={
"hoved": {2025: 0.4, 2035: 0.2, 2045: 0.1},
"fast": {2025: 0.5},
"null": {2025: 0.0},
},
kjoletaarn={"forbruk": (2.0, 2.5, 3.0), "uttak": (3.0, 4.0, 10.0)},
)