Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLDC Coursework — Deterministic and Stochastic Chaos in a Rate-and-State Spring-Slider

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/

Project at a glance

Scientific aim

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.

Methodological aim

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).


Key findings (from the report)

Deterministic dynamics

  • 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 sensitivity

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.

Data assimilation and forecasting

  • 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.


Repository layout

code/

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.

code/src/

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.jl
    • plots_sde.jl
    • plots_assimilation.jl
    • plots_forecast.jl
    • plots.jl (shared)

code/data/

Datasets and intermediate outputs used by the analyses (some may be large).

code/profiling/

Profiling artifacts / scripts (performance investigation).


Running the code

1) Clone (Large File Support)

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.

2) Instantiate the Julia environment

From code/:

julia --project=. -e "using Pkg; Pkg.instantiate()"

3) Run the full pipeline

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).


Outputs

  • report/figures/*.pdf
    Figures used by the LaTeX report.
  • figures/*.png
    Quick-look versions of figures for easy browsing.

Report

  • Main TeX: report/report.tex
  • Sections: report/parts/*.tex
  • Bibliography: report/references.bib
  • Compiled PDF: report/report.pdf

Notes and limitations

  • 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.

Disclosure and acknowledgements

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.

About

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).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages