Validation
Generated by node scripts_validation.js from the shipped engine. Hand values are computed independently from the textbook formula in the right column (not by calling the engine).
| Case | Quantity | Engine | Hand calc | Formula |
|---|---|---|---|---|
| V1 Square 1000×20 µm Si, 1 bar | w₀ (µm) | 1.1138 | 1.1138 | 0.00126 q a⁴/D |
| σ_edge (MPa) | 76.95 | 76.95 | 0.3078 q (a/h)² | |
| f₀ (kHz) | 282.23 | 282.23 | λ²/(2πa²)√(D/ρh) | |
| bridge (mV/V), P(N)=1, avg=1 | 49.733 | 49.733 | (π₄₄/2)(1−ν)σ | |
| V2 Circle Ø1000×15 µm Si, 1 bar | w₀ (µm) | 2.0462 | 2.0462 | q a⁴/64D |
| σ_edge (MPa) | 83.333 | 83.333 | 0.75 q (a/h)² | |
| f₀ (kHz) | 240.19 | 240.19 | λ²/(2πa²)√(D/ρh) | |
| bridge (mV/V), P(N)=1, avg=1 | 53.859 | 53.859 | (π₄₄/2)(1−ν)σ | |
| large-defl. residual | 0.13641 | 0.13641 | w/h + 0.488(w/h)³ = w_lin/h | |
| V3 Square 2000×10 µm, 10 kPa, ν=0.3 | w₀ (µm) | 17.15 | 17.15 | 0.00126 q a⁴/D |
| σ_edge (MPa) | 123.12 | 123.12 | 0.3078 q (a/h)² | |
| f₀ (kHz) | 32.164 | 32.164 | λ²/(2πa²)√(D/ρh) | |
| bridge (mV/V), P(N)=1, avg=1 | 61.21 | 61.21 | (π₄₄/2)(1−ν)σ | |
| V4 Circle Ø1000×5 µm, 2 bar, ν=0.3 (large deflection) | w₀ (µm) | 100.96 | 100.96 | q a⁴/64D |
| σ_edge (MPa) | 1500 | 1500 | 0.75 q (a/h)² | |
| f₀ (kHz) | 83.759 | 83.759 | λ²/(2πa²)√(D/ρh) | |
| bridge (mV/V), P(N)=1, avg=1 | 725.03 | 725.02 | (π₄₄/2)(1−ν)σ | |
| large-defl. residual | 20.192 | 20.192 | w/h + 0.488(w/h)³ = w_lin/h |
Sanity ranges
- V1 sensitivity 49.7 mV/V/bar with ideal point resistors (P(N)=1, averaging 1). This is an upper bound. No comparison against measured devices or FEA has been made yet (planned: compare against a published FEA/measurement case and Latha's own sensor data). The default UI settings (P(N)=0.85, averaging 0.8) give 33.8 mV/V/bar.
- Square/circle edge-stress ratio at equal span: 0.3078 / (0.75/4) = 1.642.
- Scaling checks in tests: σ ∝ h⁻², w ∝ h⁻³, bridge ∝ P in the small-deflection limit.
- V4 is deliberately far outside the valid range (w₀/h ≈ 20); it only checks that the large-deflection solver satisfies its own equation. The stress and bridge values there are not physical.
- Wide input grid (a 0.1–5 mm, h 2–90 µm, P 10 Pa–10 MPa, both shapes): all outputs finite, w_NL ≤ w_lin.
Issues found and fixed during audit
| Date | Issue | Fix |
|---|---|---|
| 2026-09-27 | Large-deflection solver used Roark's rounded K₁ = 5.33/(1−ν²) while the linear model uses the exact 16/3. At low load w_NL exceeded w_lin by 0.06 %, giving a small negative nonlinearity. | K₁ now derived from the exact linear coefficient for both shapes; regression test "results are finite across a wide input grid" asserts w_NL ≤ w_lin. |
| 2026-09-27 | Circular diaphragm entered as radius was error-prone for users who think in diameter. | UI takes diameter and converts; engine keeps radius. |
Test suite
npm test runs engine tests (formulas, scaling, validation, insights, grid robustness) and API tests (analytics whitelist, rate limit, lead validation and honeypot, license validation, webhook signature and idempotency, admin auth).