Expand description
Pure-Rust electronics device physics: linearised companion models for semiconductor and passive components used by MNA-based circuit simulators.
sindr-devices provides the small-signal linearisation that
Newton–Raphson solvers need at every iteration: given an applied voltage,
each device returns a (g_eq, i_eq) pair — an equivalent conductance and
Norton-current source. Stamp those into the MNA matrix and the solver
converges on the operating point.
This crate has no dependency on a particular solver. Use it standalone
if you’re building your own MNA implementation, or pair it with the
companion crate sindr for an
end-to-end simulator.
§Devices
| Module | Device | Model |
|---|---|---|
diode | Silicon diode | Shockley with series resistance + temperature IS scaling |
bjt | BJT (NPN/PNP) | Ebers–Moll with Early voltage |
mosfet | MOSFET (NMOS/PMOS) | Level-1 |
jfet | JFET (N/P-channel) | Shichman–Hodges |
igbt | IGBT | MOSFET gate control + BJT output conductance |
led | LED | Diode with colour-dependent forward voltage |
zener | Zener diode | Shockley + reverse-breakdown branch |
schottky | Schottky diode | Shockley with low-N, low-IS parameters |
varactor | Varactor | Voltage-dependent junction capacitance |
thermistor | NTC thermistor | Beta model R(T) = R₀·exp(β·(1/T − 1/T₀)) |
photodiode | Photodiode | Diode + photocurrent offset |
photoresistor | Photoresistor (LDR) | Light-level-dependent resistance |
§Quick example
use sindr_devices::diode::{DiodeParams, diode_companion};
let params = DiodeParams::silicon(); // IS=1e-14, N=1.0, rs=0.0
let v_applied = 0.65; // forward bias, volts
let (g_eq, i_eq) = diode_companion(v_applied, ¶ms);
// Stamp g_eq into Y(p,p), Y(q,q), -g_eq into Y(p,q)/Y(q,p),
// and i_eq into b(p)/-i_eq into b(q) in your MNA system.
assert!(g_eq > 0.0);§Conventions
- Voltages and currents are in SI units (V, A).
- Temperature is in kelvin. Default is 300.15 K (≈ 27 °C, the SPICE default).
- Sign convention for two-terminal companions:
v_appliedis the voltage fromnodes[0]tonodes[1], andi_eqis the current flowing intonodes[0]. - Companion form: each
*_companionfunction returns the linearised(g_eq, i_eq)at the operating point — the form Newton–Raphson stamps directly.
Modules§
- bjt
- BJT (Bipolar Junction Transistor) device model.
- diode
- Diode model: Shockley equation, companion model, voltage limiting.
- igbt
- IGBT (Insulated Gate Bipolar Transistor) simplified model.
- jfet
- JFET (Junction Field-Effect Transistor) device model.
- led
- LED colour presets.
- mosfet
- MOSFET Level 1 (Shichman-Hodges) model with body effect.
- photodiode
- Photodiode companion model.
- photoresistor
- Photoresistor (LDR) model: resistance as a function of illuminance.
- schottky
- Schottky diode companion model.
- thermistor
- NTC thermistor resistance model (Beta model).
- varactor
- Varactor diode model: voltage-dependent junction capacitance.
- zener
- Zener diode model: piecewise companion for Newton-Raphson simulation.