We define the backward difference operator
by:

Repeated application gives:

We can also derive a formula for
where
is any real number,
independent of
:

Now we can express the following general integral using the function value from
either left (
) or right (
) hand side of the interval
:

Code:
>>> from sympy import var, simplify, integrate
>>> var("nabla t h")
(nabla, t, h)
>>> s = integrate((1-nabla)**(-t/h), (t, 0, h))
>>> simplify(s)
h*nabla/(-log(1 - nabla) + nabla*log(1 - nabla))
>>> s.series(nabla, 0, 5)
h + h*nabla/2 + 5*h*nabla**2/12 + 3*h*nabla**3/8 + 251*h*nabla**4/720 + O(nabla**5)
>>> s2 = s*(1-nabla)
>>> simplify(s2)
-h*nabla/log(1 - nabla)
>>> s2.series(nabla, 0, 5)
h - h*nabla/2 - h*nabla**2/12 - h*nabla**3/24 - 19*h*nabla**4/720 + O(nabla**5)
Keeping terms only to third-order, we obtain:

Similarly:

Code:
>>> from sympy import var
>>> var("f0 f1 f2 f3")
(f0, f1, f2, f3)
>>> nabla1 = f0 - f1
>>> nabla2 = f0 - 2*f1 + f2
>>> nabla3 = f0 - 3*f1 + 3*f2 - f3
>>> 24*(f0 + nabla1/2 + 5*nabla2/12 + 3*nabla3/8)
-59*f1 - 9*f3 + 37*f2 + 55*f0
>>> 24*(f0 - nabla1/2 - nabla2/12 - nabla3/24)
f3 - 5*f2 + 9*f0 + 19*f1
Set of linear ODEs can be written in the form:
(1)
For example for the Schrödinger we have

Now we need to choose a grid
, where
is some uniform grid. For
example
:

where
. We also need the derivative, for the exampe
above we get:

Now we substitute this into (1):

We can integrate this system from
to
on a uniform grid
:

where
and we use some method to approximate the
integral, see the previous section.
Radial Poisson equation is:
(2)
The left hand side can be written as:

So the Poisson equation can also be written as:
(3)
Now we determine the values of
,
and the behavior of
and
. The equation determines
up to an
arbitrary constant, so we set
and now the potential
is
determined uniquely.
The 3D integral of the (number) density is equal to the total (numeric) charge, which is equal to
(number of electrons). We can then use the Poisson equation to rewrite the integral in terms of
:
![Z = \int n({\bf x}) \d^3 x
= \int n(r) r^2\d\Omega\d r
= \int_0^\infty 4\pi n(r) r^2\d r =
= -\int_0^\infty (rV)'' r\d r =
= \int_0^\infty (rV)'\d r - [(rV)'r]_0^\infty =
= [rV]_0^\infty - [(rV)'r]_0^\infty =
= [rV - (rV)'r]_0^\infty =
= -[V'r^2]_0^\infty =
= -\lim_{r\to\infty} V'(r)r^2](../../_images/math/0b17edd0a4996c6a1323df0b203f243a94923da0.png)
So in the limit
, we get the equation:

by integrating (and requiring that
vanished in infinity to get rid of the
integration constant), we get for
:

Integrating (3) directly, we get:
![[(rV)']_0^\infty = -4\pi\int_0^\infty r n(r) \d r
[V + rV']_0^\infty = -4\pi\int_0^\infty r n(r) \d r](../../_images/math/8c84b6dbba5afb7683f3ce0a24aad32f95d7fb71.png)
We already know that
behaves like
in infinity,
so
vanishes. Requiring
itself to
vanish in infinity, the left hand side simplifies to
and we get:

Last thing to determine is
. To do that, we expand the charge density
and potential (and it’s derivatives) into a series around the origin:

And substitute into the equation (2):

We now multiply the whole equation by
and then set
. We get
, so
. We put it back into the equation to get:

This must hold for all
, so we get the following set of equations for
:

from which we express
for all
.
We already know the values for
and
from earlier, so overall we get:

in particular:

So we get the following series expansion for
and
:

Good analytic testing solution, that satisfies the asymptotic relations is:
