123 lines
3.8 KiB
Markdown
123 lines
3.8 KiB
Markdown
|
|
# Analyze Optimization Workflow Skill
|
||
|
|
|
||
|
|
You are analyzing a structural optimization request for the Atomizer system.
|
||
|
|
|
||
|
|
When the user provides a request, break it down into atomic workflow steps and classify each step intelligently.
|
||
|
|
|
||
|
|
## Step Types
|
||
|
|
|
||
|
|
**1. ENGINEERING FEATURES** - Complex FEA/CAE operations needing specialized knowledge:
|
||
|
|
- Extract results from OP2 files (displacement, stress, strain, element forces, etc.)
|
||
|
|
- Modify FEA properties (CBUSH/CBAR stiffness, PCOMP layup, material properties)
|
||
|
|
- Run simulations (SOL101, SOL103, etc.)
|
||
|
|
- Create/modify geometry in NX
|
||
|
|
|
||
|
|
**2. INLINE CALCULATIONS** - Simple math operations (auto-generate Python):
|
||
|
|
- Calculate average, min, max, sum
|
||
|
|
- Compare values, compute ratios
|
||
|
|
- Statistical operations
|
||
|
|
|
||
|
|
**3. POST-PROCESSING HOOKS** - Custom calculations between FEA steps:
|
||
|
|
- Custom objective functions combining multiple results
|
||
|
|
- Data transformations
|
||
|
|
- Filtering/aggregation logic
|
||
|
|
|
||
|
|
**4. OPTIMIZATION** - Algorithm and configuration:
|
||
|
|
- Optuna, genetic algorithm, etc.
|
||
|
|
- Design variables and their ranges
|
||
|
|
- Multi-objective vs single objective
|
||
|
|
|
||
|
|
## Important Distinctions
|
||
|
|
|
||
|
|
- "extract forces from 1D elements" → ENGINEERING FEATURE (needs pyNastran/OP2 knowledge)
|
||
|
|
- "find average of forces" → INLINE CALCULATION (simple Python: sum/len)
|
||
|
|
- "compare max to average and create metric" → POST-PROCESSING HOOK (custom logic)
|
||
|
|
- Element forces vs Reaction forces are DIFFERENT (element internal forces vs nodal reactions)
|
||
|
|
- CBUSH vs CBAR are different element types with different properties
|
||
|
|
- Extract from OP2 vs Read from .prt expression are different domains
|
||
|
|
|
||
|
|
## Output Format
|
||
|
|
|
||
|
|
Return a detailed JSON analysis with this structure:
|
||
|
|
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"engineering_features": [
|
||
|
|
{
|
||
|
|
"action": "extract_1d_element_forces",
|
||
|
|
"domain": "result_extraction",
|
||
|
|
"description": "Extract element forces from 1D elements (CBAR) in Z direction from OP2 file",
|
||
|
|
"params": {
|
||
|
|
"element_types": ["CBAR"],
|
||
|
|
"result_type": "element_force",
|
||
|
|
"direction": "Z"
|
||
|
|
},
|
||
|
|
"why_engineering": "Requires pyNastran library and OP2 file format knowledge"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"inline_calculations": [
|
||
|
|
{
|
||
|
|
"action": "calculate_average",
|
||
|
|
"description": "Calculate average of extracted forces",
|
||
|
|
"params": {
|
||
|
|
"input": "forces_z",
|
||
|
|
"operation": "mean"
|
||
|
|
},
|
||
|
|
"code_hint": "avg = sum(forces_z) / len(forces_z)"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"action": "find_minimum",
|
||
|
|
"description": "Find minimum force value",
|
||
|
|
"params": {
|
||
|
|
"input": "forces_z",
|
||
|
|
"operation": "min"
|
||
|
|
},
|
||
|
|
"code_hint": "min_val = min(forces_z)"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"post_processing_hooks": [
|
||
|
|
{
|
||
|
|
"action": "custom_objective_metric",
|
||
|
|
"description": "Compare minimum to average and create objective metric to minimize",
|
||
|
|
"params": {
|
||
|
|
"inputs": ["min_force", "avg_force"],
|
||
|
|
"formula": "min_force / avg_force",
|
||
|
|
"objective": "minimize"
|
||
|
|
},
|
||
|
|
"why_hook": "Custom business logic that combines multiple calculations"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"optimization": {
|
||
|
|
"algorithm": "genetic_algorithm",
|
||
|
|
"design_variables": [
|
||
|
|
{
|
||
|
|
"parameter": "cbar_stiffness_x",
|
||
|
|
"type": "FEA_property",
|
||
|
|
"element_type": "CBAR",
|
||
|
|
"direction": "X"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"objectives": [
|
||
|
|
{
|
||
|
|
"type": "minimize",
|
||
|
|
"target": "custom_objective_metric"
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
"summary": {
|
||
|
|
"total_steps": 5,
|
||
|
|
"engineering_needed": 1,
|
||
|
|
"auto_generate": 4,
|
||
|
|
"research_needed": ["1D element force extraction", "Genetic algorithm implementation"]
|
||
|
|
}
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
Be intelligent about:
|
||
|
|
- Distinguishing element types (CBUSH vs CBAR vs CBEAM)
|
||
|
|
- Directions (X vs Y vs Z)
|
||
|
|
- Metrics (min vs max vs average)
|
||
|
|
- Algorithms (Optuna TPE vs genetic algorithm vs gradient-based)
|
||
|
|
- Data sources (OP2 file vs .prt expression vs .fem file)
|
||
|
|
|
||
|
|
Return ONLY the JSON analysis, no other text.
|