2
$\begingroup$

In my heat transfer classes, we encounter the Gaussian error function when dealing with unsteady heat conduction of a semi-infinite surface. The equation I have to solve is usually of the form:

$$\text{erf}(x)=c$$

where $c$ is a number and $x$ is the variable.

For these questions, the method I use involves guessing a bunch of $x$'s and getting them as close to $c$ as possible. I can compute error function in my scientific calculator using:

$$\text{erf}(x)=\frac{2}{\sqrt{\pi}}\int_{0}^{x}{e^{-u^2}du}$$

The other method I know involves quadratic interpolation about three nearby points, but obtaining the polynomial and solving it is too time-consuming, so that's ruled out as well.

I would appreciate any method to compute error function equations which can be done reasonably by a scientific calculator. I knew the error function had an inverse, but I couldnt find a suitable form which I can compute via calculator.

$\endgroup$
3
  • 1
    $\begingroup$ You can use Newton-Raphson method of root finding, which has quadratic convergence, and only requires computing the function and its derivative. Both of which you can do $\endgroup$
    – Yuriy S
    Aug 7, 2019 at 16:09
  • $\begingroup$ @YuriyS wow I haven't thought of that, silly me. Can you please post it as an answer so I can accept it and call it closed? Thank you. $\endgroup$ Aug 7, 2019 at 16:11
  • 1
    $\begingroup$ I don't like giving short answers, so you can do it yourself if you want. I would also like to point out that, depending on the argument range, the error function can be computed by its Taylor series, or its asymptotic series, rather than the integral. Though it only matters if you need to optimize the algorithm for speed. $\endgroup$
    – Yuriy S
    Aug 7, 2019 at 16:41

1 Answer 1

1
$\begingroup$

It is possible to use the Newton-Raphson iteration method to solve it:

$$x_n=x_{n-1}-\frac{c-\int_{0}^{x_{n-1}}{e^{-u^2}du} }{-e^{-x_{n-1}^2}}$$

A suitable choice of $x_0$ is required for a speedy convergence.

$\endgroup$

You must log in to answer this question.

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