How to solve for $x$: $e^{-x/d}\cdot (1-e^{-x/a})$ value that will give a certain $y$?

80 Views Asked by At

I have a simple equation for $h(x)$ as a multiplication of two exponentials:

  • $f(x) = 1-e^{-x/a}$
  • $g(x) = e^{-x/d}$
  • $h(x) = f(x)g(x)$

I solved $h(x)$ for its maxima at an $x$-value of $m= a\cdot\ln((a+d)/a)$. Thus I have created a scaled version to a max of $y=1$:

  • $i(x) = h(x)/h(m)$

This looks like this:

Graph

https://www.desmos.com/calculator/tagnzdeqes

I would like to now be able to solve the lowest $x$-value of $i(x)$ for a given $y$ between $0$ and $1$ (say $y=r$). Ie. I would like to be able to work out the lowest $x$-value that provides a $y$ of say $0.2$.

I have tried entering it in equation solvers as:

$r = e^{-x/d}\cdot (1-e^{-x/a}), \mathrm{solve\, for\,} x$

But I cannot get an answer from them. $d$ and $a$ are both real numbers $>0$. Is this solvable?

1

There are 1 best solutions below

0
On BEST ANSWER

Except for very few cases, in general, this equation will no show analyical solutions and you will need some numerical method such as Newton (xhich means that you need a starting guess of $x$.

In all the following, I assume $a>0$ and $d>0$.

Considering that you look for the zero's of $$f(x)=e^{-\frac{x}{d}}\left(1-e^{-\frac{x}{a}}\right) -r$$ $$f'(x)=\frac{e^{-x \left(\frac{1}{a}+\frac{1}{d}\right)} \left(-a e^{\frac{x}{a}}+a+d\right)}{a d}$$ $$f''(x)=\frac{e^{-x \left(\frac{1}{a}+\frac{1}{d}\right)} \left(a^2 e^{\frac{x}{a}}-(a+d)^2\right)}{a^2 d^2}$$ The derivative cancels at a point $$x_*=a \log \left(\frac{a+d}{a}\right)$$ which is a maximum since $$f''(x_*)=-\frac{\left(\frac{a+d}{a}\right)^{-\frac{a}{d}}}{a d} <0$$ So, to get solutions, we need that $$f(x_*)=\frac{d \left(\frac{a+d}{a}\right)^{-\frac{a}{d}}}{a+d}-r >0$$ If this is the case, we could try to get estimates using a Taylor expansion around $x_*$; this would give $$f(x)=f(x_*)+\frac 12 f''(x_*)(x-x_*)^2+O((x-x_*)^3)$$ Solving the quadratic would give $$x_\pm=x_* \pm \sqrt{-2\frac{f(x_*)}{f''(x_*)}}$$ If $x_-<0$, we should use $x_-=0$ since $f(0)=-r$.

Using these guesses, we could start using Newton method.

Let us try using your numbers $a=0.01$, $d=0.4$ and $r=0.2$. This gives $x_+\approx 0.115$. Now, Newton iterates for the upper solution. $$\left( \begin{array}{cc} n & x_n \\ 0 & 0.114912 \\ 1 & 0.408407 \\ 2 & 0.586326 \\ 3 & 0.639840 \\ 4 & 0.643756 \\ 5 & 0.643775 \end{array} \right)$$ For the other one $$\left( \begin{array}{cc} n & x_n \\ 0 & 0.00000000 \\ 1 & 0.00200000 \\ 2 & 0.00224236 \\ 3 & 0.00224552 \end{array} \right)$$

If we are only concerned by the smallest root, making a Taylor series around $x=0$ would give $$f(x)=-r+\frac{1}{a}x- \left(\frac{1}{2 a^2}+\frac{1}{a d}\right)x^2+O\left(x^3\right)$$ and keeping the smallest root, the estimate $$x \sim \frac{2 a d-\sqrt{4 a^2 d^2-8 a^2 d (2 a+d)r}}{2 (2 a+d)}$$ For the worked example, this will give as starting guess $x_0=0.00227069$ and Newton would converge very quickly.

Instead of Taylor series, we could also use $[1,n]$ Padé approximants. The simplest would give $$x_{(1)}=-\frac{2 a d r}{2 a r+d (r-2)}$$ which, for the worked example, would give $ \frac{2}{895}=0.00223464$ and probably one iteration would suffice.

Another thing which could be done is an expansion of $(f(x)+r)$ as a long Taylor series and use series reversion to get $$x=a r+\frac{a (2 a+d)}{2 d}r^2+\frac{a (3 a+d) (3 a+2 d)}{6 d^2}r^3 +\frac{a (2 a+d) (4 a+d) (4 a+3 d)}{12 d^3}r^4+\frac{a (5 a+d) (5 a+2 d) (5 a+3 d) (5 a+4 d)}{120 d^4} r^5+\frac{a (2 a+d) (3 a+d) (6 a+d) (3 a+2 d) (6 a+5 d)}{60 d^5}r^6+O\left(r^7\right)$$ which would give, as an estimate, $x=0.00224549$.

Edit

For the case where $a \ll d$, we could instead look for the zero of $$g(x)=x+a \log \left(1-r e^{\frac{x}{d}}\right)$$ Using Taylor series built at $x=0$ would give $$g(x)=a \log (1-r)+ \left(\frac{a r}{d (r-1)}+1\right)x+O\left(x^2\right)$$ from which an estimate $$x_0=-\frac{a d (r-1) \log (1-r)}{a r+d (r-1)}$$ For the worked example, this gives $x_0=0.00224547$