Skip to content

Instantly share code, notes, and snippets.

View pukpr's full-sized avatar
🎯
Focusing

Paul Pukite pukpr

🎯
Focusing
View GitHub Profile
@pukpr
pukpr / cw.py
Last active November 12, 2026 16:35
Electromechanical Chandler-wobble analog: strobed 26.844/yr drive aliased to 0.844/yr through the free-wobble resonance (cw.py), beat exhibit, and literature analogues
"""Electromechanical analog of Earth's annual wobble.
An oblate rotor (spin axis z_b, inertia C > A) with a dynamically magnetized
body (susceptibility chi_par along z_b, chi_perp across it, plus optional
permanent moment m_p along z_b) sits in the field of an electromagnet that is
swept around a circle (the "orbit", period T = 2*pi/OMEGA) and amplitude cycled
as B(t) = B0 (1 + k cos(OMEGA t)).
Torque: tau = m x B with m = m_p z_b + chi . B (body frame).
Dynamics: Euler equations I dw/dt = -w x I w + tau ; orientation R' = R [w]x.
@pukpr
pukpr / combined_solar_lunar.md
Last active November 9, 2026 19:51
Lunar draconic + solar annual impulses: combined Chandler-type model (companion to 310afd6ad3fbf40df0dd7672341a138d)

Lunar draconic impulses plus a solar annual impulse: combined Chandler-type model

Companion to the lunar-only gist: https://gist.github.com/pukpr/310afd6ad3fbf40df0dd7672341a138d That gist covers the derivation (stroboscopic aliasing, the 432.8 d line, the north/south impulse algebra) and the base model. This one adds the solar annual impulse and combines the two.

1. Model

Same linearized Euler equation as the lunar-only gist, with pole offset m = m1 + i*m2:

dm/dt = (i*sigma0 - g) m - i*sigma0*psi(t), g = sigma0/(2Q)
@pukpr
pukpr / euler_impulse_model.png
Created November 9, 2026 16:44
Annual impulses, draconic latitude and a 432.8 d aliased line
euler_impulse_model.png
@pukpr
pukpr / fig3_replicated.csv
Last active November 8, 2026 03:00
XIAO_replicate
id lat lon A ph sA sP xA xph
1 48.38 -4.49 7.786873405034136 -1.5822927380277878 5.022428463462408 0.43123179650732285 17.42 -0.31
10 37.81 -122.47 11.99021167914358 -2.437019219157614 7.004167451989492 0.5299013399347384 17.56 -2.69
11 54.17 12.1 4.440415250073591 -2.2077549355671646 3.6150487243371736 0.266608744666257 17.57 -0.52
111 -32.06 115.74 20.98496780123558 2.53846384043755 6.932684022652091 0.5174454524983098 16.22 1.11
113 55.33 11.14 7.849908964284038 3.0313732286227566 3.810253137297361 0.2789117535935542 16.27 -0.46
118 55.7 21.13 8.14864163198246 -1.3296928164732034 8.286689271583748 0.7881582291472994 16.12 -0.37
119 56.09 12.46 5.586560232708745 -3.0372249974274137 6.536528498645707 0.665241370639943 16.44 -0.49
120 54.57 11.93 6.2234938041231995 -2.9489717482877555 3.7996595223682785 0.2347825933933955 18.76 -0.67
122 62.37 17.53 5.951651357748291 -0.037237477472642645 6.5704920450943405 1.075287507811467 16.52 -0.72
@pukpr
pukpr / draconic_crest_standalone.html
Created November 3, 2026 23:33
Draconic Crest: 3-D surf analogy for lunar forcing (QBO, Chandler wobble, ENSO)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<style>:root{color-scheme:light}body{margin:0;font:14px system-ui,sans-serif}img{max-width:100%}[hidden]{display:none!important}</style>
</head>
<body>
<title>Draconic Crest</title>
<meta name="claude:viewport-fit-sides" content="cover">
@pukpr
pukpr / amo_vs_neg_lod.py
Created October 2, 2026 03:15
Visualize the AMO model, observation, and -LOD together to show the decadal-scale tracking.
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from scipy.stats import pearsonr
yr, model, obs = np.loadtxt('amo/lte_results.csv', delimiter=',', usecols=(0,1,2), unpack=True)
mask = (yr >= 1880) & (yr < 2021)
yr, model, obs = [a[mask] for a in [yr, model, obs]]
@pukpr
pukpr / oam_to_lod_mechanism.py
Last active October 2, 2026 02:27
Generate a figure showing the causal chain from tidal forcing through ocean angular momentum (OAM) variations to Length-of-Day (LOD) changes.
#!/usr/bin/env python3
"""Generate a figure showing the causal chain from tidal forcing through
ocean angular momentum (OAM) variations to Length-of-Day (LOD) changes.
The mechanism:
Tidal forcing (lunisolar) → barotropic tides → baroclinic internal waves
→ ocean mass redistribution → OAM changes → Earth rotation changes (LOD)
This connects the winding scalogram physics (barotropic-baroclinic coupling)
to the observed AMO/-LOD correlation (r≈+0.6 on decadal scales).
@pukpr
pukpr / amo_cyclic_vs_lod.py
Created October 2, 2026 02:15
Examine the cyclic part of the AMO manifold (after removing the secular ramp), plus the rectified cyclic part, and the time derivative d(cyclic)/dt. Compare each against LOD (1880-2020).
#!/usr/bin/env python3
"""Examine the *cyclic* part of the AMO manifold (after removing the secular
ramp), plus the rectified cyclic part |cyclic|, and the time derivative
d(cyclic)/dt. Compare each against LOD (1880-2020).
The manifold = secular_ramp + cyclic_tidal_beats. The ramp absorbs the
'trend' and 'accel' parameters; the cyclic part is what's left — the actual
tidal forcing oscillation.
"""
import numpy as np
@pukpr
pukpr / WINDING_NARRATIVE.md
Last active September 10, 2026 21:49
Climate index winding narrative

Winding-Frequency Signatures, by Index

An analytic read of the Forcing -> Model winding-frequency fingerprints computed by param_survey.py (CV window 1880-1885, EXCLUDE=true, the project default, per-index resp override where set — see the script's own printed header for exact per-index windows). All wave-numbers below are |M|; harmonic order means the integer multiplier of each index's own M(NM) reference (i.e. M_harmonic / M(NM), rounded).

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)