- #1

debilo

- 6

- 0

- TL;DR Summary
- I try to solve 3D Poisson equation with boundaries condition at infinity.

Hello !

I want to solve the 3D Poisson equation using spherical coordinates and spherical harmonics.

First I must solve this : ##d^2\phi/dr^2 + 1/rd\phi/dr - l*(l+1)/r^2 = \rho (r)## with ##\phi (\infty ) = 0## (here ##\phi## is the gravitationnal potential and ##\rho## is the mass density).

To deal with the infinite grid I tried to use the hyperbolic transformation ##r = X*arctanh(R)## with ##X## a constant and ##R## between 0 and 1.

I use a LU-decomposition method to solve this. For ##\phi (0)## I apply symmetrical conditions.

I tried to solve the problem in the case of a spherical mass distribution. I compared the calculated potential with the theoretical potential.

I find a pretty good result when I fix the value in rmax.

But for ##\phi (\infty )## I have a problem. In fact I obviously get in trouble when I let R go to 1 (or 0) ; so I take ##Rmin = 0+\varepsilon## and ##Rmax = 1-\varepsilon##.

My question is : do you know a trick to really set the value of the potential to zero at infinity ?

I want to solve the 3D Poisson equation using spherical coordinates and spherical harmonics.

First I must solve this : ##d^2\phi/dr^2 + 1/rd\phi/dr - l*(l+1)/r^2 = \rho (r)## with ##\phi (\infty ) = 0## (here ##\phi## is the gravitationnal potential and ##\rho## is the mass density).

To deal with the infinite grid I tried to use the hyperbolic transformation ##r = X*arctanh(R)## with ##X## a constant and ##R## between 0 and 1.

I use a LU-decomposition method to solve this. For ##\phi (0)## I apply symmetrical conditions.

I tried to solve the problem in the case of a spherical mass distribution. I compared the calculated potential with the theoretical potential.

I find a pretty good result when I fix the value in rmax.

But for ##\phi (\infty )## I have a problem. In fact I obviously get in trouble when I let R go to 1 (or 0) ; so I take ##Rmin = 0+\varepsilon## and ##Rmax = 1-\varepsilon##.

My question is : do you know a trick to really set the value of the potential to zero at infinity ?