4. Corridor-Based Magnitude and Phase Evaluation in CORA
Why Corridors Are the Right Tool for Magnitude and Phase
CORA's corridor metrics answer a deceptively simple question: does the CAE curve stay inside an acceptable band around the test curve, and if not, where and by how much does it leave? Unlike a single global error number, corridors preserve the time-localized structure of the disagreement. That matters because two very different failure modes — a systematic phase lag and an amplitude scaling error — can produce nearly identical RMS or peak-error values, yet require completely different corrective actions. A phase lag points to stiffness, mass distribution, or damping modeling; an amplitude scaling error points to excitation level, gain, or unit/calibration issues.
This case builds both corridor types for one transient response channel, then reads the corridor departure pattern to classify the dominant error. The reference signal is the test measurement; the CAE signal is evaluated against it. All numeric values below are a constructed teaching example, not measured data.
Corridor Definitions Used Here
A magnitude corridor is a symmetric band around the test signal y_test(t) whose half-width is a fixed fraction of the local or global amplitude:
upper(t) = y_test(t) + k_mag * A_ref
lower(t) = y_test(t) - k_mag * A_ref
A_ref = max(|y_test(t)|) # global peak reference
k_mag = 0.10 # 10 % magnitude corridor
A phase corridor is a time-shifted band: the test signal is displaced by an allowed time tolerance ±Δt, and the CAE curve must lie within the envelope swept by that displacement:
upper(t) = max( y_test(t - Δt), y_test(t + Δt) )
lower(t) = min( y_test(t - Δt), y_test(t + Δt) )
Δt = 2.0 ms # phase corridor tolerance
The two corridors are complementary. The magnitude corridor is insensitive to small time shifts but sensitive to gain; the phase corridor is insensitive to gain but sensitive to lag. Evaluating both and comparing their departure profiles is what separates the two error classes.
Worked Example: One Transient Channel
Consider a half-sine shock response, 20 ms duration, sampled at 0.1 ms (200 samples). The test peak is 50 g. The CAE signal is a scaled and delayed copy of the test signal, constructed deliberately so the ground truth is known:
y_cae(t) = 1.15 * y_test(t - 1.5 ms) # +15 % gain, 1.5 ms lag
With k_mag = 0.10 and Δt = 2.0 ms, the expected outcome is:
- Magnitude corridor: the CAE peak (57.5 g) exceeds the upper bound (55 g) near the peak, so the curve exits the corridor on the rising and falling flanks — a symmetric, peak-centered departure.
- Phase corridor: the 1.5 ms lag is inside the 2.0 ms tolerance, so the CAE curve stays within the phase envelope everywhere. No phase departure is flagged.
The diagnostic reading is therefore: amplitude scaling error, phase acceptable. If the lag had been 3.0 ms instead, the phase corridor would flag departure on the steep flanks while the magnitude corridor stayed clean — the opposite signature.
Computing the Corridor Metrics
The following Python fragment builds both corridors and reports the departure fraction and maximum excursion for each. It is self-contained and runs on the teaching example above.
import numpy as np
dt = 0.1e-3
t = np.arange(0, 20e-3, dt)
y_test = 50.0 * np.sin(np.pi * t / 20e-3) # half-sine, peak 50 g
y_cae = 1.15 * np.interp(t - 1.5e-3, t, y_test, left=0, right=0)
k_mag = 0.10
A_ref = np.max(np.abs(y_test))
mag_up = y_test + k_mag * A_ref
mag_lo = y_test - k_mag * A_ref
mag_out = (y_cae > mag_up) | (y_cae < mag_lo)
d_shift = int(round(2.0e-3 / dt))
y_lo_s = np.roll(y_test, d_shift); y_lo_s[:d_shift] = 0
y_hi_s = np.roll(y_test, -d_shift); y_hi_s[-d_shift:] = 0
ph_up = np.maximum(y_lo_s, y_hi_s)
ph_lo = np.minimum(y_lo_s, y_hi_s)
ph_out = (y_cae > ph_up) | (y_cae < ph_lo)
print("magnitude departure fraction:", mag_out.mean())
print("phase departure fraction: ", ph_out.mean())
print("max magnitude excursion (g): ", np.max(np.maximum(y_cae-mag_up, mag_lo-y_cae)))
Expected output for this constructed example: a magnitude departure fraction around 0.15–0.20 (the flanks near the peak), a phase departure fraction of 0.0, and a maximum magnitude excursion near 2.5 g (the 15 % gain on a 50 g peak minus the 5 g corridor half-width). These are the values the corridor logic should produce; if your run differs materially, check the interpolation boundary handling and the np.roll edge fill.
Interpreting the Result and Choosing the Next Action
The corridor pair gives a clean classification. A magnitude-only departure with a clean phase corridor means the CAE model reproduces the timing of the response but over- or under-predicts its level. Before touching the model, verify the excitation amplitude, sensor calibration, and unit consistency between test and CAE — a 15 % gain error is far more often a scaling/calibration issue than a genuine dynamic amplification error. Only after those are ruled out should stiffness or damping be adjusted.
Conversely, a phase-only departure with a clean magnitude corridor indicates a timing error: the response shape and level are right but shifted. That points to mass/stiffness ratio, boundary-condition compliance, or a preprocessing alignment residual. Because the phase corridor tolerance Δt is a modeling decision, document it alongside the scorecard — a 2 ms tolerance on a 20 ms event is generous, and tightening it to 1 ms would flag the 1.5 ms lag in this example.
k_mag or Δt after seeing the result to make the curve pass. Corridor tolerances must be fixed from the acceptance specification before evaluation; otherwise the metric loses its meaning and the scorecard becomes non-comparable across load cases.Practical Checklist for This Channel
| Check | Pass condition | If it fails |
|---|---|---|
| Test and CAE share time base and units | Same sample rate, same g units | Resample/convert before corridor build |
| Magnitude corridor half-width set from spec | k_mag fixed before run | Re-derive from acceptance document |
| Phase tolerance set from spec | Δt fixed before run | Do not widen to hide lag |
| Departure pattern classified | Magnitude-only, phase-only, both, or neither | Apply the matching corrective action |
| Aggregate score recorded with tolerances | Score + k_mag + Δt logged together | Scorecard not reproducible |
With both corridors built and the departure pattern classified, this channel is ready to feed its magnitude and phase scores into the load-case scorecard. The key discipline is that the corridor tolerances are inputs fixed by specification, and the corridor output is a diagnostic signature — not just a pass/fail number.