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>
This commit is contained in:
Kjell Tore Guttormsen 2026-11-12 17:17:13 +01:00
commit d607128ec6
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
12 changed files with 718 additions and 112 deletions

View file

@ -263,3 +263,15 @@ def test_programmets_enheter_i_B_teller_ogsaa_etter_at_anleggene_er_gaatt_ut(
ut = skala.overskudd_utover_avkastning(inn, res)
assert ut[2058 - 2027] < 0
assert np.count_nonzero(ut[2056 - 2027 :]) == 5
def test_statens_kontantstrom_ved_siden_av_M6(oppdiktet: LagInndata) -> None:
"""Clarification 53: S30 in the first year of stable operation over the petroleum cash flow."""
inn = oppdiktet(T_slutt=2040)
dim = ks.dimensjoner(inn, Losning.R)
res = ks.regn_program(
inn, Losning.R, ks.lag_plan(inn, Losning.R, dim, N_anlegg=1), Knapphet.VARER, dim=dim
)
KS_stat = np.arange(len(res.aar), dtype=np.float64) * 1e9
assert skala.forste_aar_med_stabil_drift(res) == 2030
assert skala.statens_kontantstrom_mot_petroleum(inn, res, KS_stat) == pytest.approx(3e9 / 500e9)