Commit graph

9 commits

Author SHA1 Message Date
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