Fast method to solve transcendental equation for a range of parameters?

518 Views Asked by At

I have an equation of the form

$t + e^{Ax} + e^{Bx} = 0$

This is a transcendental equation, and I would use a Newton-Raphson algorithm or uniroot in R, to solve for $x$.

I am interested in finding the solution to this equation for a range of values of $t$.

Do I need to repeat the same algorithm for every value of $t$, or is there any way in which I can use the solution for a particular $t$ to calculate the solution for other values of $t$?


Edit: In my specific problem I have $A > 0$ and $B<0$.

1

There are 1 best solutions below

4
On BEST ANSWER

Here is a solution that transforms the initial problem with 2 parameters into a 1 parameter issue, easier to tackle.

Set $C=B/A$ (a negative number because $A>0$ and $B<0$).

Let us make a (bijective !) change of variable

$$u=e^{Ax} \ \ \iff \ \ x=\frac{1}{A}\text{ln}(u)\tag{1}$$

Important remark : $u>0$.

The initial equation

$$x+e^{Ax}+e^{Bx}=0 \tag{2}$$

is thus transformed into

$$\underbrace{t+u+u^C}_{f(u)}=0\tag{3}$$

or, geometrically, into the intersection of

$$\begin{cases}y&=&u^C& \ \ \text{(curve with asymptotes)} \\y&=&-u-t& \ \ \text{line with slope} \ -1\end{cases}\tag{4}$$

Fig. 1 illustrates (4).

Three cases can occur (due to the fact that the straight line hits the $y$ axis in $-t$) :

  • either zero solutions when $t<t_0$ for a certain $t_0$.

  • (exceptionally) one solution when $t=t_0$,

  • 2 solutions when $t=t_0$,

and in this case which one do you desire ?

I have assumed here that we are looking for the root with the highest magnitude.

The choice of the initial value is directed by the diagram : if we take the initial value $u=-t$, for big values of $-t$, we will be already rather close to the final value.

The following Matlab program applying Newton iteration is very efficient :

A=1.;B=-2.5;C=B/A;
t=-3;
u=-t, % initialization
for k=1:4, % 4 iterations are usually enough
   u=u-(t+u+u^C)/(1+C*u^(C-1)), % Newton iteration step u = u-f(u)/f'(u)
end;
x=(1/A)*log(u), % solution x=x(t)
t+exp(A*x)+exp(B*x), % checking that this value is (almost !) zero

enter image description here

Fig. 1 : (case $A=1, B=-2.5, C=B/A=-2.5$. Horizontal axis is for $u$ variable). Curve with equation $y=u^C$ and two straight lines with resp. equations $y=-u-t_0$ and $y=-u-t$ for two different values of $t$ ($t=-3$ and $t=t_0 \approx 1.818$); Newton recurrence relationship with initial value $u_0=3$ gives final value $u_5=2.9321...$ out of which $x=1.0757...$.