Welcome to the Rossby Wave Deep Learning Prediction App! This application simulates and predicts Rossby waves using various deep learning models, including LSTM, CNN, GAN, and Physics-Informed Neural Networks (PINNs). Built with Streamlit, it provides an interactive interface for generating wave simulations, training models, and visualizing predictions.
- Simulate Rossby Waves: Generate two-dimensional Rossby wave data using finite difference methods.
- Model Selection: Choose from LSTM, CNN, GAN, or PINN models to predict wave behavior.
- Interactive Hyperparameters: Adjust simulation and model hyperparameters in real-time.
- Visualization: View initial states, actual outcomes, and model predictions side by side.
- Training Progress: Monitor training progress and loss metrics live.
- Background
- Getting Started
- Prerequisites
- Installation
- Usage
- Simulation Parameters
- Model Training
- Wave Prediction
- Methods
- Rossby Wave Equation
- Deep Learning Models
- Contributing
The Rossby wave is a fundamental concept in geophysical fluid dynamics, describing large-scale motions in the Earth's atmosphere and oceans due to the planet's rotation. The two-dimensional barotropic Rossby wave equation is:
This Streamlit app provides a numerical solution to the Rossby wave equation. The governing equation is:
where
represents the Laplacian in two dimensions.
We can use finite difference methods to solve the Rossby wave equation numerically. This process involves calculating spatial derivatives. The spatial derivatives are computed using second derivatives in both ( x ) and ( y ) directions:
We used both sinusoidal and Gaussian initial conditions in 2D:
-
Sinusoidal:
ψ(x, y) = sin(4πx) sin(4πy)
-
Gaussian:
ψ(x, y) = exp(- ((x - x₀)² + (y - y₀)²) / (2σ²))
- Python 3.6+
- pip package installer
-
Clone the repository:
git clone https://github.com/yourusername/rossby-wave-prediction-app.git cd rossby-wave-prediction-app
-
Create a Virtual Environment (Optional but Recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Required Packages
pip install -r requirements.txt
-
Run the App
streamlit run rossby2_4.py
- Adjust Simulation Settings
- Navigate to the sidebar.
- Set parameters like grid points (Nx, Ny), domain lengths (Lx, Ly), Rossby parameter (β), wave numbers (kx, ky), Gaussian width (σ), total simulation time (T), and time step (dt).
- Generate Rossby Wave
- Click "Generate Rossby Wave".
- View the initial wave state displayed in the main area.
- Select Model Type
- Choose from LSTM, CNN, GAN, or PINNs in the sidebar.
- Set Model Hyperparameters
- Depending on the model, adjust hyperparameters like sequence length, units, filters, kernel size, latent dimensions, iterations, batch size, and learning rate.
- Run the Model
- Click "Run the model".
- Monitor the training progress, loss curves, and model summary displayed.
- Run Prediction
- After training, click "Run Prediction".
- Compare the Initial Wave State, Actual Wave State, and Predicted Wave State side by side.
- Review the mean squared error between the predicted and actual wave.
- Long Short-Term Memory (LSTM)
- Purpose: Capture temporal dependencies in sequential data.
- Architecture: Sequential model with LSTM layers followed by dense layers.
- Usage: Predict the next state of the wave given a sequence of previous states.
- Convolutional Neural Network (CNN)
- Purpose: Capture spatial patterns in data.
- Architecture: Sequential model with convolutional layers.
- Usage: Predict the next spatial state based on the current state.
- Generative Adversarial Network (GAN)
- Purpose: Generate new data samples mimicking the training data distribution.
- Architecture: Consists of a generator and discriminator network.
- Usage: Generate new wave states resembling actual wave states.
- Physics-Informed Neural Networks (PINNs)
- Purpose: Incorporate physical laws into the neural network training process.
- Usage: Solve partial differential equations (PDEs) using neural networks.
Contributions are welcome! Please follow these steps:
- Fork the Repository
Click on the "Fork" button at the top right of the repository page.
- Clone Your Fork
git clone https://github.com/yourusername/rossby-wave-prediction-app.git
cd rossby-wave-prediction-app
- Create a New Branch
git checkout -b feature/YourFeature
- Commit Your Changes
git commit -am 'Add new feature'
- Push to the Branch
git push origin feature/YourFeature