201 lines
6.6 KiB
Markdown
201 lines
6.6 KiB
Markdown
|
|
# UAV Arm AtomizerField Test Study
|
|||
|
|
|
|||
|
|
## Overview
|
|||
|
|
|
|||
|
|
This document summarizes the setup of the UAV arm AtomizerField neural surrogate test study, demonstrating the integration of Graph Neural Networks (GNN) for 600x-500,000x speedup in FEA-based optimization.
|
|||
|
|
|
|||
|
|
## Study Location
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
studies/uav_arm_atomizerfield_test/
|
|||
|
|
├── 1_setup/
|
|||
|
|
│ ├── model/ # NX model files (copied from uav_arm_optimization)
|
|||
|
|
│ └── workflow_config.json # Neural surrogate configuration
|
|||
|
|
├── 2_results/ # Will contain optimization results
|
|||
|
|
├── run_optimization.py # Neural-enhanced runner script
|
|||
|
|
└── reset_study.py # Clean reset utility
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Neural Surrogate Configuration
|
|||
|
|
|
|||
|
|
The study is configured with a **phased optimization strategy**:
|
|||
|
|
|
|||
|
|
### Phase 1: Initial FEA Exploration (Trials 0-30)
|
|||
|
|
- **Purpose**: Collect diverse training data using pure FEA
|
|||
|
|
- **Neural Surrogate**: DISABLED
|
|||
|
|
- **Training Data Export**: ENABLED to `atomizer_field_training_data/uav_arm_test/`
|
|||
|
|
|
|||
|
|
### Phase 2: Neural Training (Trials 31-40)
|
|||
|
|
- **Purpose**: Continue FEA while training neural network
|
|||
|
|
- **Neural Surrogate**: DISABLED (training in background)
|
|||
|
|
- **Action Required**: Run AtomizerField training scripts
|
|||
|
|
|
|||
|
|
### Phase 3: Neural Exploitation (Trials 41-180)
|
|||
|
|
- **Purpose**: Rapid optimization using neural surrogate
|
|||
|
|
- **Neural Surrogate**: ENABLED (600x speedup)
|
|||
|
|
- **Confidence Threshold**: 85% (fallback to FEA if lower)
|
|||
|
|
|
|||
|
|
### Phase 4: Final Validation (Trials 181-200)
|
|||
|
|
- **Purpose**: Validate best designs with FEA
|
|||
|
|
- **Neural Surrogate**: DISABLED
|
|||
|
|
- **Ensures accuracy of final results**
|
|||
|
|
|
|||
|
|
## Key Features
|
|||
|
|
|
|||
|
|
### 1. Training Data Export
|
|||
|
|
- Automatically exports NX Nastran .dat (input) and .op2 (results) files
|
|||
|
|
- Creates structured directory with metadata.json for each trial
|
|||
|
|
- Compatible with AtomizerField batch_parser.py
|
|||
|
|
|
|||
|
|
### 2. Confidence-Based Fallback
|
|||
|
|
- Neural predictions include confidence estimate
|
|||
|
|
- Automatically falls back to FEA when confidence < 85%
|
|||
|
|
- Ensures reliability while maximizing speedup
|
|||
|
|
|
|||
|
|
### 3. Hybrid Optimization
|
|||
|
|
- Smart switching between FEA and NN based on:
|
|||
|
|
- Current optimization phase
|
|||
|
|
- Prediction confidence
|
|||
|
|
- Validation frequency
|
|||
|
|
- Drift detection
|
|||
|
|
|
|||
|
|
### 4. Performance Tracking
|
|||
|
|
- Tracks speedup metrics for each neural prediction
|
|||
|
|
- Exports performance report after optimization
|
|||
|
|
- Shows time saved and accuracy achieved
|
|||
|
|
|
|||
|
|
## Running the Test
|
|||
|
|
|
|||
|
|
### Step 1: Initial FEA Trials (Collect Training Data)
|
|||
|
|
```bash
|
|||
|
|
cd studies/uav_arm_atomizerfield_test
|
|||
|
|
python run_optimization.py --trials 30
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
This will:
|
|||
|
|
- Run 30 FEA trials to explore design space
|
|||
|
|
- Export training data to `atomizer_field_training_data/uav_arm_test/`
|
|||
|
|
- Create optimization database in `2_results/study.db`
|
|||
|
|
|
|||
|
|
### Step 2: Train Neural Network (AtomizerField)
|
|||
|
|
```bash
|
|||
|
|
cd atomizer-field
|
|||
|
|
python batch_parser.py --data-dir ../atomizer_field_training_data/uav_arm_test
|
|||
|
|
python train.py --epochs 200 --model GraphUNet
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
### Step 3: Enable Neural Surrogate
|
|||
|
|
Update `workflow_config.json`:
|
|||
|
|
```json
|
|||
|
|
{
|
|||
|
|
"neural_surrogate": {
|
|||
|
|
"enabled": true, // Change from false to true
|
|||
|
|
"model_checkpoint": "atomizer-field/checkpoints/uav_arm_model/best.pt"
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
### Step 4: Continue Optimization with Neural Acceleration
|
|||
|
|
```bash
|
|||
|
|
python run_optimization.py --trials 170 --resume --enable-nn
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
This will:
|
|||
|
|
- Use neural network for trials 41-180 (140 trials)
|
|||
|
|
- Achieve 600x+ speedup (50ms vs 30 minutes per evaluation)
|
|||
|
|
- Fall back to FEA when confidence is low
|
|||
|
|
- Validate final 20 designs with FEA
|
|||
|
|
|
|||
|
|
## Expected Results
|
|||
|
|
|
|||
|
|
### Without Neural Surrogate (Pure FEA)
|
|||
|
|
- 200 trials × 30 minutes = 100 hours
|
|||
|
|
- Limited design space exploration
|
|||
|
|
- High computational cost
|
|||
|
|
|
|||
|
|
### With Neural Surrogate
|
|||
|
|
- 50 FEA trials × 30 minutes = 25 hours
|
|||
|
|
- 150 NN trials × 50ms = 7.5 seconds
|
|||
|
|
- **Total: ~25 hours (75% reduction)**
|
|||
|
|
- 600x more designs evaluated in exploitation phase
|
|||
|
|
|
|||
|
|
## Monitoring Progress
|
|||
|
|
|
|||
|
|
The script provides real-time feedback:
|
|||
|
|
```
|
|||
|
|
Trial 42: Used neural network (confidence: 94.2%, time: 0.048s)
|
|||
|
|
Trial 43: Neural confidence too low (72.1%), using FEA
|
|||
|
|
Trial 44: Used neural network (confidence: 91.8%, time: 0.051s)
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Final summary:
|
|||
|
|
```
|
|||
|
|
============================================================
|
|||
|
|
NEURAL NETWORK SPEEDUP SUMMARY
|
|||
|
|
============================================================
|
|||
|
|
Trials using neural network: 140/200 (70.0%)
|
|||
|
|
Average NN inference time: 0.052 seconds
|
|||
|
|
Average NN confidence: 92.3%
|
|||
|
|
Estimated speedup: 34,615x
|
|||
|
|
Time saved: ~70.0 hours
|
|||
|
|
============================================================
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Design Variables (4)
|
|||
|
|
1. **beam_half_core_thickness**: 20-30 mm
|
|||
|
|
2. **beam_face_thickness**: 1-3 mm
|
|||
|
|
3. **holes_diameter**: 180-280 mm
|
|||
|
|
4. **hole_count**: 8-14 (integer)
|
|||
|
|
|
|||
|
|
## Objectives (2)
|
|||
|
|
1. **Minimize mass** (target < 120g)
|
|||
|
|
2. **Maximize fundamental frequency** (target > 150 Hz)
|
|||
|
|
|
|||
|
|
## Constraints (3)
|
|||
|
|
1. **Max displacement < 1.5mm** (850g camera load)
|
|||
|
|
2. **Max stress < 120 MPa** (Al 6061-T6, SF=2.3)
|
|||
|
|
3. **Min frequency > 150 Hz** (avoid rotor resonance)
|
|||
|
|
|
|||
|
|
## Files Created
|
|||
|
|
|
|||
|
|
1. **run_optimization.py**: Neural-enhanced optimization runner
|
|||
|
|
- Uses `NeuralOptimizationRunner` from `runner_with_neural.py`
|
|||
|
|
- Integrates with existing NX solver and extractors
|
|||
|
|
- Command-line flags for training and enabling NN
|
|||
|
|
|
|||
|
|
2. **workflow_config.json**: Complete neural surrogate configuration
|
|||
|
|
- Neural model settings (checkpoint, confidence, device)
|
|||
|
|
- Hybrid optimization phases
|
|||
|
|
- Training data export configuration
|
|||
|
|
- Performance tracking settings
|
|||
|
|
|
|||
|
|
3. **reset_study.py**: Clean reset utility
|
|||
|
|
- Removes results and training data
|
|||
|
|
- Preserves setup and model files
|
|||
|
|
|
|||
|
|
## Next Steps
|
|||
|
|
|
|||
|
|
1. **Run initial FEA trials** to generate training data
|
|||
|
|
2. **Train AtomizerField model** on collected data
|
|||
|
|
3. **Enable neural surrogate** and continue optimization
|
|||
|
|
4. **Analyze speedup metrics** and validate accuracy
|
|||
|
|
5. **Deploy to production** if successful
|
|||
|
|
|
|||
|
|
## Integration Status
|
|||
|
|
|
|||
|
|
✅ Neural surrogate module created (`optimization_engine/neural_surrogate.py`)
|
|||
|
|
✅ Neural runner created (`optimization_engine/runner_with_neural.py`)
|
|||
|
|
✅ Training data exporter integrated (`optimization_engine/training_data_exporter.py`)
|
|||
|
|
✅ UAV arm test study configured
|
|||
|
|
⏳ Waiting to run initial trials and train model
|
|||
|
|
|
|||
|
|
## Technical Details
|
|||
|
|
|
|||
|
|
- **Neural Architecture**: Graph U-Net with 718k parameters
|
|||
|
|
- **Input**: FEA mesh topology + design variables
|
|||
|
|
- **Output**: Stress, displacement, frequency predictions
|
|||
|
|
- **Physics Loss**: Enforces equilibrium and boundary conditions
|
|||
|
|
- **Ensemble**: 3 models for uncertainty quantification
|
|||
|
|
- **Device**: CUDA GPU for 10x faster inference
|
|||
|
|
|
|||
|
|
This test study demonstrates the seamless integration of AtomizerField neural surrogates with Atomizer, enabling dramatic speedup in engineering optimization while maintaining accuracy through confidence-based fallback and validation.
|