6 const RadiationSpec& spec,
double end_area,
double end_pressure_gain)
noexcept
8 const auto positive = [](
double value) {
return std::isfinite(value) && value > 0.0; };
10 const auto [gamma, lambda, theta] = spec.model;
12 if (!positive(gamma) || !positive(lambda) || !positive(theta)
13 || !positive(spec.radius) || !positive(spec.sound_speed) || !positive(spec.air_density)
14 || !positive(spec.time_step) || !positive(end_area) || !positive(end_pressure_gain)) {
18 const double c = spec.sound_speed;
19 const double a = spec.radius;
20 const double k = spec.time_step;
21 const double impedance = spec.air_density * c / end_area;
23 const double inductance = lambda * (a / c) * impedance;
24 const double memory_scale = 2.0 * theta * a / (c * k);
25 const double denominator = 1.0 + 1.0 / gamma + memory_scale;
26 const double branch_weight = 1.0 / denominator;
27 const double branch_memory = memory_scale / denominator;
30 coefficients.inductor_gain = k / inductance;
31 coefficients.branch_weight = branch_weight;
32 coefficients.branch_memory = branch_memory;
33 coefficients.memory_conductance = branch_memory / impedance;
34 coefficients.conductance = 0.5 * k / inductance + (1.0 - branch_weight) / impedance;
35 coefficients.end_half_gain = 0.5 * end_pressure_gain;
36 coefficients.reciprocal = 1.0 / (1.0 + coefficients.end_half_gain * coefficients.conductance);