Computational Astrophysics

Similar documents
CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 13

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

Lecture 21: Numerical methods for pricing American type derivatives

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 16

Polynomial Regression Models

Relaxation Methods for Iterative Solution to Linear Systems of Equations

6.3.4 Modified Euler s method of integration

Lecture 12: Discrete Laplacian

Georgia Tech PHYS 6124 Mathematical Methods of Physics I

Lecture 13 APPROXIMATION OF SECOMD ORDER DERIVATIVES

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 12

Integrals and Invariants of Euler-Lagrange Equations

THE VIBRATIONS OF MOLECULES II THE CARBON DIOXIDE MOLECULE Student Instructions

( ) [ ( k) ( k) ( x) ( ) ( ) ( ) [ ] ξ [ ] [ ] [ ] ( )( ) i ( ) ( )( ) 2! ( ) = ( ) 3 Interpolation. Polynomial Approximation.

10/23/2003 PHY Lecture 14R 1

Multigrid Methods and Applications in CFD

Some Comments on Accelerating Convergence of Iterative Sequences Using Direct Inversion of the Iterative Subspace (DIIS)

MACHINE APPLIED MACHINE LEARNING LEARNING. Gaussian Mixture Regression

2.29 Numerical Fluid Mechanics

Lecture 2: Numerical Methods for Differentiations and Integrations

Physics 181. Particle Systems

A New Refinement of Jacobi Method for Solution of Linear System Equations AX=b

Feb 14: Spatial analysis of data fields

Chapter 7 Generalized and Weighted Least Squares Estimation. In this method, the deviation between the observed and expected values of

Feature Selection: Part 1

Electron-Impact Double Ionization of the H 2

Turbulent Flow. Turbulent Flow

Chapter 3 Differentiation and Integration

1 Matrix representations of canonical matrices

SOLVING NON-LINEAR SYSTEMS BY NEWTON s METHOD USING SPREADSHEET EXCEL Tay Kim Gaik Universiti Tun Hussein Onn Malaysia

Numerical Heat and Mass Transfer

Moments of Inertia. and reminds us of the analogous equation for linear momentum p= mv, which is of the form. The kinetic energy of the body is.

4DVAR, according to the name, is a four-dimensional variational method.

Chapter 4: Root Finding

Chapter Newton s Method

Quantum Mechanics I Problem set No.1

Lossy Compression. Compromise accuracy of reconstruction for increased compression.

1 GSW Iterative Techniques for y = Ax

Classification as a Regression Problem

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

Hidden Markov Models & The Multivariate Gaussian (10/26/04)

Chapter 9: Statistical Inference and the Relationship between Two Variables

MATH 5630: Discrete Time-Space Model Hung Phan, UMass Lowell March 1, 2018

N-Body Simulation. Typical uncertainty: π = 4 Acircle/Asquare! 4 ncircle/n. πest π = O(n

Statistical Inference. 2.3 Summary Statistics Measures of Center and Spread. parameters ( population characteristics )

Nice plotting of proteins II

A constant recursive convolution technique for frequency dependent scalar wave equation based FDTD algorithm

Mechanics Physics 151

5.04, Principles of Inorganic Chemistry II MIT Department of Chemistry Lecture 32: Vibrational Spectroscopy and the IR

Integrals and Invariants of

Module 1 : The equation of continuity. Lecture 1: Equation of Continuity

CHAPTER 14 GENERAL PERTURBATION THEORY

FTCS Solution to the Heat Equation

LINEAR REGRESSION ANALYSIS. MODULE IX Lecture Multicollinearity

The EM Algorithm (Dempster, Laird, Rubin 1977) The missing data or incomplete data setting: ODL(φ;Y ) = [Y;φ] = [Y X,φ][X φ] = X

Mechanics Physics 151

Conservation of Angular Momentum = "Spin"

ME 501A Seminar in Engineering Analysis Page 1

2 Finite difference basics

Math1110 (Spring 2009) Prelim 3 - Solutions

Army Ants Tunneling for Classical Simulations

Report on Image warping

Solution of the Navier-Stokes Equations

n α j x j = 0 j=1 has a nontrivial solution. Here A is the n k matrix whose jth column is the vector for all t j=0

NON-CENTRAL 7-POINT FORMULA IN THE METHOD OF LINES FOR PARABOLIC AND BURGERS' EQUATIONS

ELASTIC WAVE PROPAGATION IN A CONTINUOUS MEDIUM

Application of the Adjoint Method for Vehicle Aerodynamic Optimization. Dr. Thomas Blacha, Audi AG

Formal solvers of the RT equation

Affine and Riemannian Connections

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

High resolution entropy stable scheme for shallow water equations

UPGRADE OF THE GSP GYROKINETIC CODE MID-YEAR PROGRESS REPORT

CHAPTER 5 NUMERICAL EVALUATION OF DYNAMIC RESPONSE

However, since P is a symmetric idempotent matrix, of P are either 0 or 1 [Eigen-values

Using TranSIESTA (II): Integration contour and tbtrans

Hongyi Miao, College of Science, Nanjing Forestry University, Nanjing ,China. (Received 20 June 2013, accepted 11 March 2014) I)ϕ (k)

New Method for Solving Poisson Equation. on Irregular Domains

STATISTICAL MECHANICS

Lecture Notes on Linear Regression

Inexact Newton Methods for Inverse Eigenvalue Problems

Lab session: numerical simulations of sponateous polarization

Solutions to Exercises in Astrophysical Gas Dynamics

Grid Generation around a Cylinder by Complex Potential Functions

Inner Product. Euclidean Space. Orthonormal Basis. Orthogonal

12. The Hamilton-Jacobi Equation Michael Fowler

STAT 309: MATHEMATICAL COMPUTATIONS I FALL 2018 LECTURE 17. a ij x (k) b i. a ij x (k+1) (D + L)x (k+1) = b Ux (k)

ECONOMICS 351*-A Mid-Term Exam -- Fall Term 2000 Page 1 of 13 pages. QUEEN'S UNIVERSITY AT KINGSTON Department of Economics

Dr. Shalabh Department of Mathematics and Statistics Indian Institute of Technology Kanpur

Linear Momentum. Center of Mass.

Errors for Linear Systems

Physics 607 Exam 1. ( ) = 1, Γ( z +1) = zγ( z) x n e x2 dx = 1. e x2

arxiv: v1 [physics.flu-dyn] 16 Sep 2013

EEL 6266 Power System Operation and Control. Chapter 3 Economic Dispatch Using Dynamic Programming

Note 10. Modeling and Simulation of Dynamic Systems

. The kinetic energy of this system is T = T i. m i. Now let s consider how the kinetic energy of the system changes in time. Assuming each.

SIO 224. m(r) =(ρ(r),k s (r),µ(r))

Computational Fluid Dynamics. Smoothed Particle Hydrodynamics. Simulations. Smoothing Kernels and Basis of SPH

A linear imaging system with white additive Gaussian noise on the observed data is modeled as follows:

Physics 141. Lecture 14. Frank L. H. Wolfs Department of Physics and Astronomy, University of Rochester, Lecture 14, Page 1

χ x B E (c) Figure 2.1.1: (a) a material particle in a body, (b) a place in space, (c) a configuration of the body

Transcription:

Computatonal Astrophyscs Solvng for Gravty Alexander Knebe, Unversdad Autonoma de Madrd

Computatonal Astrophyscs Solvng for Gravty the equatons full set of equatons collsonless matter (e.g. dark matter d x DM = v DM dt d v DM = φ dt Posson s equaton Δφ = 4πGρ tot collsonal matter (e.g. gas deal gas equatons ρ t + ρ v ( = 0 p = ( γ 1ρε ( ρ v t & + ρ v v & ( + ( p + 1 ' ' 2µ B2 " + 1 1 B B + * µ * = ρ ( φ ρε = ρe 1 2 ρv 2 ( ρe t,% +. ' ρe + p + 1 -& 2µ B2 ( * v 1 µ v B [ ] B / 1 0 = ρ v ( φ + ( Γ L Maxwell s equaton B t = v B (

Computatonal Astrophyscs Solvng for Gravty the equatons full set of equatons collsonless matter (e.g. dark matter d x DM = v DM dt d v DM = φ and the force dt Posson s equaton Δφ = 4πGρ tot collsonal matter (e.g. gas deal gas equatons ρ t + ρ v ( = 0 p = ( γ 1ρε ( ρ v t & + ρ v v & ( + ( p + 1 ' ' 2µ B2 " + 1 1 B B + * µ * = ρ ( φ ρε = ρe 1 2 ρv 2 ( ρe t,% +. ' ρe + p + 1 -& 2µ B2 ( * v 1 µ v B [ ] B / 1 0 = ρ v ( φ + ( Γ L Maxwell s equaton B t = v B (

Computatonal Astrophyscs Solvng for Gravty Posson s Equaton Posson s equaton F ( x = m Φ( x ΔΦ( x = 4πGρ( x

Computatonal Astrophyscs Solvng for Gravty Posson s Equaton Posson s equaton F ( x = m Φ( x ΔΦ( x = 4πGρ( x partcle approach F ( x Gm = m j (x x j ( x 3 x j j grd approach ΔΦ( x, j,k = 4πGρ( x, j,k F ( x, j,k = m Φ( x, j,k ( x, j,k =poston of centre of grd cell (, j,k

Computatonal Astrophyscs Solvng for Gravty Posson s equaton F ( x = m Φ( x ΔΦ( x = 4πGρ( x weapon of choce: tree codes grd approach ΔΦ( x, j,k = 4πGρ( x, j,k F ( x, j,k = m Φ( x, j,k Posson s Equaton partcle approach F ( x Gm = m j (x x j ( x 3 x j j ( x, j,k =poston of centre of grd cell (, j,k

Computatonal Astrophyscs Solvng for Gravty Posson s Equaton Posson s equaton F ( x = m Φ( x ΔΦ( x = 4πGρ( x partcle approach F ( x Gm = m j (x x j ( x 3 x j j grd approach ΔΦ( x, j,k = 4πGρ( x, j,k F ( x, j,k = m Φ( x, j,k ( x, j,k =poston of centre of grd cell (, j,k weapon of choce: AMR codes

Computatonal Astrophyscs Solvng for Gravty the partcle-mesh (PM method

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton ΔΦ( g k,l,m = 4πGρ( g k,l,m F ( g k,l,m = m Φ( g k,l,m

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton ΔΦ( g k,l,m = 4πGρ( g k,l,m F ( g k,l,m = m Φ( g k,l,m

Computatonal Astrophyscs Partcle-Mesh Method Solvng for Gravty numercally ntegrate Posson s equaton ΔΦ( g k,l,m = 4πGρ( g k,l,m F ( g k,l,m = m Φ( g k,l,m 1. calculate mass densty on grd 2. solve Posson s equaton on grd 3. dfferentate potental to get forces 4. nterpolate forces back to partcles x ρ( g k,l,m Φ( g k,l,m F ( g k,l,m F ( g k,l,m F ( x N N

Computatonal Astrophyscs Partcle-Mesh Method Solvng for Gravty numercally ntegrate Posson s equaton ΔΦ( g k,l,m = 4πGρ( g k,l,m F ( g k,l,m = m Φ( g k,l,m 1. calculate mass densty on grd 2. solve Posson s equaton on grd 3. dfferentate potental to get forces 4. nterpolate forces back to partcles x ρ( g k,l,m Φ( g k,l,m F ( g k,l,m F ( g k,l,m F ( x sounds lke a waste of tme and computer resources, but exceptonally fast n practce

Computatonal Astrophyscs Partcle-Mesh Method Solvng for Gravty numercally ntegrate Posson s equaton ΔΦ( g k,l,m = 4πGρ( g k,l,m F ( g k,l,m = m Φ( g k,l,m 1. calculate mass densty on grd 2. solve Posson s equaton on grd 3. dfferentate potental to get forces 4. nterpolate forces back to partcles x ρ( g k,l,m Φ( g k,l,m F ( g k,l,m F ( g k,l,m F ( x

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m example: 1 partcle on 1 dmensonal grd M(g k = mw (d d = x g k ρ(g k = M(g k H partcle poston x grd pont g k H m x axs

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m example: 1 partcle on 1 dmensonal grd M(g k = mw (d ρ(g k = M(g k H d = x g k mass assgnment functon partcle poston x grd pont g k H m x axs

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m example: 1 partcle on 1 dmensonal grd herarchy of mass assgnment schemes: - Nearest-Grd-Pont NGP - Could-In-Cell CIC - Trangular-Shaped Cloud TSC - partcle poston x grd pont g k H m x axs

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m Nearest-Grd-Pont (NGP: mass assgnment functon: # W (d = $ 1 d H /2 % 0 otherwse H m x axs

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m Nearest-Grd-Pont (NGP: partcle shape: S(x = δ(x mass assgnment functon: # W (d = $ 1 d H /2 % 0 otherwse H m x axs

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m Cloud-In-Cell (CIC: mass assgnment functon: $ 1 d & H W (d = % d H & 0 '& otherwse H m x axs

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m Cloud-In-Cell (CIC: partcle shape: # S(x = $ 1 x H /2 % 0 otherwse mass assgnment functon: $ 1 d & H W (d = % d H & 0 '& otherwse H m x axs

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m Trangular-Shaped-Cloud (TSC: * 3 4 d 2 # &, % ( d H mass assgnment functon:, $ H ' 2, W (d = 1# 3 % 2 2 d 2 + & H, ( $ H ' 2 d 3H 2,, -, 0 otherwse H m x axs

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m Trangular-Shaped-Cloud (TSC: partcle shape: $ & S(x = 1 x % x H H '& 0 otherwse * 3 4 d 2 # &, % ( d H mass assgnment functon:, $ H ' 2, W (d = 1# 3 % 2 2 d 2 + & H, ( $ H ' 2 d 3H 2,, -, 0 otherwse H m x axs

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m N partcles on 3 dmensonal grd d = x g k,l,m M( g N k,l,m = m W ( d x W ( d y W ( d z =1 ρ( g k,l,m = M( g k,l,m H 3

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes x ρ( g k,l,m N partcles on 3 dmensonal grd d = x g k,l,m M( g N k,l,m = m W ( d x W ( d y W ( d z =1 for every grd pont we need to loop over all N partcles ρ( g k,l,m = M( g k,l,m H 3

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes - n practce x ρ( g k,l,m rather loop over all partcles and assgn them to the approprate grd ponts, because the mappng x g k s rather easy

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes - n practce x ρ( g k,l,m example for CIC assgnment n 2D: x contrbutes ts mass m to the 4 closest grd ponts : m

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes - n practce x ρ( g k,l,m example for CIC assgnment n 3D: x contrbutes ts mass m to the 8 closest grd ponts : g k,l,m +1 g k +1,l,m +1 g k,l,m g k +1,l,m g k,l +1,m +1 g k +1,l +1,m +1 g k,l +1,m g k +1,l +1,m

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes whch scheme to choose? NGP = stepwse force CIC = contnuous pecewse lnear force (1 grd pont (8 grd ponts TSC = contnuous force and frst dervatve (27 grd ponts

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes whch scheme to choose? NGP = too crude CIC = common choce ncreased smoothng of densty feld TSC = pretty smooth smoothng the densty feld wll lead to a bas n the forces but at the same tme decrease the varance bas = ( F( x F true ( x ε α var = F 2 ( x F( x 2 N β

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method densty assgnment schemes whch scheme to choose? NGP = too crude CIC = common choce TSC = pretty smooth smoothng the densty feld wll lead to a bas n the forces but at the same tme decrease the varance bas = ( F( x F true ( x ε α var = F 2 ( x F( x 2 N β (nterplay between N and ε: Nε 3 =const.

Computatonal Astrophyscs Partcle-Mesh Method Solvng for Gravty numercally ntegrate Posson s equaton ΔΦ( g k,l,m = 4πGρ( g k,l,m F ( g k,l,m = m Φ( g k,l,m 1. calculate mass densty on grd 2. solve Posson s equaton on grd 3. dfferentate potental to get forces 4. nterpolate forces back to partcles x ρ( g k,l,m Φ( g k,l,m F ( g k,l,m F ( g k,l,m F ( x

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton ΔΦ k,l,m = ρ k,l,m relaxaton technque: FTT technque: applcable and usable for any dfferental equaton only applcable and usable for lnear dfferental equaton

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque obtan teratve solver by dscretzng dfferental equaton ΔΦ k,l,m = ρ k,l,m

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque obtan teratve solver by dscretzng dfferental equaton ΔΦ k,l,m = ρ k,l,m ΔΦ k,l,m = Φ k,l,m ' * ' Φ *, k,l,m, x, x, =, Φ k,l,m, y, y, Φ, k,l,m, ( z + ( z + ' *, ' = 1 x, Φ Φ * k + 1,l,m k 1,l,m 2 2,, Φ H y, Φ, k,l + 1,m k,l 1,m 2 2 Φ k,l,m + 1 Φ, k,l,m 1, ( 2 2 + ( z + = 1 ' Φ k + 1 Φ,l,m k 1,l,m 2 2 + H ( x x Φ k,l + 1 2,m y Φ k,l 1 2,m y + Φ k,l,m + 1 2 z Φ k,l,m 1 2 z = 1 ( Φ H 2 k +1,l,m 2Φ k,l,m + Φ k 1,l,m + Φ k,l +1,m 2Φ k,l,m + Φ k,l 1,m + Φ k,l,m +1 2Φ k,l,m + Φ k,l,m 1 *, +

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque obtan teratve solver by dscretzng dfferental equaton ΔΦ k,l,m = ρ k,l,m dscretzed Posson s equaton Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque obtan teratve solver by dscretzng dfferental equaton ΔΦ k,l,m = ρ k,l,m teratve soluton: Φ k,l,m +1 Φ k,l,m dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque obtan teratve solver by dscretzng dfferental equaton k,l+1,m k-1,l,m k,l,m k+1,l,m k,l-1,m dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Partcle-Mesh Method Solvng for Gravty numercally ntegrate Posson s equaton relaxaton technque obtan teratve solver by dscretzng dfferental equaton k-1,l,m k,l+1,m k,l,m k,l-1,m k+1,l,m applcable to grds of arbtrary geometry dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque how to sweep through the grd? k,l+1,m k-1,l,m k,l,m k+1,l,m k,l-1,m dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque how to sweep through the grd?? dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque how to sweep through the grd?? dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque Gauss-Sedel sweeps: k,l+1,m k-1,l,m k,l,m k+1,l,m k,l-1,m dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque Gauss-Sedel sweeps: loop over all black cells loop over all red cells one teraton of the potental Φ k,l,m +1 Φ k,l,m how many teratons are necessary? dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: ΔΦ k,l,m = ρ k,l,m dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: ΔΦ k,l,m? ρ k,l,m & 0 dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: ΔΦ k,l,m? ρ k,l,m & 0 densty as gven by mass assgnment scheme densty as gven by currently best guess for Φ dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: ΔΦ k,l,m? ρ k,l,m & 0 resdual: R = ΔΦ k,l,m ρ k,l,m = sutable norm dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: ΔΦ k,l,m? ρ k,l,m & 0 R = ΔΦ k,l,m ρ k,l,m ετ = sutable norm tolerance error estmate dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: R = ΔΦ k,l,m ρ k,l,m ετ - truncaton error: error due to dscreteness of grd dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: R = ΔΦ k,l,m ρ k,l,m ετ - truncaton error: error due to dscreteness of grd estmaton "" " compare soluton on actual grd to soluton on coarser grd dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: R = ΔΦ k,l,m ρ k,l,m ετ = ε T k,l,m - truncaton error: [ ] ΔΦ k,l,m Τ k,l,m = P Δ( RΦ k,l,m ( RΦ k,l,m Δ RΦ k,l,m =Φ j,n,p 1 ( = ρ j,n, p ( [ ] = ρ k,l,m P Δ RΦ k,l,m restrcton to coarser grd prolongaton to fner grd dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: R = ΔΦ k,l,m ρ k,l,m ετ = ε T k,l,m - truncaton error: [ ] ΔΦ k,l,m Τ k,l,m = P Δ( RΦ k,l,m ( RΦ k,l,m =Φ j,n,p 1 Δ( RΦ k,l,m = ρ j,n, p [ ( ] = ρ k,l,m P Δ RΦ k,l,m? = ΔΦ k,l,m dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: R = ΔΦ k,l,m ρ k,l,m ετ = ε T k,l,m R εt dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque stoppng crteron: R = ΔΦ k,l,m ρ k,l,m ετ = ε T k,l,m R faster convergence? εt dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque convergence: R = ΔΦ k,l,m ρ k,l,m - slow convergence: R +1 R large-scale errors n Φ cannot be relaxed suffcently fast on the actual grd => use coarser grds to speed up convergence dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton relaxaton technque convergence: R = ΔΦ k,l,m ρ k,l,m - slow convergence: R +1 R mult-grd relaxaton technques => beyond the scope of ths lecture though dscretzed Posson s equaton +1 Φ k,l,m = 1 6 (Φ k +1,l,m + Φ k 1,l,m + Φ k,l +1,m + Φ k,l 1,m + Φ k,l,m +1 + Φ k,l,m 1 ρ k,l,m H 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton ΔΦ k,l,m = ρ k,l,m Green s functon method: - solve dfferental equaton by Fourer transformaton - applcable and usable for lnear dfferental equatons

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton fast fourer transform method Green s functon method ΔΦ = ρ Φ( x = G( x x $ ρ( x $ d 3 $ x ; G( x = 1 4π x

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton fast fourer transform method Green s functon method ΔΦ = ρ Φ( x = G( x x $ ρ( x $ d 3 $ x ; G( x = 1 4π x Φ = ρ G FFT " convoluton becomes multplcaton ˆ Φ = ˆ ρ ˆ G (wth G ˆ = 1 for Posson s equaton k 2

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton fast fourer transform method Green s functon method ΔΦ = ρ Φ( x = G( x x $ ρ( x $ d 3 $ x ; G( x = 1 4π x Φ = ρ G FFT " convoluton becomes multplcaton ˆ Φ = ˆ ρ ˆ G (wth G ˆ = 1 for Posson s equaton k 2 Φ FFT -1 (FFT demands a regular grd though

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton fast fourer transform method dscretzed Green s functon G ˆ ( k = 1 k 2 " G ˆ ( g k,l,m = # sn 2 % $ k x 2 1 & # ( + sn k & 2 y # k % ( + sn 2 z & % ( ' $ 2 ' $ 2 ' G ˆ ( g 0,0,0 = 0, k x = 2π k L, k y = 2π l L, k y = 2π m L

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton accuracy of ether relaxaton or FFT method to solve Posson s equaton?

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton pure PM calculaton

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton pure PM calculaton

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton pure PM calculaton the force s automatcally softened... (cf. tree-code lecture

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton pure PM calculaton the force s automatcally softened...but what f need to resolve smaller scales?

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton pure PM calculaton ntroducton of fner grds n hgh densty regons

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton AMR calculaton Yahag & Yosh (2001

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton AMR calculaton detals later Yahag & Yosh (2001

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton pure PM calculaton and what are these wggles?

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton pure PM calculaton and what are these wggles?

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method numercally ntegrate Posson s equaton pure PM calculaton force ansotropy and what are these wggles?

Computatonal Astrophyscs Partcle-Mesh Method Solvng for Gravty numercally ntegrate Posson s equaton ΔΦ( g k,l,m = 4πGρ( g k,l,m F ( g k,l,m = m Φ( g k,l,m 1. calculate mass densty on grd 2. solve Posson s equaton on grd 3. dfferentate potental to get forces 4. nterpolate forces back to partcles x ρ( g k,l,m Φ( g k,l,m F ( g k,l,m F ( g k,l,m F ( x

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method obtanng the forces F ( g k,l,m = m Φ( g k,l,m F x ( g k,l,m = m Φ( g k +1,l,m Φ( g k 1,l,m 2H F y ( g k,l,m = m Φ( g k,l +1,m Φ( g k,l 1,m F z ( g k,l,m = m Φ( 2H g k,l,m +1 Φ( g k,l,m 1 2H k-1,l,m k,l+1,m k,l,m k,l-1,m k+1,l,m H = (current grd spacng

Computatonal Astrophyscs Partcle-Mesh Method Solvng for Gravty numercally ntegrate Posson s equaton ΔΦ( g k,l,m = 4πGρ( g k,l,m F ( g k,l,m = m Φ( g k,l,m 1. calculate mass densty on grd 2. solve Posson s equaton on grd 3. dfferentate potental to get forces 4. nterpolate forces back to partcles x ρ( g k,l,m Φ( g k,l,m F ( g k,l,m F ( g k,l,m F ( x

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method nterpolatng the forces F ( g k,l,m F ( r

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method nterpolatng the forces F ( g k,l,m F ( r use the nverse of the mass assgnment scheme to nsure momentum conservaton and mnmze force ansotropes F( r = k l m F( g k,l,m W ( r g k,l,m n practce the trple sum s only over 8 (CIC or 27 (TSC cells

Computatonal Astrophyscs Solvng for Gravty Partcle-Mesh Method nterpolatng the forces F ( g k,l,m F ( r use the nverse of the mass assgnment scheme to nsure momentum conservaton and mnmze force ansotropes F( r = k l m F( g k,l,m W ( r g k,l,m *check by calculatng the total (perodc force: N F tot = F( r = =... = N =1 =1 k l m N N =... =1 j=1 k,l,m k #, l #, m# F( g k,l,m W ( r g k,l,m m m j W ( r H 3 g k,l,m G( g k,l,m g k #, l #, m # W ( r j g # ant-symmetrc = 0 (because of nvarance under coordnate nverson k, l #, m # PM scheme: F x ( g k,l,m = m Φ( g k+1,l,m Φ( g k 1,l,m 2H Φ( g k,l,m = G( g k,l,m g k #, l #, m # ρ( g # k# l# m# ρ( g k,l,m = M( g k,l,m H 3 N M( g k,l,m = m W ( r g k,l,m =1 k, l #, m #

Computatonal Astrophyscs Summary Solvng for Gravty Partcle-Mesh (PM method ΔΦ( g k,l,m = 4πGρ( g k,l,m F ( g k,l,m = m Φ( g k,l,m 1. calculate mass densty on grd 2. solve Posson s equaton on grd 3. dfferentate potental to get forces 4. nterpolate forces back to partcles x ρ( g k,l,m Φ( g k,l,m F ( g k,l,m F ( g k,l,m F ( x anyone fances to wrte a PM code as the project?

Computatonal Astrophyscs Solvng for Gravty Alexander Knebe, Unversdad Autonoma de Madrd