Class 17
Class 17
Class 17
• For 2-pt BVP, must make a free choice of unknown BVs at initial point, then integrate
away. But solution will almost certainly not satisfy other BCs at end.
• Strategy: Use information about how much the other BVs “missed” to iteratively
improve initial guess.
Notation
• Denote standard system as:
dyi (x)
= gi (x, y1 , ..., yN ) i = 1, ..., N.
dx
• At x2 , it is supposed to satisfy:
where n2 = N − n1 .
3. Integrate as IVP to x2 .
1
1
y
3 00111100Desired BV
2
0011
Required BV x
Relaxation method
1. Replace ODEs by finite-difference equations on mesh from x1 to x2 .
3. Mathematically, FDEs are just algebraic relations between unknowns. Use iterative
technique to relax this solution to true solution.
2
y 3
true solution 00111100Required BV
00111100
Required BV x
• Relaxation very powerful for smooth solutions, or ODEs that must be solved many
times with different parameter values. Also good when ODEs have extraneous solu-
tions, i.e., stiff equations.
2
2-pt BVP: Shooting Method
Procedure (NRiC §17.1):
• n1 values given by BC at x1 .
• ∴ n2 = N − n1 values can be chosen freely.
3. Now integrate to x2 .
7. Use Vnew to solve ODEs again as IVP, recompute F, and iterate again until |F| < ε,
the convergence criterion.
3
• NOTE: Can also shoot to a fitting point xf between x1 and x2 (NRiC §17.2; specify
known points at x1 and x2 , choose the rest, integrate in both directions, and require
that y(xf ) match for both integrations). Useful for singular BC(s) and/or domain
point(s); integrate away from these.
y 00111100
11
00
x1 xf x2
1. Replace ODEs
dy(x)
= g(x, y)
dx
with finite difference equations (FDEs) on a grid:1
yk − yk−1 xk + xk−1 yk + yk−1
=g , ,
xk − xk−1 2 2
where yk refers to the entire set of dependent variables y1 , y2 , . . . , yN at point xk .
• Here xk and the components of yk are discrete values of independent and depen-
dent variables at “mesh points.”
1 2 3 ... M
4
• This is (M − 1)N equations; get remaining equations from the boundary condi-
tions:
0 = E1 ≡ B(x1 , y1 )
0 = EM +1 ≡ C(xM , yM )
2. The “solution” of the FDE problem consists of a set of variables yj,k . Need to guess
starting values for all yj,k . We then determine increments ∆yj,k such that yj,k + ∆yj,k
is an improved approximation to the solution.
3. To get increments, expand FDEs in first-order Taylor series about yk (N-R method):
N N
X ∂Ek X ∂Ek
Ek (yk + ∆yk , yk−1 + ∆yk−1 ) ≃ Ek (yk , yk−1 ) + ∆yn,k−1 + ∆yn,k .
n=1
∂y n,k−1 n=1
∂y n,k
Similar relations can be obtained for the boundary conditions (see NRiC §17.3 for
details; the partial derivatives can be computed analytically—it’s just tedious! NRiC
§17.4 gives a worked example).
4. Want E(y + ∆y) = 0. Result is a large (M × N ) × (M × N ) block-diagonal matrix2
that can be solved using optimized Gaussian elimination for the ∆y’s.
5. After applying the new increments, iteratively improve (“relax”) solution until the
boundary conditions are satisfied and the difference equations between grid points are
zeroed to the desired accuracy.
• Need to solve a matrix equation each iteration.
• Choice of grid points is an important issue and leads to adaptive mesh strategies
in modern solvers.
5
2. Hydrostatic equilibrium =⇒ net force on shell is zero. ∴ −∇r P − ρg = 0, where g =
gravitational acceleration per unit mass = GMr /r2 , or,
dP GMr
= − 2 ρ.
dr r
(To derive, note upward force on shell per unit area = P (r) − P (r + ∆r) = −∆P
must equal downward force per unit area = [GMr /r2 ](Mshell /4πr2 ) = (GMr /r2 )ρ dr.)
Transforming,
dP GMr
=− .
dMr 4πr4
3. Let ε = energy generation rate/unit mass. Then energy transport rate through shell
∆L = L(r + ∆r) − L(r) must equal energy generation rate 4πr2 dr ρε, where L =
luminosity, or,
dLr
= 4πr2 ρε.
dr
Transforming,
dLr
= ε.
dMr
4. Finally, there is an equation describing energy transport. For radiative (and conduc-
tive) transport,
dT κρLr
∝ 2 3,
dr r T
where κ is the mean absorption coefficient (opacity; so higher opacity =⇒ higher T
gradient). Transforming,
dT κLr
∝ 4 3.
dMr r T
• This equation harder to derive since it depends on radiation transport mechanism
and convective stability.
6
• First solving techniques based on shooting method.
• Modern stellar structure codes use relaxation method with adaptive mesh (e.g., P.
Eggleton, MNRAS, 151, 351 (1971)).
Polytropes
• Can illustrate technique with calculation of structure of polytropes.
• Assume there is no energy generation anywhere inside (ε ≡ 0), e.g., white dwarf or
neutron star.
– E.g., EOS for monatomic gas (such as degenerate electron gas) is:
P ∝ ρ5/3 if non-relativistic (n = 3/2);
P ∝ ρ4/3 if relativistic (n = 3).