refactor: Major project cleanup and reorganization
## Removed Duplicate Directories - Deleted old `dashboard/` (replaced by atomizer-dashboard) - Deleted old `mcp_server/` Python tools (moved model_discovery to optimization_engine) - Deleted `tests/mcp_server/` (obsolete tests) - Deleted `launch_dashboard.bat` (old launcher) ## Consolidated Code - Moved `mcp_server/tools/model_discovery.py` to `optimization_engine/model_discovery/` - Updated import in `optimization_config_builder.py` - Deleted stub `extract_mass.py` (use extract_mass_from_bdf instead) - Deleted unused `intelligent_setup.py` and `hybrid_study_creator.py` - Archived `result_extractors/` to `archive/deprecated/` ## Documentation Cleanup - Deleted deprecated `docs/06_PROTOCOLS_DETAILED/` (14 files) - Archived dated dev docs to `docs/08_ARCHIVE/sessions/` - Archived old plans to `docs/08_ARCHIVE/plans/` - Updated `docs/protocols/README.md` with SYS_15 ## Skills Consolidation - Archived redundant study creation skills to `.claude/skills/archive/` - Kept `core/study-creation-core.md` as canonical ## Housekeeping - Updated `.gitignore` to prevent `nul` and `_dat_run*.dat` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
402
.claude/skills/archive/create-study-wizard.md
Normal file
402
.claude/skills/archive/create-study-wizard.md
Normal file
@@ -0,0 +1,402 @@
|
||||
# Create Study Wizard Skill
|
||||
|
||||
**Version**: 3.0 - StudyWizard Integration
|
||||
**Last Updated**: 2025-12-06
|
||||
|
||||
You are helping the user create a complete Atomizer optimization study using the powerful `StudyWizard` class.
|
||||
|
||||
---
|
||||
|
||||
## Quick Reference
|
||||
|
||||
```python
|
||||
from optimization_engine.study_wizard import StudyWizard, create_study, list_extractors
|
||||
|
||||
# Option 1: One-liner for simple studies
|
||||
create_study(
|
||||
study_name="my_study",
|
||||
description="Optimize bracket for stiffness",
|
||||
prt_file="path/to/model.prt",
|
||||
design_variables=[
|
||||
{"parameter": "thickness", "bounds": [5, 20], "units": "mm"}
|
||||
],
|
||||
objectives=[
|
||||
{"name": "stiffness", "goal": "maximize", "extractor": "extract_displacement"}
|
||||
],
|
||||
constraints=[
|
||||
{"name": "mass", "type": "less_than", "threshold": 0.5, "extractor": "extract_mass_from_bdf", "units": "kg"}
|
||||
]
|
||||
)
|
||||
|
||||
# Option 2: Step-by-step with full control
|
||||
wizard = StudyWizard("my_study", "Optimize bracket")
|
||||
wizard.set_model_files("path/to/model.prt")
|
||||
wizard.introspect() # Discover expressions, solutions
|
||||
wizard.add_design_variable("thickness", bounds=(5, 20), units="mm")
|
||||
wizard.add_objective("mass", goal="minimize", extractor="extract_mass_from_bdf")
|
||||
wizard.add_constraint("stress", type="less_than", threshold=250, extractor="extract_solid_stress", units="MPa")
|
||||
wizard.generate()
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Trigger Phrases
|
||||
|
||||
Use this skill when user says:
|
||||
- "create study", "new study", "set up study", "create optimization"
|
||||
- "optimize my [part/model/bracket/component]"
|
||||
- "help me minimize [mass/weight/cost]"
|
||||
- "help me maximize [stiffness/strength/frequency]"
|
||||
- "I want to find the best [design/parameters]"
|
||||
|
||||
---
|
||||
|
||||
## Workflow Steps
|
||||
|
||||
### Step 1: Gather Requirements
|
||||
|
||||
Ask the user (if not already provided):
|
||||
|
||||
1. **Model files**: "Where is your NX model? (path to .prt file)"
|
||||
2. **Optimization goal**: "What do you want to optimize?"
|
||||
- Minimize mass/weight
|
||||
- Maximize stiffness
|
||||
- Target a specific frequency
|
||||
- Multi-objective trade-off
|
||||
3. **Constraints**: "What limits must be respected?"
|
||||
- Max stress < yield/safety factor
|
||||
- Max displacement < tolerance
|
||||
- Mass budget
|
||||
|
||||
### Step 2: Introspect Model
|
||||
|
||||
```python
|
||||
from optimization_engine.study_wizard import StudyWizard
|
||||
|
||||
wizard = StudyWizard("study_name", "Description")
|
||||
wizard.set_model_files("path/to/model.prt")
|
||||
result = wizard.introspect()
|
||||
|
||||
# Show user what was found
|
||||
print(f"Found {len(result.expressions)} expressions:")
|
||||
for expr in result.expressions[:10]:
|
||||
print(f" {expr['name']}: {expr.get('value', 'N/A')}")
|
||||
|
||||
print(f"\nFound {len(result.solutions)} solutions:")
|
||||
for sol in result.solutions:
|
||||
print(f" {sol['name']}")
|
||||
|
||||
# Suggest design variables
|
||||
suggestions = result.suggest_design_variables()
|
||||
for s in suggestions:
|
||||
print(f" {s['name']}: {s['current_value']} -> bounds {s['suggested_bounds']}")
|
||||
```
|
||||
|
||||
### Step 3: Configure Study
|
||||
|
||||
```python
|
||||
# Add design variables from introspection suggestions
|
||||
for dv in selected_design_variables:
|
||||
wizard.add_design_variable(
|
||||
parameter=dv['name'],
|
||||
bounds=dv['bounds'],
|
||||
units=dv.get('units', ''),
|
||||
description=dv.get('description', '')
|
||||
)
|
||||
|
||||
# Add objectives
|
||||
wizard.add_objective(
|
||||
name="mass",
|
||||
goal="minimize",
|
||||
extractor="extract_mass_from_bdf",
|
||||
description="Minimize total bracket mass"
|
||||
)
|
||||
|
||||
wizard.add_objective(
|
||||
name="stiffness",
|
||||
goal="maximize",
|
||||
extractor="extract_displacement",
|
||||
params={"invert_for_stiffness": True},
|
||||
description="Maximize structural stiffness"
|
||||
)
|
||||
|
||||
# Add constraints
|
||||
wizard.add_constraint(
|
||||
name="max_stress",
|
||||
constraint_type="less_than",
|
||||
threshold=250,
|
||||
extractor="extract_solid_stress",
|
||||
units="MPa",
|
||||
description="Keep stress below yield/4"
|
||||
)
|
||||
|
||||
# Set protocol based on objectives
|
||||
if len(wizard.objectives) > 1:
|
||||
wizard.set_protocol("protocol_11_multi") # NSGA-II
|
||||
else:
|
||||
wizard.set_protocol("protocol_10_single") # TPE
|
||||
|
||||
wizard.set_trials(100)
|
||||
```
|
||||
|
||||
### Step 4: Generate Study
|
||||
|
||||
```python
|
||||
files = wizard.generate()
|
||||
|
||||
print("Study generated successfully!")
|
||||
print(f"Location: {wizard.study_dir}")
|
||||
print("\nNext steps:")
|
||||
print(" 1. cd", wizard.study_dir)
|
||||
print(" 2. python run_optimization.py --discover")
|
||||
print(" 3. python run_optimization.py --validate")
|
||||
print(" 4. python run_optimization.py --run --trials 100")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Available Extractors
|
||||
|
||||
| Extractor | What it extracts | Input | Output |
|
||||
|-----------|------------------|-------|--------|
|
||||
| `extract_mass_from_bdf` | Total mass | .dat/.bdf | kg |
|
||||
| `extract_part_mass` | CAD mass | .prt | kg |
|
||||
| `extract_displacement` | Max displacement | .op2 | mm |
|
||||
| `extract_solid_stress` | Von Mises stress | .op2 | MPa |
|
||||
| `extract_principal_stress` | Principal stresses | .op2 | MPa |
|
||||
| `extract_strain_energy` | Strain energy | .op2 | J |
|
||||
| `extract_spc_forces` | Reaction forces | .op2 | N |
|
||||
| `extract_frequency` | Natural frequencies | .op2 | Hz |
|
||||
| `get_first_frequency` | First mode frequency | .f06 | Hz |
|
||||
| `extract_temperature` | Nodal temperatures | .op2 | K/°C |
|
||||
| `extract_modal_mass` | Modal effective mass | .f06 | kg |
|
||||
| `extract_zernike_from_op2` | Zernike WFE | .op2+.bdf | nm |
|
||||
|
||||
**List all extractors programmatically**:
|
||||
```python
|
||||
from optimization_engine.study_wizard import list_extractors
|
||||
for name, info in list_extractors().items():
|
||||
print(f"{name}: {info['description']}")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Common Optimization Patterns
|
||||
|
||||
### Pattern 1: Minimize Mass with Stress Constraint
|
||||
|
||||
```python
|
||||
create_study(
|
||||
study_name="lightweight_bracket",
|
||||
description="Minimize mass while keeping stress below yield",
|
||||
prt_file="Bracket.prt",
|
||||
design_variables=[
|
||||
{"parameter": "wall_thickness", "bounds": [2, 10], "units": "mm"},
|
||||
{"parameter": "rib_count", "bounds": [2, 8], "units": "count"}
|
||||
],
|
||||
objectives=[
|
||||
{"name": "mass", "goal": "minimize", "extractor": "extract_mass_from_bdf"}
|
||||
],
|
||||
constraints=[
|
||||
{"name": "stress", "type": "less_than", "threshold": 250,
|
||||
"extractor": "extract_solid_stress", "units": "MPa"}
|
||||
],
|
||||
protocol="protocol_10_single"
|
||||
)
|
||||
```
|
||||
|
||||
### Pattern 2: Multi-Objective Stiffness vs Mass
|
||||
|
||||
```python
|
||||
create_study(
|
||||
study_name="pareto_bracket",
|
||||
description="Trade-off between stiffness and mass",
|
||||
prt_file="Bracket.prt",
|
||||
design_variables=[
|
||||
{"parameter": "thickness", "bounds": [5, 25], "units": "mm"},
|
||||
{"parameter": "support_angle", "bounds": [20, 70], "units": "degrees"}
|
||||
],
|
||||
objectives=[
|
||||
{"name": "stiffness", "goal": "maximize", "extractor": "extract_displacement"},
|
||||
{"name": "mass", "goal": "minimize", "extractor": "extract_mass_from_bdf"}
|
||||
],
|
||||
constraints=[
|
||||
{"name": "mass_limit", "type": "less_than", "threshold": 0.5,
|
||||
"extractor": "extract_mass_from_bdf", "units": "kg"}
|
||||
],
|
||||
protocol="protocol_11_multi",
|
||||
n_trials=150
|
||||
)
|
||||
```
|
||||
|
||||
### Pattern 3: Frequency-Targeted Modal Optimization
|
||||
|
||||
```python
|
||||
create_study(
|
||||
study_name="modal_bracket",
|
||||
description="Tune first natural frequency to target",
|
||||
prt_file="Bracket.prt",
|
||||
design_variables=[
|
||||
{"parameter": "thickness", "bounds": [3, 15], "units": "mm"},
|
||||
{"parameter": "length", "bounds": [50, 150], "units": "mm"}
|
||||
],
|
||||
objectives=[
|
||||
{"name": "frequency_error", "goal": "minimize",
|
||||
"extractor": "get_first_frequency",
|
||||
"params": {"target": 100}} # Target 100 Hz
|
||||
],
|
||||
constraints=[
|
||||
{"name": "mass", "type": "less_than", "threshold": 0.3,
|
||||
"extractor": "extract_mass_from_bdf", "units": "kg"}
|
||||
]
|
||||
)
|
||||
```
|
||||
|
||||
### Pattern 4: Thermal Optimization
|
||||
|
||||
```python
|
||||
create_study(
|
||||
study_name="heat_sink",
|
||||
description="Minimize max temperature",
|
||||
prt_file="HeatSink.prt",
|
||||
design_variables=[
|
||||
{"parameter": "fin_height", "bounds": [10, 50], "units": "mm"},
|
||||
{"parameter": "fin_count", "bounds": [5, 20], "units": "count"}
|
||||
],
|
||||
objectives=[
|
||||
{"name": "max_temp", "goal": "minimize", "extractor": "get_max_temperature"}
|
||||
],
|
||||
constraints=[
|
||||
{"name": "mass", "type": "less_than", "threshold": 0.2,
|
||||
"extractor": "extract_mass_from_bdf", "units": "kg"}
|
||||
]
|
||||
)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Protocol Selection Guide
|
||||
|
||||
| Scenario | Protocol | Sampler |
|
||||
|----------|----------|---------|
|
||||
| Single objective | `protocol_10_single` | TPESampler |
|
||||
| Multiple objectives (Pareto) | `protocol_11_multi` | NSGAIISampler |
|
||||
| Smooth design space | `protocol_10_single` | CmaEsSampler |
|
||||
| Discrete variables | `protocol_10_single` | TPESampler |
|
||||
|
||||
---
|
||||
|
||||
## Files Generated
|
||||
|
||||
The wizard generates a complete study structure:
|
||||
|
||||
```
|
||||
studies/{study_name}/
|
||||
├── 1_setup/
|
||||
│ ├── model/ # NX model files (copied)
|
||||
│ ├── optimization_config.json
|
||||
│ └── workflow_config.json
|
||||
├── 2_results/ # Created on first run
|
||||
├── run_optimization.py # Main script with staged workflow
|
||||
├── reset_study.py # Reset results
|
||||
├── README.md # Engineering documentation
|
||||
├── STUDY_REPORT.md # Results tracking template
|
||||
└── MODEL_INTROSPECTION.md # Model analysis report
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Staged Workflow
|
||||
|
||||
After generation, guide user through staged validation:
|
||||
|
||||
```bash
|
||||
# Stage 1: Discover model outputs
|
||||
python run_optimization.py --discover
|
||||
|
||||
# Stage 2: Validate with single trial
|
||||
python run_optimization.py --validate
|
||||
|
||||
# Stage 3: Integration test (3 trials)
|
||||
python run_optimization.py --test
|
||||
|
||||
# Stage 4: Full optimization
|
||||
python run_optimization.py --run --trials 100
|
||||
|
||||
# Resume if interrupted
|
||||
python run_optimization.py --run --trials 50 --resume
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
### Common Issues and Solutions
|
||||
|
||||
| Error | Cause | Solution |
|
||||
|-------|-------|----------|
|
||||
| "Part file not found" | Wrong path | Use absolute path or relative to studies/ |
|
||||
| "No expressions found" | Part not parametric | Add expressions in NX Modeling |
|
||||
| "Simulation failed" | NX not running | Start NX before running |
|
||||
| "Extractor not found" | Typo in name | Use `list_extractors()` to see valid names |
|
||||
|
||||
---
|
||||
|
||||
## Example Conversation
|
||||
|
||||
**User**: "I want to optimize my bracket for minimum weight while keeping stress low"
|
||||
|
||||
**Claude**: "I'll help you create a weight optimization study. Let me gather some information:
|
||||
|
||||
1. Where is your NX model file?
|
||||
2. What's the maximum allowable stress (e.g., yield/4)?
|
||||
3. Are there specific parameters you want to vary (thickness, angles, etc.)?"
|
||||
|
||||
**User**: "The model is at studies/my_bracket/model/Bracket.prt. Max stress should be 250 MPa. I want to vary the wall_thickness and support_angle."
|
||||
|
||||
**Claude**: "I'll create the study and introspect your model to confirm the parameters exist."
|
||||
|
||||
```python
|
||||
from optimization_engine.study_wizard import StudyWizard
|
||||
|
||||
wizard = StudyWizard(
|
||||
study_name="my_bracket_optimization",
|
||||
description="Minimize bracket mass with stress constraint"
|
||||
)
|
||||
|
||||
wizard.set_model_files("studies/my_bracket/model/Bracket.prt")
|
||||
|
||||
# Introspect to verify parameters
|
||||
result = wizard.introspect()
|
||||
print(f"Found expressions: {result.get_expression_names()}")
|
||||
|
||||
# Configure
|
||||
wizard.add_design_variable("wall_thickness", bounds=(2, 15), units="mm")
|
||||
wizard.add_design_variable("support_angle", bounds=(20, 60), units="degrees")
|
||||
wizard.add_objective("mass", goal="minimize", extractor="extract_mass_from_bdf")
|
||||
wizard.add_constraint("stress", constraint_type="less_than", threshold=250,
|
||||
extractor="extract_solid_stress", units="MPa")
|
||||
wizard.set_trials(100)
|
||||
|
||||
files = wizard.generate()
|
||||
```
|
||||
|
||||
**Claude**: "Study created! Here's what I generated:
|
||||
- `studies/my_bracket_optimization/run_optimization.py`
|
||||
- `studies/my_bracket_optimization/README.md`
|
||||
- Configuration files in `1_setup/`
|
||||
|
||||
Next steps:
|
||||
1. `cd studies/my_bracket_optimization`
|
||||
2. `python run_optimization.py --discover`
|
||||
3. `python run_optimization.py --validate`
|
||||
4. `python run_optimization.py --run --trials 100`"
|
||||
|
||||
---
|
||||
|
||||
## Cross-References
|
||||
|
||||
- **Extractor Library**: `docs/protocols/system/SYS_12_EXTRACTOR_LIBRARY.md`
|
||||
- **Protocol 10 (IMSO)**: `docs/protocols/system/SYS_10_IMSO.md`
|
||||
- **Protocol 11 (Multi-Objective)**: `docs/protocols/system/SYS_11_MULTI_OBJECTIVE.md`
|
||||
- **StudyWizard Source**: `optimization_engine/study_wizard.py`
|
||||
30
.claude/skills/archive/create-study.md
Normal file
30
.claude/skills/archive/create-study.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Create Study Skill - REDIRECT
|
||||
|
||||
**DEPRECATED**: This file has been consolidated.
|
||||
|
||||
---
|
||||
|
||||
## Use Instead
|
||||
|
||||
For study creation, use the core skill:
|
||||
|
||||
```
|
||||
.claude/skills/core/study-creation-core.md
|
||||
```
|
||||
|
||||
## Why This Changed
|
||||
|
||||
Phase 3 of the Agentic Architecture consolidated duplicate skills:
|
||||
- This file (2207 lines) duplicated content from `core/study-creation-core.md` (739 lines)
|
||||
- The core version is more focused and maintainable
|
||||
- All extractor references now point to `SYS_12_EXTRACTOR_LIBRARY.md`
|
||||
|
||||
## Migration
|
||||
|
||||
If you were loading `create-study.md`, now load:
|
||||
1. `core/study-creation-core.md` - Core study creation logic
|
||||
2. `SYS_12_EXTRACTOR_LIBRARY.md` - Extractor reference (single source of truth)
|
||||
|
||||
---
|
||||
|
||||
*Consolidated: 2025-12-07 | Phase 3: Skill Consolidation*
|
||||
325
.claude/skills/archive/guided-study-wizard.md
Normal file
325
.claude/skills/archive/guided-study-wizard.md
Normal file
@@ -0,0 +1,325 @@
|
||||
# Guided Study Creation Wizard
|
||||
|
||||
**Version**: 1.0
|
||||
**Purpose**: Interactive conversational wizard for creating new optimization studies from scratch.
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
This skill provides a step-by-step guided experience for users who want to create a new optimization study. It asks focused questions to gather requirements, then generates the complete study configuration.
|
||||
|
||||
---
|
||||
|
||||
## Wizard Flow
|
||||
|
||||
### Phase 1: Understanding the Problem (Discovery)
|
||||
|
||||
Start with open-ended questions to understand what the user wants to optimize:
|
||||
|
||||
**Opening Prompt:**
|
||||
```
|
||||
I'll help you set up a new optimization study. Let's start with the basics:
|
||||
|
||||
1. **What are you trying to optimize?**
|
||||
- Describe the physical system (e.g., "a telescope mirror", "a UAV arm", "a bracket")
|
||||
|
||||
2. **What's your goal?**
|
||||
- Minimize weight? Maximize stiffness? Minimize stress? Multiple objectives?
|
||||
|
||||
3. **Do you have an NX model ready?**
|
||||
- If yes, where is it located?
|
||||
- If no, we can discuss what's needed
|
||||
```
|
||||
|
||||
### Phase 2: Model Analysis (If NX model provided)
|
||||
|
||||
If user provides a model path:
|
||||
|
||||
1. **Check the model exists**
|
||||
```python
|
||||
# Verify path
|
||||
model_path = Path(user_provided_path)
|
||||
if model_path.exists():
|
||||
# Proceed with analysis
|
||||
else:
|
||||
# Ask for correct path
|
||||
```
|
||||
|
||||
2. **Extract expressions (design parameters)**
|
||||
- List all NX expressions that could be design variables
|
||||
- Ask user to confirm which ones to optimize
|
||||
|
||||
3. **Identify simulation setup**
|
||||
- What solution types are present? (static, modal, buckling)
|
||||
- What results are available?
|
||||
|
||||
### Phase 3: Define Objectives & Constraints
|
||||
|
||||
Ask focused questions:
|
||||
|
||||
```
|
||||
Based on your model, I can see these results are available:
|
||||
- Displacement (from static solution)
|
||||
- Von Mises stress (from static solution)
|
||||
- Natural frequency (from modal solution)
|
||||
- Mass (from geometry)
|
||||
|
||||
**Questions:**
|
||||
|
||||
1. **Primary Objective** - What do you want to minimize/maximize?
|
||||
Examples: "minimize tip displacement", "minimize mass"
|
||||
|
||||
2. **Secondary Objectives** (optional) - Any other goals?
|
||||
Examples: "also minimize stress", "maximize first frequency"
|
||||
|
||||
3. **Constraints** - What limits must be respected?
|
||||
Examples: "stress < 200 MPa", "frequency > 50 Hz", "mass < 2 kg"
|
||||
```
|
||||
|
||||
### Phase 4: Define Design Space
|
||||
|
||||
For each design variable identified:
|
||||
|
||||
```
|
||||
For parameter `{param_name}` (current value: {current_value}):
|
||||
- **Minimum value**: (default: -20% of current)
|
||||
- **Maximum value**: (default: +20% of current)
|
||||
- **Type**: continuous or discrete?
|
||||
```
|
||||
|
||||
### Phase 5: Optimization Settings
|
||||
|
||||
```
|
||||
**Optimization Configuration:**
|
||||
|
||||
1. **Number of trials**: How thorough should the search be?
|
||||
- Quick exploration: 50-100 trials
|
||||
- Standard: 100-200 trials
|
||||
- Thorough: 200-500 trials
|
||||
- With neural acceleration: 500+ trials
|
||||
|
||||
2. **Protocol Selection** (I'll recommend based on your setup):
|
||||
- Single objective → Protocol 10 (IMSO)
|
||||
- Multi-objective (2-3 goals) → Protocol 11 (NSGA-II)
|
||||
- Large-scale with NN → Protocol 12 (Hybrid)
|
||||
|
||||
3. **Neural Network Acceleration**:
|
||||
- Enable if n_trials > 100 and you want faster iterations
|
||||
```
|
||||
|
||||
### Phase 6: Summary & Confirmation
|
||||
|
||||
Present the complete configuration for user approval:
|
||||
|
||||
```
|
||||
## Study Configuration Summary
|
||||
|
||||
**Study Name**: {study_name}
|
||||
**Location**: studies/{study_name}/
|
||||
|
||||
**Model**: {model_path}
|
||||
|
||||
**Design Variables** ({n_vars} parameters):
|
||||
| Parameter | Min | Max | Type |
|
||||
|-----------|-----|-----|------|
|
||||
| {name1} | {min1} | {max1} | continuous |
|
||||
| ... | ... | ... | ... |
|
||||
|
||||
**Objectives**:
|
||||
- {objective1}: {direction1}
|
||||
- {objective2}: {direction2} (if multi-objective)
|
||||
|
||||
**Constraints**:
|
||||
- {constraint1}
|
||||
- {constraint2}
|
||||
|
||||
**Settings**:
|
||||
- Protocol: {protocol}
|
||||
- Trials: {n_trials}
|
||||
- Sampler: {sampler}
|
||||
- Neural Acceleration: {enabled/disabled}
|
||||
|
||||
---
|
||||
|
||||
Does this look correct?
|
||||
- Type "yes" to generate the study files
|
||||
- Type "change X" to modify a specific setting
|
||||
- Type "start over" to begin again
|
||||
```
|
||||
|
||||
### Phase 7: Generation
|
||||
|
||||
Once confirmed, generate:
|
||||
|
||||
1. Create study directory structure
|
||||
2. Copy model files to working directory
|
||||
3. Generate `optimization_config.json`
|
||||
4. Generate `run_optimization.py`
|
||||
5. Validate everything works
|
||||
|
||||
```
|
||||
✓ Study created successfully!
|
||||
|
||||
**Next Steps:**
|
||||
1. Review the generated files in studies/{study_name}/
|
||||
2. Run a quick validation: `python run_optimization.py --validate`
|
||||
3. Start optimization: `python run_optimization.py --start`
|
||||
|
||||
Or just tell me "start the optimization" and I'll handle it!
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Question Templates
|
||||
|
||||
### For Understanding Goals
|
||||
|
||||
- "What problem are you trying to solve?"
|
||||
- "What makes a 'good' design for your application?"
|
||||
- "Are there any hard limits that must not be exceeded?"
|
||||
- "Is this a weight reduction study, a performance study, or both?"
|
||||
|
||||
### For Design Variables
|
||||
|
||||
- "Which dimensions or parameters should I vary?"
|
||||
- "Are there any parameters that must stay fixed?"
|
||||
- "What are reasonable bounds for {parameter}?"
|
||||
- "Should {parameter} be continuous or discrete (specific values only)?"
|
||||
|
||||
### For Constraints
|
||||
|
||||
- "What's the maximum stress this component can handle?"
|
||||
- "Is there a minimum stiffness requirement?"
|
||||
- "Are there weight limits?"
|
||||
- "What frequency should the structure avoid (resonance concerns)?"
|
||||
|
||||
### For Optimization Settings
|
||||
|
||||
- "How much time can you allocate to this study?"
|
||||
- "Do you need a quick exploration or thorough optimization?"
|
||||
- "Is this a preliminary study or final optimization?"
|
||||
|
||||
---
|
||||
|
||||
## Default Configurations by Use Case
|
||||
|
||||
### Structural Weight Minimization
|
||||
```json
|
||||
{
|
||||
"objectives": [
|
||||
{"name": "mass", "direction": "minimize", "target": null}
|
||||
],
|
||||
"constraints": [
|
||||
{"name": "max_stress", "type": "<=", "value": 200e6, "unit": "Pa"},
|
||||
{"name": "max_displacement", "type": "<=", "value": 0.001, "unit": "m"}
|
||||
],
|
||||
"n_trials": 150,
|
||||
"sampler": "TPE"
|
||||
}
|
||||
```
|
||||
|
||||
### Multi-Objective (Weight vs Performance)
|
||||
```json
|
||||
{
|
||||
"objectives": [
|
||||
{"name": "mass", "direction": "minimize"},
|
||||
{"name": "max_displacement", "direction": "minimize"}
|
||||
],
|
||||
"n_trials": 200,
|
||||
"sampler": "NSGA-II"
|
||||
}
|
||||
```
|
||||
|
||||
### Modal Optimization (Frequency Tuning)
|
||||
```json
|
||||
{
|
||||
"objectives": [
|
||||
{"name": "first_frequency", "direction": "maximize"}
|
||||
],
|
||||
"constraints": [
|
||||
{"name": "mass", "type": "<=", "value": 5.0, "unit": "kg"}
|
||||
],
|
||||
"n_trials": 150,
|
||||
"sampler": "TPE"
|
||||
}
|
||||
```
|
||||
|
||||
### Telescope Mirror (Zernike WFE)
|
||||
```json
|
||||
{
|
||||
"objectives": [
|
||||
{"name": "filtered_rms", "direction": "minimize", "unit": "nm"}
|
||||
],
|
||||
"constraints": [
|
||||
{"name": "mass", "type": "<=", "value": null}
|
||||
],
|
||||
"extractor": "ZernikeExtractor",
|
||||
"n_trials": 200,
|
||||
"sampler": "NSGA-II"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
### Model Not Found
|
||||
```
|
||||
I couldn't find a model at that path. Let's verify:
|
||||
- Current directory: {cwd}
|
||||
- You specified: {user_path}
|
||||
|
||||
Could you check the path and try again?
|
||||
Tip: Use an absolute path like "C:/Users/.../model.prt"
|
||||
```
|
||||
|
||||
### No Expressions Found
|
||||
```
|
||||
I couldn't find any parametric expressions in this model.
|
||||
|
||||
For optimization, we need parameters defined as NX expressions.
|
||||
Would you like me to explain how to add expressions to your model?
|
||||
```
|
||||
|
||||
### Invalid Constraint
|
||||
```
|
||||
That constraint doesn't match any available results.
|
||||
|
||||
Available results from your model:
|
||||
- {result1}
|
||||
- {result2}
|
||||
|
||||
Which of these would you like to constrain?
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Integration with Dashboard
|
||||
|
||||
When running from the Atomizer dashboard with a connected Claude terminal:
|
||||
|
||||
1. **No study selected** → Offer to create a new study
|
||||
2. **Study selected** → Use that study's context, offer to modify or run
|
||||
|
||||
The dashboard will display the study once created, showing real-time progress.
|
||||
|
||||
---
|
||||
|
||||
## Quick Commands
|
||||
|
||||
For users who know what they want:
|
||||
|
||||
- `create study {name} from {model_path}` - Skip to model analysis
|
||||
- `quick setup` - Use all defaults, just confirm
|
||||
- `copy study {existing} as {new}` - Clone an existing study as starting point
|
||||
|
||||
---
|
||||
|
||||
## Remember
|
||||
|
||||
- **Be conversational** - This is a wizard, not a form
|
||||
- **Offer sensible defaults** - Don't make users specify everything
|
||||
- **Validate as you go** - Catch issues early
|
||||
- **Explain decisions** - Say why you recommend certain settings
|
||||
- **Keep it focused** - One question at a time, don't overwhelm
|
||||
Reference in New Issue
Block a user