MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
PressureFlowSolve.hpp File Reference

Same-sample coupling of an end cell to a flow that depends on the pressure across it. More...

Include dependency graph for PressureFlowSolve.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  MayaFlux
 Main namespace for the Maya Flux audio engine.
namespace  MayaFlux::Kinesis
namespace  MayaFlux::Kinesis::Acoustics

Typedefs

using MayaFlux::Kinesis::Acoustics::FlowSample = std::pair<double, double>
 Flow through a coupling, then its slope against the pressure difference.

Functions

constexpr double MayaFlux::Kinesis::Acoustics::centred_end_pressure (double driving_pressure, double pressure_difference, double end_pressure) noexcept
 Pressure of the end cell after the step, once the difference is solved.
constexpr double MayaFlux::Kinesis::Acoustics::flow_coupling_gain (double end_pressure_gain) noexcept
 Gain of a time centred coupling at an end cell.
constexpr double MayaFlux::Kinesis::Acoustics::flow_coupling_target (double driving_pressure, double end_pressure, double gain, double downstream_flow) noexcept
 Right side of the coupling equation.
template<typename FlowLaw>
requires std::invocable<FlowLaw&, double> && std::convertible_to<std::invoke_result_t<FlowLaw&, double>, FlowSample>
std::tuple< double, double, RootStatus > MayaFlux::Kinesis::Acoustics::solve_pressure_flow (FlowLaw law, double gain, double target, double lower, double upper, double guess, const RootOptions &options={})
 Solve a coupling for any flow law.

Detailed Description

Same-sample coupling of an end cell to a flow that depends on the pressure across it.

An end cell with an exciter or a load at its edge has a pressure that depends on the flow, and a flow that depends on the pressure. Time centred, the two meet in one scalar equation in the pressure difference d across the coupling:

d + gain * flow(d) = target

where gain is half the end cell's pressure gain, target gathers the driving pressure, the cell's pressure and the flow arriving from the bore, and the end pressure afterwards is 2 (driving - d) - end. Solving it in the same sample leaves no one sample delay in the coupling, and being centred in time keeps the end second order and free of added damping.

Where the left side is increasing in d the solution is unique. Where the flow law falls with the difference, as a reed does past a third of its closing pressure, uniqueness holds only while gain times the steepest fall stays under one; past that the coupling can have several solutions and the one a search finds follows its starting guess.

Definition in file PressureFlowSolve.hpp.