feat(modell): count chips from the first possible operating year
The project owner answered the three questions from part 5b on 2026-11-12
("Ja til dine anbefalinger"), before any result is computed:
- chips are a stock from the solution's first possible operating year, not
from the decision year (clarification 25 rewritten; the old reading stays
as a switch that is not part of the verdicts)
- renewable power in C enters operation the same year as the facility
(clarification 24 stands)
- the other choices in clarifications 21-40 are approved
The default in the code is flipped, seven tests that assumed a stock from
2027 are redone, and the comparison with the independent reader's code is
rerun with its switch set the same way: same numbers in all 9 471 paths
that can be built. The parameter file is unchanged.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
326b80d8d1
commit
fb13b8fd75
6 changed files with 120 additions and 55 deletions
|
|
@ -274,13 +274,13 @@ def test_bane_som_ikke_lar_seg_bygge_har_ingen_naaverdi(oppdiktet: LagInndata) -
|
|||
|
||||
|
||||
def test_anlegg_uten_brikker_har_verken_inntekt_eller_kraftbruk(oppdiktet: LagInndata) -> None:
|
||||
"""Chips for one vintage every five years, but a three-year export stop from 2035.
|
||||
"""Chips for one facility a year from 2030, but a three-year export stop from 2035.
|
||||
|
||||
The vintage from 2030 has expired in 2035 and is replaced in 2038. In between the
|
||||
facility earns nothing and uses no power, but its fixed operation is still paid.
|
||||
"""
|
||||
u = tuple(0.0 if aar == 2035 else 0.5 for aar in range(2028, 2061))
|
||||
inn = oppdiktet(u_eksport=u, phi_X=0.1, D_X=3.0, s_brikker=0.02)
|
||||
inn = oppdiktet(u_eksport=u, phi_X=0.1, D_X=3.0)
|
||||
res = _regn(inn, Losning.R)
|
||||
aar = dict(zip(res.aar, range(len(res.aar)), strict=True))
|
||||
assert res.plan.stopp[2035 - 2028 : 2039 - 2028] == (True, True, True, False)
|
||||
|
|
@ -326,17 +326,17 @@ def test_kraftverk_paa_nettet_selger_ogsaa_naar_anlegget_staar(oppdiktet: LagInn
|
|||
assert res.kraftaar[aar[2041]].Delta_Q == pytest.approx(-2 * 8760.0 * 0.8 * 1000.0)
|
||||
|
||||
|
||||
def test_brikker_kan_telles_fra_forste_mulige_aar(oppdiktet: LagInndata) -> None:
|
||||
"""1 000 MW of chips a year. Counted from 2027, three facilities start in 2030.
|
||||
def test_brikker_telles_fra_forste_mulige_aar(oppdiktet: LagInndata) -> None:
|
||||
"""1 000 MW of chips a year, counted from the first possible year (2030): one facility a year.
|
||||
|
||||
Counted from the first possible year (2030), they start in 2030, 2031 and 2032.
|
||||
Saved up from the decision year instead (the switch), three facilities start in 2030.
|
||||
"""
|
||||
inn = oppdiktet(L_H=7)
|
||||
dim = ks.dimensjoner(inn, Losning.R)
|
||||
fra_beslutning = ks.lag_plan(inn, Losning.R, dim, N_anlegg=3)
|
||||
assert [a.start for a in fra_beslutning.anlegg] == [2030, 2030, 2030]
|
||||
fra_start = ks.lag_plan(inn, Losning.R, dim, N_anlegg=3, brikker_fra_T0=False)
|
||||
fra_start = ks.lag_plan(inn, Losning.R, dim, N_anlegg=3)
|
||||
assert [a.start for a in fra_start.anlegg] == [2030, 2031, 2032]
|
||||
fra_beslutning = ks.lag_plan(inn, Losning.R, dim, N_anlegg=3, brikker_fra_T0=True)
|
||||
assert [a.start for a in fra_beslutning.anlegg] == [2030, 2030, 2030]
|
||||
|
||||
|
||||
def test_uten_eksportregel_brukes_ikke_strommen(oppdiktet: LagInndata) -> None:
|
||||
|
|
@ -458,7 +458,7 @@ def _enheter(inn: Inndata, N_anlegg: int) -> tuple[ks.Enhetsgruppe, ...]:
|
|||
|
||||
def test_B_enhetene_hoerer_til_programmet(oppdiktet: LagInndata) -> None:
|
||||
"""Three facilities that start together and need 1.125 unit each: four units of 1 000 MW."""
|
||||
inn = oppdiktet()
|
||||
inn = oppdiktet(s_brikker=0.12)
|
||||
dim = ks.dimensjoner(inn, Losning.B)
|
||||
assert dim.P_G_N == pytest.approx(0.75 * 1.2 * 1000.0 / 0.8)
|
||||
assert all(ks.kraftverk_for_anlegg(inn, Losning.B, dim, k) == () for k in (1, 2, 3))
|
||||
|
|
@ -633,8 +633,12 @@ def test_s45_binder_ikke_for_et_kraftverk_som_taper(oppdiktet: LagInndata) -> No
|
|||
|
||||
|
||||
def test_s45_gir_naaverdi_null_naar_den_binder(oppdiktet: LagInndata) -> None:
|
||||
"""A cheap reactor that earns money on the grid is credited nothing."""
|
||||
inn = oppdiktet(c_N_ref=10e6, f_N=0.3e6)
|
||||
"""A cheap reactor that earns money on the grid is credited nothing.
|
||||
|
||||
Chips for three facilities a year, so the two start together and every unit goes out
|
||||
before the final year; the helper below has no residual value.
|
||||
"""
|
||||
inn = oppdiktet(c_N_ref=10e6, f_N=0.3e6, s_brikker=0.12)
|
||||
for losning in (Losning.B, Losning.B_MERKET):
|
||||
res = _regn(inn, losning, N_anlegg=2)
|
||||
assert 0.0 < res.varsigma[ks.KJERNEKRAFT] < 1.0
|
||||
|
|
@ -785,7 +789,7 @@ def test_anlegg_som_taper_faar_bare_avviklingen_i_restverdien(oppdiktet: LagInnd
|
|||
|
||||
def test_effektkostnaden_deles_paa_anleggene_i_drift(oppdiktet: LagInndata) -> None:
|
||||
"""Three facilities in R that start the same year carry a third each of F_a."""
|
||||
inn = oppdiktet(T_slutt=2040)
|
||||
inn = oppdiktet(T_slutt=2040, s_brikker=0.12)
|
||||
en = _regn(inn, Losning.R, N_anlegg=1)
|
||||
tre = _regn(inn, Losning.R, N_anlegg=3)
|
||||
assert [a.start for a in tre.plan.anlegg] == [2030, 2030, 2030]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue