Skip to main content

Crate sindr_devices

Crate sindr_devices 

Source
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

ModuleDeviceModel
diodeSilicon diodeShockley with series resistance + temperature IS scaling
bjtBJT (NPN/PNP)Ebers–Moll with Early voltage
mosfetMOSFET (NMOS/PMOS)Level-1
jfetJFET (N/P-channel)Shichman–Hodges
igbtIGBTMOSFET gate control + BJT output conductance
ledLEDDiode with colour-dependent forward voltage
zenerZener diodeShockley + reverse-breakdown branch
schottkySchottky diodeShockley with low-N, low-IS parameters
varactorVaractorVoltage-dependent junction capacitance
thermistorNTC thermistorBeta model R(T) = R₀·exp(β·(1/T − 1/T₀))
photodiodePhotodiodeDiode + photocurrent offset
photoresistorPhotoresistor (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, &params);

// 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_applied is the voltage from nodes[0] to nodes[1], and i_eq is the current flowing into nodes[0].
  • Companion form: each *_companion function 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.