sindr-devices
Pure electronics device physics companion models for MNA circuit simulation.
sindr-devices is a standalone workspace crate that implements the nonlinear device models used by the sindr solver. It has no dependency on the solver — pure physics math, independently testable.
Devices
| Module | Device | Model |
|---|---|---|
diode |
Silicon diode | Shockley companion model with series resistance and temperature IS scaling |
bjt |
BJT transistor (NPN/PNP) | Ebers-Moll companion model with Early voltage |
mosfet |
MOSFET (NMOS/PMOS) | Level-1 MOSFET companion model |
varactor |
Varactor diode | Voltage-dependent junction capacitance C_j(V) |
igbt |
IGBT | MOSFET gate control with BJT output conductance |
schottky |
Schottky diode | Shockley with Schottky IS/N (~0.3 V forward) |
thermistor |
NTC thermistor | Beta model R(T) = R₀·exp(β·(1/T − 1/T₀)) |
photodiode |
Photodiode | Diode + photocurrent offset |
Usage
Add to your Cargo.toml:
[]
= { = true }
Diode companion model
use ;
let params = silicon; // IS=1e-14, N=1.0, rs=0.0, temperature=300.15 K
let = diode_companion;
// g_eq — linearised conductance (S)
// i_eq — Norton current source (A)
// Temperature-dependent IS (SPICE formula)
let is_at_125c = temperature_scale_is;
DiodeParams fields:
is: f64— saturation current (A)n: f64— ideality factorrs: f64— series resistance (Ω), default 0.0; single-step Newton correction applied internallytemperature: f64— junction temperature (K), default 300.15 K
BJT companion model
use ;
let params = default; // IS=1e-15, BF=100, BR=1, vaf=0.0 (no Early effect)
let companion = bjt_companion;
// companion.g_ce — Early output conductance (A/V); 0.0 when vaf=0
// companion.{gbe, gbc, ice, ibc, ibe, ...}
BjtParams fields:
is, bf, br— Ebers-Moll parametersvaf: f64— forward Early voltage (V); 0.0 = infinite (no Early effect)var: f64— reverse Early voltage (V); 0.0 = infinitetemperature: f64— junction temperature (K), default 300.15 K
MOSFET companion model
use ;
let params = default; // Vto=0.7, Kp=2e-4, Lambda=0.01
let companion = mosfet_companion;
// companion.gds, companion.ids, companion.region (Cutoff/Triode/Saturation)
Varactor junction capacitance
use ;
let params = VaractorParams ;
let c_j = junction_capacitance; // reverse-biased capacitance
// Transient companion (dt=0.0 → DC open circuit)
let = varactor_companion;
VaractorParams fields: cj0 (zero-bias cap, F), phi (built-in potential, V), m (grading coefficient).
IGBT companion model
use ;
let params = default; // vth=5.0, k=5.0, vce_sat=2.0
let companion = igbt_companion;
// companion.gm — transconductance (A/V)
// companion.ids — collector current (A)
// companion.g_ce — output conductance = ids / vce_sat (A/V)
// companion.region — "cutoff" | "triode" | "saturation"
Schottky diode
use ;
let params = default; // IS=1e-8, N=1.05 → ~0.3 V forward
let companion = schottky_companion;
NTC thermistor
use ;
let params = ntc_10k; // R0=10 kΩ, beta=3950 K, T0=298.15 K
let r_at_85c = thermistor_resistance; // ~2.5 kΩ
Photodiode
use ;
let params = default; // responsivity=0.5 A/W, IS=1e-11
let companion = photodiode_companion;
// i_ph = responsivity * irradiance flows as reverse photocurrent
Optional features
| Feature | Enables |
|---|---|
serde |
Serialize/Deserialize on all param structs |
= { = true, = ["serde"] }