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: f64Saturation current (A). Silicon ≈ 1e-15, Germanium ≈ 1e-6.
n_vt: f64Thermal voltage * ideality factor (V). Vt ≈ 25.85 mV at 20 °C.
rs: f64Series resistance (Ω). Accounts for ohmic contact and bulk resistance. SPICE: RS parameter. Typical: 0.5-1Ω for silicon, 2-5Ω for germanium.
Implementations§
§impl DiodeModel
impl DiodeModel
pub fn from_bjt_base_emitter(model: &GummelPoonModel) -> 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
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
pub fn silicon() -> DiodeModel
Generic silicon diode — averaged parameters for 1N914/1N4148 family.
pub fn _1n914() -> DiodeModel
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
pub fn _1n4148() -> DiodeModel
1N4148 — ubiquitous small-signal silicon diode. Most common clipping diode in guitar pedals.
pub fn _1n4001() -> DiodeModel
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
pub fn germanium() -> DiodeModel
Generic germanium diode — averaged parameters for OA-series / 1N34A.
pub fn _1n34a() -> DiodeModel
pub fn _1n34a() -> DiodeModel
1N34A — classic germanium point-contact diode. Lower forward voltage (~0.3V) for earlier, softer clipping onset.
pub fn _oa90() -> DiodeModel
pub fn _oa90() -> DiodeModel
OA90 — European germanium glass diode (Mullard). Very low forward voltage, used in vintage fuzzes.
pub fn led() -> DiodeModel
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
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
pub fn led_red() -> DiodeModel
Red LED — Vf ≈ 1.7V, used in Klon Centaur and high-headroom clippers.
pub fn led_green() -> DiodeModel
pub fn led_green() -> DiodeModel
Green LED — higher Vf ≈ 2.1V for even more headroom.
Trait Implementations§
§impl Clone for DiodeModel
impl Clone for DiodeModel
§fn clone(&self) -> DiodeModel
fn clone(&self) -> DiodeModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more