MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ radiation_step()

std::pair< double, double > MayaFlux::Kinesis::Acoustics::radiation_step ( const RadiationCoefficients & coefficients,
RadiationState & state,
double end_pressure,
double upstream_flow )
inlinenodiscardnoexcept

Advance the end cell and the load one sample.

Parameters
coefficientsFrom make_radiation_coefficients
stateUpdated in place
end_pressurePressure of the last point at the start of the sample
upstream_flowVolume velocity of the last half section, from the same sample
Returns
The end pressure after the sample, then the flow out of the bore at the half step

Definition at line 113 of file Radiation.hpp.

118{
119 const double mean = (end_pressure
120 + coefficients.end_half_gain
121 * (upstream_flow - state.inductor_flow
122 + coefficients.memory_conductance * state.branch_pressure))
123 * coefficients.reciprocal;
124
125 const double flow = state.inductor_flow
126 - coefficients.memory_conductance * state.branch_pressure
127 + coefficients.conductance * mean;
128
129 const double branch_mean = coefficients.branch_weight * mean
130 + coefficients.branch_memory * state.branch_pressure;
131
132 state.inductor_flow += coefficients.inductor_gain * mean;
133 state.branch_pressure = 2.0 * branch_mean - state.branch_pressure;
134
135 return { 2.0 * mean - end_pressure, flow };
136}