Skip to main content

DiodeModel

Struct DiodeModel 

pub struct DiodeModel {
    pub is: f64,
    pub n_vt: f64,
    pub rs: f64,
}
Expand description

Diode model parameters derived from the Shockley equation.

Fields§

§is: f64

Saturation current (A). Silicon ≈ 1e-15, Germanium ≈ 1e-6.

§n_vt: f64

Thermal voltage * ideality factor (V). Vt ≈ 25.85 mV at 20 °C.

§rs: f64

Series resistance (Ω). Accounts for ohmic contact and bulk resistance. SPICE: RS parameter. Typical: 0.5-1Ω for silicon, 2-5Ω for germanium.

Implementations§

§

impl DiodeModel

pub fn from_bjt_base_emitter(model: &GummelPoonModel) -> DiodeModel

Base-emitter diode approximation from a Gummel-Poon BJT model.

Used for diode-connected BJTs where base and collector are shorted. The resulting one-port uses the BJT’s saturation current and forward ideality factor, with emitter resistance represented as series Rs.

pub fn dynamic_resistance_from_sources(&self, sources: &[(f64, f64)]) -> f64

Small-signal resistance at a diode operating point set by Thevenin sources feeding the diode anode.

pub fn silicon() -> DiodeModel

Generic silicon diode — averaged parameters for 1N914/1N4148 family.

pub fn _1n914() -> DiodeModel

1N914 — fast switching silicon diode (original TS808 diode). Slightly lower forward voltage than 1N4148 due to smaller die.

pub fn _1n4148() -> DiodeModel

1N4148 — ubiquitous small-signal silicon diode. Most common clipping diode in guitar pedals.

pub fn _1n4001() -> DiodeModel

1N4001 — rectifier diode, used in some pedals for asymmetric clipping. Higher Is and softer knee than signal diodes.

pub fn germanium() -> DiodeModel

Generic germanium diode — averaged parameters for OA-series / 1N34A.

pub fn _1n34a() -> DiodeModel

1N34A — classic germanium point-contact diode. Lower forward voltage (~0.3V) for earlier, softer clipping onset.

pub fn _oa90() -> DiodeModel

OA90 — European germanium glass diode (Mullard). Very low forward voltage, used in vintage fuzzes.

pub fn led() -> DiodeModel

Generic LED diode — higher forward voltage (~1.7V) for harder clipping.

LEDs have much lower saturation current than silicon diodes due to their wide bandgap (GaAsP for red LEDs). This results in higher forward voltage at the same current levels.

Real LED SPICE models use high ideality factors (n≈3-4) because carrier recombination in the wide-bandgap junction dominates. Reference: LTspice red LED uses Is=9.4e-14, N=3.73, Rs=2.1.

pub fn schottky() -> DiodeModel

Generic Schottky diode — low forward voltage (~0.3V), fast recovery. Used in power protection, but also in boutique pedals for soft clipping (germanium-like Vf without temperature instability).

pub fn led_red() -> DiodeModel

Red LED — Vf ≈ 1.7V, used in Klon Centaur and high-headroom clippers.

pub fn led_green() -> DiodeModel

Green LED — higher Vf ≈ 2.1V for even more headroom.

Trait Implementations§

§

impl Clone for DiodeModel

§

fn clone(&self) -> DiodeModel

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 DiodeModel

§

impl Debug for DiodeModel

§

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