Commit graph

21 commits

Author SHA1 Message Date
7dd3edc68a
feat(verktoy): the tools of chapter 12 and the data files of the main run, on made-up numbers (clarifications 126 to 133)
grunnlag.py holds what a run needs besides the model code, from a made-up
basis file or from the freeze (which stops until the EEA assessment is
written down). datafiler.py writes the six files in a fixed format without
rounding and compares two folders. verktoy.py is the command line:
hovedkjoring, kontroll, scenario, folsomhet, terskel, sammenlign,
arbeidskopi. tests/oppdiktet holds a made-up basis of 200 draws and the files
written from it; they are reproduced byte for byte with 1 and 8 processes and
in a new process. Nothing is computed on the frozen parameters.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 21:55:03 +01:00
aff6624c5e
feat(kart): the map from equation to function, generated from the code (clarification 131)
Every S-number of the specification points to the functions named after it
and, where it is put together over the years or the draws, to the functions
that do so. A test holds the stored map against the code.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 20:53:31 +01:00
550f02d0a9
feat(folsomheter): the row for standard contract terms carries the note that it can favour A (clarification 125)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 20:36:00 +01:00
45aaffcb69
feat(folsomheter): the sensitivity list through the run over the draws, with eleven new switches in the model code
42 rows from the 37 lines: each row is the main run with one change, run
on the main run's step for the solutions it applies to and put in the
fixed table next to the main run. New switches in dimensjoner and
regn_program for lines 4, 7, 8, 10, 12, 13, 16, 17, 18, 20 and 21, the
cost factor of line 28 in the ownership pass, and the state's cash flow
next to M6. With the switches off every figure is unchanged to the last
digit. Made-up draws only; nothing is computed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 20:31:12 +01:00
1da369daa4
feat(terskler): demonstrated effect, the halves of rho_D and the conditions taken together (clarification 115)
A threshold counts when the quantity has a source, its first-order index
for the condition is above the chi-square limit, and, for rho_N, the target
holds under the condition in each half of the draws by rho_D. For a solution
whose conditions can be named, the share of the draws that meets the chosen
conditions together is given, and the share of them in which M1 to M4 hold.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 19:39:36 +01:00
925df404a0
feat(sobol): the number of classes with draws, for the expectation without an effect
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 18:47:03 +01:00
8d13501653
feat(kjoring): thresholds, the conditions of part I, Sobol indices and threshold surfaces
Clarifications 105 to 111, on invented outcomes and made-up draws only. The price
threshold runs the model with the price multiplied by a factor; the thresholds in
a quantity, the indices and two of the surfaces are read from the outcomes per draw.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 17:57:52 +01:00
28a0911825
feat(dommer): the step with a single facility cannot be the 25 % step (clarification 104)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 17:46:37 +01:00
1a3a2fd5a8
test(kjoring): the median when exactly half the draws cannot be built
And the docstring of the percentile says how it is computed
(clarification 103).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 15:48:11 +01:00
8ab69c7619
feat(kjoring): the run over the draws, the verdicts put together and the timeline
For every draw the seven solutions on every step of the ladder in six
scenarios, with the outcomes the verdicts need; the verdicts per target,
the step they are read on, part I and part II; S50 summarised over the
draws; and the ownership forms on that step. Tested on made-up draws and
invented outcomes only. Written and committed before the independent
reader's code was opened.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 15:22:09 +01:00
fe2b2131f3
feat(dommer): five solutions in M5 and the verdicts, and three sensitivities of chapter 17.8 as switches
The ladder, part I and M7 now cover A, B, C, T-F and T-K: A is best when it
can be built and beats each of the four others that can. M5 holds by
definition for T-F and judges T-K as nuclear power on every step.

Switches for the sensitivities: full displacement in the first stage
(delta_V = 1 for the modules started within the grid that exists, in S11,
S23, S24, the grid investment and V), new renewable power counted from a
later year for C and T, and Inndata.med for modules of 50 and 200 MW. Next
to S54 the withdrawal with sea water only for the nuclear production the
data centres themselves use.

With the switches off every figure for all seven solutions is unchanged to
the last digit (267 made-up paths, 516 817 lines, byte for byte). Not yet
reconciled against the independent reader's code.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 13:41:29 +01:00
b58e79ee82
feat(nivaaisert): take solution T and the loss of demand through the levelised cost, ownership and scale
The power cost per module (S11): a renewable module with its own portfolio and grid
connection, as a facility in C; the nuclear modules of T-K on the programme's units, as the
facilities in B, with only the nuclear modules that use power in the denominator. Tariff,
building, IT hardware and residual value per module with P_m. The units' cash flow is shared
among the nuclear modules operated that year, never on the renewable modules.

The factor of S51 stands per vintage in S19, S27 and S42 and in the disconnection arm a
business pays; S31 gets it through the revenue and F_a of the cash flow. Without a loss, and
for A, B, B', C and R, every figure of chapters 7 to 9 is unchanged to the last digit (282
made-up paths, 151 525 lines of figures compared byte for byte).

The technologies of a facility are now kept in the plants' own order. As a set of names their
order differed from run to run, and with it the last digit of every sum over them in C.

The refusal of T and of a loss of demand (krev_uten_tillegget) is removed. Run on made-up
numbers only; no result for the hypothesis has been computed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 09:25:27 +01:00
1e7273b4b0
feat(kontantstrom): take solution T through the power system and the cash flow
Everything per module, renewable modules with their own portfolio, the nuclear
modules of T-K on shared units, S41 counted to the first unit. The factor of
S51 enters the revenue and the disconnection arm of S47. S53 and S54 are put
together over a programme for all solutions. Present values are exactly
rounded sums, so the same computation gives the same last digit every time.
The chapters after the cash flow refuse T and a loss of demand for now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-13 00:37:50 +01:00
bca6496c0a
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>
2026-11-12 23:55:57 +01:00
ea26cd4226
feat(trekninger): read parameter file 1.1 and store the new draws
The loader knows the new checksum and the units of the new quantities
(g CO2 per kWh, cubic metres per MWh). 10 000 draws of 91 quantities with the
same seed; the four new ones are the last columns. All columns have new
numbers, because the random numbers are laid out row by row. The stream for
yearly events is byte for byte the same; only its description records the new
checksum. Tests for the counts, the new quantities and the checksum in the
pre-registration. README, CHANGELOG and CLAUDE.md updated.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 23:07:09 +01:00
d607128ec6
feat(kode): bring the ownership comparison in line with clarifications 62-69
eierskap.py: the residual value and the sale at the final year, the levies,
the private owners' cash flow and the settlement over the draws, the present
value with rho_D without the debt flows, the required return before tax, and
equal values in the ranking. Also the median of the petroleum cash flow in
2025 kroner, the state's cash flow next to M6, the shares shown next to each
verdict, and the sources' figures for M5 (i).

Made-up numbers only: 424 tests pass, 7 documented misses. The project's
code and the independent reader's code agree to within one krone on 1 500
made-up paths.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 17:17:13 +01:00
d4aebad0f9
feat(kode): bring business economics, ownership, scale and verdicts in line with clarifications 41-61
The accident cost stays in S11 and S31 when the additionality rule binds;
the peak year of M6 is taken among operating years; tax depreciation and
carried losses lose real value with price growth; the special tax deducts
the corporate tax, has a return allowance and carries a negative basis with
interest, so it only meets return above r_e; ownership forms are compared
only with forms that pass the EEA assessment; the overall verdict needs a
negative median to fell a solution and takes whether conditions can be
named; M5 does not hold when both (i) and (ii) are broken; a non-positive
price without the programme is an error in M3. Made-up numbers only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 14:33:49 +01:00
e216702d69
feat(kode): first coding of business economics, ownership, scale, environment and verdicts
Chapters 7 to 11 of the specification, on the made-up set only:

- nivaaisert: the power cost per facility, year and vintage on levelised
  form (S9, S11 with clarifications 2, 11, 13 and 15), S15, S19, S27, S42
- eierskap: the business cash flow with every asset booked, tax, S28, S29
  and S30 for the four ownership forms, the criteria over the draws
- skala: S31 year by year, the first year with stable operation, M6
- miljo: S32 year by year, the rules of M5 (i) and (ii)
- dommer: S37, the verdict per target, the step of the ladder, the overall
  verdicts; tested on invented outcomes
- kontantstrom: each asset is recorded as it is paid, and the price of
  compute exposes the competitor's cost and the markup

This is an intermediate step. The readings are not settled: an independent
reader is coding the same from the specification alone, a first comparison
agrees on the levelised cost, S19, S42, the cash flows, M3 and M4 and
differs on depreciation at the final year, tax, debt and two definitions.
Chapter 16 gets the clarifications before any result is computed.
Nothing is computed for the hypothesis; the parameter file is unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 12:45:54 +01:00
fb13b8fd75
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>
2026-11-12 12:14:28 +01:00
5c91cadf4c
feat(kode): add the build-out, the power system and the cash flow
- utbygging.py: when each facility starts and which vintages of IT hardware it
  gets (S22, S33), with chips as a stock, replacement before new facilities and
  the export rule.
- kraftsystem.py: the fitted price lines and the power and capacity balances
  year by year (S23, S24, S25, S38).
- kontantstrom.py: the yearly cash flows per facility, the additionality rule
  by iteration, the residual value and the net present value for Norway (S26,
  S34, S35, S40, S45), for the solutions A, B, B', C and R.
- hendelser.py and data/aarshendelser.npy: the stream of random numbers for the
  export rule, one uniform number per draw and year 2028-2100, from its own seed.
- inndata.py: one set of values in the units of the equations.
- ligninger.py: one function per equation for chapters 4 to 6.

Tested on a made-up set of values only (tests/conftest.py); no result for the
hypothesis has been computed. 271 tests pass. Seven are documented misses
against a source: the five from before, and the price lines for NO3 and NO4,
which miss one of NVE's twelve scenarios by 6.0 and 7.7 per cent.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 11:58:24 +01:00
a63f66c416
feat(kode): add the levelised equations, the parameter reader and the draws
One pure function per equation for chapters 1 to 3 of the specification
(S1-S21, S36, S43-S47), a strict reader for the frozen parameter file with
checksum, validation and unit conversion, and the 10 000 Monte Carlo draws of
the 87 drawn quantities, stored in data/ and reproducible bit for bit.

Tests: unit tests and edge cases per equation, the reader, the draws, and
known answers from Argonne, NOU 2026: 4, Epoch and NVE with the sources' own
assumptions. Five comparisons miss the 5 % tolerance and are kept as strict
expected failures with the measured deviation. No result for the hypothesis
is computed. ruff ALL and mypy strict pass.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:08:47 +01:00