1
$\begingroup$

I need to solve this equation (find $\lambda$) using numerical methods:

$\displaystyle N_0e^{\lambda}+v\frac{e^{\lambda}-1}{\lambda}-N_1 = 0$

All other terms are constant and known.

N0 = 1000000; v = 435000; N1 = 1564000;

I need to solve it by using bisection, false position, newton Raphson and fixed point. I have already solved it by using the three first approaches, however I am stuck in the fixed point. I cannot find a function, such that finding the roots of that function represents the equation and also $|f'(\alpha)| < 1$ where alpha is near the root (Condition that must be satisfied so that the method converges. I have tried several combinations, like dividing by N0, changing the starting approximation (I know that the root is around 0.1). Could somebody help me?

$\endgroup$
3
  • $\begingroup$ Treat the $e^\lambda$ as a separate variable and solve for $\lambda$. I don't have the time at the moment to check the work, but this is a method that does converge to machine precision pretty quickly. The function looks like $$\lambda_{i+1}=\frac{v(e^{\lambda_i}-1)}{n_1-n_0e^{\lambda_i}}$$ $\endgroup$
    – Terra Hyde
    Commented Sep 3, 2015 at 5:06
  • 1
    $\begingroup$ It actually converges to zero, which is the solution to $\lambda(N_0 e^\lambda - N_1) + \nu (e^\lambda - 1) = 0$. It actually runs away from the root since $$ \left|\frac{d}{d\lambda}\left(\frac{\nu (e^\lambda - 1)}{n_1 - n_0 e^\lambda}\right)\right| \approx 1.28 > 1. $$ Sure, you can solve for $e^\lambda$ and do the inverse iterations. $\endgroup$
    – uranix
    Commented Sep 3, 2015 at 7:35
  • $\begingroup$ And that is what I get for working while tired. Thanks. :) $\endgroup$
    – Terra Hyde
    Commented Sep 3, 2015 at 14:34

1 Answer 1

3
$\begingroup$

If you know that the root is around $0.1$ then $$ e^\lambda - 1 \approx \lambda $$ so the solution is close to the solution of $$ N_0 e^\lambda + \nu = N_1 $$ Solving it for $\lambda$ yields $$ \lambda = \log \frac{N_1 - \nu}{N_0}. $$ Let's use that as the initial guess. $$ \lambda_0 = \log \frac{1.564 - 0.435}{1} \approx 0.121332. $$ Recall that we approximated $\frac{e^\lambda - 1}{\lambda}$ by $1$ to obtain the approximate solution. Now let's bring that term back $$ \lambda = \log \left(N_1 - \nu \frac{e^{\lambda} - 1}{\lambda}\right) - \log{N_0}. $$ Instead of approximating the term with $1$, let's use the last known approximate value for $\lambda$. That would give the following iterative method: $$ \lambda_{n+1} = \log \left(N_1 - \nu \frac{e^{\lambda_n} - 1}{\lambda_n}\right) - \log{N_0}. $$ Here are the first 10 iterations of the method: $$ \begin{array}{ccc} n & \lambda_n & \text{error}\\ 0 & 1.21332000000000\times 10^{-1} & 2.03341\times 10^{-2} \\ 1 & 9.66817916349767\times 10^{-2} & 4.31614\times 10^{-3} \\ 2 & 1.01904141090938\times 10^{-1} & 9.06211\times 10^{-4} \\ 3 & 1.00807223823552\times 10^{-1} & 1.90706\times 10^{-4} \\ 4 & 1.01038042978185\times 10^{-1} & 4.01133\times 10^{-5} \\ 5 & 1.00989491349787\times 10^{-1} & 8.43834\times 10^{-6} \\ 6 & 1.00999704757899\times 10^{-1} & 1.77507\times 10^{-6} \\ 7 & 1.00997556283298\times 10^{-1} & 3.73402\times 10^{-7} \\ 8 & 1.00998008234252\times 10^{-1} & 7.85485\times 10^{-8} \\ 9 & 1.00997913162376\times 10^{-1} & 1.65234\times 10^{-8} \\ 10 & 1.00997933161588\times 10^{-1} & 3.47584\times 10^{-9} \end{array}. $$ The method has $|f'(\alpha)| \approx 0.210$ near the root (gives $\approx 0.7$ correct digits per iteration).

NB. In fact Newton's method also is a fixed point method.

The other method, based on inverse iterations proposed by Terra Hyde may be obtained if you solve the equation for $e^\lambda$ treating $\lambda$ as independent variable $$ e^\lambda = \frac{N_1 + \nu \lambda}{N_0 + \nu \lambda}\\ \lambda_{n+1} = \log \frac{N_1 + \nu \lambda_n}{N_0 + \nu \lambda_n}. $$ The method has $|f'(\alpha)| \approx 0.771$ near the root (gives $\approx 0.11$ correct digits per iteration).

$\endgroup$
1
  • $\begingroup$ awesome answer! I am speechless, thank you! $\endgroup$
    – dpalma
    Commented Sep 3, 2015 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .