Documentation: - Add docs/06_PHYSICS/ with Zernike fundamentals and OPD method docs - Add docs/guides/CMA-ES_EXPLAINED.md optimization guide - Update CLAUDE.md and ATOMIZER_CONTEXT.md with current architecture - Update OP_01_CREATE_STUDY protocol Planning: - Add DYNAMIC_RESPONSE plans for random vibration/PSD support - Add OPTIMIZATION_ENGINE_MIGRATION_PLAN for code reorganization Insights System: - Update design_space, modal_analysis, stress_field, thermal_field insights - Improve error handling and data validation NX Journals: - Add analyze_wfe_zernike.py for Zernike WFE analysis - Add capture_study_images.py for automated screenshots - Add extract_expressions.py and introspect_part.py utilities - Add user_generated_journals/journal_top_view_image_taking.py Tests & Tools: - Add comprehensive Zernike OPD test suite - Add audit_v10 tests for WFE validation - Add tools for Pareto graphs and mirror data extraction - Add migrate_studies_to_topics.py utility Knowledge Base: - Initialize LAC (Learning Atomizer Core) with failure/success patterns Dashboard: - Update Setup.tsx and launch_dashboard.py - Add restart-dev.bat helper script 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
75 lines
2.8 KiB
Python
75 lines
2.8 KiB
Python
#!/usr/bin/env python
|
|
"""Compare V8 and V11 lateral parameter convergence"""
|
|
import optuna
|
|
import statistics
|
|
|
|
# Load V8 study
|
|
v8_study = optuna.load_study(
|
|
study_name='m1_mirror_cost_reduction_V8',
|
|
storage='sqlite:///studies/M1_Mirror/m1_mirror_cost_reduction_V8/3_results/study.db'
|
|
)
|
|
|
|
# Load V11 study
|
|
v11_study = optuna.load_study(
|
|
study_name='m1_mirror_cost_reduction_V11',
|
|
storage='sqlite:///studies/M1_Mirror/m1_mirror_cost_reduction_V11/3_results/study.db'
|
|
)
|
|
|
|
print("="*70)
|
|
print("V8 BEST TRIAL (Z-only Zernike)")
|
|
print("="*70)
|
|
v8_best = v8_study.best_trial
|
|
print(f"Trial: {v8_best.number}")
|
|
print(f"WS: {v8_best.value:.2f}")
|
|
print("\nLateral Parameters:")
|
|
for k, v in sorted(v8_best.params.items()):
|
|
print(f" {k}: {v:.4f}")
|
|
print("\nObjectives:")
|
|
for k, v in v8_best.user_attrs.items():
|
|
if isinstance(v, (int, float)):
|
|
print(f" {k}: {v:.4f}")
|
|
|
|
print("\n" + "="*70)
|
|
print("V11 BEST TRIAL (ZernikeOPD + extract_relative)")
|
|
print("="*70)
|
|
v11_best = v11_study.best_trial
|
|
print(f"Trial: {v11_best.number}")
|
|
print(f"WS: {v11_best.value:.2f}")
|
|
print("\nLateral Parameters:")
|
|
for k, v in sorted(v11_best.params.items()):
|
|
print(f" {k}: {v:.4f}")
|
|
print("\nObjectives:")
|
|
for k, v in v11_best.user_attrs.items():
|
|
if isinstance(v, (int, float)):
|
|
print(f" {k}: {v:.4f}")
|
|
|
|
# Compare parameter ranges explored
|
|
print("\n" + "="*70)
|
|
print("PARAMETER EXPLORATION COMPARISON")
|
|
print("="*70)
|
|
|
|
params = ['lateral_inner_angle', 'lateral_outer_angle', 'lateral_outer_pivot',
|
|
'lateral_inner_pivot', 'lateral_middle_pivot', 'lateral_closeness']
|
|
|
|
for p in params:
|
|
v8_vals = [t.params.get(p) for t in v8_study.trials if t.state.name == 'COMPLETE' and p in t.params]
|
|
v11_vals = [t.params.get(p) for t in v11_study.trials if t.state.name == 'COMPLETE' and p in t.params]
|
|
|
|
if v8_vals and v11_vals:
|
|
print(f"\n{p}:")
|
|
print(f" V8: mean={statistics.mean(v8_vals):.2f}, std={statistics.stdev(v8_vals) if len(v8_vals) > 1 else 0:.2f}, range=[{min(v8_vals):.2f}, {max(v8_vals):.2f}]")
|
|
print(f" V11: mean={statistics.mean(v11_vals):.2f}, std={statistics.stdev(v11_vals) if len(v11_vals) > 1 else 0:.2f}, range=[{min(v11_vals):.2f}, {max(v11_vals):.2f}]")
|
|
print(f" Best V8: {v8_best.params.get(p, 'N/A'):.2f}")
|
|
print(f" Best V11: {v11_best.params.get(p, 'N/A'):.2f}")
|
|
|
|
# Lateral displacement comparison (V11 has this data)
|
|
print("\n" + "="*70)
|
|
print("V11 LATERAL DISPLACEMENT DATA (not available in V8)")
|
|
print("="*70)
|
|
for t in v11_study.trials:
|
|
if t.state.name == 'COMPLETE':
|
|
lat_rms = t.user_attrs.get('lateral_rms_um', None)
|
|
lat_max = t.user_attrs.get('lateral_max_um', None)
|
|
if lat_rms is not None:
|
|
print(f"Trial {t.number}: RMS={lat_rms:.2f} um, Max={lat_max:.2f} um, WS={t.value:.2f}")
|