Using Mathematica for:

Motivation
Using Mathematica
Using Mathematica for:
Strong Conservation Form and Grid Generation in Nonsteady
Curvilinear Coordinates
Harald Höller
Unterstützung zu M1 mit Schwerpunkt Computeralgebra und Wiki
23.06.2010
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
1 Motivation
Astrophysical Motivation
Numerical and Mathematical Motivation
2 Using Mathematica
Computeralgebra as interstage
Playground
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
1 Motivation
Astrophysical Motivation
Numerical and Mathematical Motivation
2 Using Mathematica
Computeralgebra as interstage
Playground
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
What we want
Solve Equations of Radiation
Hydrodynamics (RHD)
RHD describe physics of the weather, stars
and cars
Figure: Cat’s Eye
Nebula, Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
What we want
Solve Equations of Radiation
Hydrodynamics (RHD)
RHD describe physics of the weather, stars
and cars
RHD is system of coupled partial differential
equations
Figure: Cat’s Eye
Nebula, Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
What we want
Solve Equations of Radiation
Hydrodynamics (RHD)
RHD describe physics of the weather, stars
and cars
RHD is system of coupled partial differential
equations
RHD contains non differentiable solutions
(weak solutions)
Harald Höller
Using Mathematica for:
Figure: Cat’s Eye
Nebula, Source (Link)
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
What we want
Solve Equations of Radiation
Hydrodynamics (RHD)
RHD describe physics of the weather, stars
and cars
RHD is system of coupled partial differential
equations
RHD contains non differentiable solutions
(weak solutions)
Problem oriented geometries
Harald Höller
Using Mathematica for:
Figure: Cat’s Eye
Nebula, Source (Link)
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
What we want
Solve Equations of Radiation
Hydrodynamics (RHD)
RHD describe physics of the weather, stars
and cars
RHD is system of coupled partial differential
equations
RHD contains non differentiable solutions
(weak solutions)
Problem oriented geometries
Parallel supercomputers VS implicit methods
Harald Höller
Using Mathematica for:
Figure: Cat’s Eye
Nebula, Source (Link)
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
How RHD looks like
Continuity Equation
∂t ρ + div (uρ) = 0
Equation of motion
4π
∂t ρu + div ρuu + P − σ − ρG −
χR H = 0
c
Equation of Internal Energy
∂t ρǫ + div ρǫu + P − σ · u − 4πχP (J − S) = 0
Equation of Radiation Energy
∂t J + div uJ + c div H + K : grad u − cχP J − S = 0
Radiation Flux Equation
∂t H + div uH + c div K + H · grad u + cχR H = 0
Poisson Equation
∆φ = 4πG ρ
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
How we do that
Solve Equations of Radiation
Hydrodynamics (RHD)
Solve PDEs numerically
Figure: Slightly
non-orthogonal polar
grid
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
How we do that
Solve Equations of Radiation
Hydrodynamics (RHD)
Solve PDEs numerically
Temporal and spatial discretization equations formulated on a grid
Figure: Slightly
non-orthogonal polar
grid
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
How we do that
Solve Equations of Radiation
Hydrodynamics (RHD)
Solve PDEs numerically
Temporal and spatial discretization equations formulated on a grid
2DO: Write a (Fortran, C, Java . . . ) code,
that solves the equations of RHD
Figure: Slightly
non-orthogonal polar
grid
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
How we do that
Solve Equations of Radiation
Hydrodynamics (RHD)
Solve PDEs numerically
Temporal and spatial discretization equations formulated on a grid
2DO: Write a (Fortran, C, Java . . . ) code,
that solves the equations of RHD
. . . so what do we need Mathematica for?
Figure: Slightly
non-orthogonal polar
grid
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
What we had
1D Implicit Method
Figure: Betelgeuse,
Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
What we had
1D Implicit Method
Question: Can we generate a method to
solve the equations of RHD in generalized
multidimensional geometries?
Figure: Betelgeuse,
Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
Non-Spherically Symmetric Astrophysical Problems
Spherical symmetry is a major constriction
and comes into conflict with . . .
Flattening by rotation
Figure: Betelgeuse,
Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
Non-Spherically Symmetric Astrophysical Problems
Spherical symmetry is a major constriction
and comes into conflict with . . .
Flattening by rotation
Rotation-induced mixing
Figure: Betelgeuse,
Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
Non-Spherically Symmetric Astrophysical Problems
Spherical symmetry is a major constriction
and comes into conflict with . . .
Flattening by rotation
Rotation-induced mixing
Coupled pulsation modes
Figure: Betelgeuse,
Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
Non-Spherically Symmetric Astrophysical Problems
Spherical symmetry is a major constriction
and comes into conflict with . . .
Flattening by rotation
Rotation-induced mixing
Coupled pulsation modes
Convection
Figure: Betelgeuse,
Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
Non-Spherically Symmetric Astrophysical Problems
Spherical symmetry is a major constriction
and comes into conflict with . . .
Flattening by rotation
Rotation-induced mixing
Coupled pulsation modes
Convection
Accretion discs
Figure: Betelgeuse,
Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
Non-Spherically Symmetric Astrophysical Problems
Spherical symmetry is a major constriction
and comes into conflict with . . .
Flattening by rotation
Rotation-induced mixing
Coupled pulsation modes
Convection
Accretion discs
(Galactic) winds
Figure: Betelgeuse,
Source (Link)
...
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
1 Motivation
Astrophysical Motivation
Numerical and Mathematical Motivation
2 Using Mathematica
Computeralgebra as interstage
Playground
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
The Numerical Approach
RHD numerics - the status quo
Conventional stellar evolution codes are
1D - spherically symmetric
Figure: 3D Convection,
H. Muthsam,
Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
The Numerical Approach
RHD numerics - the status quo
Conventional stellar evolution codes are
1D - spherically symmetric
2D and 3D RHD Codes often emphasize
on temporally and spatially small scales
(convection)
Figure: 3D Convection,
H. Muthsam,
Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
The Numerical Approach
RHD numerics - the status quo
Conventional stellar evolution codes are
1D - spherically symmetric
2D and 3D RHD Codes often emphasize
on temporally and spatially small scales
(convection)
Explicit codes are parallelizable but time
steps are limited by CFL-condition
Harald Höller
Figure: 3D Convection,
H. Muthsam,
Source (Link)
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
The Numerical Approach
RHD numerics - the status quo
Conventional stellar evolution codes are
1D - spherically symmetric
2D and 3D RHD Codes often emphasize
on temporally and spatially small scales
(convection)
Explicit codes are parallelizable but time
steps are limited by CFL-condition
Special non Euclidean geometries demand
problem-oriented grids
Harald Höller
Figure: 3D Convection,
H. Muthsam,
Source (Link)
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
Conservative Formulation
Numerical treatment of RHD mathematics
Analytically left and right hand side of ∇(uρ) = u∇ρ + ρ∇u are
equivalent; numerically the product (uρ) must be treated as
conservative density function
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
Conservative Formulation
Numerical treatment of RHD mathematics
Analytically left and right hand side of ∇(uρ) = u∇ρ + ρ∇u are
equivalent; numerically the product (uρ) must be treated as
conservative density function
Components of tensors (most of our physical variables are tensors)
are not conserved; Christoffel symbols are unwelcome geometric
source terms
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Astrophysical Motivation
Numerical and Mathematical Motivation
Conservative Formulation
Numerical treatment of RHD mathematics
Analytically left and right hand side of ∇(uρ) = u∇ρ + ρ∇u are
equivalent; numerically the product (uρ) must be treated as
conservative density function
Components of tensors (most of our physical variables are tensors)
are not conserved; Christoffel symbols are unwelcome geometric
source terms
Conservative covariant derivatives are motivated by the theory of
differential forms and yield [1] e.g.
hp
i
1
|g|φ êµ
gradφ = êµ ∂µ φ = êµ ∇µ φ = p ∂µ
|g|
(1)
References e.g. Randall J. LeVeque (1990) [2], Thompson, Warsi, Mastin
(1985) [1], Vladimir D. Liseikin (1999) [3], Vladimir D. Liseikin (2004) [4]
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Computeralgebra as interstage
Playground
1 Motivation
Astrophysical Motivation
Numerical and Mathematical Motivation
2 Using Mathematica
Computeralgebra as interstage
Playground
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Computeralgebra as interstage
Playground
What we use Mathematica for
The long path to the code
Do a little tensor analysis
Figure: Mathematica 7
Logo, Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Computeralgebra as interstage
Playground
What we use Mathematica for
The long path to the code
Do a little tensor analysis
Generate the equations of RHD in conservation
form
Figure: Mathematica 7
Logo, Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Computeralgebra as interstage
Playground
What we use Mathematica for
The long path to the code
Do a little tensor analysis
Generate the equations of RHD in conservation
form
Generate an adequate adaptive grid
Figure: Mathematica 7
Logo, Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Computeralgebra as interstage
Playground
What we use Mathematica for
The long path to the code
Do a little tensor analysis
Generate the equations of RHD in conservation
form
Generate an adequate adaptive grid
Generate the equations of RHD in conservation
form on an adaptive curvilinear grid
Figure: Mathematica 7
Logo, Source (Link)
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Computeralgebra as interstage
Playground
What we use Mathematica for
The long path to the code
Do a little tensor analysis
Generate the equations of RHD in conservation
form
Generate an adequate adaptive grid
Generate the equations of RHD in conservation
form on an adaptive curvilinear grid
Calculate the Jacobian of the system of PDEs
(already 1D)
Harald Höller
Using Mathematica for:
Figure: Mathematica 7
Logo, Source (Link)
Motivation
Using Mathematica
Computeralgebra as interstage
Playground
1 Motivation
Astrophysical Motivation
Numerical and Mathematical Motivation
2 Using Mathematica
Computeralgebra as interstage
Playground
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Computeralgebra as interstage
Playground
Using Mathematica
On the Playground
Mathematica-File as pdf-document in the appendix
Harald Höller
Using Mathematica for:
Motivation
Using Mathematica
Computeralgebra as interstage
Playground
Bibliography I
J. F. Thompson, Z. U. Warsi, and C. W. Mastin,
Numerical grid generation: foundations and applications (Elsevier
North-Holland, Inc., New York, NY, USA, 1985).
R. J. LeVeque,
Lectures in Mathematics, ETH-Zurich (1990).
V. D. Liseikin,
A Computational Differential Geometry Approach to Grid Generation
(Springer-Verlag, Berlin Heidelberg, 2004).
V. D. Liseikin,
Grid Generation Methods (Springer-Verlag, Berlin Heidelberg, 1999).
Harald Höller
Using Mathematica for:
Playground: Using Mathematica
Author: Harald Höller
Unterstützung zu M1 mit Schwerpunkt Computeralgebra und Wiki
Last modified: 23.06.2010
Licence: http://creativecommons.org/licenses/by- nc- nd/3.0/at/
Do a Little Tensor Analysis
Differential Geometric Relations
Let us assume a nice orthogonal standard-coordinate system, the spherical coordinates r Î [0,¥), Φ Î
[0,2Π], Θ Î [0,Pi]. We calculate some relevant quantities as the metric tensor and the co- and contravariant
base vectors.
Ÿ Coordinate Transformation
x := r Sin@thetaD Cos@phiD
y := r Sin@thetaD Sin@phiD
z := r Cos@thetaD
lij = 88D@x, rD, D@x, thetaD, D@x, phiD<,
8D@y, rD, D@y, thetaD, D@y, phiD<, 8D@z, rD, D@z, thetaD, D@z, phiD<<;
lijtransposed := Transpose@lijD
Ÿ Metric Tensor (covariant Components)
gij = lijtransposed.lij  FullSimplify
981, 0, 0<, 90, r2 , 0=, 90, 0, r2 Sin@thetaD2 ==
g = Det@gijD
r4 Sin@thetaD2
rootg = r ^ 2 * Sin@thetaD;
Ÿ Basis (covariant)
er = lijtransposed@@1DD
8Cos@phiD Sin@thetaD, Sin@phiD Sin@thetaD, Cos@thetaD<
etheta = lijtransposed@@2DD
8r Cos@phiD Cos@thetaD, r Cos@thetaD Sin@phiD, - r Sin@thetaD<
2
playground_wed_latex.nb
ephi = lijtransposed@@3DD
8- r Sin@phiD Sin@thetaD, r Cos@phiD Sin@thetaD, 0<
Ÿ Contravariant Basis
Er = 1  rootg * Cross@etheta , ephi D  FullSimplify
8Cos@phiD Sin@thetaD, Sin@phiD Sin@thetaD, Cos@thetaD<
Etheta = 1  rootg * Cross@ephi , er D  FullSimplify
Cos@phiD Cos@thetaD
Cos@thetaD Sin@phiD
,
9
Sin@thetaD
,-
r
r
=
r
Ephi = 1  rootg * Cross@er , etheta D  FullSimplify
Csc@thetaD Sin@phiD
Cos@phiD Csc@thetaD
,
9-
, 0=
r
r
Ÿ Covariant, Mixed and Contravariant Components of the Metric Tensor
Table@metricg@i, jD = ei .ej  FullSimplify, 8i, 8r, theta, phi<<, 8j, 8r, theta, phi<<D
981, 0, 0<, 90, r2 , 0=, 90, 0, r2 Sin@thetaD2 ==
Table@Metricg@i, jD = Ei .Ej  FullSimplify, 8i, 8r, theta, phi<<, 8j, 8r, theta, phi<<D
Csc@thetaD2
1
981, 0, 0<, 90,
, 0=, 90, 0,
==
r2
r2
Table@delta@i, jD = Ei .ej  FullSimplify, 8i, 8r, theta, phi<<, 8j, 8r, theta, phi<<D
881, 0, 0<, 80, 1, 0<, 80, 0, 1<<
Ÿ Christoffel- Symbols
Table@Table@Table@Gammer@sigma, mu, nuD =
1  2 * Sum@HEsigma .Erho L * HD@Henu .erho L, muD + D@Hemu .erho L, nuD - D@Hemu .enu L, rhoDL,
8rho, 8r, theta, phi<<D  FullSimplify,
8sigma, 8r, theta, phi<<D, 8mu, 8r, theta, phi<<D, 8nu, 8r, theta, phi<<D
1
9980, 0, 0<, 90,
r
1
990, 0,
r
1
, 0=, 90, 0,
1
, 0=, 8- r, 0, 0<, 80, 0, Cot@thetaD<=,
==, 990,
r
r
=, 80, 0, Cot@thetaD<, 9- r Sin@thetaD2 , - Cos@thetaD Sin@thetaD, 0===
playground_wed_latex.nb
Differentiation
Ÿ Tensor of Artificial Viscosity
Ÿ Covariant components of qschlange
Table@qschlange@i, jD =
1  2 * Hd@iD@u@jDD + d@jD@u@iDD - Sum@Gammer@k, i, jD * u@kD, 8k, 8r, theta, phi<<D Sum@Gammer@k, j, iD * u@kD, 8k, 8r, theta, phi<<DL 1  3 * metricg@i, jD * div@uD, 8i, 8r, theta, phi<<, 8j, 8r, theta, phi<<D
div@uD
1
+ d@rD@u@rDD,
993
1
2 u@thetaD
+ d@rD@u@thetaDD + d@thetaD@u@rDD ,
2
r
2 u@phiD
+ d@phiD@u@rDD + d@rD@u@phiDD =,
2
r
1
2 u@thetaD
+ d@rD@u@thetaDD + d@thetaD@u@rDD ,
-
9
2
r
1
-
r2 div@uD +
3
1
H2 r u@rD + 2 d@thetaD@u@thetaDDL,
2
1
H- 2 Cot@thetaD u@phiD + d@phiD@u@thetaDD + d@thetaD@u@phiDDL=,
2
1
2 u@phiD
2
1
+ d@phiD@u@rDD + d@rD@u@phiDD ,
-
9
r
2
1
H- 2 Cot@thetaD u@phiD + d@phiD@u@thetaDD + d@thetaD@u@phiDDL, -
r2 div@uD Sin@thetaD2 +
3
1
2
I2 r Sin@thetaD2 u@rD + 2 Cos@thetaD Sin@thetaD u@thetaD + 2 d@phiD@u@phiDDM==
3
4
playground_wed_latex.nb
Ÿ Contravariant
Table@qschlangeoben@m, nD = Sum@HMetricg@m, kD * Metricg@n, lDL *
H1  2 * Hd@kD@u@lDD + d@lD@u@kDD - Sum@Gammer@o, k, lD * u@oD, 8o, 8r, theta, phi<<D Sum@Gammer@o, l, kD * u@oD, 8o, 8r, theta, phi<<DL - 1  3 * metricg@m, nD * div@uDL,
8k, 8r, theta, phi<<, 8l, 8r, theta, phi<<D, 8m, 8r, theta,
phi<<, 8n, 8r, theta, phi<<D
-
div@uD
+ d@rD@u@rDD,
99-
2 u@thetaD
r
+ d@rD@u@thetaDD + d@thetaD@u@rDD
,
2 r2
3
Csc@thetaD2 I-
2 u@phiD
r
+ d@phiD@u@rDD + d@rD@u@phiDDM
=,
2 r2
-
2 u@thetaD
r
+ d@rD@u@thetaDD + d@thetaD@u@rDD
,
9
2 r2
-
1
3
r2 div@uD +
1
2
H2 r u@rD + 2 d@thetaD@u@thetaDDL
,
r4
Csc@thetaD2 H- 2 Cot@thetaD u@phiD + d@phiD@u@thetaDD + d@thetaD@u@phiDDL
=,
2 r4
Csc@thetaD2 I-
2 u@phiD
r
+ d@phiD@u@rDD + d@rD@u@phiDDM
,
9
2 r2
Csc@thetaD2 H- 2 Cot@thetaD u@phiD + d@phiD@u@thetaDD + d@thetaD@u@phiDDL
,
2 r4
1
Csc@thetaD4 -
r4
1
r2 div@uD Sin@thetaD2 +
3
1
I2 r Sin@thetaD2 u@rD + 2 Cos@thetaD Sin@thetaD u@thetaD + 2 d@phiD@u@phiDDM ==
2
Table@
qoben@m, nD = Sum@HMetricg@m, iD * Metricg@n, jDL qschlange@i, jD, 8i, 8r, theta, phi<<,
8j, 8r, theta, phi<<D, 8m, 8r, theta, phi<<, 8n, 8r, theta, phi<<D;
playground_wed_latex.nb
Ÿ Mixed components
Table@qmix@n, iD = Sum@Metricg@n, jD * qschlange@j, iD, 8j, 8r, theta, phi<<D,
8i, 8r, theta, phi<<, 8n, 8r, theta, phi<<D
-
div@uD
+ d@rD@u@rDD,
99-
2 u@thetaD
r
+ d@rD@u@thetaDD + d@thetaD@u@rDD
,
2 r2
3
2 u@phiD
r
Csc@thetaD2 I-
+ d@phiD@u@rDD + d@rD@u@phiDDM
=,
2 r2
1
2 u@thetaD
+ d@rD@u@thetaDD + d@thetaD@u@rDD ,
-
9
2
r
1
3
-
r2 div@uD +
1
2
H2 r u@rD + 2 d@thetaD@u@thetaDDL
,
r2
Csc@thetaD2 H- 2 Cot@thetaD u@phiD + d@phiD@u@thetaDD + d@thetaD@u@phiDDL
=,
2 r2
1
2 u@phiD
+ d@phiD@u@rDD + d@rD@u@phiDD ,
-
9
2
r
- 2 Cot@thetaD u@phiD + d@phiD@u@thetaDD + d@thetaD@u@phiDD
,
2 r2
1
Csc@thetaD2 -
r2
1
r2 div@uD Sin@thetaD2 +
3
1
I2 r Sin@thetaD2 u@rD + 2 Cos@thetaD Sin@thetaD u@thetaD + 2 d@phiD@u@phiDDM ==
2
Ÿ Simplified Viscosity Tensor
Table@qsimp@m, nD = Sum@HMetricg@m, iD * Metricg@n, jDL
H1  2 * Hd@iD@u@jDD + d@jD@u@iDD - Sum@Gammer@k, i, jD * u@kD, 8k, 8r, theta, phi<<D Sum@Gammer@k, j, iD * u@kD, 8k, 8r, theta, phi<<DL 1  3 * metricg@i, jD * div@uDL, 8i, 8r, theta, phi<<, 8j, 8r, theta, phi<<D 
FullSimplify, 8m, 8r, theta, phi<<, 8n, 8r, theta, phi<<D
div@uD
- 2 u@thetaD + r Hd@rD@u@thetaDD + d@thetaD@u@rDDL
+ d@rD@u@rDD,
99-
,
2 r3
3
Csc@thetaD2 H- 2 u@phiD + r Hd@phiD@u@rDD + d@rD@u@phiDDLL
=,
2 r3
- 2 u@thetaD + r Hd@rD@u@thetaDD + d@thetaD@u@rDDL
,
9
2 r3
- r2 div@uD + 3 Hr u@rD + d@thetaD@u@thetaDDL
,
3 r4
Csc@thetaD2 H- 2 Cot@thetaD u@phiD + d@phiD@u@thetaDD + d@thetaD@u@phiDDL
=,
2 r4
Csc@thetaD2 H- 2 u@phiD + r Hd@phiD@u@rDD + d@rD@u@phiDDLL
,
9
2 r3
Csc@thetaD2 H- 2 Cot@thetaD u@phiD + d@phiD@u@thetaDD + d@thetaD@u@phiDDL
,
2 r4
Csc@thetaD2 I- r2 div@uD + 3 Ir u@rD + Cot@thetaD u@thetaD + Csc@thetaD2 d@phiD@u@phiDDMM
==
3 r4
5
6
playground_wed_latex.nb
Ÿ Divergence of Tensors
Ÿ Definition of Tensors in Equation of Motion
Table@rschlange@i, jD = rho * Hu@iD - xdot@iDL * u@jD  FullSimplify,
8i, 8r, theta, phi<<, 8j, 8r, theta, phi<<D
Table@p@i, jD = p * Metricg@i, jD  FullSimplify,
8i, 8r, theta, phi<<, 8j, 8r, theta, phi<<D
Table@q@i, jD = qsimp@i, jD  FullSimplify, 8i, 8r, theta, phi<<, 8j, 8r, theta, phi<<D
88rho u@rD Hu@rD - xdot@rDL, rho u@thetaD Hu@rD - xdot@rDL, rho u@phiD Hu@rD - xdot@rDL<,
8rho u@rD Hu@thetaD - xdot@thetaDL, rho u@thetaD Hu@thetaD - xdot@thetaDL,
rho u@phiD Hu@thetaD - xdot@thetaDL<, 8rho u@rD Hu@phiD - xdot@phiDL,
rho u@thetaD Hu@phiD - xdot@phiDL, rho u@phiD Hu@phiD - xdot@phiDL<<
p Csc@thetaD2
p
98p, 0, 0<, 90,
, 0=, 90, 0,
r2
==
r2
div@uD
- 2 u@thetaD + r Hd@rD@u@thetaDD + d@thetaD@u@rDDL
+ d@rD@u@rDD,
99-
,
2 r3
3
Csc@thetaD2 H- 2 u@phiD + r Hd@phiD@u@rDD + d@rD@u@phiDDLL
=,
2 r3
- 2 u@thetaD + r Hd@rD@u@thetaDD + d@thetaD@u@rDDL
,
9
2 r3
- r2 div@uD + 3 Hr u@rD + d@thetaD@u@thetaDDL
,
3 r4
Csc@thetaD2 H- 2 Cot@thetaD u@phiD + d@phiD@u@thetaDD + d@thetaD@u@phiDDL
=,
2 r4
Csc@thetaD2 H- 2 u@phiD + r Hd@phiD@u@rDD + d@rD@u@phiDDLL
,
9
2 r3
Csc@thetaD2 H- 2 Cot@thetaD u@phiD + d@phiD@u@thetaDD + d@thetaD@u@phiDDL
,
2 r4
Csc@thetaD2 I- r2 div@uD + 3 Ir u@rD + Cot@thetaD u@thetaD + Csc@thetaD2 d@phiD@u@phiDDMM
==
3 r4
Generate the Equations of RDH in Conservation Form
Example: Spatial Part of the Equation of Motion in Spherical Coordinates
Table@d@tD@Sum@Sqrt@gD * rho * u@nD * en @@kDD, 8n, 8r, theta, phi<<DD +
Sum@Sum@d@iD@Sqrt@gD * H rschlange@i, jD + p@i, jD + Qkomp@i, jDL * ej @@kDDD,
8i, 8r, theta, phi<<D, 8j, 8r, theta, phi<<D +
rho * Sum@d@lD@Sqrt@gD * Phi * El @@kDDD, 8l, 8r, theta, phi<<D 4 Pi  c * Sqrt@gD * HSum@H@oD * eo @@kDD, 8o, 8r, theta, phi<<DL .
8Sin@thetaD ® Sqrt@1 - mu ^ 2D, d@thetaD ® - Sqrt@1 - mu ^ 2D d@muD,
Csc@thetaD ® 1  Sqrt@1 - mu ^ 2D, Cos@thetaD ® mu<, 8k, 81, 2, 3<<D
playground_wed_latex.nb
1
I1 - mu2 M r4
4Π
9c
1 - mu2 Cos@phiD H@rD + mu r Cos@phiD H@thetaD 1 - mu2 d@muD A-
-
1 - mu2 r
1 - mu2 r H@phiD Sin@phiD +
I1 - mu2 M r4 Sin@phiD
HQkomp@theta, phiD + rho u@phiD Hu@thetaD - xdot@thetaDLLE + 1 - mu2
I1 - mu2 M r4 Cos@phiD HQkomp@theta, rD + rho u@rD Hu@thetaD - xdot@thetaDLLE +
1 - mu2 d@muD Amu r
-
1 - mu2 d@muD A
I1 - mu2 M r4 Cos@phiD
p
+ Qkomp@theta, thetaD + rho u@thetaD Hu@thetaD - xdot@thetaDL E +
r2
1 - mu2 r
d@phiDA-
I1 - mu2 M r4 Sin@phiD
p
+ Qkomp@phi, phiD + rho u@phiD Hu@phiD - xdot@phiDL E +
I1 - mu2 M r2
1 - mu2
d@phiDA
I1 - mu2 M r4 Cos@phiD HQkomp@phi, rD + rho u@rD Hu@phiD - xdot@phiDLLE +
I1 - mu2 M r4 Cos@phiD
d@phiDAmu r
HQkomp@phi, thetaD + rho u@thetaD Hu@phiD - xdot@phiDLLE +
mu Phi
rho
I1 - mu2 M r4 Cos@phiD
1 - mu2 d@muD A
-
E+
r
I1 - mu2 M r4 Sin@phiD
Phi
d@phiDA-
1d@rDA-
1 - mu2 r
1 - mu2
d@rDA
d@rDAmu r
-
I1 - mu2 M r4 Cos@phiDE +
r
I1 - mu2 M r4 Sin@phiD HQkomp@r, phiD + rho u@phiD Hu@rD - xdot@rDLLE +
I1 - mu2 M r4 Cos@phiD Hp + Qkomp@r, rD + rho u@rD Hu@rD - xdot@rDLLE +
I1 - mu2 M r4 Cos@phiD HQkomp@r, thetaD + rho u@thetaD Hu@rD - xdot@rDLLE + d@tDA
1 - mu2 r
mu r
1 - mu2 Phi
E + d@rDA
mu2
I1 - mu2 M r4 rho Sin@phiD u@phiD +
I1 - mu2 M r4 rho Cos@phiD u@thetaDE, -
1 - mu2
1
4Π
I1 - mu2 M r4 rho Cos@phiD u@rD +
I1 - mu2 M r4
c
1 - mu2 r Cos@phiD H@phiD +
-
1 - mu2 d@muD A
1 - mu2 r
1 - mu2 H@rD Sin@phiD + mu r H@thetaD Sin@phiD +
I1 - mu2 M r4 Cos@phiD
HQkomp@theta, phiD + rho u@phiD Hu@thetaD - xdot@thetaDLLE + 1 - mu2
-
1 - mu2 d@muD A
I1 - mu2 M r4 Sin@phiD HQkomp@theta, rD + rho u@rD Hu@thetaD - xdot@thetaDLLE +
1 - mu2 d@muD Amu r
I1 - mu2 M r4 Sin@phiD
E+
7
8
playground_wed_latex.nb
p
+ Qkomp@theta, thetaD + rho u@thetaD Hu@thetaD - xdot@thetaDL E +
r2
1 - mu2 r
d@phiDA
I1 - mu2 M r4 Cos@phiD
p
+ Qkomp@phi, phiD + rho u@phiD Hu@phiD - xdot@phiDL E +
I1 - mu2 M r2
1 - mu2
d@phiDA
I1 - mu2 M r4 Sin@phiD HQkomp@phi, rD + rho u@rD Hu@phiD - xdot@phiDLLE +
I1 - mu2 M r4 Sin@phiD
d@phiDAmu r
HQkomp@phi, thetaD + rho u@thetaD Hu@phiD - xdot@phiDLLE +
mu Phi
rho
I1 - mu2 M r4 Sin@phiD
1 - mu2 d@muD A
-
E+
r
I1 - mu2 M r4 Cos@phiD
Phi
d@phiDA
1d@rDA
1 - mu2 r
d@rDA
1 - mu2
r
I1 - mu2 M r4 Cos@phiD HQkomp@r, phiD + rho u@phiD Hu@rD - xdot@rDLLE +
I1 - mu2 M r4 Sin@phiD Hp + Qkomp@r, rD + rho u@rD Hu@rD - xdot@rDLLE +
1 - mu2 r
1 - mu2
I1 - mu2 M r4 rho Cos@phiD u@phiD +
I1 - mu2 M r4 rho Sin@phiD u@rD + mu r
I1 - mu2 M r4 Jmu H@rD -
4Π
I1 - mu2 M r4 Sin@phiDE +
I1 - mu2 M r4 Sin@phiD HQkomp@r, thetaD + rho u@thetaD Hu@rD - xdot@rDLLE +
d@rDAmu r
d@tDA
1 - mu2 Phi
E + d@rDA
mu2
I1 - mu2 M r4 rho Sin@phiD u@thetaDE,
1 - mu2 r H@thetaDN
-
+
c
-
1 - mu2 d@muD @0D + -
I1 - mu2 M r4 HQkomp@theta, rD + rho u@rD Hu@thetaD - xdot@thetaDLLE +
mu
-
1 - mu2 d@muD A
1 - mu2 d@muD A-
1 - mu2 r
I1 - mu2 M r4
p
+ Qkomp@theta, thetaD + rho u@thetaD Hu@thetaD - xdot@thetaDL E + d@phiD@0D +
r2
d@phiDAmu
-
I1 - mu2 M r4 HQkomp@phi, rD + rho u@rD Hu@phiD - xdot@phiDLLE + d@phiDA
1 - mu2 r
I1 - mu2 M r4 HQkomp@phi, thetaD + rho u@thetaD Hu@phiD - xdot@phiDLLE +
1 - mu2 Phi
d@rD@0D + rho
-
I1 - mu2 M r4
1 - mu2 d@muD A-
E+
r
d@phiD@0D + d@rDAmu Phi
d@rDAmu
d@rDAd@tDAmu
I1 - mu2 M r4 E +
I1 - mu2 M r4 Hp + Qkomp@r, rD + rho u@rD Hu@rD - xdot@rDLLE +
1 - mu2 r
I1 - mu2 M r4 HQkomp@r, thetaD + rho u@thetaD Hu@rD - xdot@rDLLE +
I1 - mu2 M r4 rho u@rD -
1 - mu2 r
I1 - mu2 M r4 rho u@thetaDE=
Ÿ With Tensor of Artificial Viscosity
Table@d@tD@Sum@Sqrt@gD * rho * u@nD * en @@kDD, 8n, 8r, theta, phi<<DD +
Sum@Sum@d@iD@Sqrt@gD * H rschlange@i, jD + p@i, jD + q@i, jDL * ej @@kDDD,
8i, 8r, theta, phi<<D, 8j, 8r, theta, phi<<D + rho * Sum@d@lD@Sqrt@gD * Phi * El @@kDDD, 8l, 8r, theta, phi<<D 4 Pi  c *
Sqrt@gD * HSum@H@oD * eo @@kDD, 8o, 8r, theta, phi<<DL .
8Sin@thetaD ® Sqrt@1 - mu ^ 2D, d@thetaD ® - Sqrt@1 - mu ^ 2D d@muD,
Csc@thetaD ® 1  Sqrt@1 - mu ^ 2D, Cos@thetaD ® mu<, 8k, 81, 2, 3<<D
playground_wed_latex.nb
1 - mu2 d@muD Amu r
9 -
I1 - mu2 M r4 Cos@phiD
p
+ rho u@thetaD Hu@thetaD - xdot@thetaDL +
r2
- r2 div@uD + 3 Jr u@rD + J-
1 - mu2 d@muDN@u@thetaDDN
1 - mu2 d@muD A
E+ 3 r4
-
1 - mu2 r
I1 - mu2 M r4 Sin@phiD rho u@phiD Hu@thetaD - xdot@thetaDL +
- 2 Cot@thetaD u@phiD + J-
1 - mu2 d@muDN@u@phiDD + d@phiD@u@thetaDD
E+
2 I1 - mu2 M r4
-
1 - mu2 d@muD A
1 - mu2
- 2 u@thetaD + r JJ-
I1 - mu2 M r4 Cos@phiD rho u@rD Hu@thetaD - xdot@thetaDL +
1 - mu2 d@muDN@u@rDD + d@rD@u@thetaDDN
E+
2 r3
d@phiDA-
1 - mu2 r
p
I1 - mu2 M r4 Sin@phiD
+ rho u@phiD Hu@phiD - xdot@phiDL +
I1 - mu2 M r2
- r2 div@uD + 3 Jr u@rD + Cot@thetaD u@thetaD +
d@phiD@u@phiDD
1-mu2
N
E+
3 I1 - mu2 M r4
d@phiDAmu r
I1 - mu2 M r4 Cos@phiD rho u@thetaD Hu@phiD - xdot@phiDL +
- 2 Cot@thetaD u@phiD + J-
1 - mu2 d@muDN@u@phiDD + d@phiD@u@thetaDD
E+
2 I1 - mu2 M r4
d@phiDA
1 - mu2
I1 - mu2 M r4 Cos@phiD rho u@rD Hu@phiD - xdot@phiDL +
- 2 u@phiD + r Hd@phiD@u@rDD + d@rD@u@phiDDL
1
4Π
E2 I1 -
mu2 M
r3
1 - mu2 Cos@phiD H@rD + mu r Cos@phiD H@thetaD mu Phi
-
I1 - mu2 M r4 rho
c
1 - mu2 r H@phiD Sin@phiD
I1 - mu2 M r4 Cos@phiD
1 - mu2 d@muD A
E+
r
+
+
9
10
playground_wed_latex.nb
Phi
I1 - mu2 M r4 Sin@phiD
d@phiDA-
E + d@rDA
1-
d@rDA-
1 - mu2 r
mu2
1 - mu2 Phi
I1 - mu2 M r4 Cos@phiDE +
r
I1 - mu2 M r4 Sin@phiD
- 2 u@phiD + r Hd@phiD@u@rDD + d@rD@u@phiDDL
rho u@phiD Hu@rD - xdot@rDL +
E + d@rDA
2 I1 - mu2 M r3
1 - mu2
I1 - mu2 M r4 Cos@phiD p -
div@uD
+ rho u@rD Hu@rD - xdot@rDL + d@rD@u@rDD E +
3
I1 - mu2 M r4 Cos@phiD rho u@thetaD Hu@rD - xdot@rDL +
d@rDAmu r
- 2 u@thetaD + r JJ-
1 - mu2 d@muDN@u@rDD + d@rD@u@thetaDDN
E+
2 r3
d@tDA-
1 - mu2 r
1 - mu2
I1 - mu2 M r4 rho Sin@phiD u@phiD +
I1 - mu2 M r4 rho Cos@phiD u@rD + mu r
1 - mu2 d@muD Amu r
-
I1 - mu2 M r4 Sin@phiD
I1 - mu2 M r4 rho Cos@phiD u@thetaDE,
p
+ rho u@thetaD Hu@thetaD - xdot@thetaDL +
r2
- r2 div@uD + 3 Jr u@rD + J-
1 - mu2 d@muDN@u@thetaDDN
1 - mu2 d@muD A
E+ 3 r4
1 - mu2 r
I1 - mu2 M r4 Cos@phiD rho u@phiD Hu@thetaD - xdot@thetaDL +
- 2 Cot@thetaD u@phiD + J-
1 - mu2 d@muDN@u@phiDD + d@phiD@u@thetaDD
E+
2 I1 - mu2 M r4
-
1 - mu2 d@muD A
1 - mu2
- 2 u@thetaD + r JJ-
I1 - mu2 M r4 Sin@phiD rho u@rD Hu@thetaD - xdot@thetaDL +
1 - mu2 d@muDN@u@rDD + d@rD@u@thetaDDN
E+
2 r3
d@phiDA
1 - mu2 r
I1 - mu2 M r4 Cos@phiD
p
+ rho u@phiD Hu@phiD - xdot@phiDL +
I1 - mu2 M r2
- r2 div@uD + 3 Jr u@rD + Cot@thetaD u@thetaD +
d@phiD@u@phiDD
1-mu2
N
E+
3 I1 - mu2 M r4
playground_wed_latex.nb
I1 - mu2 M r4 Sin@phiD rho u@thetaD Hu@phiD - xdot@phiDL +
d@phiDAmu r
1 - mu2 d@muDN@u@phiDD + d@phiD@u@thetaDD
- 2 Cot@thetaD u@phiD + J-
E+
2 I1 - mu2 M r4
1 - mu2
d@phiDA
I1 - mu2 M r4 Sin@phiD rho u@rD Hu@phiD - xdot@phiDL +
- 2 u@phiD + r Hd@phiD@u@rDD + d@rD@u@phiDDL
1
4Π
E2 I1 -
mu2 M
r3
1 - mu2 r Cos@phiD H@phiD +
1 - mu2 H@rD Sin@phiD + mu r H@thetaD Sin@phiD
I1 - mu2 M r4 Sin@phiD
mu Phi
-
I1 - mu2 M r4 rho
c
1 - mu2 d@muD A
E+
r
Phi
I1 - mu2 M r4 Cos@phiD
d@phiDA
E + d@rDA
1 - mu2 Phi
I1 - mu2 M r4 Sin@phiDE +
1 - mu2 r
d@rDA
1 - mu2 r
I1 - mu2 M r4 Cos@phiD rho u@phiD Hu@rD - xdot@rDL +
- 2 u@phiD + r Hd@phiD@u@rDD + d@rD@u@phiDDL
E + d@rDA
2 I1 - mu2 M r3
1 - mu2
I1 - mu2 M r4 Sin@phiD p -
div@uD
+ rho u@rD Hu@rD - xdot@rDL + d@rD@u@rDD E +
3
d@rDAmu r
I1 - mu2 M r4 Sin@phiD rho u@thetaD Hu@rD - xdot@rDL +
- 2 u@thetaD + r JJ-
1 - mu2 d@muDN@u@rDD + d@rD@u@thetaDDN
E+
2 r3
d@tDA
1 - mu2 r
1 - mu2
I1 - mu2 M r4 rho Cos@phiD u@phiD +
I1 - mu2 M r4 rho Sin@phiD u@rD + mu r
1 - mu2 d@muD @0D + -
-
-
1 - mu2 r
I1 - mu2 M r4
I1 - mu2 M r4 rho Sin@phiD u@thetaDE,
1 - mu2 d@muD A
p
+ rho u@thetaD Hu@thetaD - xdot@thetaDL +
r2
- r2 div@uD + 3 Jr u@rD + J-
1 - mu2 d@muDN@u@thetaDDN
E+
3 r4
11
12
playground_wed_latex.nb
-
1 - mu2 d@muD Amu
I1 - mu2 M r4
- 2 u@thetaD + r JJ-
rho u@rD Hu@thetaD - xdot@thetaDL +
1 - mu2 d@muDN@u@rDD + d@rD@u@thetaDDN
E+
2 r3
1 - mu2 r
d@phiD@0D + d@phiDA-
- 2 Cot@thetaD u@phiD + J-
I1 - mu2 M r4
rho u@thetaD Hu@phiD - xdot@phiDL +
1 - mu2 d@muDN@u@phiDD + d@phiD@u@thetaDD
E+
2 I1 - mu2 M r4
d@phiDAmu
I1 - mu2 M r4
rho u@rD Hu@phiD - xdot@phiDL +
- 2 u@phiD + r Hd@phiD@u@rDD + d@rD@u@phiDDL
E + d@rD@0D 2 I1 - mu2 M r3
1
I1 - mu2 M r4 rho mu H@rD -
4Π
1 - mu2 r H@thetaD
-
1 - mu2 d@muD A
c
1 - mu2 Phi
I1 - mu2 M r4
E + d@phiD@0D + d@rDAmu Phi
-
I1 - mu2 M r4 E +
r
I1 - mu2 M r4
d@rDAmu
div@uD
p-
+ rho u@rD Hu@rD - xdot@rDL + d@rD@u@rDD E +
3
d@rDA-
1 - mu2 r
I1 - mu2 M r4
- 2 u@thetaD + r JJ-
rho u@thetaD Hu@rD - xdot@rDL +
1 - mu2 d@muDN@u@rDD + d@rD@u@thetaDDN
E+
2 r3
d@tDAmu
I1 - mu2 M r4 rho u@rD -
1 - mu2 r
I1 - mu2 M r4 rho u@thetaDE=
Clear@"Global`*"D
Generate an Adequate Adaptive Grid
Ansatz for quasi-polar coordinates
To a certain extent is is demanded, that phyiscs take place in coordinate planes or in other words, that there
are no strong gradients skew to coordinate lines. Since in reality no (for RHD relevant) astrophysical
object is spherical, we look for a more general coordinate system that allows oblateness etc.
Ÿ Coordinate Transformation with Product Ansatz
We define a coordinate transformation with product ansatz, which is reasonable for any kind of coordinate
system.
x = X@Ξ, ΗD;
y = Y@Ξ, ΗD;
playground_wed_latex.nb
13
X@Ξ_, Η_D = a@ΞD * Α@ΗD;
Y@Ξ_, Η_D = b@ΞD * Β@ΗD;
Α@Η_D
Β@Η_D
a@Ξ_D
b@Ξ_D
=
=
=
=
H1 + alpha1 * Η + alpha2 * Η ^ 2 + alpha3 * Η ^ 3L * Cos@ΗD;
H1 + beta1 * Η + beta2 * Η ^ 2 + beta3 * Η ^ 3L * Sin@ΗD;
Ha1 * Ξ + a2 * Ξ ^ 2L ;
Hb1 * Ξ + b2 * Ξ ^ 2L ;
We calculate the Jacobian of this transformation to get the base vectors in the new coordinate system.
lij = 88D@x, ΞD, D@x, ΗD<, 8D@y, ΞD, D@y, ΗD<<;
lijtransposed := Transpose@lijD
Ÿ 2D Metric Tensor (covariant Components)
For trivial signatures, the metric tensor is simply given by the Jacobian times its transpositon. The off
diagonal elements contain the information about the non-orthogonality (angles), the diagonal elements are
measures of lenght in the coordinate directions.
gij = lijtransposed.lij;
g11@Ξ_,
g12@Ξ_,
g21@Ξ_,
g22@Ξ_,
Η_D
Η_D
Η_D
Η_D
=
=
=
=
gij@@1,
gij@@1,
gij@@2,
gij@@2,
1DD;
2DD;
1DD;
2DD;
Ÿ 2D Basis (covariant)
The base vectors yield
eΞ @Ξ_, Η_D = lijtransposed@@1DD
9I1 + alpha1 Η + alpha2 Η2 + alpha3 Η3 M Ha1 + 2 a2 ΞL Cos@ΗD,
I1 + beta1 Η + beta2 Η2 + beta3 Η3 M Hb1 + 2 b2 ΞL Sin@ΗD=
eΗ @Ξ_, Η_D = lijtransposed@@2DD
9Ialpha1 + 2 alpha2 Η + 3 alpha3 Η2 M Ia1 Ξ + a2 Ξ2 M Cos@ΗD I1 + alpha1 Η + alpha2 Η2 + alpha3 Η3 M Ia1 Ξ + a2 Ξ2 M Sin@ΗD,
I1 + beta1 Η + beta2 Η2 + beta3 Η3 M Ib1 Ξ + b2 Ξ2 M Cos@ΗD +
Ibeta1 + 2 beta2 Η + 3 beta3 Η2 M Ib1 Ξ + b2 Ξ2 M Sin@ΗD=
PDEs + Boundary conditions
Ÿ Equations and boundary conditions
In order to control the shape of the grid by a manageable number of parameters and for reasons of symmetry we impose geometrically motivated boundary conditions. Since some of them are either redundant or
exclusive, the following list is somewhat heuristic.
14
playground_wed_latex.nb
ESSol = SolveA9
H*g12@Ξ,ΗDŠ0,*L H* orthogonality *L
eΞ @Ξ, 0D@@1DD Š 1, H* scaling *L
eΞ @Ξ, 0D@@2DD Š 0, H* in "x"-axis *L
eΞ @Ξ, Pi  2D@@1DD Š 0, H* in "y"-axis *L
eΞ @Ξ, Pi  2D@@2DD Š 1, H* scaling *L
eΗ @Ξ, 0D@@1DD Š 0, H* normal to "x"-axis *L
eΗ @Ξ, 0D@@2DD Š Ξ, H* scaling *L
eΗ @Ξ, Pi  2D@@1DD Š - Ξ, H* orientation *L
eΗ @Ξ, Pi  2D@@2DD Š 0, H* normal to "y"-axis *L
X@0, 0D Š 0, H* set origin *L
Y@0, 0D Š 0, H* set origin *L
X@Ξ, 0D Š X@Ξ, 2 * PiD, H* periodicity *L
Y@Ξ, 0D Š Y@Ξ, 2 * PiD, H* periodicity *L
X@Ξ, 0D Š Ξ * X@1, 0D H* scaling *L
=,
8alpha1, alpha2, beta1, beta2, , alpha3, beta3, a1, a2<E
Solve::svars : Equations may not give solutions for all "solve" variables. ‡
beta3 Π3 - 16 b2 Ξ + b2 beta3 Π3 Ξ
- beta3 Π3 + 4 b2 Ξ - b2 beta3 Π3 Ξ
, beta2 ®
99beta1 ®
4 Π H1 + b2 ΞL
,
Π2 H1 + b2 ΞL
alpha2 ® 0, alpha1 ® 0, alpha3 ® 0, a1 ® 1, a2 ® 0==
Xnew@Ξ_, Η_D = Evaluate@X@Ξ, ΗD . ESSol@@1DDD  Simplify
Ynew@Ξ_, Η_D = Evaluate@Y@Ξ, ΗD . ESSol@@1DDD  Simplify
Ξ Cos@ΗD
1
4
Π2
Ξ Hb1 + b2 ΞL I- 16 b2 Π Η Ξ + 16 b2 Η2 Ξ +
H1 + b2 ΞL
beta3 Π4 Η H1 + b2 ΞL - 4 beta3 Π3 Η2 H1 + b2 ΞL + 4 Π2 I1 + beta3 Η3 M H1 + b2 ΞLM Sin@ΗD
Ÿ Plots
This example for a quasi-polar mesh is being controled by three parameters.
playground_wed_latex.nb
ManipulateAParametricPlotA
1
9Ξ Cos@ΗD,
4
Π2
Ξ Hb1 + b2 ΞL I- 16 b2 Π Η Ξ + 16 b2 Η2 Ξ + beta3 Π4 Η H1 + b2 ΞL -
H1 + b2 ΞL
4 beta3 Π3 Η2 H1 + b2 ΞL + 4 Π2 I1 + beta3 Η3 M H1 + b2 ΞLM Sin@ΗD=,
8Ξ, 0.0001, 1<, 8Η, 0, Pi  2<, AspectRatio ® 1E,
88b1, 1<, - 1, 1<, 88b2, 0<, - 1, 1<, 8 8beta3, 0<, - 1, 1<E
b1
b2
beta3
15
16
playground_wed_latex.nb
Ÿ Examples
playground_wed_latex.nb
Mesh Refinement (Graphically)
Ÿ Plots
ManipulateAParametricPlotA
1
9Ξ Cos@ΗD,
Ξ Hb1 + b2 ΞL I- 16 b2 Π Η Ξ + 16 b2 Η2 Ξ + beta3 Π4 Η H1 + b2 ΞL -
4 Π2 H1 + b2 ΞL
4 beta3 Π3 Η2 H1 + b2 ΞL + 4 Π2 I1 + beta3 Η3 M H1 + b2 ΞLM Sin@ΗD=,
8Ξ, 0.0001, 1<, 8Η, 0, Pi  2<, AspectRatio ® 1,
MeshFunctions ® 81  t * Exp@HSqrt@ð1 ^ 2 + ð2 ^ 2D - pL ^ 2  tD * Sqrt@ð1 ^ 2 + ð2 ^ 2D &,
Exp@HArcSin@ð2  HSqrt@ð1 ^ 2 + ð2 ^ 2DLD - mL ^ 2  s ^ 2D *
ArcSin@ð2  HSqrt@ð1 ^ 2 + ð2 ^ 2DLD &<E,
88b1, 1<, - 1, 1<, 88b2, 0<, - 1, 1<, 8 8beta3, 0<, - 1, 1<,
88m, 0<, 0, 2<, 88s, 3<, 0.01, 3<, 88t, 3<, 0.01, 3<, 88p, 0<, 0, 2<E
b1
b2
beta3
m
s
t
p
17
18
playground_wed_latex.nb
Ÿ Examples
playground_wed_latex.nb
Generate the Equations of RHD in Conservation Form on an Adaptive
Curvilinear Grid
Some Differential Geometry
Ÿ Coordinate Transformation
x = Xnew@r, thetaD
y=0
z = Ynew@r, thetaD
r Cos@thetaD
0
1
4
Π2
r Hb1 + b2 rL I- 16 b2 Π r theta + beta3 Π4 H1 + b2 rL theta + 16 b2 r theta2 -
H1 + b2 rL
4 beta3 Π3 H1 + b2 rL theta2 + 4 Π2 H1 + b2 rL I1 + beta3 theta3 MM Sin@thetaD
19
20
playground_wed_latex.nb
lij = 88D@x, rD, D@x, thetaD<, 8D@z, rD, D@z, thetaD<<
98Cos@thetaD, - r Sin@thetaD<,
1
r Hb1 + b2 rL I- 16 b2 Π theta + b2 beta3 Π4 theta + 16 b2 theta2 -
9
4
Π2
H1 + b2 rL
4 b2 beta3 Π3 theta2 + 4 b2 Π2 I1 + beta3 theta3 MM Sin@thetaD +
1
4
Π2
b2 r I- 16 b2 Π r theta + beta3 Π4 H1 + b2 rL theta + 16 b2 r theta2 -
H1 + b2 rL
4 beta3 Π3 H1 + b2 rL theta2 + 4 Π2 H1 + b2 rL I1 + beta3 theta3 MM Sin@thetaD 1
4
Π2
b2 r Hb1 + b2 rL I- 16 b2 Π r theta + beta3 Π4 H1 + b2 rL theta + 16 b2 r theta2 -
H1 + b2 rL
2
4 beta3 Π3 H1 + b2 rL theta2 + 4 Π2 H1 + b2 rL I1 + beta3 theta3 MM Sin@thetaD +
1
4
Π2
Hb1 + b2 rL I- 16 b2 Π r theta + beta3 Π4 H1 + b2 rL theta + 16 b2 r theta2 -
H1 + b2 rL
4 beta3 Π3 H1 + b2 rL theta2 + 4 Π2 H1 + b2 rL I1 + beta3 theta3 MM Sin@thetaD,
1
r Hb1 + b2 rL I- 16 b2 Π r theta + beta3 Π4 H1 + b2 rL theta + 16 b2 r theta2 -
4 Π2 H1 + b2 rL
4 beta3 Π3 H1 + b2 rL theta2 + 4 Π2 H1 + b2 rL I1 + beta3 theta3 MM Cos@thetaD +
1
r Hb1 + b2 rL I- 16 b2 Π r + beta3 Π4 H1 + b2 rL + 32 b2 r theta -
4 Π2 H1 + b2 rL
8 beta3 Π3 H1 + b2 rL theta + 12 beta3 Π2 H1 + b2 rL theta2 M Sin@thetaD==
lijtransposed := Transpose@lijD
Ÿ 2D Metric Tensor (covariant Components)
gij = lijtransposed.lij  Simplify;
Gij = Inverse@gijD  Simplify;
Grr = Gij@@1, 1DD;
Grtheta = Gij@@1, 2DD;
Gthetar = Gij@@2, 1DD;
Gthetatheta = Gij@@2, 2DD;
g = Det@gijD;
playground_wed_latex.nb
rootg = Sqrt@gD  Simplify
1
8 Π2
1
r2 I8 b1 Π2 + 12 b2 Π2 r + 16 b1 b2 Π2 r + 24 b22 Π2 r2 + 8 b1 b22 Π2 r2 + 12 b23 Π2 r3 +
.
4
H1 + b2 rL
2 b1 beta3 Π4 theta - 48 b1 b2 Π r theta + 3 b2 beta3 Π4 r theta +
4 b1 b2 beta3 Π4 r theta - 64 b22 Π r2 theta - 32 b1 b22 Π r2 theta +
6 b22 beta3 Π4 r2 theta + 2 b1 b22 beta3 Π4 r2 theta - 48 b23 Π r3 theta +
3 b23 beta3 Π4 r3 theta - 8 b1 beta3 Π3 theta2 + 48 b1 b2 r theta2 12 b2 beta3 Π3 r theta2 - 16 b1 b2 beta3 Π3 r theta2 + 64 b22 r2 theta2 +
32 b1 b22 r2 theta2 - 24 b22 beta3 Π3 r2 theta2 - 8 b1 b22 beta3 Π3 r2 theta2 +
48 b23 r3 theta2 - 12 b23 beta3 Π3 r3 theta2 + 8 b1 beta3 Π2 theta3 +
12 b2 beta3 Π2 r theta3 + 16 b1 b2 beta3 Π2 r theta3 + 24 b22 beta3 Π2 r2 theta3 +
8 b1 b22 beta3 Π2 r2 theta3 + 12 b23 beta3 Π2 r3 theta3 b2 r Ibeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@2 thetaD + H1 + b2 rL Hb1 + b2 rL
2
I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM HΠ - 2 thetaL Sin@2 thetaDM
Ÿ 2D Basis (covariant)
er = lijtransposed@@1DD
1
9Cos@thetaD,
4
Π2
r Hb1 + b2 rL I- 16 b2 Π theta + b2 beta3 Π4 theta +
H1 + b2 rL
16 b2 theta2 - 4 b2 beta3 Π3 theta2 + 4 b2 Π2 I1 + beta3 theta3 MM Sin@thetaD +
1
4
Π2
b2 r I- 16 b2 Π r theta + beta3 Π4 H1 + b2 rL theta + 16 b2 r theta2 -
H1 + b2 rL
4 beta3 Π3 H1 + b2 rL theta2 + 4 Π2 H1 + b2 rL I1 + beta3 theta3 MM Sin@thetaD 1
4
Π2
b2 r Hb1 + b2 rL I- 16 b2 Π r theta + beta3 Π4 H1 + b2 rL theta + 16 b2 r theta2 -
H1 + b2 rL2
4 beta3 Π3 H1 + b2 rL theta2 + 4 Π2 H1 + b2 rL I1 + beta3 theta3 MM Sin@thetaD +
1
4
Π2
Hb1 + b2 rL I- 16 b2 Π r theta + beta3 Π4 H1 + b2 rL theta + 16 b2 r theta2 -
H1 + b2 rL
4 beta3 Π3 H1 + b2 rL theta2 + 4 Π2 H1 + b2 rL I1 + beta3 theta3 MM Sin@thetaD=
etheta = lijtransposed@@2DD
9- r Sin@thetaD,
1
4
Π2
r Hb1 + b2 rL I- 16 b2 Π r theta + beta3 Π4 H1 + b2 rL theta + 16 b2 r theta2 -
H1 + b2 rL
4 beta3 Π3 H1 + b2 rL theta2 + 4 Π2 H1 + b2 rL I1 + beta3 theta3 MM Cos@thetaD +
1
r Hb1 + b2 rL I- 16 b2 Π r + beta3 Π4 H1 + b2 rL + 32 b2 r theta -
4 Π2 H1 + b2 rL
8 beta3 Π3 H1 + b2 rL theta + 12 beta3 Π2 H1 + b2 rL theta2 M Sin@thetaD=
Ÿ 2D Contravariant Basis
Er = Grtheta * etheta + Grr * er ;
21
22
playground_wed_latex.nb
Etheta = Gthetar * er + Gthetatheta * etheta ;
Ÿ 2D Covariant, Mixed and Contravariant Components of the Metric Tensor
Table@metricg@i, jD = ei .ej  Simplify, 8i, 8r, theta<<, 8j, 8r, theta<<D;
Table@Metricg@i, jD = Ei .Ej  Simplify, 8i, 8r, theta<<, 8j, 8r, theta<<D;
Simplify::time :
Time spent on a transformation exceeded 300 seconds, and the transformation
was aborted. Increasing the value of TimeConstraint
option may improve the result of simplification. ‡
Ÿ 2D Christoffel-Symbols
Table@Table@Table@Gammer@sigma, mu, nuD =
1  2 * Sum@HEsigma .Erho L * HD@Henu .erho L, muD + D@Hemu .erho L, nuD - D@Hemu .enu L, rhoDL,
8rho, 8r, theta<<D  FullSimplify,
8sigma, 8r, theta<<D, 8mu, 8r, theta<<D, 8nu, 8r, theta<<D
999I4 b2 Ibeta3 Π4 H1 + b2 rL3 theta - 16 Π Hb1 + b2 r H3 + b2 r H3 + b2 rLLL theta 4 beta3 HΠ + b2 Π rL3 theta2 + 16 Hb1 + b2 r H3 + b2 r H3 + b2 rLLL theta2 +
4 Π2 H1 + b2 rL3 I1 + beta3 theta3 MM Sin@thetaD2 M ‘
IH1 + b2 rL I2 b1 Ibeta3 Π4 H1 + b2 rL2 theta - 8 b2 Π r H3 + 2 b2 rL theta + 8 b2 r H3 + 2 b2 rL
theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 + 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
b2 r I3 beta3 Π4 H1 + b2 rL2 theta - 16 b2 Π r H4 + 3 b2 rL theta + 16 b2 r H4 + 3 b2 rL
theta2 - 12 beta3 Π3 Htheta + b2 r thetaL2 + 12 HΠ + b2 Π rL2 I1 + beta3 theta3 MM b2 r Ibeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@2 thetaD + H1 + b2 rL Hb1 + b2 rL
I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM HΠ - 2 thetaL Sin@2 thetaDMM,
I2 b2 Ibeta3 Π4 H1 + b2 rL3 theta - 16 Π Hb1 + b2 r H3 + b2 r H3 + b2 rLLL theta 4 beta3 HΠ + b2 Π rL3 theta2 + 16 Hb1 + b2 r H3 + b2 r H3 + b2 rLLL theta2 +
4 Π2 H1 + b2 rL3 I1 + beta3 theta3 MM Sin@2 thetaDM ‘
Ir H1 + b2 rL I2 b1 Ibeta3 Π4 H1 + b2 rL2 theta - 8 b2 Π r H3 + 2 b2 rL theta + 8 b2 r H3 + 2 b2 rL
theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 + 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
b2 r I3 beta3 Π4 H1 + b2 rL2 theta - 16 b2 Π r H4 + 3 b2 rL theta + 16 b2 r H4 + 3 b2 rL
theta2 - 12 beta3 Π3 Htheta + b2 r thetaL2 + 12 HΠ + b2 Π rL2 I1 + beta3 theta3 MM b2 r Ibeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@2 thetaD + H1 + b2 rL Hb1 + b2 rL
I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM HΠ - 2 thetaL Sin@2 thetaDMM=,
9I2 b2 r Sin@thetaD IIbeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@thetaD +
playground_wed_latex.nb
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@thetaD +
I- 16 b1 - 16 b2 r H2 + b2 rL + beta3 HΠ + b2 Π rL2 HΠ - 6 thetaLM
HΠ - 2 thetaL Sin@thetaDMM ‘
I2 b1 Ibeta3 Π4 H1 + b2 rL2 theta - 8 b2 Π r H3 + 2 b2 rL theta + 8 b2 r H3 + 2 b2 rL theta2 4 beta3 Π3 Htheta + b2 r thetaL2 + 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
b2 r I3 beta3 Π4 H1 + b2 rL2 theta - 16 b2 Π r H4 + 3 b2 rL theta + 16 b2 r H4 + 3 b2 rL theta2 12 beta3 Π3 Htheta + b2 r thetaL2 + 12 HΠ + b2 Π rL2 I1 + beta3 theta3 MM b2 r Ibeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@2 thetaD +
H1 + b2 rL Hb1 + b2 rL I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM
HΠ - 2 thetaL Sin@2 thetaDM,
I2 b1 I- beta3 Π4 H1 + b2 rL2 theta + 16 b2 Π r H2 + b2 rL theta - 16 b2 r H2 + b2 rL theta2 +
4 beta3 Π3 Htheta + b2 r thetaL2 - 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
4 b2 r I- beta3 Π4 H1 + b2 rL2 theta + 8 b2 Π r H3 + 2 b2 rL theta - 8 b2 r H3 + 2 b2 rL theta2 +
4 beta3 Π3 Htheta + b2 r thetaL2 - 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Ib1 I- 16 b2 r H2 + b2 rL + beta3 HΠ + b2 Π rL2 HΠ - 6 thetaLM + 2 b2 r
I- 8 b2 r H3 + 2 b2 rL + beta3 HΠ + b2 Π rL2 HΠ - 6 thetaLMM HΠ - 2 thetaL Sin@2 thetaDM ‘
Ir Ib2 r I- 3 beta3 Π4 H1 + b2 rL2 theta + 16 b2 Π r H4 + 3 b2 rL theta - 16 b2 r H4 + 3 b2 rL
theta2 + 12 beta3 Π3 Htheta + b2 r thetaL2 - 12 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
2 b1 I- beta3 Π4 H1 + b2 rL2 theta + 8 b2 Π r H3 + 2 b2 rL theta - 8 b2 r H3 + 2 b2 rL theta2 +
4 beta3 Π3 Htheta + b2 r thetaL2 - 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
b2 r Ibeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@2 thetaD - H1 + b2 rL Hb1 + b2 rL
I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM HΠ - 2 thetaL Sin@2 thetaDMM==,
99I2 b2 r Sin@thetaD IIbeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@thetaD + I- 16 b1 - 16 b2 r H2 + b2 rL +
beta3 HΠ + b2 Π rL2 HΠ - 6 thetaLM HΠ - 2 thetaL Sin@thetaDMM ‘
I2 b1 Ibeta3 Π4 H1 + b2 rL2 theta - 8 b2 Π r H3 + 2 b2 rL theta + 8 b2 r H3 + 2 b2 rL theta2 4 beta3 Π3 Htheta + b2 r thetaL2 + 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
b2 r I3 beta3 Π4 H1 + b2 rL2 theta - 16 b2 Π r H4 + 3 b2 rL theta + 16 b2 r H4 + 3 b2 rL theta2 12 beta3 Π3 Htheta + b2 r thetaL2 + 12 HΠ + b2 Π rL2 I1 + beta3 theta3 MM b2 r Ibeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@2 thetaD +
H1 + b2 rL Hb1 + b2 rL I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM
HΠ - 2 thetaL Sin@2 thetaDM,
I2 b1 I- beta3 Π4 H1 + b2 rL2 theta + 16 b2 Π r H2 + b2 rL theta - 16 b2 r H2 + b2 rL theta2 +
4 beta3 Π3 Htheta + b2 r thetaL2 - 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
4 b2 r I- beta3 Π4 H1 + b2 rL2 theta + 8 b2 Π r H3 + 2 b2 rL theta - 8 b2 r H3 + 2 b2 rL theta2 +
4 beta3 Π3 Htheta + b2 r thetaL2 - 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Ib1 I- 16 b2 r H2 + b2 rL + beta3 HΠ + b2 Π rL2 HΠ - 6 thetaLM + 2 b2 r
I- 8 b2 r H3 + 2 b2 rL + beta3 HΠ + b2 Π rL2 HΠ - 6 thetaLMM HΠ - 2 thetaL Sin@2 thetaDM ‘
Ir Ib2 r I- 3 beta3 Π4 H1 + b2 rL2 theta + 16 b2 Π r H4 + 3 b2 rL theta - 16 b2 r H4 + 3 b2 rL
theta2 + 12 beta3 Π3 Htheta + b2 r thetaL2 - 12 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
23
24
playground_wed_latex.nb
theta2 + 12 beta3 Π3 Htheta + b2 r thetaL2 - 12 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
2 b1 I- beta3 Π4 H1 + b2 rL2 theta + 8 b2 Π r H3 + 2 b2 rL theta - 8 b2 r H3 + 2 b2 rL theta2 +
4 beta3 Π3 Htheta + b2 r thetaL2 - 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
b2 r Ibeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@2 thetaD - H1 + b2 rL Hb1 + b2 rL
I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM HΠ - 2 thetaL Sin@2 thetaDMM=,
9Ir H1 + b2 rL Hb1 + b2 rL I- 32 b2 Π r theta + 2 beta3 Π4 H1 + b2 rL theta + 32 b2 r I- 1 + theta2 M 8 beta3 Π3 H1 + b2 rL I- 1 + theta2 M + 8 Π2 H1 + b2 rL I1 + beta3 theta I- 3 + theta2 MM 8 I- 4 b2 r + beta3 Π2 H1 + b2 rL HΠ - 3 thetaLM Cos@2 thetaD I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM HΠ - 2 thetaL Sin@2 thetaDMM ‘
Ib2 r I- 3 beta3 Π4 H1 + b2 rL2 theta + 16 b2 Π r H4 + 3 b2 rL theta - 16 b2 r H4 + 3 b2 rL theta2 +
12 beta3 Π3 Htheta + b2 r thetaL2 - 12 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
2 b1 I- beta3 Π4 H1 + b2 rL2 theta + 8 b2 Π r H3 + 2 b2 rL theta - 8 b2 r H3 + 2 b2 rL theta2 +
4 beta3 Π3 Htheta + b2 r thetaL2 - 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
b2 r Ibeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@2 thetaD H1 + b2 rL Hb1 + b2 rL I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM
HΠ - 2 thetaL Sin@2 thetaDM,
I2 Cos@thetaD I2 H1 + b2 rL Hb1 + b2 rL I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM
HΠ - 2 thetaL Cos@thetaD +
I8 b1 I- beta3 HΠ + b2 Π rL2 HΠ - 3 thetaL + 2 b2 r I2 + 2 b2 r - Π theta + theta2 MM +
b2 r Ibeta3 Π4 H1 + b2 rL2 theta - 16 b2 Π r H2 + b2 rL theta 4 beta3 Π3 H1 + b2 rL2 I2 + theta2 M + 16 b2 r I2 I1 + theta2 M + b2 r I2 + theta2 MM +
4 HΠ + b2 Π rL2 I1 + beta3 theta I6 + theta2 MMMM Sin@thetaDMM ‘
I2 b1 Ibeta3 Π4 H1 + b2 rL2 theta - 8 b2 Π r H3 + 2 b2 rL theta + 8 b2 r H3 + 2 b2 rL theta2 4 beta3 Π3 Htheta + b2 r thetaL2 + 4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM +
b2 r I3 beta3 Π4 H1 + b2 rL2 theta - 16 b2 Π r H4 + 3 b2 rL theta + 16 b2 r H4 + 3 b2 rL theta2 12 beta3 Π3 Htheta + b2 r thetaL2 + 12 HΠ + b2 Π rL2 I1 + beta3 theta3 MM b2 r Ibeta3 Π4 H1 + b2 rL2 theta - 16 Π Hb1 + b2 r H2 + b2 rLL theta +
16 Hb1 + b2 r H2 + b2 rLL theta2 - 4 beta3 Π3 Htheta + b2 r thetaL2 +
4 HΠ + b2 Π rL2 I1 + beta3 theta3 MM Cos@2 thetaD +
H1 + b2 rL Hb1 + b2 rL I- 16 b2 r + beta3 Π2 H1 + b2 rL HΠ - 6 thetaLM
HΠ - 2 thetaL Sin@2 thetaDM===
Spatial Part of Continuity Equation
Ÿ 2D Divergence
Ÿ Divergence - Spacial Part of Continuity Eqaution
Sum@d@iD@Sqrt@gD * Hrho * Hu@iD - xdot@iDLLD, 8i, 8r, theta<<D
playground_wed_latex.nb
A very large output was generated. Here is a sample of it:
d@rDArho - J
4 b1
b22
b12 r2 Cos@thetaD4
H1+b2 rL2
r4
Cos@thetaD4
H1+b2 rL2
+
+
2 b1 b2 r3 Cos@thetaD4
b12
H1+b2 rL2
b22
r4
Cos@thetaD4
H1+b2 rL2
117 b12 b28 beta34 Π4 r10 theta10 Sin@thetaD4
d@thetaDArho
b12 r2 †1‡4
H1+†1‡L2
H1+b2 rL2
b28
648 b1
+ †13 021‡ +
+
b22 r4 Cos@thetaD4
H1+b2 rL2
beta34
Π4
H1+b2 rL2 HΠ+b2 Π rL4
H1+b2 rL2 HΠ+b2 Π rL4
+ †13 030‡ +
36 †5‡ †1‡
†1‡2 †1‡
r10
theta10
+
Sin@thetaD4
H1+b2 rL2 HΠ+b2 Π rL4
36 b210 beta34 Π4 r12 theta10 Sin@thetaD4
+
H1+b2 rL2 HΠ+b2 Π rL4
2 b12 b2 r3 Cos@thetaD4
216 b29 beta34 Π4 r11 theta10 Sin@thetaD4
+
H1+b2 rL2 HΠ+b2 Π rL4
108 b1 b29 beta34 Π4 r11 theta10 Sin@thetaD4
+
+
N Hu@rD - xdot@rDLE +
Hu@thetaD - xdot@thetaDLE
Show Less Show More Show Full Output Set Size Limit...
Ÿ Divergence in Polar Coordinates in Conservative, Axisymmetric Formulation
Sum@d@iD@Sqrt@gD * Hrho * Hu@iD - xdot@iDLLD, 8i, 8r, theta<<D .
8Sin@thetaD ® Sqrt@1 - mu ^ 2D, d@thetaD ® - Sqrt@1 - mu ^ 2D d@muD,
Csc@thetaD ® 1  Sqrt@1 - mu ^ 2D, Cos@thetaD ® mu<
A very large output was generated. Here is a sample of it:
J-
1 - mu2 d@muDNA
rho - -
b14 beta3 mu I1-mu2 M32 Π2 r2
b14 mu2 I1-mu2 M r2
-
H1+b2 rL6
6 b14 b2 mu2 I1-mu2 M r3
H1+b2 rL6
+ †13 017‡ +
12 b1
beta34
mu2
I1-mu2 M
Π4
r11
H1+b2 rL2 HΠ+b2 Π rL4
6 b13 b2 mu2 I1-mu2 M r3
-
H1+b2 rL6
-
+
H1+b2 rL2 HΠ+b2 Π rL4
24 b29 beta34 mu2 I1-mu2 M Π4 r11 theta12
+
H1+b2 rL2 HΠ+b2 Π rL4
16 H1+b2 rL6
72 b1 b28 beta34 mu2 I1-mu2 M Π4 r10 theta12
13 b12 b28 beta34 mu2 I1-mu2 M Π4 r10 theta12
b29
b14 beta32 I1-mu2 M2 Π4 r2
-
2 H1+b2 rL6
theta12
+
H1+b2 rL2 HΠ+b2 Π rL4
4
b210
+
Hu@thetaD - xdot@thetaDLE + d@rDArho
beta34
mu2
I1-mu2 M
Π4
r12
theta12
H1+b2 rL2 HΠ+b2 Π rL4
†13 030‡ +
4 †7‡
†1‡2 †1‡
+
Hu@rD - xdot@rDLE
Show Less Show More Show Full Output Set Size Limit...
25
26
playground_wed_latex.nb
Ÿ Continuity Equation
d@tD@Sqrt@gD * rhoD + Sum@d@iD@Sqrt@gD * Hrho * Hu@iD - xdot@iDLLD, 8i, 8r, theta<<D .
8Sin@thetaD ® Sqrt@1 - mu ^ 2D, d@thetaD ® - Sqrt@1 - mu ^ 2D d@muD,
Csc@thetaD ® 1  Sqrt@1 - mu ^ 2D, Cos@thetaD ® mu<  Simplify
A very large output was generated. Here is a sample of it:
r2 J-b12 H†1‡L+2 b1 b2 r H†1‡L+b22 r2 H†1‡LN
rho
J-
-
Hu@thetaD-xdot@thetaDL
H1+b2 rL4
1 - mu2 d@muDNA
E+
4 Π2
r2 J-b12 H†1‡L+2 b1 b2 r J-4 beta32 Π7 H†1‡L4 theta H†1‡L+†11‡N+b22 r2 H†1‡LN
rho
-
E+
4 Π2
r2 -b12 -beta32 Π8 H1+b2 rL4 -mu2 +mu4 -2 mu
rho
d@tDA
Hu@rD-xdot@rDL
H1+b2 rL4
d@rDA
1-mu2 theta-theta2 -8 †4‡ J†4‡+†5‡2 N+†11‡ +2 †4‡+b22 r2 H†1‡L
H1+b2 rL4
4 Π2
Show Less Show More Show Full Output Set Size Limit...
E