--- license: mit tags: - aerospace - physics-informed-neural-network - pinn - pytorch - surrogate-model - alrithm library_name: pytorch --- # πŸš€ ALRITHM-Astro **ALRITHM-Astro** is an AI-powered Aerospace Engineering Copilot designed to simulate rocket flight dynamics and predict Maximum Dynamic Pressure (Max Q). It combines a custom-trained Physics-Informed Neural Network (PINN) with a natural language interface. πŸ”— **[Try the Live Demo Here](https://godela-web.vercel.app)** ## πŸ›οΈ Powered by Alrithm This project is fundamentally built upon and inspired by the vision of **[Alrithm](https://alrithmapi.vercel.app)**. - **Data Source:** The current model version is trained on a specific subset of the **`alr-aerospace-platform-0.2`** dataset (targeting the `max_q_kpa` quantity), fetched via the official Alrithm API. - **Philosophy:** Alrithm provides rigorously verified, high-fidelity aerospace data. ALRITHM-Astro serves as a demonstration of how developers can leverage Alrithm's verified data streams to build real-time, physics-informed AI applications. ## ✨ Features - **Natural Language Processing:** Understands complex aerospace queries using Groq's LLMs (`openai/gpt-oss-120b`). - **Physics-Informed Prediction:** Calculates Max Q with high precision using a custom PyTorch Neural Network. - **Interactive 3D Visualization:** Renders the rocket's 3D trajectory in real-time using Plotly.js. - **Full-Stack Architecture:** FastAPI backend (Render) + Vanilla JS frontend (Vercel). ## 🧠 Model Details (Version 0.2 - Max Q Specialist) - **Architecture:** Multi-Layer Perceptron (MLP) with 256 hidden units and SiLU activation. - **Input Features:** 13 engineered physical features (e.g., Burnout Velocity, Thrust-to-Weight Ratio, Mass Ratio). - **Output:** Maximum Dynamic Pressure (`max_q_kpa`). - **Training:** 5-Fold Cross-Validation (Fine-tuned specifically on the `max_q_kpa` subset of the Alrithm dataset). > ⚠️ **Current Limitation:** This `v0.2` model is a **Single-Task** surrogate model. It is currently specialized only for `max_q_kpa`. It has *not yet* been trained on the entire 4600+ dataset across all task types. ## πŸ—ΊοΈ Roadmap (Next Steps) - [x] **Phase 1:** Build the End-to-End Pipeline (Data -> Neural Network -> FastAPI -> Vercel). - [x] **Phase 2:** Train a Single-Task Model for `max_q_kpa`. - [ ] **Phase 3:** Implement **Multi-Task Learning (MTL)** using the full 4600+ `alr-aerospace-platform-0.2` dataset to predict all quantities (Apogee, Burnout Speed, etc.) simultaneously. ## πŸ› οΈ How to use this model You can load this model directly using PyTorch: ```python import torch import torch.nn as nn class PureMLPModel_Deep(nn.Module): def __init__(self, in_dim=13, hidden=256): super().__init__() self.net = nn.Sequential( nn.Linear(in_dim, hidden), nn.SiLU(), nn.Linear(hidden, hidden), nn.SiLU(), nn.Linear(hidden, hidden), nn.SiLU(), nn.Linear(hidden, 1), ) def forward(self, x): return self.net(x).squeeze(-1) # 1. Load the ALRITHM-Astro model weights checkpoint = torch.load("alrithm_astro_model.pth", map_location="cpu") # 2. Initialize the architecture and load weights model = PureMLPModel_Deep() model.load_state_dict(checkpoint['model_state_dict']) model.eval() # 3. Retrieve the scalers for data normalization scaler_x = checkpoint['scaler_x'] scaler_y = checkpoint['scaler_y'] print("βœ… ALRITHM-Astro model loaded successfully!")