docs: describe the code for the build-out of solution T

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 4c9539d68a
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
3 changed files with 28 additions and 10 deletions

View file

@ -76,3 +76,11 @@ All notable changes to this project will be documented in this file.
new value, range or distribution. 137 parameters, 91 drawn quantities, new draws in `data/`. Before the
deviation the project itself looked up the 30 source entries behind the new quantities in the primary
sources; four things changed from the candidates (see chapter 17.8 of the specification).
- The build-out of solution T in code (`src/tokenfabrikker/utbygging.py`, chapter 17.1): when each module of
100 MW starts in T-F and T-K, with the grid balance of the first stage, the condition for nuclear power (S49)
and the two stocks of chips, and the timeline of megawatts in operation per type of power (S50). The equations
S48–S54 are pure functions, and the new quantities are read into the input data. Written from the text
before the independent reader's code was opened, then run against it: 42 000 made-up build-outs and 20 000
made-up sets for S51–S54 without a difference. Six clarifications (70–75) in chapter 16 of the specification
say how chapter 17 is read where the text was silent. Solution T is not taken through the cash flow or the
verdicts yet, and no result for the hypothesis has been computed.

View file

@ -18,8 +18,9 @@ carousel, Python code, and a Claude plugin (own repo, later).
avoided emissions and cooling water).
Every model parameter must trace to an entry here.
- `FORHANDSREGISTRERING.md`: the approved direction and pre-registered criteria (M1–M7). Committed.
- `modell/spesifikasjon.md`: the model specification (equations S1–S54; chapter 17,
the addition to the direction, is not coded yet). `modell/parametere.json`: the frozen
- `modell/spesifikasjon.md`: the model specification (equations S1–S54; of chapter 17,
the addition to the direction, the build-out of solution T and the equations S48–S54 are coded, the rest
is not). `modell/parametere.json`: the frozen
parameters (value, range, distribution, source entries); its checksum is recorded in the pre-registration
(version 1.1 after the one deviation of 2026-11-12, which added the quantities of chapter 17.8).
The table in chapter 14 of the specification is generated from that file.
@ -32,7 +33,9 @@ carousel, Python code, and a Claude plugin (own repo, later).
specification. `parametere.py` reads the frozen file (checksum, strict validation, unit conversion).
`fordelinger.py` and `trekninger.py` make the Monte Carlo draws, `hendelser.py` the stream for yearly events.
`inndata.py` holds one set of values in the equations' units (`Inndata`; `fra_trekning` builds it for a draw).
`utbygging.py` (S22: start years, IT vintages, export stops), `kraftsystem.py` (S23 to S25, S38) and
`utbygging.py` (S22: start years, IT vintages, export stops; chapter 17.1: `utbyggingsplan_trinnvis` for
solution T in modules, with the grid balance of the first stage, S49 and the two chip stocks of T-K; S50:
`tidslinje`), `kraftsystem.py` (S23 to S25, S38) and
`kontantstrom.py` (S26, S34, S35, S40, S45: `lag_plan`, `regn_program`) put the equations together over the
years. `nivaaisert.py` (the power cost per facility, year and vintage on levelised form; S15, S19, S27, S42),
`eierskap.py` (S28 to S30: business cash flow, tax, ownership forms, the criteria over the draws), `skala.py`
@ -41,15 +44,21 @@ carousel, Python code, and a Claude plugin (own repo, later).
41 to 69), settled against an independent reader's code. Clarifications 62 to 66 correct the comparison of
ownership forms (residual value, levies, private owners, the rate the state's cash flow is valued with, the
cost of capital before tax), approved by the operator 2026-11-12; 67 lists what remains. Clarification 68
holds the sources' figures for M5 (i), mirrored in `miljo.KILDEVERDIER_M5`. The run over the draws, the
sensitivities and the tools of chapter 12 are not coded yet.
holds the sources' figures for M5 (i), mirrored in `miljo.KILDEVERDIER_M5`. Clarifications 70 to 75 hold the
readings of chapter 17 made when its build-out was coded, settled against an independent reader's code.
Solution T (`Losning.T_F`, `Losning.T_K`) only has its build-out: `lag_plan` returns a `Trinnvisplan`, and
`regn_program` refuses T until it is taken through the power system, cash flow, ownership and verdicts.
S51 to S54 are pure functions in `ligninger.py`; the factor of S51 is not in the revenue yet, and S53 and
S54 are not put together over a programme. The run over the draws, the sensitivities and the tools of
chapter 12 are not coded yet.
- `data/trekninger.npy` and `data/trekninger.json`: the 10 000 draws of the 91 drawn quantities, in the parameter
file's units. `data/aarshendelser.npy` and `.json`: one uniform number per draw and year 2028–2100 for the
export rule (own seed). Committed; every later computation reads them.
- `tests/`: unit tests per equation, the loader, the draws, and `test_fasit.py` (known answers from Argonne,
NOU 2026: 4, Epoch and NVE with the sources' own assumptions). Build-out, power system and cash flow are tested
on the made-up set of values in `tests/conftest.py`, and so are the levelised cost, ownership, scale and
environment. The verdicts are tested on invented outcomes per draw.
environment. The verdicts are tested on invented outcomes per draw. `test_trinnvis.py` holds chapter 17:
hand-computed build-outs for T-F and T-K, and S48 to S54.
- `requirements.txt` (numpy, scipy) and `requirements-dev.txt` (pytest, ruff, mypy) pin exact versions;
`pyproject.toml` only configures the tools (ruff `ALL`, mypy strict).

View file

@ -14,8 +14,8 @@ skal si når satsingen lønner seg, og når den ikke gjør det.
- `kilder/`: kildebanken. Én fil per område, med påstand, tall, kilde, ordrett sitat og kontroll mot primærkilden.
- `modell/spesifikasjon.md`: modellen: ligninger, størrelser og parametere med kilde. Kapittel 16 har
avklaringene som ble gjort etter at en uavhengig leser kodet ligningene. Kapittel 17 har tillegget til
retningen: trinnvis oppbygging, AI-bruk på brukernes egne maskiner, utslipp «med fradrag» og kjølevann. Det er
ikke kodet ennå.
retningen: trinnvis oppbygging, AI-bruk på brukernes egne maskiner, utslipp «med fradrag» og kjølevann. Av
det er utbyggingen i moduler og ligningene S48–S54 kodet; resten er ikke kodet ennå.
- `modell/parametere.json`: parameterne, frosset før noe er regnet: verdi, spenn, fordeling og poster i
kildebanken. Fila er endret én gang etter frysen, 12. november 2026, da størrelsene for tillegget til retningen
kom inn, også det før noe er regnet. Sjekksummen og hva som ble endret, står i forhåndsregistreringen.
@ -24,8 +24,9 @@ skal si når satsingen lønner seg, og når den ikke gjør det.
- `src/tokenfabrikker/`: koden. Én funksjon per ligning, med samme nummer som i spesifikasjonen: kraftverket,
datasenteret og inntekten (kapittel 1–3), utbyggingen (kapittel 4), kraftsystemet (kapittel 5), kontantstrømmen
med netto nåverdi for Norge (kapittel 6), bedriftsøkonomien, eierformene, skala, miljø og dommene (kapittel
7–11), og innlesing av parameterne og trekningene. Kjøringen over trekningene, følsomhetene og verktøyene er
ikke kodet ennå, og ingen resultater er regnet.
7–11), og innlesing av parameterne og trekningene. For den trinnvise løsningen er bare utbyggingen kodet
(kapittel 17.1): når hver modul starter, og hvilken kraft den går på. Kjøringen over trekningene,
følsomhetene og verktøyene er ikke kodet ennå, og ingen resultater er regnet.
- `data/trekninger.npy`: de 10 000 trekningene av parameterne, laget med fast frø. `data/trekninger.json` sier hva
kolonnene er. `data/aarshendelser.npy` er en egen strøm av tilfeldige tall for eksportregelen, ett tall per
trekning og år.