Struct OpAmpModel
pub struct OpAmpModel {
pub open_loop_gain: f64,
pub gbw: f64,
pub slew_rate: f64,
pub v_rail_pos: f64,
pub v_rail_neg: f64,
pub output_impedance: f64,
pub output_capacitance: f64,
}Expand description
Op-amp model parameters for WDF integration.
Models the op-amp as a voltage-controlled voltage source:
Vout = Aol * (Vp - Vm)
Where:
Aolis the open-loop DC gain (typically 100k-1M)Vpis the non-inverting input voltage (set externally)Vmis the inverting input voltage (often feedback-dependent)
The feedback network stays in the WDF tree as passive components. The op-amp root enforces the gain relationship between its differential input and output via Newton-Raphson iteration.
Non-idealities captured:
- Finite open-loop gain
- Output voltage saturation
- Slew rate limiting (optional, applied post-convergence)
- Gain-bandwidth product (closed-loop bandwidth rolloff)
Fields§
§open_loop_gain: f64Open-loop DC gain. TL072 ≈ 200k (106dB), LM308 ≈ 300k.
gbw: f64Gain-bandwidth product (Hz). TL072 ≈ 3MHz, LM308 ≈ 1MHz. Determines closed-loop bandwidth: f_cl = GBW / closed_loop_gain.
slew_rate: f64Slew rate (V/µs). TL072 ≈ 13, LM308 ≈ 0.3.
v_rail_pos: f64Maximum positive output swing (V above bias point). For symmetric bias: same as v_rail_neg. For asymmetric: differs.
v_rail_neg: f64Maximum negative output swing (V below bias point).
output_impedance: f64Output impedance (Ω). Typically 50-200Ω for voltage-feedback op-amps. Used by the VCVS stamp in the MNA nullor path.
output_capacitance: f64Output capacitance (F). Physical capacitance of the output stage. Keeps the output node as a dynamic state in the state-space reduction, preserving the feedback loop’s energy recirculation. Typical: 10-50pF.
Implementations§
§impl OpAmpModel
impl OpAmpModel
pub fn tl072() -> OpAmpModel
pub fn tl072() -> OpAmpModel
TL072 — JFET-input dual op-amp.
The modern standard for guitar pedals. Fast slew rate (13 V/µs), low noise, high input impedance. Used in Klon Centaur, Phase 90, and countless modern designs.
pub fn tl082() -> OpAmpModel
pub fn tl082() -> OpAmpModel
TL082 — JFET-input dual op-amp (TL072 variant).
Similar to TL072 but slightly different specs. Used interchangeably in many designs.
pub fn lm308() -> OpAmpModel
pub fn lm741() -> OpAmpModel
pub fn jrc4558() -> OpAmpModel
pub fn rc4558() -> OpAmpModel
pub fn ne5532() -> OpAmpModel
pub fn op07() -> OpAmpModel
pub fn generic() -> OpAmpModel
Trait Implementations§
§impl Clone for OpAmpModel
impl Clone for OpAmpModel
§fn clone(&self) -> OpAmpModel
fn clone(&self) -> OpAmpModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more