Integer frame-count choice under a Raman saturation limit (source code)

= Integer frame-count choice under a Raman saturation limit
{title2=$T_n=\min(W-2nd,2nc)$}

\b[Integer frame-count choice under a Raman saturation limit] chooses the number of pump-on/off exposure pairs as well as their durations. More pairs incur more readout overhead; too few pairs can saturate before using the available wall-clock budget. Under the model of <maximum-exposure constraint in paired Raman acquisition>, for positive readout time $d$ and frame cap $c$, each candidate integer $n$ with $2nd<W$ has usable live time
$$
T_n=\min(W-2nd,2nc).
$$
Its unused budget is $W-2nd-T_n\geq0$. This <wall-clock slack in saturation-limited Raman frame allocation> is allowed: failure to consume the entire budget does not make a shorter acquisition physically impossible.

For each candidate, allocate $T_{\rm on}+T_{\rm off}=T_n$ with each total at most $nc$. Clip the unconstrained on total $T_n\sqrt\alpha/(\sqrt\alpha+\sqrt\beta)$ to $[\max(0,T_n-nc),\min(T_n,nc)]$, then evaluate $V_n=\alpha/T_{\rm on}+\beta/T_{\rm off}$. This solves the continuous subproblem; comparing the finitely many integer candidates solves the stated frame-count problem. Positive counts and no other costs make additional feasible live time beneficial.

In an original example, use $W=0.60\,\mathrm s$, $d=0.010\,\mathrm s$, $c=0.097\,\mathrm s$, $\alpha=2\times10^{-6}\,\mathrm s$ and $\beta=0.5\times10^{-6}\,\mathrm s$. The relevant candidates are
$$
\begin{array}{c|c|c|c}
n&T_n\ (\mathrm s)&\text{unused time}\ (\mathrm s)&10^6V_n\\\hline
2&0.388&0.172&12.8866\\
3&0.540&0&8.8809\\
4&0.520&0&8.6538\\
5&0.500&0&9.0000
\end{array}
$$
Four pairs are globally optimal in this model: one or two pairs use both states at their caps and improve as $n$ increases; three is evaluated explicitly; for every $n\geq4$ the unconstrained ratio is feasible and $V_n=4.5\times10^{-6}/(0.60-0.02n)$ increases with $n$. At four pairs the on/off totals are about $0.3467$ and $0.1733\,\mathrm s$.

The primary Raman apparatus used 97 ms exposures to avoid saturation and 10 ms shuttered readout, motivating these stipulated example timings.<Femtosecond Broadband Stimulated Raman: A New Approach for High-Performance Vibrational Spectroscopy by David W. McCamant and others>[Data Collection, exposure limit and on/off shutter sequence preceding equation 4]{ref} Actual frame choice can also be constrained by read noise, drift and minimum switching cadence. Such costs must be included before treating this shot-noise-only optimum as an experimental operating prescription.