Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ME5311 Project 2: System Modeling and Prediction

Author: Yu Huize

A data-driven pipeline for modeling and predicting 2D vector field dynamics using dimensionality reduction and multiple forecasting methods.

Overview

This project applies five data-driven approaches to learn the temporal evolution of a 2D velocity field (×ばつ64 grid, 2 components) and compares their prediction performance:

Model Type Description
DMD Physics-informed (linear) Dynamic Mode Decomposition — fits a linear operator via eigendecomposition
SINDy Physics-informed (nonlinear) Sparse Identification of Nonlinear Dynamics — discovers sparse polynomial ODEs
Ridge Regression Machine learning (linear) Autoregressive prediction with L2 regularization
MLP Machine learning (nonlinear) Two-hidden-layer neural network (64→32, tanh)
SVR Machine learning (nonlinear) Support Vector Regression with RBF kernel

All models operate in a POD-reduced space (20 modes capturing 92.84% of fluctuation energy), reducing the original 8192-dimensional system for computational efficiency.

Project Structure

System-Modeling-and-Prediction/
├── pyproject.toml # Project metadata and dependencies
├── main.py # Full pipeline script (run all steps)
├── notebooks/
│ └── notebook.ipynb # Interactive Jupyter notebook with visualizations
├── src/
│ ├── config.py # Hyperparameters and paths
│ ├── data_loader.py # Data loading and preprocessing
│ ├── svd_reduction.py # SVD/POD decomposition and reconstruction
│ ├── dmd_model.py # DMD model implementation
│ ├── sindy_model.py # SINDy model implementation
│ ├── ml_models.py # Ridge, MLP, and SVR models
│ ├── evaluation.py # Metrics (RMSE, relative error, correlation)
│ └── visualization.py # Plotting utilities
├── data/
│ └── vector_64.npy # Raw vector field data (15000 snapshots)
├── figures/ # Generated plots
├── results/
│ └── summary.txt # Evaluation summary
└── docs/ # Documentation

Requirements

  • Python 3.10+
  • NumPy
  • SciPy
  • Matplotlib
  • scikit-learn

Installation

pip install .

Or install with notebook support:

pip install .[notebook]

Quick Start

Run the full pipeline

python main.py

This executes all steps sequentially: data loading → SVD/POD → model fitting (DMD, SINDy, Ridge, MLP, SVR) → evaluation → visualization. Results are saved to results/summary.txt and figures to figures/.

Interactive notebook

Open notebooks/notebook.ipynb in Jupyter for step-by-step exploration with inline plots and discussion.

Pipeline

  1. Data Loading & Preprocessing — Load 15,000 snapshots of a ×ばつ2 velocity field; compute temporal mean and fluctuations
  2. SVD/POD Decomposition — Extract dominant spatial modes; reduce from 8,192 to 20 dimensions
  3. Model Fitting — Train five models on POD temporal coefficients (train set: 10,500 snapshots)
  4. Evaluation — Predict on validation (2,250) and test (2,250) sets; compute RMSE, relative error, and Pearson correlation
  5. Sliding Window Evaluation — Assess prediction accuracy at multiple horizons (1, 5, 10, 25, 50, 100, 200 steps)

Key Results

Model RMSE Rel. Error Correlation Fit Time
Ridge 0.7632 1.0113 0.1636 0.07s
MLP 1.0209 1.3729 -0.0649 6.44s
SVR 1.1336 1.5127 -0.0500 96.36s
DMD 1.8487 2.1707 -0.2035 0.01s
SINDy 2.5648 3.3436 0.1366 0.14s
  • Ridge Regression achieves the best overall accuracy across all horizons
  • DMD is the fastest to fit and produces bounded predictions but loses phase alignment
  • SINDy provides the most interpretable model (explicit governing equations) but diverges long-term
  • No model achieves reliable prediction beyond ~50 time steps for this chaotic system

Configuration

Key parameters can be adjusted in src/config.py:

Parameter Default Description
N_MODES 20 Number of POD modes retained
SINDY_N_MODES 10 Number of modes used in SINDy
ML_LOOKBACK 10 Lookback window for ML models
SINDY_THRESHOLD 0.005 Sparsity threshold for SINDy (STLSQ)
SINDY_POLY_ORDER 2 Polynomial order for SINDy library
DT 0.2 Simulation time step

About

A data-driven pipeline for modeling and predicting 2D vector field dynamics using dimensionality reduction and multiple forecasting methods. (ME5311 Project 2)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /