class
SushiDSP::SiliconDiode
Models a Shockley-law silicon diode with an ideality factor as a nonlinear branch of a DK-method solver; the defaults match docs/reference/spice/models/d1n914.sub.
- Declared in
include/SushiDSP/circuits/models/SiliconDiode.hpp
The law is exact for |v| <= 40*n*Vt and continues on its own tangent beyond either knee, so the current is C^1 and finite everywhere (include/SushiDSP/README.md).
Static public attributes
static constexpr std::size_t kBranchCount = 1The number of nonlinear branch equations this device contributes to a DK solve.
Public member functions
explicit SiliconDiode(double saturation_current_amps=2.52e-9, double ideality_factor=1.752, double thermal_voltage_volts=0.025864)Parameters
saturation_current_ampsIs, the diode's reverse saturation current.
ideality_factorn, the Shockley ideality (emission coefficient).
thermal_voltage_voltsVt, the thermal voltage (~0.025864 V at room temperature).
void current_and_jacobian(double voltage, double ¤t_amps, double &conductance_siemens) constEvaluates the diode current and its derivative from a single exponential.
The DK solver always needs both, and current()/jacobian() each cost one exp(); this entry point costs one for the pair. current() and jacobian() forward here, so the Shockley law and its linear extrapolation exist in exactly one place.
Parameters
voltageThe voltage across the diode (anode minus cathode), in volts.
current_ampsReceives the diode current in amperes. Always finite.
conductance_siemensReceives di/dv in siemens. Always finite.
double current(double voltage) constEvaluates the diode current for a given branch voltage.
Parameters
voltageThe voltage across the diode (anode minus cathode), in volts.
Returns
The diode current in amperes. Always finite.
void current_and_antiderivative(double voltage, double ¤t_amps, double &antiderivative_ampere_volts) constEvaluates the diode current and its antiderivative from a single exponential.
The antiderivative is C^1 wherever the current is C^0, and only a difference of two evaluations means anything (include/SushiDSP/README.md).
Parameters
voltageThe voltage across the diode (anode minus cathode), in volts.
current_ampsReceives the diode current in amperes. Always finite.
antiderivative_ampere_voltsReceives the integral of the current. Always finite.
double current_antiderivative(double voltage) constEvaluates the antiderivative of the diode current with respect to its voltage.
Parameters
voltageThe voltage across the diode (anode minus cathode), in volts.
Returns
The integral of the diode current in ampere-volts. Always finite.
double jacobian(double voltage) constEvaluates the derivative of the diode current with respect to its voltage.
Parameters
voltageThe voltage across the diode (anode minus cathode), in volts.
Returns
di/dv in siemens. Always finite.

