Tuesday, 28 June 2016

Solving diode circuit with iteration - why doesn't it work?


We are given the information that the forward voltage drop of the diode \$V_D\$ is 0.7 V @ 1 mA. Applying KVL, we get: \$-V_{DD} + R \cdot I_D + V_D = 0\$


We know that \$I_D = I_S \cdot e^{\frac{V_D}{V_T}}\$. Plugging in \$V_D = 0.7\text{ V}, I_D= 1 \text{mA}, V_T= 25 \text{mV}\$, we find that \$I_S = 6.9144 \cdot 10^{-16} \text{A}\$.


Rearranging the 1st equation, we have \$V_D = V_{DD} - R \cdot I_D = 5 - 10\text{k} × 6.9144 \cdot 10^{-16} × e^{\frac{VD}{0.025}}\$.


According to my understanding, we can solve this by iteration. We pick a value of \$V_D\$, say 0.7 V, plug it in the RHS of the last equation and we should end up with a better approximation. Repeat until we are satisfied with the result. However this does not work and I end up with a garbage value.


Anyone knows why?



schematic


simulate this circuit – Schematic created using CircuitLab



Answer



Your electrical analysis is fine, it is really just a question of which numerical method to use, since the equation cannot be solved analytically.


Different numerical methods are appropriate for different situations. I'm not quite sure what the problem with using your method is in this circuit, but I think it is because the slope is so steep with the 10k resistor that the next estimate overshoots the correct value by way too much.


A different numerical method that can work is basically a binary search. The key to notice is that the function \$A - B e^{x}\$ is strictly decreasing, so that if the left hand \$V_D\$ is too low, you know the right hand \$V_D\$ is too high. By hand the process looks something like this (Python):


>>> def vd1(vd0):
... return 5-6.9144e-12*math.exp(vd0/0.025)
...
>>> vd1(0.7)

-4.999999845336939
>>> vd1(0.6)
4.8168436139454105
>>> vd1(0.65)
3.646647188565237
>>> vd1(0.675)
1.3212056451829235
>>> vd1(0.68)
0.5067104283223642
>>> vd1(0.678)

0.8521709473357619
>>> vd1(0.679)
0.6828948324788575
>>> vd1(0.6791)
0.6655918288722198
>>> vd1(0.67905)
0.6742519821744661
>>> vd1(0.67902)
0.6794397665027283


So \$V_D \approx 0.679\$V.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...