I am trying to calculate Id given the following equations:
Vd = 5 - (Id * R)
Id = Is * e^(Vd/.025)
Is = 10^-15
R = 1000
By substitution:
Id = 10^-15 * e^(40(5 - (Id * 1000)))
Id = 10^-15 * e^200 * e^(-40 * Id * 1000)
Id * e^(40 * Id * 1000) = 10^-15 * e^200
(40 * Id * 1000) * e^(40 * Id * 1000) = 40 * 1000 * 10^-15 * e^200
40000 * Id * e^(40000 * Id) = (e^200) / 25000000000
W((e^200) / 25000000000) = 40000 * Id
Id = W((e^200) / 25000000000)) / 40000
So I got this far but have no idea how to solve further. How can I compute W((e^200) / 25000000000))?
When $x\to\infty$, one has $$W(x)=\ln x-\ln\ln x+o(1).$$ In the question, $x=4\cdot10^{-11}\cdot\mathrm e^{200}$, then $\ln x\approx176$ and $\ln176\approx5$ hence $W(x)\approx171$.
Edit: To solve the OP, it might be best to avoid the Lambert W function altogether and to use the following approach.
Calling $u$ the quantity to be computed,
40000 * Idin the question, and $c$ the parameter $$c=\ln(4\cdot10^{-11})+200\approx176.057858338,$$ the goal is to solve the equation $$u=c-\log u.$$ This seems tailored for a recursive algorithm since, starting from $u_0$ not too large and not too small (more about this later), and defining a sequence $(u_n)$ by $$u_{n+1}=c-\log u_n,$$ for every $n$, one can hope that $u_n\to u$.More precisely, consider the function $A(t)=c-\log t$, note that $A$ is decreasing on $t\gt0$ with $A(1)=c$ and $A(c)\gt1$ (since $\log t\lt t-1$ for every $t\ne1$) hence $A(I)\subset I$ with $I=[1,c]$. A consequence is that every $u_0$ in $I$ fits.
Furthermore, $A'(t)=-1/t$ hence $A$ is contracting on $I$. Thus, iterating $u_{n+1}=A(u_n)$ soon puts us close to $u$, alternatively above and below $u$, each term being roughly $1/|A'(u)|=u$ times closer to $u$ than the preceding term of the sequence. Since $u$ is in the hundreds, after a few iterations, one gets two more digits at each iteration.
To sum up, $u_n\to u$ for every $1\leqslant u_0\leqslant c$. If $u_0=c$ (the least effective choice, in a sense), one gets $$u_1=170.88704566,\quad u_2=170.91685555,\quad u_3=170.91668112,$$ hence three iterations are already sufficient to declare that $170.91668112\lt u\lt170.91685555$, in particular, we proved rigorously that $$u=170.91677\pm10^{-5},$$ and we know for some good reasons that a better approximation is $u_4$ itself, as confirmed by the next term of the sequence, namely, $$u_4=170.91668215.$$