Files
Atomizer/archive/scripts/create_circular_plate_study.py
Anto01 2b3573ec42 feat: Add AtomizerField training data export and intelligent model discovery
Major additions:
- Training data export system for AtomizerField neural network training
- Bracket stiffness optimization study with 50+ training samples
- Intelligent NX model discovery (auto-detect solutions, expressions, mesh)
- Result extractors module for displacement, stress, frequency, mass
- User-generated NX journals for advanced workflows
- Archive structure for legacy scripts and test outputs
- Protocol documentation and dashboard launcher

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 12:01:50 -05:00

71 lines
2.2 KiB
Python

"""
Create circular plate frequency tuning study with COMPLETE automation.
This demonstrates the proper Hybrid Mode workflow:
1. Study structure creation
2. Benchmarking
3. Validation
4. Auto-generated runner
"""
from pathlib import Path
import sys
sys.path.insert(0, str(Path(__file__).parent))
from optimization_engine.hybrid_study_creator import HybridStudyCreator
def main():
creator = HybridStudyCreator()
# Create workflow JSON first (in temp location)
import json
import tempfile
workflow = {
"study_name": "circular_plate_frequency_tuning",
"optimization_request": "Tune the first natural frequency mode to exactly 115 Hz (within 0.1 Hz tolerance)",
"design_variables": [
{"parameter": "inner_diameter", "bounds": [50, 150]},
{"parameter": "plate_thickness", "bounds": [2, 10]}
],
"objectives": [{
"name": "frequency_error",
"goal": "minimize",
"extraction": {
"action": "extract_first_natural_frequency",
"params": {"mode_number": 1, "target_frequency": 115.0}
}
}],
"constraints": [{
"name": "frequency_tolerance",
"type": "less_than",
"threshold": 0.1
}]
}
# Write to temp file
temp_workflow = Path(tempfile.gettempdir()) / "circular_plate_workflow.json"
with open(temp_workflow, 'w') as f:
json.dump(workflow, f, indent=2)
# Create study with complete automation
study_dir = creator.create_from_workflow(
workflow_json_path=temp_workflow,
model_files={
'prt': Path("examples/Models/Circular Plate/Circular_Plate.prt"),
'sim': Path("examples/Models/Circular Plate/Circular_Plate_sim1.sim"),
'fem': Path("examples/Models/Circular Plate/Circular_Plate_fem1.fem"),
'fem_i': Path("examples/Models/Circular Plate/Circular_Plate_fem1_i.prt")
},
study_name="circular_plate_frequency_tuning"
)
print(f"Study ready at: {study_dir}")
print()
print("Next step:")
print(f" python {study_dir}/run_optimization.py")
if __name__ == "__main__":
main()