Struct BjtRoot
pub struct BjtRoot {
pub model: GummelPoonModel,
pub is_pnp: bool,
/* private fields */
}Expand description
BJT as a single-port WDF root (like TriodeRoot for tubes).
Vbe is set externally as a control parameter (from the base signal). The collector-emitter path is the WDF port. This enables:
- Standard WDF tree processing for BJT stages
- K-method table generation (2D: b_tree × Vbe)
- Blockwise decomposition of BJT cascades (303 ladder)
Uses the Gummel-Poon model for the I-V characteristic.
Fields§
§model: GummelPoonModel§is_pnp: boolImplementations§
§impl BjtRoot
impl BjtRoot
pub fn new(model: GummelPoonModel, is_pnp: bool) -> BjtRoot
pub fn new_with_v_max( model: GummelPoonModel, is_pnp: bool, v_max: f64, ) -> BjtRoot
pub fn initial_prev_v(&self) -> f64
pub fn initial_prev_v(&self) -> f64
Get the initial Vce warm-start (for diagnostics and testing).
pub fn set_initial_prev_v(&mut self, vce: f64)
pub fn set_initial_prev_v(&mut self, vce: f64)
Set the initial Vce warm-start from an init { } hint.
Called once at compile time. On reset(), prev_v is restored to this
value, giving the NR solver an asymmetric starting point that can kick
free-running oscillators (e.g. BJT astable multivibrators) out of the
symmetric DC fixed point.
pub fn reset(&mut self)
pub fn reset(&mut self)
Restore prev_v to the compile-time initial value.
Called by WdfStage::reset() for Bjt roots so that DAW resets return to the hint-specified asymmetric state rather than to 0.0.
pub fn set_bias(&mut self, vbe_bias: f64)
pub fn set_bias(&mut self, vbe_bias: f64)
Set the DC bias operating point from circuit analysis. Called at compile time, not per-sample.
pub fn set_vbe(&mut self, vbe: f64)
pub fn set_vbe(&mut self, vbe: f64)
Set the base-emitter voltage (external control from input signal).
pub fn set_v_max(&mut self, v_max: f64)
pub fn collector_current(&self, vce: f64) -> f64
pub fn collector_current(&self, vce: f64) -> f64
Collector current Ic as a function of Vce, with Vbe held constant. This is the I-V characteristic seen at the WDF port.
pub fn collector_current_derivative(&self, vce: f64) -> f64
pub fn collector_current_derivative(&self, vce: f64) -> f64
Derivative dIc/dVce for Newton-Raphson.