1

I don't know how to use The Lambert W function in this form, and I didn't find anything about it. Can someone help me? I'm trying to make a multimeter, and, to measure the voltage between the terminals, I need to calculate this equation, which referees two diodes in parallel, both in series with a resistor. I can resolve it with graphs, but I want to decrease the work that my microcontroller will do. Again, can someone help me? Thank you very much for your attention :)

Bernard
  • 175,478
  • 3
    There's no guarantee that the Lambert-W function can be used here: It's intended specifically to solve $y=xe^x$, not arbitrary equations involving $e^x$ and $x$. As a specific case, consider $2e^{x}+e^{2x}+x=1$: Mathematica can do root-finding to determine $x\approx -0.528$, but fails to find a closed-form using Solve. So it seems dubious you'll be able to solve these equations explicitly. – Semiclassical Jan 02 '21 at 19:49
  • Could you at least provide the signs and sizes of the $(a,b,c,d,f)$ coefficients ? How large is $x$ (small or not ?). In any manner, you will need a numerical method but, under some conditions, we could generate good estimates to make the solution faster. – Claude Leibovici Jan 03 '21 at 03:15

1 Answers1

1

Waiting for more information about the parameters, I shall assume that $a$ and $c$ are positive.

You are looking for the zero of function $$f(x)=ae^{bx}+ce^{dx}+x - f$$ which will not show any analytical solution and for which a numerical method will be required. This implies a "reasonable" starting guess or at least a renge for the solution.

What we can consider is that $f(x)$ is somewhere between $$g(x)=ae^{bx}+ce^{bx}+x - f \quad \text{and} \quad h(x)=ae^{dx}+ce^{dx}+x - f$$

$$g(x)=0 \implies x_g=f-\frac 1b W\left(b (a+c) e^{b f}\right)$$ $$h(x)=0 \implies x_h=f-\frac 1d W\left(d (a+c) e^{d f}\right) $$

Let us try for $a=2$, $b=\frac 12$, $c=3$, $d=\frac 15$ and $f=23.456$. This would give $$x_g \sim 2.83386 \quad \text{and} \quad x_h\sim 6.19505$$ Using the average as $x_0$, Newton iterates would be $$\left( \begin{array}{cc} 0 & 4.514450 \\ 1 & 3.885394 \\ 2 & 3.787382 \\ 3 & 3.785395 \\ 4 & 3.785394 \end{array} \right)$$

Using @Semiclassical's example $$f(x)=2e^{x}+e^{2x}+x-1$$ we should have $$x_g \sim -0.617642 \quad \text{and} \quad x_h\sim -0.38607$$ Newton iterates would be $$\left( \begin{array}{cc} n & x_n \\ 0 & -0.5018562 \\ 1 & -0.5274934 \\ 2 & -0.5277952 \end{array} \right)$$