# Product Specification: Optical Link Reliability Emulator
## NASA/JPL-Style Requirements Package for a Reduced-Order Deep-Space Optical-Link Closure Probability Tool

> **Source document.** This is the original NASA/JPL-style specification package the lab used to build the **Optical Link Reliability Emulator** at `/gut/nasa/optical-link-reliability-emulator/`. It is reproduced here verbatim so a reviewer can see the requirements the implementation was traced to. The tool itself is a public engineering-surrogate, not mission-certified software.

**Version:** 1.0
**Target buyer / evaluator:** NASA/JPL-style optical communications, mission design, mission assurance, optical ground systems, navigation, timing, and systems-engineering teams
**Target deployment:** `https://physics.magflowmeters.com/gut/nasa/optical-link-reliability-emulator/`
**Product class:** Public engineering-surrogate / reduced-order reliability emulator, not mission-certified flight software
**Primary funding fit:** SBIR/STTR Phase I → Phase II → mission-integration pilot
**Estimated value if validated:** $250k–$1.5M initially; $850k–$3M+ if benchmarked against high-fidelity wave-optics / atmosphere / detector / coding simulations
**Core value proposition:** Estimate optical-link closure probability and dominant failure modes in seconds, using a reduced-order emulator trained or calibrated against analytic cases, public scenarios, and high-fidelity benchmark datasets.

---

## 0. Executive Summary

A standard link-budget calculator gives one deterministic margin $M_{\rm dB}$. But mission engineers need a reliability answer:

$$P(\text{link closes}) = P(M_{\rm dB} > 0)$$

under uncertain atmospheric, pointing, detector, background, range, geometry, and coding assumptions.

The proposed tool builds a reduced-order emulator:

> scenario + uncertainty assumptions → fast surrogate → $P_{\rm close}$ + margin distribution + dominant failure mode + confidence / validity domain

The tool does **not** replace mission-grade simulations. Its purpose is to help teams:

1. Estimate closure probability quickly;
2. Identify dominant reliability drivers;
3. Screen designs before expensive high-fidelity runs;
4. Prioritize which scenarios need full simulation;
5. Generate auditable certificates and review packets.

> **Final positioning:** NASA/JPL can run the full simulation. This tool estimates reliability fast and tells engineers when the full simulation is needed.

---

## 1. Claim Boundary

### 1.1 What this tool may claim

Given declared optical-link assumptions and uncertainty distributions, the Optical Link Reliability Emulator estimates link-closure probability, margin distribution, outage probability, dominant failure mode, and high-fidelity simulation priority inside a validated public-surrogate domain.

### 1.2 What this tool must not claim

- to be NASA/JPL software;
- to reproduce internal DSOC link budgets;
- to replace mission-certified optical communication analysis;
- to model proprietary detector/coding/pointing/adaptive-optics systems unless supplied;
- to replace wave-optics or atmospheric propagation simulations;
- to replace SPICE/Horizons/OD workflows;
- to provide flight-qualified reliability values;
- to validate new physics.

---

## 5. Raw Input Model

### 5.1 Nominal scenario vector

$$x_0 = (R, \lambda, D_t, D_r, P_t, R_b, \sigma_p, T_{\rm atm}, r_0, \eta_{\rm det}, B_{\rm sky}, G_c, N_{\gamma/{\rm bit, req}}, \theta_{\rm sun}, v_\perp, \ldots)$$

| Variable | Meaning | Units |
|---|---|---|
| $R$ | range | km / AU / m |
| $\lambda$ | wavelength | nm / m |
| $D_t$ | transmit aperture | m |
| $D_r$ | receive aperture | m |
| $P_t$ | transmit power | W |
| $R_b$ | data rate | bits/s |
| $\sigma_p$ | pointing jitter RMS | rad |
| $T_{\rm atm}$ | atmospheric transmission | unitless |
| $r_0$ | Fried parameter | m |
| $\eta_{\rm det}$ | detector efficiency | unitless |
| $B_{\rm sky}$ | background count rate | counts/s |
| $G_c$ | coding gain | dB |
| $N_{\gamma/{\rm bit, req}}$ | required photons/bit | photons/bit |
| $\theta_{\rm sun}$ | Sun angle | rad |
| $v_\perp$ | transverse velocity | m/s |

### 5.2 Uncertainty model

Each input may be fixed or distributed:

```json
{
  "name": "pointing_jitter",
  "value": 0.8,
  "unit": "urad",
  "distribution": "lognormal",
  "sigma": 0.2,
  "bounds": [0.1, 5.0],
  "source_id": "user_assumption"
}
```

Supported distributions: fixed, normal, lognormal, uniform, triangular, empirical table, weather/site percentile table, user-uploaded samples.

---

## 7. Reduced-Order Optical Link Model

### 7.1 Required formulas

- Photon energy: $E_\gamma = hc/\lambda$
- Diffraction angle: $\theta_{\rm div} = 1.22 \lambda / D_t$
- Beam radius: $w(R) \approx R \theta_{\rm div}$
- Gaussian collection: $f_{\rm collect} = 1 - \exp(-2 r_r^2 / w(R)^2)$ with $r_r = D_r/2$
- Received power: $P_r = P_t \cdot f_{\rm collect} \cdot T_{\rm atm} \cdot L_{\rm pointing} \cdot L_{\rm other}$
- Photon rate: $\dot N_\gamma = P_r \eta_{\rm det} / E_\gamma$
- Photons per bit: $N_{\gamma/{\rm bit}} = \dot N_\gamma / R_b$
- Margin (dB): $M_{\rm dB} = 10 \log_{10}(N_{\gamma/{\rm bit}} / N_{\gamma/{\rm bit, req}}) + G_c - L_{\rm implementation}$

### 7.2 Reliability outputs

Treat margin as a random variable $M = M(X)$ with $X$ drawn from declared uncertainty distributions.

- Closure probability: $P_{\rm close} = P(M > 0)$
- Outage probability: $P_{\rm outage} = 1 - P_{\rm close}$
- Margin percentiles: $M_{05}, M_{50}, M_{95}$

### 7.3 Dominant failure mode

For each sample, compute limiter margins $g_i(z)$ and classify $i^* = \arg\min_i g_i(z)$.

Failure classes: range-limited, aperture/diffraction-limited, pointing-limited, atmosphere-limited, turbulence-limited, detector-limited, background-limited, coding-limited, geometry-limited, mixed-boundary, outside validated domain.

---

## 8. Functional Requirements (Summary)

| ID | Requirement |
|---|---|
| FR-1 | Scenario setup with import/export |
| FR-2 | Uncertainty declaration (fixed, normal, lognormal, uniform, triangular, empirical) |
| FR-3 | Fast reliability estimate ($P_{\rm close}$, percentiles, dominant failure mode) |
| FR-4 | Deterministic + Monte Carlo + trained-surrogate modes |
| FR-5 | Surrogate training/calibration with domain warnings |
| FR-6 | Dominant failure mode analysis with mixed-boundary detection |
| FR-7 | High-fidelity escalation recommendation (7 priority rules) |
| FR-8 | Visualizations (histogram, CDF, tornado, failure-mode bars, range/aperture sweeps) |
| FR-9 | Certificate (JSON + Markdown + PDF) and review packet export |

---

## 10. Verification and Validation Plan

### 10.1 Validation classes

- Exact analytic — formula and units
- Implementation regression — code drift detection
- Public scenario anchor — public DSOC/Psyche-style scenario context
- Synthetic high-fidelity benchmark — emulator accuracy
- Adversarial fail-closed — invalid input handling
- Cross-tool consistency — agreement with link budget / ranker
- Reproducibility — deterministic seeds and hashes

### 10.4 Benchmark metrics (Phase I targets / Phase II targets)

| Metric | Phase I | Phase II |
|---|---:|---:|
| $P_{\rm close}$ absolute error | ≤ 0.10 | ≤ 0.05 |
| Median margin error | ≤ 3 dB | ≤ 1 dB |
| 5th-percentile margin error | ≤ 4 dB | ≤ 1.5 dB |
| Dominant failure mode accuracy | ≥ 80% | ≥ 90% |
| False-safe rate | ≤ 5% | ≤ 1–2% |
| High-fidelity escalation recall | ≥ 90% | ≥ 98% |
| Compute reduction | ≥ 10× | ≥ 100× |

Definitions:
- **false-safe**: emulator predicts safe/closed but high-fidelity benchmark fails.
- **escalation recall**: fraction of benchmark-critical boundary cases recommended for high-fidelity simulation.

---

## 12. TRL and Funding Plan

### 12.1 Phase I / TRL 2–3 (Feasibility)

Duration: 6 months. Budget: ~$150k.

Deliverables: mathematical spec, browser MVP, deterministic + Monte Carlo modes, public scenario anchors, analytic validation suite, synthetic benchmark prototype, certificate/review packet, feasibility report.

### 12.2 Phase II / TRL 4–5 (Prototype Maturation)

Duration: 18–24 months. Budget: ~$850k.

Deliverables: full reliability workbench, trained surrogate mode, high-fidelity benchmark suite, uncertainty correlations, Horizons/SPICE integration, PDF certificates, reproducibility bundle, design-space reliability maps, high-fidelity run recommendation engine, independent review / partner demonstration.

### 12.3 Mission-Integration Pilot / TRL 6

Budget: $1M–$3M+.

Deliverables: mission-specific scenario adapters, private benchmark ingestion, uncertainty/covariance interface, team workflow integration, security/access controls, training and documentation.

---

## 19. Final Editorial Rule

The tool should say:

> "We estimate reliability quickly, expose uncertainty, and tell engineers when high-fidelity simulation is required."

The funding case succeeds if the tool demonstrates:

> fast reliability estimates + bounded error + low false-safe rate + major compute reduction.

---

*Original spec preserved verbatim. See `USER_GUIDE.md` in this directory for a walk-through of how to use the deployed tool, and `BENCHMARK_DATASET_MANIFEST.md` / `SURROGATE_MODEL_CARD.md` / `RISK_REGISTER.md` for the supporting engineering documents.*
