Skip to main content

OpAmpModel

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:

  • Aol is the open-loop DC gain (typically 100k-1M)
  • Vp is the non-inverting input voltage (set externally)
  • Vm is 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: f64

Open-loop DC gain. TL072 ≈ 200k (106dB), LM308 ≈ 300k.

§gbw: f64

Gain-bandwidth product (Hz). TL072 ≈ 3MHz, LM308 ≈ 1MHz. Determines closed-loop bandwidth: f_cl = GBW / closed_loop_gain.

§slew_rate: f64

Slew rate (V/µs). TL072 ≈ 13, LM308 ≈ 0.3.

§v_rail_pos: f64

Maximum positive output swing (V above bias point). For symmetric bias: same as v_rail_neg. For asymmetric: differs.

§v_rail_neg: f64

Maximum negative output swing (V below bias point).

§output_impedance: f64

Output impedance (Ω). Typically 50-200Ω for voltage-feedback op-amps. Used by the VCVS stamp in the MNA nullor path.

§output_capacitance: f64

Output 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

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

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

§

fn clone(&self) -> OpAmpModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Copy for OpAmpModel

§

impl Debug for OpAmpModel

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more