Skip to content

About

Project for MATH303 ODE and Dynamic Systems: using reservoir computing to learn Lyapunov's exponents for chaos system

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

ml_chaos_system

MATH303 project on reservoir computing for chaotic systems (currently focused on the Lorenz system).

What is in this folder

  • lorenz.py: reproducible Lorenz + reservoir computing experiment pipeline
  • euler_method.py: simple Euler simulation for the Lorenz system
  • outputs_final/: generated figures and metrics from the tuned run (created after running lorenz.py)

Features in lorenz.py

  • Deterministic runs with a fixed random seed
  • Lorenz data generation via scipy.integrate.solve_ivp
  • Reservoir computing training with ridge regression
  • Validation-based hyperparameter search
  • Test forecasting metrics (including valid prediction time)
  • Lyapunov exponent estimation from the autonomous reservoir
  • Saved plots and JSON metrics for report writing

Requirements

Use a Python environment with:

  • numpy
  • scipy
  • matplotlib

You can install them with:

pip install -r requirements.txt

Run the experiment

Example tuned run:

MPLBACKEND=Agg MPLCONFIGDIR=.mplconfig python lorenz.py --trials 12 --forecast-steps 4000 --out-dir outputs_final

If your default Python does not have scientific packages, use your Conda Python (example):

MPLBACKEND=Agg MPLCONFIGDIR=.mplconfig /Users/sandyuelin/miniconda3/bin/python lorenz.py --trials 12 --forecast-steps 4000 --out-dir outputs_final

Output files

The script writes:

  • metrics.json: final experiment metrics and best hyperparameters
  • trial_records.json: validation scores from the hyperparameter search
  • timeseries_test_forecast.png
  • phase_portrait_test.png
  • return_map_test.png
  • hyperparameter_search.png

About

Project for MATH303 ODE and Dynamic Systems: using reservoir computing to learn Lyapunov's exponents for chaos system

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages