Diode modelling

In electronics, diode modelling refers to the mathematical models used to approximate the actual behaviour of real diodes to enable calculations and circuit analysis. A diode's I-V curve is nonlinear. 
A very accurate, but complicated, physical model composes the I-V curve from three exponentials with a slightly different steepness (i.e. ideality factor), which correspond to different recombination mechanisms in the device; at very large and very tiny currents the curve can be continued by linear segments (i.e. resistive behaviour).
In a relatively good approximation a diode is modelled by the single-exponential Shockley diode law. This nonlinearity still complicates calculations in circuits involving diodes 
so even simpler models are often used.
This article discusses the modelling of p-n junction diodes, but the techniques may be generalized to other solid state diodes.
Large-signal modelling.
Shockley diode model.
The Shockley diode equation relates the diode current formula_1 of a p-n junction diode to the diode voltage formula_2. This relationship is the diode "I-V characteristic":
where formula_4 is the "saturation current" or "scale current" of the diode (the magnitude of the current that flows for negative formula_2 in excess of a few formula_6, typically 10−12A). The scale current is proportional to the cross-sectional area of the diode. Continuing with the symbols: formula_6 is the thermal voltage (formula_8, about 26 mV at normal temperatures), and formula_9 is known as the diode ideality factor (for silicon diodes formula_9 is approximately 1 to 2).
When formula_11 the formula can be simplified to:
This expression is, however, only an approximation of a more complex I-V characteristic. Its applicability is particularly limited in case of ultrashallow junctions, for which better analytical models exist.
Diode-resistor circuit example.
To illustrate the complications in using this law, consider the problem of finding the voltage across the diode in Figure 1.
Because the current flowing through the diode is the same as the current throughout the entire circuit, we can lay down another equation. By Kirchhoff's laws, the current flowing in the circuit is
These two equations determine the diode current and the diode voltage. To solve these two equations, we could substitute the current formula_1 from the second equation into the first equation, and then try to rearrange the resulting equation to get formula_2 in terms of formula_16. A difficulty with this method is that the diode law is nonlinear. Nonetheless, a formula expressing formula_1 directly in terms of formula_16 without involving formula_2 can be obtained using the Lambert "W"-function , which is the inverse function of formula_20, that is, formula_21. This solution is discussed next.
Explicit solution.
An explicit expression for the diode current can be obtained in terms of the Lambert "W"-function (also called the Omega function). A guide to these manipulations follows. A new variable formula_22 is introduced as
Following the substitutions formula_24:
and formula_26:
rearrangement of the diode law in terms of "w" becomes:
which using the Lambert formula_29-function becomes
With the approximations (valid for the most common values of the parameters) formula_31 and formula_32, this solution becomes
Once the current is determined, the diode voltage can be found using either of the other equations.
For large x, formula_34 can be approximated by formula_35. For common physical parameters and resistances, formula_36 will be on the order of 1040.
Iterative solution.
The diode voltage formula_2 can be found in terms of formula_16 for any particular set of values by an iterative method using a calculator or computer. The diode law is rearranged by dividing by formula_4, and adding 1. The diode law becomes
By taking natural logarithms of both sides the exponential is removed, and the equation becomes
For any formula_1, this equation determines formula_2. However, formula_1 also must satisfy the Kirchhoff's law equation, given above. This expression is substituted for formula_1 to obtain
or
The voltage of the source formula_16 is a known given value, but formula_2 is on both sides of the equation, which forces an iterative solution: a starting value for formula_2 is guessed and put into the right side of the equation. Carrying out the various operations on the right side, we come up with a new value for formula_2. This new value now is substituted on the right side, and so forth. If this iteration "converges" the values of formula_2 become closer and closer together as the process continues, and we can stop iteration when the accuracy is sufficient. Once formula_2 is found, formula_1 can be found from the Kirchhoff's law equation.
Sometimes an iterative procedure depends critically on the first guess. In this example, almost any first guess will do, say formula_55. Sometimes an iterative procedure does not converge at all: in this problem an iteration based on the exponential function does not converge, and that is why the equations were rearranged to use a logarithm. Finding a convergent iterative formulation is an art, and every problem is different.
Graphical solution.
Graphical analysis is a simple way to derive a numerical solution to the transcendental equations describing the diode. As with most graphical methods, it has the advantage of easy visualization. By plotting the "I"-"V" curves, it is possible to obtain an approximate solution to any arbitrary degree of accuracy. This process is the graphical equivalent of the two previous approaches, which are more amenable to computer implementation.
This method plots the two current-voltage equations on a graph and the point of intersection of the two curves satisfies both equations, giving the value of the current flowing through the circuit and the voltage across the diode. The figure illustrates such method.
Piecewise linear model.
In practice, the graphical method is complicated and impractical for complex circuits. Another method of modelling a diode is called piecewise linear (PWL) modelling. In mathematics, this means taking a function and breaking it down into several linear segments. This method is used to approximate the diode characteristic curve as a series of linear segments. The real diode is modelled as 3 components in series: an ideal diode, a voltage source and a resistor.
The figure shows a real diode I-V curve being approximated by a two-segment piecewise linear model. Typically the sloped line segment would be chosen tangent to the diode curve at the Q-point. Then the slope of this line is given by the reciprocal of the small-signal resistance of the diode at the Q-point.
Mathematically idealized diode.
Firstly, consider a mathematically idealized diode. In such an ideal diode, if the diode is reverse biased, the current flowing through it is zero. This ideal diode starts conducting at 0 V and for any positive voltage an infinite current flows and the diode acts like a short circuit. The I-V characteristics of an ideal diode are shown below:
Ideal diode in series with voltage source.
Now consider the case when we add a voltage source in series with the diode in the form shown below:
When forward biased, the ideal diode is simply a short circuit and when reverse biased, an open circuit.
If the anode of the diode is connected to 0V, the voltage at the cathode will be at "Vt" and so the potential at the cathode will be greater than the potential at the anode and the diode will be reverse biased. In order to get the diode to conduct, the voltage at the anode will need to be taken to "Vt". This circuit approximates the cut-in voltage present in real diodes. The combined I-V characteristic of this circuit is shown below:
The Shockley diode model can be used to predict the approximate value of formula_56.
Using formula_58 and formula_59:
Typical values of the saturation current at room temperature are:
As the variation of formula_2 goes with the logarithm of the ratio formula_64, its value varies very little for a big variation of the ratio. The use of base 10 logarithms makes it easier to 
think in orders of magnitude.
For a current of 1.0mA:
For a current of 100mA:
Values of 0.6 or 0.7 volts are commonly used for silicon diodes.
Diode with voltage source and current-limiting resistor.
The last thing needed is a resistor to limit the current, as shown below:
The "I-V" characteristic of the final circuit looks like this:
The real diode now can be replaced with the combined ideal diode, voltage source and resistor and the circuit then is modelled using just linear elements. If the sloped-line segment is tangent to the real diode curve at the Q-point, this approximate circuit has the same small-signal circuit at the Q-point as the real diode.
Dual PWL-diodes or 3-Line PWL model.
When more accuracy is desired in modelling the diode's turn-on characteristic, the model can be enhanced by doubling-up the standard PWL-model. This model uses two piecewise-linear diodes in parallel, as a way to model a single diode more accurately.
Small-signal modelling.
Resistance.
Using the Shockley equation, the small-signal diode resistance formula_69 of the diode can be derived about some operating point (Q-point) where the DC bias current is formula_70 and the Q-point applied voltage is formula_71. To begin, the diode "small-signal conductance" formula_72 is found, that is, the change in current in the diode caused by a small change in voltage across the diode, divided by this voltage change, namely:
The latter approximation assumes that the bias current formula_70 is large enough so that the factor of 1 in the parentheses of the Shockley diode equation can be ignored. This approximation is accurate even at rather small voltages, because the thermal voltage formula_75 at 300K, so formula_76 tends to be large, meaning that the exponential is very large.
Noting that the small-signal resistance formula_69 is the reciprocal of the small-signal conductance just found, the diode resistance is independent of the ac current, but depends on the dc current, and is given as
Capacitance.
The charge in the diode carrying current formula_70 is known to be
where formula_81 is the forward transit time of charge carriers: The first term in the charge is the charge in transit across the diode when the current formula_70 flows. The second term is the charge stored in the junction itself when it is viewed as a simple capacitor; that is, as a pair of electrodes with opposite charges on them. It is the charge stored on the diode by virtue of simply having a voltage across it, regardless of any current it conducts.
In a similar fashion as before, the diode capacitance is the change in diode charge with diode voltage:
where formula_84 is the junction capacitance and the first term is called the diffusion capacitance, because it is related to the current diffusing through the junction.
Variation of forward voltage with temperature.
The Shockley diode equation has an exponential of formula_85, which would lead one to expect that the forward-voltage increases with temperature. In fact, this is generally not the case: as temperature rises, the saturation current formula_4 rises, and this effect dominates. So as the diode becomes "hotter", the forward-voltage (for a given current) "decreases".
Here is some detailed experimental data, which shows this for a 1N4005 silicon diode. In fact, some silicon diodes are used as temperature sensors; for example, the CY7 series from OMEGA has a forward voltage of 1.02V in liquid nitrogen (77K), 0.54V at room temperature, and 0.29V at 100 °C.
In addition, there is a small change of the material parameter bandgap with temperature. For LEDs, this bandgap change also shifts their colour: they move towards the blue end of the spectrum when cooled.
Since the diode forward-voltage drops as its temperature rises, this can lead to thermal runaway in bipolar-transistor circuits (base-emitter junction of a BJT acts as a diode), where a change in bias leads to an increase in power-dissipation, which in turn changes the bias even further.