class
SushiDSP::Triode12AX7
Stateless Koren 12AX7 triode: plate current plus Norman's soft grid-conduction law.
- Declared in
include/SushiDSP/circuits/models/Triode12AX7.hpp
Parameters are transcribed from docs/reference/spice/models/12ax7_koren.sub. The two branch voltages are v[0] = Vgk and v[1] = Vpk; the two branch currents are i[0] = Ig and i[1] = Ip. A DK solver wants the currents and the Jacobian at the same operating point, so current_and_jacobian() carries the physics and current()/jacobian() forward to it. Every entry point is allocation-free, throw-free and safe on the audio thread.
Static public attributes
static constexpr std::size_t kBranchCount = 2Branch 0 is the grid, branch 1 is the plate.
static constexpr double kMu = 100.0Amplification factor MU (12ax7_koren.sub).
static constexpr double kKp = 600.0Koren's grid-drive sharpness KP (12ax7_koren.sub).
static constexpr double kKvb = 300.0Koren's knee-softening constant KVB (12ax7_koren.sub).
static constexpr double kKg1 = 1060.0Koren's perveance divisor KG1 (12ax7_koren.sub).
static constexpr double kKx = 1.4Koren's plate-current exponent KX (12ax7_koren.sub).
static constexpr double kGridCurrentScale = 1.0e-6Norman grid-current scale IG0, in amperes (12ax7_koren.sub).
static constexpr double kGridThresholdVolts = 0.5Norman grid-conduction threshold VGAMMA, in volts (12ax7_koren.sub).
static constexpr double kGridTransitionVolts = 0.15Norman grid-conduction transition width VTG, in volts (12ax7_koren.sub).
Public member functions
void current_and_jacobian(const std::array< double, 2 > &v, std::array< double, 2 > &i, std::array< std::array< double, 2 >, 2 > &j) constEvaluates both branch currents and the 2x2 Jacobian at one operating point.
The plate law's root, softplus, logistic and E1^(kx-1) are shared between the current and its derivative, and E1^kx is formed as E1^(kx-1) * E1 rather than by a second pow. current() and jacobian() forward here.
Parameters
vBranch voltages: v[0] = Vgk, v[1] = Vpk, in volts.
iReceives the branch currents: i[0] = Ig, i[1] = Ip, in amperes.
jReceives the 2x2 Jacobian j[a][b] = d i_a / d v_b in siemens.
void current(const std::array< double, 2 > &v, std::array< double, 2 > &i) constEvaluates the grid and plate currents at one operating point.
Parameters
vBranch voltages: v[0] = Vgk, v[1] = Vpk, in volts.
iReceives the branch currents: i[0] = Ig, i[1] = Ip, in amperes.
void jacobian(const std::array< double, 2 > &v, std::array< std::array< double, 2 >, 2 > &j) constEvaluates the branch-current Jacobian j[a][b] = d i_a / d v_b at one point.
Parameters
vBranch voltages: v[0] = Vgk, v[1] = Vpk, in volts.
jReceives the 2x2 Jacobian in siemens; j[0][1] is exactly zero because the grid current depends on Vgk alone.

