A comprehensive AI-powered nuclear reactor control and monitoring system using Deep Reinforcement Learning (Soft Actor-Critic) models.
This project demonstrates an advanced control system for nuclear reactors using pre-trained SAC (Soft Actor-Critic) reinforcement learning models. The system provides:
- Real-time Reactor Monitoring: Live dashboards with gauges, graphs, and metrics
- AI-Powered Control: Automatic reactor control using trained SAC agents
- Manual Override: User-adjustable controls for testing and education
- Scenario Testing: Multiple test scenarios (LOFA, rod malfunction, power ramp)
- Event Detection: Anomaly detection and critical event logging
- Performance Metrics: Comprehensive statistics on model performance
- Node.js 18+ and npm
- Python 3.8+
- Ports 3000 (frontend) and 8000 (backend) available
# Terminal 1: Start Backend
cd backend
pip install -r requirements.txt
python run.py
# Expected: "Running on http://localhost:8000"
# Terminal 2: Start Frontend
cd frontend
npm install
npm run dev
# Expected: "Ready on http://localhost:3000"- Open http://localhost:3000
- Select a model from dropdown (e.g., "Enhanced SAC Agent")
- Select a scenario (e.g., "Normal Operation")
- Click "Start Simulation"
- Watch the AI control the reactor in real-time!
- 4 Circular Gauges: Power, Fuel Temperature, Coolant Temperature, Pressure
- Control Rods Display: Visual representation of power and precursor levels
- Temperature Heatmap: Color-coded thermal profile
- Model Selector: Choose between Enhanced or Optimized SAC agent
- Scenario Selector: Test different reactor conditions
- Control Buttons: Start, Stop, Pause, Reset
- Manual Controls: Adjustable sliders for control rods and coolant flow
- Status Card: Current simulation state and progress
- Event Log: Timestamped events (100 max, circular buffer)
- Metrics Summary: Statistics (reward, steps, temperature peaks, etc.)
- Score Cards: Key performance indicators
- Real-time Graphs: Power, temperatures, and pressure trends
GET /api/health โ Backend health check
GET /api/status โ System status & available models/scenarios
GET /api/models โ List all models
GET /api/models/{id} โ Model details
POST /api/models/{id}/load โ Load model into memory
GET /api/scenarios โ List available scenarios
POST /api/simulation/reset โ Reset environment
POST /api/simulation/start โ Start with model & scenario
POST /api/simulation/step โ Execute AI step
POST /api/simulation/action โ Execute manual action
GET /api/simulation/state โ Get current state
POST /api/simulation/stop โ Stop & get summary
- Training Steps: 250,000
- Average Reward: 48.6 points/step
- Network Size: Large
- Performance: Excellent control stability
- Use Case: Production control
- Location:
python/SAC_enhanced_model/nuclear_reactor_sac/models/enhanced/best_model.pth
- Training Steps: 150,000
- Average Reward: 7.3 points/step
- Network Size: Smaller
- Performance: Good control with faster inference
- Use Case: Real-time edge deployment
- Location:
python/SAC_model/models/optimized/best_model.pth
Default safe reactor operation at nominal 100 MW. Used for baseline testing.
Simulates loss of coolant flow (40% reduction) starting at t=5s. Tests AI's ability to manage reactor without added cooling.
Control rod stuck at 50% insertion starting at t=3s. Tests AI's ability to control power with limited rod movement.
Gradual demand increase to 120 MW. Tests safe power escalation and thermal management.
- Select model and scenario
- Click "Start"
- Watch AI maintain reactor stability
- Monitor real-time metrics and events
- Start simulation in any scenario
- Adjust control rods (-1.0 fully retracted, 1.0 fully inserted)
- Adjust coolant flow (-1.0 decrease, 1.0 increase)
- Compare your manual control against the AI
- Stop simulation at any time
- View final metrics and performance
- Compare multiple models on same scenario
- Export event history and metrics
- โ Production-ready Flask backend
- โ Complete Next.js frontend
- โ 20+ React components
- โ Real-time reactor monitoring
- โ AI model integration
- โ Manual control override
- โ Multiple scenarios
- โ Performance metrics
- โ Event logging
- โ Comprehensive documentation
- โ Type-safe code
- โ Error handling
- โ CORS configuration
- WebSocket real-time updates
- Model comparison mode
- Historical data storage
- Advanced charting (Recharts)
- Dark mode
- Export capabilities
- Model training UI
- Docker containerization
This project is licensed under the terms specified in the MIT License.
A complete, production-ready AI-powered nuclear reactor control system demonstrating:
- โ Advanced AI control (Soft Actor-Critic)
- โ Real-time monitoring and visualization
- โ Comprehensive documentation
- โ Professional code quality
- โ Modern web technologies
- โ Ready to run locally
- โ Ready to deploy
Status: โ FULLY FUNCTIONAL
# 1. Backend (Terminal 1)
cd backend && pip install -r requirements.txt && python run.py
# 2. Frontend (Terminal 2)
cd frontend && npm install && npm run dev
# 3. Open Browser
http://localhost:3000Then explore, experiment, and enjoy controlling a nuclear reactor with AI! ๐โ๏ธ
Version: 1.0.0
Last Updated: April 2025
Status: Production Ready