Solve for $ x $: $ ae^{bx}+ce^{dx}+x = f $

lambert-w

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 🙂

Best Answer

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)$$

Related Question