Contents

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 = 1

The 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_amps

Is, the diode's reverse saturation current.

ideality_factor

n, the Shockley ideality (emission coefficient).

thermal_voltage_volts

Vt, the thermal voltage (~0.025864 V at room temperature).

void current_and_jacobian(double voltage, double &current_amps, double &conductance_siemens) const

Evaluates 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

voltage

The voltage across the diode (anode minus cathode), in volts.

current_amps

Receives the diode current in amperes. Always finite.

conductance_siemens

Receives di/dv in siemens. Always finite.

double current(double voltage) const

Evaluates the diode current for a given branch voltage.

Parameters

voltage

The voltage across the diode (anode minus cathode), in volts.

Returns

The diode current in amperes. Always finite.

void current_and_antiderivative(double voltage, double &current_amps, double &antiderivative_ampere_volts) const

Evaluates 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

voltage

The voltage across the diode (anode minus cathode), in volts.

current_amps

Receives the diode current in amperes. Always finite.

antiderivative_ampere_volts

Receives the integral of the current. Always finite.

double current_antiderivative(double voltage) const

Evaluates the antiderivative of the diode current with respect to its voltage.

Parameters

voltage

The 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) const

Evaluates the derivative of the diode current with respect to its voltage.

Parameters

voltage

The voltage across the diode (anode minus cathode), in volts.

Returns

di/dv in siemens. Always finite.