> ⚠️ **Critical:** The baseline design likely **violates** the displacement constraint (~22 mm vs 10 mm limit). Baseline re-run pending — CEO running SOL 101 in parallel. The optimizer must first find the feasible region before it can meaningfully minimize mass. This shapes the entire strategy.
>
> **Introspection note (2026-02-10):** Mass expression is `p173` (body_property147.mass, kg). DV baselines are NOT round numbers (face=21.504mm, core=25.162mm). NX expression `beam_lenght` has a typo (no 'h'). `hole_count` links to `Pattern_p7` in the NX pattern feature.
1.**Phase 1 budget: 50 trials (not 40).** With 4 variables, we want at least 10× the dimensionality for a reliable DoE. 50 trials also divides cleanly for stratified integer sampling (≈4-5 trials per hole_count level).
2.**Enqueue baseline as Trial 0.** LAC critical lesson: CMA-ES doesn't evaluate x0 first. While we're using LHS (not CMA-ES), the same principle applies — **always evaluate the baseline explicitly** so we have a verified anchor point. This also validates the extractor pipeline before burning 50 trials.
3.**Phase 2 budget: 80 trials (flexible 60-100).** Start with 60, apply convergence criteria (Section 6), extend to 100 if still improving.
4.**Seed Phase 2 from Phase 1 data.** Use Optuna's `enqueue_trial()` to warm-start TPE with the best feasible point(s) from the DoE. This avoids the TPE startup penalty (first `n_startup_trials` are random).
#### Algorithms NOT selected (and why)
| Algorithm | Why Not |
|-----------|---------|
| **CMA-ES** | Good option, but integer rounding is a hack; doesn't evaluate x0 first (LAC lesson); TPE is equally good at 4D |
| **NSGA-II** | Overkill for single-objective; population size wastes budget |
| **Surrogate + L-BFGS** | **LAC CRITICAL: Gradient descent on surrogates finds fake optima.** V5 mirror study: L-BFGS was 22% WORSE than pure TPE (WS=325 vs WS=290). V6 confirmed simple TPE beats complex surrogate methods. Do not use. |
| **SOL 200 (Nastran native)** | No integer support for hole_count; gradient-based so may miss global optimum; more NX setup effort. Keep as backup (Tech Lead's suggestion). |
| **Nelder-Mead** | No integer support; poor exploration; would miss the feasible region |
### 2.3 Final Algorithm Configuration
```
Phase 1: LHS DoE
- Trials: 50 (+ 1 baseline = 51 total)
- Sampling: Maximin LHS, DV4 rounded to nearest integer
| **Deb's rules** (selected) | No tuning params; feasible always beats infeasible; explores infeasible region for learning | Requires custom Optuna integration | ✅ Best for this case |
| **Adaptive penalty** | Self-tuning | Complex implementation; may oscillate | ❌ Over-engineered for 4 DVs |
| **Death penalty** (reject infeasible) | Simplest | With infeasible baseline, may reject 80%+ of trials → wasted budget | ❌ Dangerous |
### 3.4 Phase 1 (DoE) Constraint Handling
During the DoE phase, **record all results without filtering.** Every trial runs, every result is stored. Infeasible points are valuable for:
- Mapping the feasibility boundary
- Training the TPE model in Phase 2
- Understanding which variables drive constraint violation
### 3.5 Constraint Margin Buffer
Consider a 5% inner margin during optimization to account for numerical noise:
- Displacement target for optimizer: ≤ 9.5 mm (vs hard limit 10.0 mm)
- Stress target for optimizer: ≤ 123.5 MPa (vs hard limit 130.0 MPa)
The hard limits remain 10 mm / 130 MPa for final validation. The buffer prevents the optimizer from converging to designs that are right on the boundary and may flip infeasible under mesh variation.
The NX pattern places `n` holes across a span of `p6` mm using `n-1` intervals (holes at both endpoints of the span). Confirmed by introspection: `Pattern_p8 = 4000/9 = 444.44 mm`.
This means `beam_face_thickness` and `holes_diameter` interact geometrically — thicker faces reduce the web clear height available for holes. This constraint is captured in the pre-flight filter (§4.2):
| ↑ DV1 (thicker core) | ↑ mass (but stiffness scales ~d², mass scales ~d) → **efficient** |
| ↑ DV2 (thicker face) | ↑ mass (direct) |
| ↓ DV3 (smaller holes) | ↑ mass (more web material) |
| ↓ DV4 (fewer holes) | ↑ mass (more web material) |
**Prediction:** The feasible region (displacement ≤ 10 mm) likely requires:
- DV1 in upper range (25-40 mm) — the sandwich effect is the most mass-efficient stiffness lever
- DV2 moderate (15-30 mm) — thicker faces help stiffness but cost mass directly
- DV3 and DV4 constrained by stress — large/many holes save mass but increase stress
The optimizer should find a "sweet spot" where core thickness provides stiffness, and holes are sized to save mass without violating stress limits.
### 4.5 Estimated Design Space Volume
- DV1: 30 mm span (continuous)
- DV2: 30 mm span (continuous)
- DV3: 300 mm span (continuous)
- DV4: 11 integer levels
Total configurations: effectively infinite (3 continuous), but the integer dimension creates 11 "slices" of the space. With 50 DoE trials, we get ~4-5 trials per slice — sufficient for trend identification.
Our budget of 114–156 falls in the **standard-to-thorough** range. Appropriate for a first study where we're mapping an unknown landscape with an infeasible baseline.
---
## 6. Convergence Criteria
### 6.1 Phase 1 (DoE) — No Convergence Criteria
The DoE runs all 50 planned trials. It's not iterative — it's a one-shot space-filling design. Stop conditions:
- All 50 trials complete (or fail with documented errors)
- **Early abort:** If >80% of trials fail to solve (NX crashes), stop and investigate
### 6.2 Phase 2 (TPE) — Convergence Criteria
| Criterion | Threshold | Action |
|-----------|-----------|--------|
| **Improvement stall** | Best feasible objective unchanged for 20 consecutive trials | Consider stopping |
| **Relative improvement** | < 1% improvement over last 20 trials | Consider stopping |
| **Budget exhausted** | 100 trials completed in Phase 2 | Hard stop |
| **Perfect convergence** | Multiple trials within 0.5% of each other from different regions | Confident optimum found |
| **Minimum budget** | Always run at least 60 trials in Phase 2 | Ensures adequate exploration |
### 6.3 Decision Logic
```
After 60 Phase 2 trials:
IF best_feasible improved by >2% in last 20 trials → continue to 80
IF no feasible solution found → STOP, escalate (see §7.1)
ELSE → assess convergence, decide 80 or 100
After 80 Phase 2 trials:
IF still improving >1% per 20 trials → continue to 100
ELSE → STOP, declare converged
After 100 Phase 2 trials:
HARD STOP regardless
```
### 6.4 Phase 1 → Phase 2 Gate
Before starting Phase 2, review DoE results:
| Check | Action if FAIL |
|-------|---------------|
| At least 5 feasible points found | If 0 feasible: expand bounds or relax constraints (escalate to CEO) |
| No systematic NX crashes at bounds | If crashes: tighten bounds away from failure region |
| Sensitivity trends visible | If flat: check extractors, may be reading wrong output |
---
## 7. Risk Mitigation
### 7.1 Risk: Feasible Region is Empty
**Likelihood: Medium** (baseline fails displacement by 120%)
**Detection:** After Phase 1, zero feasible points found.
**Mitigation ladder:**
1.**Check the data** — Are extractors reading correctly? Validate against manual NX check.
2.**Examine near-feasible** — Find the trial closest to feasibility. How far off? If displacement = 10.5 mm, we're close. If displacement = 18 mm, we have a problem.
3.**Targeted exploration** — Run additional trials at extreme stiffness (max DV1, max DV2, min DV3, min DV4). If even the stiffest/heaviest design fails, the constraint is physically impossible with this geometry.
4.**Constraint relaxation** — Propose to CEO: relax displacement to 12 or 15 mm. Document the mass-displacement Pareto front from DoE data to support the discussion.
5.**Geometric redesign** — If the problem is fundamentally infeasible, the beam geometry needs redesign (out of optimization scope).
### 7.2 Risk: NX Crashes at Parameter Extremes
**Likelihood: Medium** (LAC: rib_thickness had undocumented CAD constraint at 9mm, causing 34% failure rate in V13)
**Detection:** Solver returns no results for certain parameter combinations.
**Mitigation:**
1.**Pre-flight corner tests** — Before Phase 1, manually test the 16 corners of the design space (2⁴ combinations of min/max for each variable). This catches geometric rebuild failures early.
2.**Error-handling in run script** — Every trial must catch exceptions and log:
- NX rebuild failure (geometry Boolean crash)
- Meshing failure (degenerate elements)
- Solver failure (singularity, divergence)
- Extraction failure (missing result)
3.**Infeasible-by-default** — If a trial fails for any reason, record it as infeasible with maximum constraint violation (displacement=9999, stress=9999). This lets Deb's rules naturally steer away from crashing regions.
4.**NEVER kill NX processes directly** — LAC CRITICAL RULE. Use NXSessionManager.close_nx_if_allowed() only. If NX hangs, implement a timeout (e.g., 10 min per trial) and let NX time out gracefully.
### 7.3 Risk: Mesh-Dependent Stress Results
**Likelihood: Medium** (stress at hole edges is mesh-sensitive)
**Mitigation:**
1.**Mesh convergence pre-study** — Run baseline at 3 mesh densities. If stress varies >10%, refine mesh or use stress averaging region.
2.**Consistent mesh controls** — Ensure NX applies the same mesh size/refinement strategy regardless of parameter values. The parametric model should have mesh controls tied to hole geometry.
3.**Stress extraction method** — Use elemental nodal stress (conservative) per LAC success pattern. Note: pyNastran returns stress in kPa for NX kg-mm-s unit system — **divide by 1000 for MPa**.
### 7.4 Risk: Surrogate Temptation
**Mitigation: DON'T DO IT (yet).**
LAC lessons from the M1 Mirror project are unequivocal:
- V5 surrogate + L-BFGS was 22% **worse** than V6 pure TPE
- MLP surrogates have smooth gradients everywhere → L-BFGS descends to fake optima outside training distribution
- No uncertainty quantification = no way to detect out-of-distribution predictions
With only 4 variables and affordable FEA (~2 min/trial), direct FEA evaluation via TPE is both simpler and more reliable. Surrogate methods should only be considered if:
- FEA solve time exceeds 30 minutes per trial, AND
- We have 100+ validated training points, AND
- We use ensemble surrogates with uncertainty quantification (SYS_16 protocol)
### 7.5 Risk: Study Corruption
**Mitigation:** LAC CRITICAL — **Always copy working studies, never rewrite from scratch.**
- Phase 2 study will be created by **copying** the Phase 1 study directory and adding optimization logic
- Never modify `run_optimization.py` in-place for a new phase — copy to a new version
- Git-commit the study directory after each phase completion
---
## 8. AtomizerSpec Draft
See [`atomizer_spec_draft.json`](./atomizer_spec_draft.json) for the full JSON config.
### 8.1 Key Configuration Decisions
| Setting | Value | Rationale |
|---------|-------|-----------|
| `algorithm.phase1.type` | `LHS` | Space-filling DoE for landscape mapping |