Skip to content

Instantly share code, notes, and snippets.

View pukpr's full-sized avatar
🎯
Focusing

Paul Pukite pukpr

🎯
Focusing
View GitHub Profile

LTE Parameter Optimization Framework

A multi-stage optimization pipeline for the Laplace's Tidal Equation (LTE) climate index model, using coordinate descent, Pareto front analysis, and cross-index forcing manifold convergence.

Overview

The framework optimizes LTE model parameters across multiple climate indices (AMO, NAO, PDO, NINO4, TNA, Baltic) using a staged approach:

  1. IR + ltep tuning — coarse optimization of feedback and modulation frequencies
  2. lpap micro-tuning — fine adjustment of tidal amplitudes/phases (sub-0.01 shifts)
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from io import StringIO
from pathlib import Path
# Gray et al. 2004 tree-ring reconstruction (1567–1990)
raw = """age ssta amo
1567 -1.43849 NA
1568 -0.73836 NA

LTE/AMO Fitting Parameters — Objective DOF Characterization

Source: lt.exe.p / lt.exe.resp, AMO forward pass, as unwrapped in lte_forward.py. Each parameter is classified by what it mechanistically claims versus what role it plays in the fit, so that "degrees of freedom" isn't reported as a single undifferentiated count.

1. Externally anchored — not free relative to the AMO target

| Parameter | Role | Basis |

@pukpr
pukpr / lte_forward.py
Last active September 1, 2026 22:06
Concise "unwrapped" version of enso_opt.adb,, a climate index model optimizing program, defaulted to model AMO. That is, this just does one forward computation of the final params.
#!/usr/bin/env python3
"""lte_forward.py — sequential, non-optimizing equivalent of the combined
Ada (lt.exe / enso_opt) + Python (lte_gui.py) software program.
Rationale
---------
The full system runs an Ada random-descent *optimizer* (N threads, up to
MAXLOOPS restarts) wrapped around a deterministic *forward computation*:
given a parameter set (lt.exe.p) and a climate index (.dat), the pipeline
produces the forced climate response and dumps it to lte_results.csv.
@pukpr
pukpr / plot_hidden_latent_forcing.py
Created August 15, 2026 19:05
Plots hidden/latent forcing layer of a collection of LTE models
#!/usr/bin/env python3
"""Plot hidden latent forcing for the standard LTE result directories."""
from __future__ import annotations
import argparse
from bisect import bisect_right
import csv
import math
from pathlib import Path
@pukpr
pukpr / Substantiatingltedraconicmodel.md
Last active August 3, 2026 22:13
Substantiating the LTE Draconic-Tidal Model of the QBO: A Plausibility-and-Parsimony Assessment

Substantiating the LTE Draconic-Tidal Model of the QBO: A Plausibility-and-Parsimony Assessment

(Revised: corrected aliasing arithmetic; reframed stratosphere–troposphere/ocean correlation as common-mode forcing rather than QBO-as-causal-intermediary)

TL;DR

  • The figures show a physically motivated, cross-validated fit in which a single dominant lunar draconic (nodical, 27.212-day) tidal term, modulated by semi-annual solar impulses, reproduces the QBO with training CC≈0.93 and out-of-sample validation CC≈0.75 — a genuinely strong result that is plausible (the draconic month seasonally aliases to ~2.366 years, matching the QBO's ~2.37-year asymptotic period to within ~1.5 days) and arguably parsimonious (the forcing frequencies are fixed by ephemerides, not fit), but it directly contradicts the mainstream consensus that the QBO period is internally generated by wave–mean-flow interaction and, per the standard review literature, "unrelated to any known periodic forcing."
  • The strongest substantia
@pukpr
pukpr / tidal_chaos.py
Created July 28, 2026 07:27
Model of semi-diurnal estuary dynamics applying LTE
# python3 tidal_chaos.py --k 5 --C 1
# see end of https://geoenergymath.com/2026/06/16/non-homogeneous-non-autonomous/
#!/usr/bin/env python3
"""
Plot M(t) = L(t) + C * sin(k * ∫₀ᵗ L(τ) dτ) for t in [0, 20] years,
where L(t) = 1 + cos(t). The modulation frequency is proportional to L(t),
so higher L gives faster modulation, and L≈0 gives almost no modulation.
Usage: python script.py --k <value> --C <value>
"""
@pukpr
pukpr / doodson_iter.py
Last active July 15, 2026 10:34
Generating aliased frequencies from Doodson coefficients
import itertools
def frequency(i, j, k):
return (365.242 * i / 27.3216 + j / 8.848 + k / 18.6) % 1.0
def main():
indices = range(-4, 5)
rows = []
for i, j, k in itertools.product(indices, repeat=3):
f = frequency(i, j, k)
@pukpr
pukpr / folded_env.py
Last active July 15, 2026 13:46
Satellite Sideband Harmonic reconstruction of climate index
"""
Extract the symmetric "comb" component from LTE data.
The script reads time from column 1 and an amplitude column (default: column 3),
finds mirrored spectral pairs about annualised symmetry centres (0.5, 1.5, 2.5,
...), reconstructs only those paired frequencies, and writes the filtered signal
to lte_filtered.csv.
"""
from __future__ import annotations
@pukpr
pukpr / lte_results_manifold.py
Created June 30, 2026 19:59
Comparing manifold between models
#!/usr/bin/env python3
import sys
import json
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
def read_lpap(subdir):
"""
Read lpap list from lt.exe.p in the given subdirectory.