







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The particle mesh method, a computational technique used to solve gravitational problems by calculating potentials and forces on particles using a grid. It covers the algorithm, advantages, and various interpolation methods for finding forces. Poisson's equation is derived and solved using the particle mesh method.
Typology: Study notes
1 / 13
This page cannot be seen from the preview
Don't miss anything!








September 22, 2008
Syllabus topics:
Educational Objectives: At the end of the lecture and homework, students will be able to
Lesson Plan:
Some useful constants
F^ ~ = −GM m r^2
rˆ (1)
GM m r
F~ = m~a (3)
~a =
d~v dt
~v =
d~r dt
~r = (x, y, z) (6)
The particle mesh method works allowing particles to freely move, but calculating the potentials and the forces on them using a grid. In a direct particle-particle code, we need to calculate the forces on each particle using
F^ ~i =
∑^ N
j=1,j 6 =i
GMiMj r ij^2
r ˆij
where N is the total number of particles in the system. For a particle mesh code, in principle we have to do a calculation for each grid cell k
F~k =
∑^ M
l=1l 6 =k
GMkMl r kl^2
ˆrkl
Where M is the total number of cells in the grid. The real advantage in the particle mesh method comes in for several reasons-
The second reason, namely the efficiencies of using a regular grid for the calculation can be substantial.
where δ is the Dirac delta function such that
δ(x) =
{ 0 , if x 6 = 0 ∞, if x = 0
and
∫ (^) ∞
−∞
δ(x)dx = 1
Given a vector field of the form
F^ ~ = −GM m r^2
rˆ
We can use the divergence theorem ∫
V
( ∇ · F~
) dτ =
∮
S
F^ ~ · d~a ∫
V
( ∇ · F~
) dτ = −
∮
S
GM m r^2
rˆ · d~a
Since
d~a = r^2 sin θdθ dφ rˆ
On the right side, we have
∮
S
GM m r^2
ˆr · d~a = −GM m
∮
S
ˆr r^2
· d~a
= −GM m
∮
S
ˆr r^2
r^2 · ˆr sin θdθ dφ
= −GM m
∮
S
sin θdθ dφ = − 4 πGM m
The mass of our test particle m is fixed, as is G. However, the total mass M is a function of the density ρ(~r) and the volume
∫
V
ρdτ
Thus, we can write ∫
V
( ∇ · F~
) dτ = − 4 πGm
∫
V
ρdτ
Remembering our definitions for gravitational potential
F^ ~ = −∇U
∫
V
(∇ · ∇U ) dτ = − 4 πGm
∫
V
ρdτ ∫
V
( ∇^2 U
) dτ = 4 πGm
∫
V
ρdτ
Simplifying this, we have Poisson’s equation for gravitational systems
∇^2 U = 4 πGm ρ(~r)
Note that this is identical in form to the electromagnetic Poisson equation of
ǫ 0
ρ(~r)
Instead of calculating forces or potentials using integration, we can instead solve this as a system of partial differential equations.
Let
ρ(~r) = M δ(~r)
∇^2 U = 4 πGm M δ(r)
Integrating this over a volume V ∫
V
∇^2 U dτ = 4 πGm M
∫
V
δ(r)dτ ∫
V
∇^2 U dτ = 4 πGm M
Using the spherical form of the Laplacian
r^2
∂r
( r^2
∂r
)
∫
V
r^2
∂r
( r^2
∂r
) dτ = 4 πGm M
The spherical volume integration element is
dτ = r^2 dr sinθdθ dφ
or for spherically symmetric systems
dτ = 4πr^2 dr
Let’s examine the one dimensional case with cell spacing h. The cell centers are designated as
{· · · , xi− 2 , xi− 1 , xi, xi+1, xi+2, · · ·}
Let’s assume the particle is between
xi ≥ x ≥ xi+ Then the mass will be divided between cell i and i + 1 αi = (x − xi)
ρi =
h
αi
ρi+1 =
h
(1 − αi)
Let’s assume we have a two dimensional problem with cell centers set as {· · · , xi− 2 , xi− 1 , xi, xi+1, xi+2, · · ·} {· · · , yj− 2 , yj− 1 , yj , yj+1, yj+2, · · ·}
where the spacing is h and k in the x and y dimensions respectively. In two dimensions, we can generalize this to αi = (x − xi) αj = (y − yj ) Then we can write
ρi,j =
hk
αiαj
ρi+1,j =
hk
(1 − αi) αj
ρi,j+1 =
hk
αi (1 − αj )
ρi+1,j+1 =
hk
(1 − αi) (1 − αj )
Once we solve for the potential on the grid, we can then solve for the forces using the finite difference approximation for the derivative
F^ ~ = −∇U
[ ∂U ∂x
xˆ −
∂y
yˆ
]
Using the center difference approximation
F^ ~ij = −
[( Ui+1,j − Ui− 1 ,j h
) x ˆ +
( Ui,j+1 − Ui,j− 1 k
) y ˆ
]
This gives the force at the center of the grid cell at i, j. We still need to interpolate the force back to the particles.
6.2.1 Nearest Grid Point Interpolation
Just as in the particle mapping, the nearest grid point interpolation uses the center of the cell as the reference for the force. In short, for particle k located in the grid cell centered on i, j, we have
F^ ~k = F~i,j
As with the cloud in the cell particle mapping, we can use linear interpolation to calculate the forces on the particles. Assuming the particle k is cell i, j and x ≥ xi and y ≥ yj We use the definitions of
αi = (x − xi) αj = (y − yj )
We use the same geometric weighting that was used to distribute the particle’s mass to interpolate the forces back to the particle. We can define some constants-
k 1 = (1 − αi)(1 − αj ) k 2 = αi(1 − αj ) k 3 = (1 − αi)αj k 4 = αiαj
Then we can write
F^ ~ = k 1 F~i,j + k 2 F~i+1,j + k 3 F~i,j+1 + k 4 F~i+1,j+
7.1.1 Characteristic Equations
We classify PDE’s on the basis of their characteristic equations. Consider
auxx + buxy + cuyy = f
Under what conditions does u, ux, and uy uniquely determine uxx, uxy, uyy such that our equation is satisfied? To understand this, we need to add two identities using the definition of derivatives of u with respect to x and y.
d(ux) = uxxdx + uxydy d(uy) = uxydx + uyydy
We examine the case and assume that multiplicity of solutions are possible. Using the previous three equations in matrix form
a b c dx dy 0 0 dx dy
uxx uxy uyy
=
f d(ux) d(uy)
The solution for the PDE exists and is unique unless the determinant of the coefficent matrix vanishes. If multiple solutions do exist, the determinant is zero. The determinant of
a b c dx dy 0 0 dx dy
is
a(dy)^2 − bdydx + c(dx)^2 = 0
This is clearly a quadratic equation. The behavior of this quadratic is closely related to the character of the the PDE.
This type of analysis is a bit tricky, but can be done for any PDE.
7.1.2 Classification of PDEs
Normally, we consider differential equations to have three distinct classes based on their mathematical behavior.
∂u ∂t
= α
∂^2 u ∂x^2
∂^2 u ∂y^2
∂^2 u ∂z^2
α
∂^2 u ∂x^2
∂^2 u ∂y^2
∂^2 u ∂z^2
= g
∂^2 u ∂t^2
= α
∂^2 u ∂x^2
∂^2 u ∂y^2
∂^2 u ∂z^2
These classifications come from the analysis of the characteristic equations associated with each type of PDE.
7.1.3 Well Posed Problems
A problem is “well posed” if it
Problems which are not well posed are difficult to solve, but may be of interest in some cases.
7.1.4 Separation of Variables
The basic way we approach analytic PDE solutions is separation of variables. In short, we assume the partial derivatives are independent of each other. The heat equation is:
∂u ∂t
= β^2
∂^2 u ∂x^2 If we assume a solution of the form
u(x, t) = X(x)T (t)
then
β^2 X′′T = XT ′
which gives us
X′′ X
β^2
= σ
where σ is the separation constant From
X′′ X
β^2
= σ
In the Particle-Mesh method, you calculate the potentials on the grid. However, we need to find the forces so we can move the particles. To find the forces, we use a centered finite difference scheme.
( ∂U ∂x
ˆx +
∂y
yˆ
)
Using the centered difference scheme described earlier, we can write
F^ ~ = −∇U
F~ = −
([ U (xi+1,j ) − U (xi− 1 ,j ) 2 h
] ˆx +
[ U (xi,j+1) − U (xi,j− 1 ) 2 k
] y ˆ
)
where h is the spacing the x direction and k is the cell spacing in the y direction. It is often simplier to write this as
i+1,j −^ Ui− 1 ,j 2 h
] ˆx +
i,j+1 −^ Ui,j− 1 2 k
] y ˆ
)
Where we have used
Ui,j = U (xi,j )