This repository contains Julia code and a LaTeX report for a project studying deterministic and stochastic chaos in a low-dimensional rate-and-state spring-slider model, with a focus on grid-based exact Bayesian filtering, RTS smoothing, and forecasting skill under model–truth mismatch (deterministic forward model vs stochastic truth).
- Report PDF:
report/report.pdf - Main Julia entrypoint:
code/compute.jl - Reusable Julia modules:
code/src/ - Figures:
- publication-ready PDFs:
report/figures/ - quick-look PNGs:
figures/
- publication-ready PDFs:
This project studies a quasi-static, two-state-variable rate-and-state friction spring-slider system (three-dimensional state), which exhibits weak deterministic chaos. This project then assesses how stochastic forcing (SDE truth) impacts:
- attractor geometry and instability diagnostics,
- Bayesian state estimation (filter + RTS smoother),
- forecast skill and calibration.
This project implements an exact, grid-based Bayesian filter and Rauch–Tung–Striebel (RTS) smoother on a regular grid over the 3D state space. This avoids Gaussian closure assumptions (common in ensemble Kalman methods) and can represent strongly non-Gaussian posteriors, at the expense of scaling poorly with dimension (feasible here because the system is 3D).
- Leading Lyapunov exponent is positive, confirming chaos; the system is weakly chaotic (Lyapunov time of order a few hundred model time units).
- Attractor geometry is close to 2D within the 3D state space (Kaplan–Yorke dimension just above 2; correlation dimension ≈ 1.5).
- This near-2D geometry supports the tractability of grid-based assimilation on a moderate grid (used in the report:
50^3).
Stochastic forcing reduces predictability, and noise in slow state variables degrades forecast skill more severely than comparable noise applied directly to slip velocity. This is consistent with a “random attractor” picture in which small stochastic perturbations are amplified by the nonlinear dynamics.
- In the matched deterministic case, the grid filter and RTS smoother achieve reliable tracking and good calibration.
- Under deterministic-model / stochastic-truth mismatch, tracking skill remains comparable across cases, but calibration and forecast horizons depend on where the noise enters the system.
- Free forecasts after assimilation retain meaningful skill on timescales that are a fraction of the Lyapunov time (order
0.3–0.7 τ_L, depending on truth scenario and metric).
For details, see report/parts/{introduction,methods,results,discussion,conclusion}.tex and the compiled report/report.pdf.
Julia project environment and all computation.
code/Project.toml,code/Manifest.toml
Pinned Julia environment.code/compute.jl
Main driver script: runs analyses and generates figures.code/params.jl
Central parameters used across experiments.code/plot.jl
Plot orchestration / figure generation.
Reusable library code (model, diagnostics, assimilation, plotting utilities).
code/src/system.jl
Core system definition / integration utilities.code/src/SpringSlider.jl
Spring-slider model implementation.code/src/lyapunov.jl
Lyapunov exponent computation.code/src/dimension.jl
Attractor dimension estimation (e.g. correlation dimension).code/src/bayesian.jl
Grid-based Bayesian filtering + RTS smoothing + forecasting utilities.code/src/plots*.jl
Plotting helpers split by analysis type:plots_deterministic.jlplots_sde.jlplots_assimilation.jlplots_forecast.jlplots.jl(shared)
Datasets and intermediate outputs used by the analyses (some may be large).
Profiling artifacts / scripts (performance investigation).
This repository uses Git LFS for large artifacts (e.g. figures and datasets). Make sure Git LFS is installed before cloning.
If you already cloned without LFS, run git lfs pull afterwards.
From code/:
julia --project=. -e "using Pkg; Pkg.instantiate()"
The entry point is:
julia --project=. --threads=auto compute.jl
Running everything (including figure generation) may take on the order of a couple of hours depending on the compute power of the machine (9950X with 128 GB ram ~ 2 hours, 20 minutes).
report/figures/*.pdf
Figures used by the LaTeX report.figures/*.png
Quick-look versions of figures for easy browsing.
- Main TeX:
report/report.tex - Sections:
report/parts/*.tex - Bibliography:
report/references.bib - Compiled PDF:
report/report.pdf
- Grid-based Bayesian methods scale exponentially with state dimension; this approach is intentionally limited to low-dimensional systems.
- Forecast horizons and calibration can be sensitive to grid resolution, observation cadence, stochastic realisations, and initial conditions; see the report discussion for suggested robustness extensions.
I declare that the work is my own, except where acknowledgement is given. I used contextual autocomplete within Zed for programming assistance and Claude (Anthropic) for broad assistance with improving clarity and structure in writing and documenting my own code.
All substantive ideas, analyses, and conclusions are my own.