You are on page 1of 153

Theoretical Analysis of the

Vibrational Dynamics of Neutron


Star Interiors
by
Jonathan M. Hartman
Dissertation
submitted in fullment of the requirements for the degree
Master of Science
in
Physics
in the
Faculty of Science,
University of Johannesburg
Supervisor: Dr C.A. Engelbrecht
Co-Supervisor: Dr F.A.M. Frescura
Co-Supervisor: Prof. C.M. Villet
May 2009
ABSTRACT
Just as the observations of oscillations of ordinary stars can be used to determine
their composition and structure, the oscillations of neutron stars could potentially be
used to determine the nature of the dense nuclear matter from which they are made.
The superuidity of the interiors of neutron stars is normally probed by observations
of pulsar glitches. It turns out that the superuidity aects the oscillations in a
neutron star core. In particular, it results in a class of oscillation modes specically
associated with the superuid core. Although these modes have not been detected
from observations, it is hoped by some that gravitational wave data may be used
to probe the superuidity of neutron star cores. In this dissertation, a simple
equilibrium model is used in order to calculate the superuid modes in the context
of newtonian gravity. The equilibrium model that is used is the same combination
of the Serot equation of state and the Harrison-Wheeler equation of state that was
used formerly by Lee and by Lindblom & Mendell. Numerical calculations of the
superuid modes are done for 20 dierent neutron star models ranging in mass
between 0.5 and 2 solar masses. The frequencies of the oscillations for the 0.5 and
1.4 solar masses agree fairly well with Lees results, which strongly validates the
computer code written for numerical calculation in this work. In all the models, the
eigenfrequencies of the superuid or s-modes are found among those of the f and
p-modes. For the equation of state that is used, it is shown that the dimensionless
frequencies of the p-modes increase with an increase in mass of the neutron star
while those of the s-modes decrease with an increase in neutron star mass.
The plan of the dissertation is as follows. Chapter 1 gives a short introduction
to stellar oscillations and mentions the oscillations of neutron stars. Chapters 2
and 3 provide the general theoretical background of stellar structure and stellar
oscillations respectively. Chapter 4 is a review of the equations of state of neutron
star matter derived previously in the literature. Chapter 5 provides the method of
calculation as well as the results. Chapter 6 provides a discussion of the results.
Chapter 7 briey gives a review of a mathematical framework for uids that could
be used in order to calculate the oscillations in a general relativistic context and
then briey describes the eects of rotation and magnetic elds. Appendix B lists
the source code for the programs used to do the calculations and also explains some
of the extra numerical procedures used for the computation.
Acknowledgements
I wish to dedicate my dissertation to four very special people.
Judy Symons, former principal of Grantley College, where I matriculated in
1999 and Prof Roux Botha, Prof Dirk van Reenen and the late Mrs Elize Albertyn
of RAU now known as UJ. Your faith in me has enabled me to fulll my dream
of becoming a physicist. I will be eternally grateful to you all for those wonderful
opportunities.
To my supervisor, Chris Engelbrecht, Thank you for your patience and dedi-
cation and for sharing your incredible knowledge with me, yet still allowing me to
discover things for myself.
To my co-supervisors Fabio Frescura and Prof Charles Villet, Your help and
guidance was invaluable.
To Yoric Hardy, Justin Prentice and Thebe Mdupe, Thanks for your support
when I needed it.
To Prof Kinta Burger and sta in the Faculty of Science, especially Naomi
Strydom, Karien van den Berg and Ferdi van der Walt, What would my Mom and
I have done without you? Thanks a million.
To Prof Andre Strydom and the sta in the Department of Physics, Weve
been together for so long, you guys are like family. Your encouragement has meant
so much to me.
To Anlia Pretorius, Dr Paul de Wet and Brinton Spies, Im most grateful for
your guidance along my life path.
To the National Research Foundation, Im grateful for the bursaries you granted,
for both my Honours and Masters degrees. They have enabled me to continue with
my studies and become more independent as a student at UJ.
To Autism South Africa for their ongoing initiative in informing the general
public about Autism, and in my case, Asperger Syndrome, I hope Ive helped in
breaking the mould!.
I am saddened that my grandparents, who always believed that I could achieve
anything that I put my mind to, are no longer here to enjoy this achievement with
me.
Finally, and most importantly, Im indebted to my parents, Gerrit and Lorraine,
my sister Jaclyn and our extended family and special friends for their unconditional
love and daily encouragement. Mom, you taught me the freedom, as you always
put it, to y with the angels ... and dance with the stars. Thank you to you all!.
The Cosmic religious experience is the strongest and noblest driving force behind
scientic research - Albert Einstein, quoted in his obituary, 19 April 1955.
3
CONTENTS
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. An overview of stellar structure . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 Fluid Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Hydrostatic equilibrium and polytropic equations of state . . . . . . 7
3. Theoretical background of stellar oscillations . . . . . . . . . . . . . . . . 11
3.1 Linear theory of stellar oscillations . . . . . . . . . . . . . . . . . . . 11
3.2 Spherical Harmonics . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3 Adiabatic case and boundary conditions . . . . . . . . . . . . . . . . 17
3.4 Forms of oscillation equations used for calculation of models . . . . . 19
3.5 Numerical calculation of oscillation models . . . . . . . . . . . . . . 21
4. Dense nuclear matter inside neutron stars . . . . . . . . . . . . . . . . . . 25
4.1 Review of equations of state of neutron star matter . . . . . . . . . . 25
4.2 Oscillations in neutron stars . . . . . . . . . . . . . . . . . . . . . . . 30
5. Oscillations in the cores of superuid neutron stars . . . . . . . . . . . . . 34
5.1 Equilibrium model and equation of state . . . . . . . . . . . . . . . . 34
5.2 Oscillations in spherically symmetric superuid neutron stars . . . . 39
5.3 Form of superuid oscillation equations used for numerical calculation 42
5.4 Results of the oscillation calculations . . . . . . . . . . . . . . . . . . 48
6. Results and Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
7. Conclusions and plans for the future . . . . . . . . . . . . . . . . . . . . . 67
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Appendix 75
A. Derivation of Spherical Harmonics . . . . . . . . . . . . . . . . . . . . . . 76
B. Computer Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
B.1 Matlab/Octave programme that calculates the Lane Emden func-
tions for the polytrope . . . . . . . . . . . . . . . . . . . . . . . . . . 79
B.2 Matlab/Octave programme that implements the nite-dierence scheme
for the oscillations in the polytrope model . . . . . . . . . . . . . . . 81
B.3 Matlab/Octave programme used for calculating the oscillations in
the polytrope model . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
B.4 C++ programme used for calculating equilibrium models . . . . . . 83
B.5 Programme for adding neutron and proton densities to MAT le . . 101
B.6 C++ programme for neutron star oscillations . . . . . . . . . . . . . 116
B.7 Matlab/Octave programme used to calculate neutron star oscillations 146
1. INTRODUCTION
This chapter is a short introduction which briey describes stellar oscillations before
mentioning the oscillations of neutron stars.
In general, observations of stellar oscillations can be be used to determine the
composition of the matter making up stars. Theoretically, stellar oscillations are
modeled in the language of uid mechanics since stars in general are made up of gas
and/or plasma. For calculations of basic stellar structure, hydrostatic equilibrium
is assumed, in other words the force due to gas pressure as well as radiation pressure
balances with gravity. When there is no rotation, the star would assume a perfect
spherical shape. However, when there is rotation, the centrifugal force due to the
rotation distorts the spherical shape by creating a bulge at the equator. In the case
of multiple star systems, when a star has a massive nearby companion, then the
shape may be further distorted by tidal forces.
When the stellar oscillations are small, they may be taken into account as small
perturbations on the equilibrium conguration and this gives rise to the linear theory
of oscillations. The oscillations are modeled as waves propagating through the uid.
When the oscillations are radial, they propagate in the radial directions, in other
words they propagate from the centre outwards to the surface and the star would
appear to expand and contract while maintaining its shape. When the oscillations
are nonradial the waves propagate in the angular directions or along meridional
and/or azimuthal directions in the star and so the shape of the star gets distorted
due to the propagating waves. Imagine a wave that propagates in the angular
directions of the star, and say it starts at one point. It will eventually return
to that point if it moves right around the star. When thinking about nonradial
oscillations in that way, it is easy to understand that only an integral number of
waves can appear in the angular directions, otherwise destructive interference will
prevail. In the case of spherical symmetry (i.e. when the star is non-rotating), this
discrete set of wave modes that can propagate around a sphere is described by the
set of mathematical functions called the spherical harmonics (described in chapter
3).
In non-rotating stars, there are in general three kinds of oscillations. They are
called f-modes, g-modes and p-modes. If we consider a single uid element in the
star and imagine that this uid element moves due to a buoyant force, the gravity
will restore it to the original position and so it acts as a restoring force. This
movement is then responsible for creating oscillations in the star, which are called
the g-modes (the g stands for gravity waves). Pressure modes or p-modes are driven
by uctuations of the pressure. The f-modes or fundamental modes are just surface
gravity waves. In any particular spectrum of modes for a given value of l (for the
meaning of l, see the section on spherical harmonics in chapter 3), there is only
one f-mode and its frequency lies between those of the g
1
-mode and the p
1
-mode.
When the eects of rotation are taken into account, the star in the equilibrium
state is no longer spherical and Coriolis forces, due to the rotation acting on the
uid, result in the r-modes. The r-modes will not be discussed in this dissertation
because rotation is not considered in the models described in this thesis.
Because the behavior of the waves propagating through the gas is dependent
on the material that makes it up, stellar oscillations can be used to determine the
composition of matter in the star.
The structure of a neutron star consists of a solid crust, inner core and outer core.
The solid crust in the neutron star is made up of a metallic lattice. The outer core
consists of free neutrons in a superuid state with a small admixture of electrons
and protons in a superconducting state. The inner core may consist of deconned
quarks. Although the crust is solid, oscillations can occur in the superuid core of
neutron stars. If the oscillations in neutron star cores are detected, they might be
used to deduce the composition of the dense nuclear matter that makes up the cores,
just as observations of the oscillations in ordinary stars are used to determine their
composition. It was rst suggested by Epstein (1988) [24] that the superuidity
in neutron stars leads to a further class of modes. Mendell (1991) [51] developed
the adiabatic oscillation equations for the superuid core of neutron stars and then
Lindblom and Mendell (1994) [46] used these equations to calculate the eects
of superuidity on the neutron star oscillations, both with and without rotation.
Lindblom and Mendell found the oscillation modes associated with the superuid
core (now called the superuid modes and which they called s-modes) analytically
in a simplied model but not in their numerical analysis. Lee (1995) [44] found
the superuid modes amongst the f-modes and p-modes in his numerical analysis,
using the same equilibrium model as Lindblom and Mendell (1994) [46] but called
them -modes.
Observations of the superuid modes associated with the superuid cores of
neutron stars have not been made thus far, so the superuid properties of neutron
star interiors have been probed mainly by the observations of pulsar glitches [47] ,
[41]. So far, all the papers dealing with observations of neutron star oscillations in
the literature, such as in X-ray bursters, refer to observations in accreting matter
and conned to the surface (eg. McDermott and Taam [50]) but there is no record
of observed oscillations in the interior of neutron stars. The 424 ms period reported
by Zavlin et al (2000) [67] does not correspond to the oscillations calculated in this
dissertation since the longest calculated period is only 136 s. The interperetation
by Zavlin et al that the 424 ms period is due to rotation is therefore probably
correct. However, the periods calculated here could be dierent for a more realistic
equation of state and may be rened when rotation and electromagnetic elds are
taken into account. Most current telescopes dont have the time resolution to see
periods in the order of micro-seconds but MeerKAT and the SKA might be able to
detect more neutron stars than the the ones currently known and interior oscillations
might eventually be detected.
The oscillations of neutron star interiors have also been calculated in the context
of general relativity [7], [21], [9], [40]. It is hoped that gravitational wave data may
provide a probe into neutron star superuidity [6], [19].
This thesis describes the pulsational behaviour of a simplied two-component
model of a neutron star across a broad range of neutron star masses. Where the
results overlap with those published by Lindblom and Mendell, and Lee respectively,
good agreement is found with their results. However, the results described here also
demonstrate the eect of neutron star mass on the pulsational behaviour. The aim
of this work was also to develop numerical tools that can be used for further studies
of neutron stars.
3
2. AN OVERVIEW OF STELLAR STRUCTURE
This chapter gives an overview of stellar structure described in the language of uid
dynamics.
In general, stars can be thought of as balls of gas which are held together by
gravity, which is opposed by forces due to gas pressure and radiation pressure to keep
them from collapsing. The interior of a star can be divided into an inner core and
an outer envelope. In the interior, as we increase the depth from the surface of the
star, gravity acts more strongly on the gas molecules which as a result become more
energetic and so the temperature increases. When we get to the core, the ionised
atoms are so energetic that the nuclei fuse together forming heavier elements and
releasing radiation (a radiation pressure gradient is also one of the forces opposing
gravity). In a star with a similar mass to our sun, hydrogen nuclei will fuse together
to form helium. When the hydrogen is used up, the core of the star will initially
collapse while the temperature rises. Since helium has a higher ignition temperature
than hydrogen, this collapse continues until the temperature is high enough for the
helium nuclei to fuse together to form carbon. Eventually the helium will be used
up as well. When this happens, the core collapse of our low mass star continues
until it is stopped by electron degeneracy pressure at which point it becomes a
white dwarf. Paulis exclusion principle states that there can only be one fermion
per energy state. At densities as high as those in white dwarf matter, every energy
state from the ground state upward is occupied by an electron and so due to Paulis
exclusion principle electrons cannot fall into lower energy states. The result of this
is that the electrons will be extremely energetic, producing a pressure strong enough
to oppose gravity. In stars that are initially much more massive than our sun, the
core collapse after the helium is used up may raise the temperature high enough
to allow the fusion of carbon into heavier elements. The heaviest element that can
be formed in these more massive stars is iron. When most of the matter in the
cores these heavy stars is fused into iron then the core will continue to collapse and
this time electron degenracy pressure will not be strong enough to oppose it. The
collapse will then force inverse beta decay between the electrons and protons in the
nucleus to form neutrons. Neutron degeneracy pressure is stronger than electron
degeneracy pressure and this may be strong enough to oppose the gravitational
collapse thus resulting in a neutron star. If the star exceeds the mass limit of a
neutron star it will collapse to a black hole unless the hypothesis of quark stars
proves correct. As yet no convincing evidence of the latter has been found.
2.1 Fluid Dynamics
Since stars are considered to be made up of gas, uid dynamics would be the
appropriate language to describe them on scales much larger than the mean free
path of the constituent molecules. This section is concerned with setting up the
basic equations of uid dynamics describing the conservation of mass, momentum
and energy in uids. Hydrodynamics is concerned with the motion of uids on a
macroscopic scale. As such the uid is described as a continuous medium, so when
speaking of a uid particle what is meant is not an individual atom or molecule
Fig. 2.1: Volume within a body of uid; the mass owing out of the closed surface is equal
to the decrease in mass inside the volume
but an innitesimal volume in the medium. In order to reconcile the fact that
real uids are made up of atoms or molecules, this innitesimal volume can be
thought of as being large with respect to the size of individual molecules, in fact
containing many molecules, even though it is small with respect to the total volume
of the uid, (Landau and Lifshitz [39]). The equation of continuity which describes
the conservation of mass in uid dynamics can be argued for as follows. Within
a body of uid, consider a closed surface containing a volume V
0
of the uid, as
shown in gure 2.1. The mass of this volume is
_
dV where is the density of
the uid. For mass to be conserved, the net mass of the uid owing out through
the closed surface must be equal to the decrease in mass inside it. If the magnitude
of the vector d

f is taken as an area element of this surface while pointing along


the outward normal then the mass of uid owing through this volume element is
v d

f. So by conservation of mass;

d
dt
_
dV =
_
S
v d

f. (2.1)
Where S is the total surface area containing the volume. By the divergence theorem
_
S
v d

f =
_

(v)dV , therefore

t
+

(v) = 0. (2.2)
The above equation is called the equation of continuity. If we again consider some
innitesimal volume of uid and take p to be the uid pressure acting on the surface
bounding the volume, then the total force acting on the volume of uid is
_
S
pd

f.
Remembering that
_
dV is the mass of the volume then by Newtons second law
of motion we have

_
S
pd

f =
_

dv
dt
dV. (2.3)
By applying an extension of the divergence theorem to the
_
pd

f term to get it
as a volume integral and then equating the integrands, (2.3) can be rewritten as

dv
dt
=

p. (2.4)
The
dv
dt
term describes the rate of change of the velocity of a given uid particle
as it moves from a position r to a position

r

in space in an innitesimal time dt.


However, given the continuum assumption, the space is lled with a material whose
velocity eld also changes in time. So to write this in terms of rate of change in
5
uid velocity at given points in space, notice that the uid particle changes position
by an innitesimal amount dr = r

r in the time dt, so the change in velocity of


the uid particle dv when it reaches the position r

is equal to the dierence in uid


velocity in the velocity eld over the distance dr , ie dx
v
x
+dy
v
y
+dz
v
z
= (dr

)v,
plus the change in uid velocity at position

r

in time dt,
v
t
dt, thus
dv =
v
t
dt +
_
dr

_
v (2.5)
or by dividing both sides by the innitesimal value dt
dv
dt
=
v
t
+
_
v

_
v. (2.6)
We get Eulers equation by substituting (2.6) into (2.4)
v
t
+
_
v

_
v =
1

p. (2.7)
Eulers equation here is derived for ideal uids, i.e. no viscosity. To take account
of viscosity, the more general Navier-Stokes equation is used:

_
v
t
+
_
v

_
v
_
=

f

p +

, (2.8)
where

is the viscous stress tensor. The term

f is added to take account of


external forces.
In ideal uids, the conservation of energy is expressed as

t
_
1
2
v
2
+
_
=

_
v
_
1
2
v
2
+w
__
, (2.9)
The left hand side is the decrease in energy per unit volume, where is the internal
energy per unit mass, and the right hand side is the energy ux through the surface
bounding the volume, where w is the specic enthalpy. When there is viscosity,
there is also an energy ux resulting from internal friction given by v

. If the
temperature is not constant throughout the uid, there will be heat transfer from
regions of higher temperature to regions of lower temperature. In this case, there
is an added term describing thermal conduction: K

T, where K is the thermal


conductivity. For viscous uids with a temperature gradient, (2.9) can be expressed
more generally as

t
_
1
2
v
2
+
_
=

_
v
_
1
2
v
2
+w
_
v

T
_
. (2.10)
Expanding the left hand side of equation (2.10) gives

t
_
1
2
v
2
+
_
=
1
2
v
2

t
+v
v
t
+

t
+

t
(2.11)
Then using the continuity equation (2.2) and the Navier-Stokes equation (2.8) to
substitute for

t
and
v
t
respectively, we have

t
_
1
2
v
2
+
_
=
1
2
v
2

(v) v

_
1
2
v
2
_
v

p+v
i

ik
x
k
+

(v),
(2.12)
6
where the Einstein summation convention is used in the term v
i

ik
x
k
i.e. sum over
repeated indices. From thermodynamics, a small change in energy, d, is given by
d = Tds +
_
p

2
_
d, (2.13)
so

t
= T
s
t
+
p

t
, (2.14)
or from (2.2),

t
= T
s
t

p

(v). (2.15)
Note that the specic enthalpy w is given by
w = +
p

(2.16)
so that
dw = d +
1

dp
p

2
d (2.17)
or by substituting equation 2.13 for d into 2.17 we get
dw = Tds +
dp

. (2.18)
we also note that

p =

w T

s (2.19)
and that
v
i

ik
x
k
=

(v

ik
v
i
x
k
. (2.20)
Substituting the three relations (2.18), (2.19) and (2.20) plus equation (2.15) into
(2.12), and adding and subtracting

_
K

T
_
on the right hand side, we get

t
(
1
2
v
2
+) =

_
v
_
1
2
v
2
+w
_
v

T
_
+T
_
s
t
+v

s
_

ik
v
i
x
k

_
K

T
_
.
(2.21)
Substituting (2.21) into (2.10) and rearranging the equation, we arrive at a dierent
form for the expression for conservation of energy
T
_
s
t
+v

s
_
=

ik
v
i
x
k
+

(K

T). (2.22)
2.2 Hydrostatic equilibrium and polytropic equations of state
For a star in hydrostatic equilibrium, gravity, which pulls the gas inward toward the
center, is counteracted by the gas pressure plus radiation pressure acting outward
from the center. Other forces can be neglected except under some circumstances,
for example when electromagnetic phenomena need to be considered. A description
of the star in hydrostatic equilibrium is necessary before the pulsations of a star
can be described. We follow the treatment of Chandrasekhar [18], chapter 3, in
discussing the equilibrium conditions.
In stars, viscosity is generally small, so the viscosity terms in the uid equations
(2.8) and (2.22) can be neglected. In hydrostatic equilibrium, there is no motion in
7
the uid, so the velocity and time derivative terms in these equations can be set to
zero. The Navier-Stokes equation (2.8) then becomes

= 0. (2.23)
In the energy conservation equation, while the heat generation from internal friction
due to viscosity is small and can be neglected, there is also a term due to generation
of nuclear energy through nuclear fusion in the core. So for the energy conservation


F = 0, (2.24)
where

F in this case is the ux of radiation

F = K

T, (2.25)
where the radiative conductivity K is given by
K =
4ac

3
T
3
(2.26)
with a being the radiation constant, c

is the speed of light and is the opacity.


The gravitational potential is given by the Poisson equation

2
= 4G. (2.27)
If there is no rotation, then the equilibrium conguration is spherically symmetric.
If the spherical symmetry is taken into account and noting that the gravitational
acceleration is
g =

=
GM
r
r
2
r, (2.28)
where M
r
is the mass at a given radius, then in spherical coordinates equation
(2.23) is written as
dp
dr
=
GM
r
r
2
. (2.29)
A spherical distribution of matter is described by
dM
r
dr
= 4r
2
. (2.30)
Equation (2.24) gives the rate of change of the radiative luminosity L
r
= 4r
2
F
with respect to radius in spherical coordinates:
dL
r
dr
= 4r
2

N
, (2.31)
and the rate of change in temperature would be given by the equation
dT
dr
=
3
4ac

1
T
3
L
r
4r
2
. (2.32)
The equation of equilibrium is arrived at by combining (2.29) and (2.30),
1
r
2
d
dr
_
r
2

dp
dr
_
= 4G. (2.33)
In order to get the complete description, an equation of state is required in order to
get a relation between the pressure p and the density . For ideal gasses, we assume
the ideal gas law pV = NkT. An adiabatic change of state is a quasi-static change
in which there is no heat transferred to or from the uid, so changes in temperature
8
are due to changes in pressure of the gas. For an adiabatic change pV

= constant,
where the adiabatic index is given by the ratio of the specic heats =
cp
c
V
. If we
dene the specic heat when the parameter is constant as c =
_
dQ
dT
_

, then we
have c = 0 when dQ = 0 (the adiabatic case), c when dT = 0 (the isothermal
case), c = c
p
when the pressure remains constant and c = c
V
when the volume
remains constant. For a polytropic change pV

= constant, where
=
c
p
c
c
v
c
. (2.34)
An adiabatic change then is the specic case of a polytropic change with c = 0.
Noting that =
m
V
with m being the mass, we have for a polytrope:
p = C
n+1
n
, (2.35)
where n is the polytropic index with =
n+1
n
and C is a constant. If we consider
a star consisting of an ideal gas, with gravity opposed by the gas pressure then
the pressure would increase toward the core and decrease outward along the radius.
Then, if the gas expands adiabatically it would obey the relation (2.35). In order
to write equation (2.33) in terms of dimensionless quantities, consider
=
n
(2.36)
where is the central density when considering a complete polytrope, ie the relation
(2.33) with the same polytropic index holds throughout the star. The pressure is
then given by
p = C
1+
1
n

n+1
. (2.37)
Also consider
r =
_
(n + 1)C
4G

1
n
1
_1
2
. (2.38)
When the equilibrium equation (2.33) is rewritten in terms of the new variables, we
get the Lane-Emden equation
1

2
d
d
_

2
d
d
_
=
n
(2.39)
with index n and the boundary conditions
= 1,
d
d
= 0 (2.40)
at = 0. The Lane-Emden equation can only be solved analytically for three
values of n, namely for indices 0, 1 and 5. For any other polytropic index, the
Lane-Emden equation has to be solved numerically. Seven-digit tables of calculated
solutions to the Lane-Emden equation are given in a 1986 paper by G. P Horedt
[31]. To solve the Lane-Emden equation, start with a series expansion near the
origin. For the series to satisfy the boundary conditions, there can only be terms
of even powers of in order for
d
d
to vanish at the origin. So then assume a series
solution = 1 +

m=1
c
m

2m
, and substitute this into the Lane-Emden equation
(2.39) and equate the like powers of to calculate the coecients. The resulting
series should give accurate values of for < 1 with enough terms. To calculate the
solution for the entire star, including > 1, use the value calculated from the series
at a close to the origin as the initial condition and then use another numerical
technique such as the Runge-Kutta method to nd the rest of the solution. The
solution to the Lane-Emden equation of index 3 is given in gure (2.2).
9
Fig. 2.2: Solution to the Lane-Emden equation index 3. This was calculated with the
Matlab code in section B.1 in appendix B
10
3. THEORETICAL BACKGROUND OF STELLAR
OSCILLATIONS
This chapter gives a general background of stellar oscillations.
The theory of stellar oscillations was originally developed to explain the be-
haviour of variable stars, i.e. stars that appear to change their brightness periodi-
cally. This is caused by the star periodically expanding and contracting due to waves
in the gas or uid making up the star. Pulsations in a star are radial if the per-
turbations only occur along the radius of the star, in other words the star expands
and contracts without altering its spherical shape; whereas non-radial oscillations
occur along the surface as well and so parts of the star contract while other parts
expand in the angular directions. Actually radial oscillations are a special case of
the non-radial oscillations as will be explained later on in this chapter. While os-
cillations were originally used to explain variable stars, it was later discovered that
they occur in other stars that were considered non-pulsating. Actually all stars are
variable to some degree, but the variability is not as great in some as in others.
Since the pulsations are greatest in the variable stars, they were rst discovered in
them. Since the behaviour of the oscillations depend on the material that make up
the star, an analysis of the oscillations can help determine the stars composition
and internal structure in a similar sense that an analysis of the waves in the Earth
caused by tremors and earthquakes can help determine the internal structure of the
Earth. This subeld of astrophysics is called asteroseismology (helioseismology in
the specic case of the sun). Although they have a solid surface, neutron stars have
a superuid in the core which theoretically can also oscillate and although these
neutron star oscillations have not been observed as yet, they could give insight into
the structure of the nuclear matter that make them up. So far, the interiors of
neutron stars have usually been determined by studying a phenomenon known as
glitching where the rotation of the star suddenly speeds up. Oscillations of neutron
stars will be the main subject of later chapters but this chapter will be about the
general theoretical background of stellar oscillations as a whole. The best descrip-
tion of stellar oscillations is in Ledoux and Walraven [43]. Alternative descriptions
are in Unno et al [63] and Cox [22].
3.1 Linear theory of stellar oscillations
Since, in general, stars are considered uids in hydrostatic equilibrium, the best
way to describe their oscillations is by the use of uid dynamics. More specically,
the oscillations are described by waves in the uid. To do this we take the equa-
tions of stellar equilibrium derived in the previous chapter and superimpose small
perturbations for each quantity. These perturbations, given a physical quantity f,
can be expressed in Eulerian or Lagrangian form. The Eulerian form describes the
perturbation of the uid at a given position (remember that the uid is regarded
as a continuum) and denoted with a prime,
f(r, t) = f
0
(r) +f

(r, t), (3.1)


while the Lagrangian form describes the perturbation of a given uid particle, i.e.
an innitesimal volume in the uid, and is denoted by ,
f(r, t) = f
0
(r) +f(r, t). (3.2)
In order to relate these two forms, note that a uid particle moves from a position
r
0
to r in the time t due to the perturbation. Since the Eulerian perturbation is
dened as the perturbation of the uid at a given position, it gives the change in
the quantity f in time t at a xed position r, but the Lagrangian perturbation,
since it describes the change in f of a uid particle, must also take into account the
dierence in f over the displacement

r r
0
at the instant t
0
= 0. The relation
between the Lagrangian and Eulerian forms are then,
f(r, t) = f

(r, t) +



f
0
(r). (3.3)
In the previous chapter, the equation (2.5) describes the relationship between the
Lagrangian and Eulerian forms of the time variations of the uid velocity, but the
same reasoning that led to this relationship will work for any physical quantity, thus
for time derivatives,
d
dt
=

t
+v

. (3.4)
In the linear theory of oscillations, the equations are then derived by replacing every
physical quantity f in the equilibrium equations from chapter 2 with f +f

, where
the f

represents the perturbation. The perturbations are considered small enough


that the multiplication of two perturbations such as f

is considered negligible and


ignored. In the equations that follow, a subscript 0 is used to indicate a quantity
in equilibrium.
Remembering that there is no motion in the equilibrium conguration in the
current assumptions, the perturbed form of the equation of continuity (2.2) becomes,

t
+

(
0
v) = 0, (3.5)
the perturbed form of the Euler equation (2.7) becomes,

0
v
t
+

p

+
0

0
= 0, (3.6)
and the perturbed form of the conservation of energy 2.22 becomes

0
T
0

t
_
s

+

s
0
_
= (
0

N
)

. (3.7)
The perturbation in the gravitational potential given by the Poisson equation equa-
tion (2.27) is given by

= 4G

(3.8)
and that for the radiative ux (2.25) is given by

= K
0

T
0
. (3.9)
Since the unperturbed state of the star is spherically symmetric under the current
assumptions, all the equilibrium state variables are functions of the radius r only.
Therefore the perturbed variables can be separated as a product of their spatial and
time dependencies with the time dependency being a wave function e
it
where
is the oscillation frequency. So the displacement is

=

(r, , ) e
it
and therefore
the velocity is v = i

(r, , ) e
it
. Substituting this and

(r, , ) e
it
into
12
the equation of continuity (3.5) it becomes (note: the subscript 0 for equilibrium
variables from now on will be omitted for brevity),

_
= 0 (3.10)
or in Lagrangian form obtained by expanding the

_
term and substituting
the translation from the Eulerian to the Lagrangian perturbation of from (3.3):

= 0. (3.11)
When substituting v into the equation of motion (i.e. the Euler equation) (2.7) it
becomes

+
1

+
1

= 0 (3.12)
(the term

was added to the Euler equation to take into account the gravita-
tional interaction) which can be separated into radial and tangential components
as

r
+
1

r
+

r
+

d
dr
= 0 (3.13)
and

_
p

_
= 0, (3.14)
where

= (0,

) and

=
1
r
_
0,

,
1
sin

_
. So therefore (3.11) can be
written as

+
1
r
2

r
_
r
2

r
_
+

= 0 (3.15)
and substituting (3.14) into this we obtain

+
1
r
2

r
_
r
2

r
_
+
1

_
p

_
= 0. (3.16)
Using radial and horizontal components, the Poisson equation can be written as
1
r
2

r
_
r
2

r
_
+
2

= 4G

. (3.17)
Using the thermodynamic relation below , where pressure and entropy are regarded
as independent variables, (for a full list of thermodynamic relations relating the per-
turbations of pressure, density, temperature and entropy in nonradial oscillations,
section 13.4 of Unno et al [63] or sections 4.2c and 5.4c of Cox [22], the density
perturbations,

and , can be eliminated from 3.13, 3.16 and 3.17 and expressed
in terms of p

,
r
and s,

=
1

1
p
p

ad
T
p
s (3.18)
where
1
=
_
ln p
ln
_
s
and
ad
=
_
ln T
ln p
_
s
. If we write (3.18) in terms of the
Eulerian perturbation using the relation (3.3) (remember all equilibrium variables
are only dependent on the radius r), we get

=
1

1
p

p
A
r

ad
T
p
s (3.19)
13
where we dene
A =
d ln
dr

1

1
d lnp
dr
(3.20)
(the Schwarzchild discriminant) which indicates the degree of convective stability.
When A < 0 the star is stable against convection; when A > 0 it is unstable (see
section 75 and 78 of Ledoux and Walraven [43]). So using these to eliminate the
density perturbations in (3.13), (3.16) and (3.17) we get
1

_

r
+
g

1
p
_
p

2
+gA
_

r
+

r
= g
ad
T
p
s, (3.21)
1
r
2

r
_
r
2

r
_
+
1

1
d lnp
dr

r
+
_

1
p
+

2

2
_
p

+
1

=
ad
T
p
s (3.22)
and
_
1
r
2

r
r
2

r
+
2

4G
_
p

1
p
A
r
_
= 4G
ad

2
T
p
s. (3.23)
The ux perturbation can be split into radial and horizontal components as
F

r
= K
T

r
K

dT
dr
(3.24)
and

= K

. (3.25)
Since s

s
0
= s and since the time dependency is e
it
, substituting equation
(3.25) into (3.7) we get
iTs = (
N
)

1
r
2

r
_
r
2
F

r
_
+
2

(KT

) . (3.26)
Equations 3.21, 3.22, 3.23, 3.24, 3.26 and the thermodynamic relation

=
ad
p
p
+
s
c
p
, (3.27)
where c
p
= T
_
s
T
_
p
is the specic heat per unit mass at constant pressure, are the
basic equations of oscillation. In the adiabatic case, which we will get to later, the
entropy is always constant, since the change must be reversible, and so the terms
containing the entropy perturbations are zero, so that equations (3.24) and (3.26)
are not required.
3.2 Spherical Harmonics
From the forms of equations (3.21), (3.22), (3.23), (3.24) and (3.26), we see that
the equations are again separable into radial and angular components since all
the coecients of these dierential equations are either constant or related to the
equilibrium variables, which only depend on the radius r due to spherical symmetry,
and derivatives with respect to the angular coordinates only occur in the form of the
angular part of the Laplacian operator
2

. In this case we may assume solutions of


the form f

= f

(r) Y (, ) where Y (, ) is a common factor in all the perturbed


variables. Putting this into the above mentioned equations and rearranging we get
1

dp

(r)
dr
+
g

1
p
p

(r)
_

2
+gA
_

r
(r) +
d

(r)
dr
g
ad
T
p
S (r) = 0, (3.28)
14
r
2
_

(r)

2
+
p

(r)

2
_
_
1
r
2
d
dr
_
r
2

r
(r)
_
+
1

1
d lnp
dr

r
(r) +
1

1
p
p

(r)
ad
T
r
S (r)
_
=
r
2
Y (, )

Y (, ) ,
(3.29)
1

(r)
d
dr
r
2
d

(r)
dr
4Gr
2
1

(r)
_
p

(r)

1
p
A
r
(r)
_
4G
ad
r
2

2
T
p
1

(r)
S (r)
=
r
2
Y (, )

Y (, ) ,
(3.30)
F

r
(r) K
dT

(r)
dr
+K

(r)
dT
dr
= 0 (3.31)
and
r
2
KT

(r)
_
iTS (r) + (
N
)

(r)
1
r
2
d
dr
_
r
2
F

r
(r)
_
_
=
r
2
Y (, )

Y (, ) .
(3.32)
Since the left hand side of the above equations are only dependent on the radius
r, while the right hand side is dependent on the angular coordinates and but
independent of the radius r, we may solve this system by separation of variables.
If we let be the separation constant, we nd that the angular dependency of the
wave equations satises
_
r
2

+
_
Y (, ) = 0 which is just the angular part of
Laplaces equation in spherical coordinates. The solution to this equation is given
by the spherical harmonics (see appendix A for a full derivation):
Y
m
l
(, ) = (1)
(m+|m|)
2
_
2l + 1
2
(l [m[)!
(l +[m[)!
_1
2
P
|m|
l
(cos ) e
im
. (3.33)
In this case, the spherical harmonics represent the non-radial oscillations in the
angular directions of a spherical star. The spherical harmonics can be visualised as
waves along a spherical surface with a total of l nodes, i.e [m[ nodes in the azimuthal
and l [m[ in the latitudinal directions as shown in gure (3.1). As shown, when
m = 0 the spherical harmonic functions only have a dependency on and when
l = [m[ they only depend on but for all other values of l and m they depend on
both angular coordinates. Furthermore the wave equations in the radial directions
are now given as the following (all perturbed functions are functions of radius only
but for brevity the argument (r) is suppressed, for example f

is the same as f

(r)),
1

dp

dr
+
g
c
2
p

+
_
N
2
+
2
_

r
+
d

dr
= g
ad
T
p
S, (3.34)
1
r
2
d
dr
_
r
2

r
_
+
1

1
d lnp
dr

r
+
_
1
L
2
l

2
_
p

c
2

l (l + 1)

2
r
2

=
ad
T
p
S, (3.35)
1
r
2
d
dr
_
r
2
d

dr
_

l (l + 1)
r
2

4G
_
p

c
2
+
N
2
g

r
_
= 4G
ad

2
T
p
S, (3.36)
15
Fig. 3.1: an illustration of spherical harmonics (source - Wikipedia)
K
dT

dr
= F

r
K

dT
dr
(3.37)
and
iTS = (
n
)

1
r
2
d
_
r
2
F

r
_
dr

l (l + 1)
r
2
KT

(3.38)
where c is the sound velocity, L
l
is the lamb frequency, and N is the Brunt-Vaisala
frequency, given respectively by
c
2
=

1
p

, (3.39)
L
2
l
=
l (l + 1) c
2
r
2
(3.40)
and
N
2
= gA. (3.41)
Since the solutions in the angular directions are known, all that remains is to solve
the system of radial equations above. This requires boundary conditions which will
16
be determined in the next section. Up to now the equations were derived for the
general case. We now specialise to the case of adiabatic perturbation.
3.3 Adiabatic case and boundary conditions
We will now assume that the changes during oscillations are adiabatic. Then the
entropy is conserved, i.e. S = 0. For adiabatic oscillations we dont need equations
(3.37) and (3.38), and by putting S = 0, the thermodynamic relation (3.27) gives
a relation for the density perturbation in terms of the perturbation of pressure as
=
p
c
2
(3.42)
or in Eulerian form

=
p

c
2
+
r

N
2
g
(3.43)
and then we have for equation (3.34)
1

dp

dr
+
g
c
2
p

+
_
N
2

2
_

r
=
d

dr
, (3.44)
for (3.35) we have
1
r
2
d
dr
_
r
2

r
_

g
c
2

r
+
_
1
L
2
l

2
_
p

c
2
=
l (l + 1)

2
r
2

(3.45)
and for 3.36 we have
1
r
2
d
dr
_
r
2
d

dr
_

l (l + 1)
r
2

= 4G
_
p

c
2
+
N
2
g

r
_
. (3.46)
The central boundary conditions are as follows. Towards the centre c
2
varies very
little and therefore we have for the Lamb frequency L
2
l

1
r
2
. If we take the density
to be be approximately constant near the centre then noting that for a spherical
mass distribution M
r
= 4
_
r
0
r
2
(r) dr, where r a given radius inside the star,
when r 0 M
r

4
3
r
3
or M
r
0,
A =
N
2
g
=
_
1

1
d lnp
dr

d ln
dr
_
0, (3.47)
N
2
0 and
g =
GM
r
r
2

4
3
Gr 0 (3.48)
as r 0. Therefore near the centre r = 0, equations (3.44), (3.45) and (3.46)
reduce to
1

dp

dr

2

r
+
d

dr
0, (3.49)
d
dr
_
r
2

r
_

l (l + 1)

2
_
p

_
0 (3.50)
and
d
dr
_
r
2
d

dr
_
l (l + 1)

0. (3.51)
The dierential equation (3.51) has a general solution

= c
1
r
l
+c
2
r
(l+1)
, where
c
1
and c
2
are constants, but r
(l+1)
as r 0 and so in order for

to be
regular in the centre of the star, c
2
must be set to zero so that

= c
1
r
l
. If we take
17
the derivative of this solution and substitute

back in, then we have a boundary


condition for the perturbation of the gravitational potential at the centre r = 0,
d

dr

l

r
= 0. (3.52)
In order to get the second central boundary condition, we use the equations (3.50)
and (3.49). If we eliminate the
r
term between these two equations by adding
1

2
d
dr
r
2
(3.49) to (3.50), we get
d
dr
r
2
d
dr
_
p

_
l (l + 1)
_
p

_
0 (3.53)
which has a general solution
p

= c
3
r
l
+c
4
r
(l+1)
and this time in order for p

to be regular in the centre, we set c


4
= 0 so that we get a solution of
p

= c
3
r
l
or p

r
l
and
r
r
l1
. Therefore the second central boundary condition is

2
r
_
p

_
= 0 (3.54)
at r = 0. The other two boundary conditions for the system of dierential equations
are given at the surface of the star. The simplest surface boundary conditions are
the zero boundary conditions where we assume that = 0 and p = 0 at the surface
r = R (this is not generally the case if we consider the atmosphere of the star).
Since by our assumption, there is no pressure acting from outside the star we have
p = 0 or in Eulerian form
p

+
r
dp
dr
= 0 (3.55)
at r = R. Since the density is zero at the surface, equation (3.46) becomes
1
r
2
d
dr
_
r
2
d

dr
_

l (l + 1)
r
2

= 0 (3.56)
at r = R, which has a general solution of

= k
1
r
l
+ k
2
r
(l+1)
. In order to make
sure that

doesnt increase outward along the radius, k


1
must be set to zero so that

= k
1
r
(l+1)
which by taking the derivative, delivers a second surface boundary
condition
d

dr
+
(l + 1)
r

= 0 (3.57)
at r = R. The equations (3.44), (3.45) and (3.46) plus boundary conditions (3.52),
(3.54), (3.55) and (3.57) give an eigenvalue problem i.e. boundary value problem
with discrete set of solutions, with eigenvalues as the square of the frequency. These
equations describe adiabatic non-radial oscillations. The radial oscillations are the
special case when l = 0 (remember l is an integer). Here there are mainly two sets
of solutions. The one is the set of g-modes, where the order of the mode increases
as the frequency goes to zero, and the other set is that of the p-modes, where the
order of the p-mode increases as the frequency increases. In addition to these two
sets of eigenfunctions, there also exists an extra one with intermediate character
between the p
1
-mode and the g
1
-mode, called the f-mode. Physically the g-modes
are oscillations in the star that are driven by buoyancy. In other words, if a given
uid particle moves due to a buoyant force, then gravity (acting on the density
perturbation) acts as the restoring force, thereby causing an oscillation. The p-
modes on the other hand are standing acoustic waves, with pressure acting as the
restoring force.
18
3.4 Forms of oscillation equations used for calculation of models
There are two dierent forms in which the oscillation equations (3.44), (3.45) and
(3.46) can be written in order to make them practical for numerical computation.
One is described in 79 of Ledoux and Walraven [43] and in 17.5a of Cox [22]. It
is written in terms of the variables
y =
p

(3.58)
and
u = r
2

r
. (3.59)
In this format, p

and
r
in terms of y and u are given by
p

= y (3.60)
and

r
=
u
r
2
. (3.61)
Substituting 3.60 and 3.61 into 3.44, and rearranging, we obtain
dy
dr
=

2
+Ag
r
2
u Ay

dr
(3.62)
if we make use of the combination of the denition of A and equation (2.29) and
noting that N
2
= gA. Substituting (3.60) and (3.61), as well as (3.40) for the
Lamb frequency L
l
and (3.39) for c
2
, into (3.45), and then rearranging to make
(du/dr), we obtain
du
dr
=
g

1
p
u +
_
l (l + 1)

2

r
2

1
p
_
y +
l (l + 1)

. (3.63)
Finally, we can rewrite the Poisson equation in terms of y and u by substituting
(3.60) and (3.61) into (3.46) to get
1
r
2
d
dr
_
r
2
d

dr
_
=
4G
2

1
p
y
4GA
r
2
u +
l (l + 1)

r
2
(3.64)
The other form for the oscillation equations, which is also used for numerical models
and which we will be using here, appears in chapter 18 of Unno et al [63] and in
17.5b of Cox [22]. In order to write the equations in the latter form, we dene four
dimensionless interdependent variables as
y
1
=

r
r
, (3.65)
y
2
=
1
gr
_
p

_
, (3.66)
y
3
=
1
gr

(3.67)
and
y
4
=
1
g
d

dr
. (3.68)
Rearranging, we then get
r
, p

and (d

/dr) in terms of the dimensionless


variables (3.65), (3.66), (3.67) and (3.68) as

r
= ry
1
, (3.69)
19
p

= gr (y
2
y
3
) , (3.70)

= gry
3
(3.71)
and
d

dr
= gy
4
. (3.72)
If we substitute (3.69), (3.70) and (3.71) into (3.44) and make r (dy
2
/dr) the subject,
we get
r
dy
2
dr
=
_
N
2

2
_
r
g
y
1

_
gr
c
2
+
r
g
d (g)
dr
+ 1
_
y
2
+
_
gr
c
2
+
r

d
dr
_
y
3
(3.73)
(the (d (gry
3
) /dr) term cancels). Substituting (3.69), (3.70) and (3.71) into (3.45)
and making r (dy
1
/dr) the subject (if we take the Lamb frequency (3.40) into ac-
count and then note that we have a term of
_
L
l
/
2
_
y
3
on both sides, which cancel),
we get
r
dy
1
dr
=
_
gr
c
2
3
_
y
1
+
_
L
l

2
1
_
y
2
+
gr
c
2
y
3
(3.74)
and substituting (3.69), (3.70), (3.71) and (3.72) into (3.46) and rearranging to
make r
dy4
dr
the subject, you get
r
dy
4
dr
= 4G
N
2
r
2
g
2
y
1
+4G
r
2
c
2
y
2
+
_
l (l + 1) 4G
r
2
c
2
_
y
3

1
gr
d (gr)
dr
y
4
. (3.75)
We also get a relation between y
3
and y
4
by taking the derivative of (3.71) and
substituting in (3.72):
r
dy
3
dr
=
1
g
d (gr)
dr
y
3
+y
4
. (3.76)
Lets dene the dimensionless radius as
x =
r
R
, (3.77)
and dimensionless frequency as

2
=

2
R
3
GM
. (3.78)
We can also dene four other dimensionless variables as
V =
d lnp
d lnr
, (3.79)
c
1
=
r
3
M
R
3
M
r
, (3.80)
U =
d lnM
r
d lnr
(3.81)
and
A

= rA =
r

1
p
dp
dr

r

d
dr
=
rN
2
g
. (3.82)
Using (3.77), (3.78), (3.79), (3.80), (3.81) and (3.82), equations (3.73) - (3.75) be-
come
x
dy
1
dx
=
_
V

1
3
_
y
1
+
_
l (l + 1)
c
1

2

V

1
_
y
2
+
V

1
y
3
, (3.83)
20
x
dy
2
dx
=
_
c
1

2
A

_
y
1
+ (A

U + 1) y
2
A

y
3
, (3.84)
x
dy
3
dx
= (1 U) y
3
+y
4
(3.85)
and
x
dy
4
dx
= UA

y
1
+
UV

1
y
2
+
_
l (l + 1)
UV

1
_
y
3
Uy
4
. (3.86)
Note that in order to get the A

in the coecients of y
2
and y
3
in equation (3.84),
the term (gr) /c
2
can be rewritten as (r/
1
p) (dp/dr) if we make use of equation
(2.29) from the previous chapter after substituting in (GM
r
) /r
2
for g and (
1
p)
for c
2
(in the coecient of the y
2
, the (r/) (d/dr) term from (3.82) is one of
the terms resulting from application of the product rule to the (r/g) (d (g) /dr)).
When rewriting (3.52) and (3.54) in terms of the dimensionless variables y
1
, y
2
, y
3
and y
4
we get the central boundary conditions as
ly
3
y
4
= 0 (3.87)
for the rst central boundary condition (3.52) and
c
1

2
l
y
1
y
2
= 0 (3.88)
for the second central boundary condition (3.54). Similarly for the surface boundary
conditions (3.55) and (3.57) we obtain
y
1
y
2
+y
3
= 0 (3.89)
for the rst surface boundary condition (3.55) (substitute in
dp
dr
= g) and
(l + 1) y
3
+y
4
= 0 (3.90)
for the second surface boundary condition (3.57).
3.5 Numerical calculation of oscillation models
Boundary value problems for ordinary dierential equations may be solved by the
shooting method. In the shooting method, the boundary value problem is turned
into an initial value problem by choosing an initial value which satises the boundary
conditions at one end point but then requiring the equations to give a solution
which satises the boundary conditions at the other end. If the ordinary dierential
equations are linear, then what is needed is to solve the system with dierent
possible initial values which are linearly independent. The solution which satises
the boundary conditions on the other end is a linear combination of these (see
Ascher, Mattheij and Russell [13] and Keller [34]). Otherwise, the boundary value
problem may also be solved by using a nite dierence technique. This is done by
dividing the interval of the solution into a mesh of N points, and then approximating
the dierential equations as nite dierence equations at each of the N points. We
then have for I dierential equations, a set of NI algebraic equations which must
be solved simultaneously for every point on the mesh (see Ascher, Mattheij and
Russell [13]). In the case of the oscillation equations, it may be solved with shooting
by integrating from each boundary to a point in between, or tting point, by using
the boundary conditions as the initial conditions. Since the problem is an eigenvalue
problem, i.e. a problem with a discrete set of solutions, the eigenvalues must also
be determined (the eigenvalues are the square of the eigenfrequencies). When using
21
the shooting method, the solutions will only match at the tting point if the correct
values are chosen for the eigenfreqiencies. When using a nite dierence scheme, it
is convenient to use a so-called -method in order to write the dierential equations
as a set of dierence equations. If we consider the set of dierential equations as
dy
i
dx
= f
i
_
y
j
;
2
_
, (3.91)
for i, j = 1, 2, 3, 4 then, using the -method, the dierence equations are approxi-
mated as
y
n+1
i
y
n
i
x
n
= (1
i
) f
i
_
y
n+1
j
;
2
_
+
i
f
i
_
y
n
j
;
2
_
(3.92)
where x
n
= x
n+1
x
n
, n is a given mesh point between 1 and N 1 and is
some constant 0 1 and is normally taken as 0.5 for good accuracy. The
idea behind the method is to take an average of values at adjacent mesh points
so as to evaluate the equations at a point in between the mesh points n + 1 and
n. As a result the derivative would be a central dierence of that point (in the
case of = 0.5 it could be thought of as the central dierence at the point n +
1
2
)
and hence gives a better approximation for the derivative and for the ys. Then
equations (3.83), (3.84), (3.85) and (3.86) may be written as the set of dierence
equations
0.5 (x
n+1
+x
n
)
y
n+1
1
y
n
1
x
n+1
x
n
=
0.5
__
V
n+1

n+1
1
3
_
y
n+1
1
+
_
l (l + 1)
c
n+1
1

2

V
n+1

n+1
1
_
y
n+1
2
+
V
n+1

n+1
1
y
n+1
3
_
+0.5
__
V
n

n
1
3
_
y
n
1
+
_
l (l + 1)
c
n
1

2

V
n

n
1
_
y
n
2
+
V
n

n
1
x
y
n
3
_
,
(3.93)
0.5 (x
n+1
+x
n
)
y
n+1
2
y
n
2
x
n+1
x
n
=
0.5
__
c
n+1
1

2
A
n+1
_
y
n+1
1
+
_
A
n+1
U
n+1
+ 1
_
y
n+1
2
A
n+1
y
n+1
3

+0.5
__
c
n
1

2
A
n
_
y
n
1
+ (A
n
U
n
+ 1) y
n
2
A
n
y
n
3

,
(3.94)
0.5 (x
n+1
+x
n
)
y
n+1
3
y
n
3
x
n+1
x
n
= 0.5
__
1 U
n+1
_
y
n+1
3
+y
n+1
4

+0.5 [(1 U
n
) y
n
3
+y
n
4
]
(3.95)
and
0.5 (x
n+1
+x
n
)
y
n+1
4
y
n
4
x
n+1
x
n
=
0.5
_
U
n+1
A
n+1
y
n+1
1
+
U
n+1
V
n+1

n+1
1
y
n+1
2
+
_
l (l + 1)
U
n+1
V
n+1

n+1
1
_
y
n+1
3
U
n+1
y
n+1
4
_
+0.5
_
U
n
A
n
y
n
1
+
U
n
V
n

n
1
y
n
2
+
_
l (l + 1)
U
n
V
n

n
1
_
y
n
3
U
n
y
n
4
_
(3.96)
where in this case the average of x
n+1
and x
n
was also taken on the left. The set
of equations (3.93), (3.94), (3.95) and (3.96) as well as the boundary conditions
22
are needed to solve the system. The boundary conditions (3.87), (3.88), (3.89) and
(3.90) are given in terms of the above scheme as
ly
0
3
+y
0
4
= 0 (3.97)
and
c
1
(0)
2
l
y
0
1
y
0
2
= 0 (3.98)
at the centre, and
y
N
1
y
N
2
+y
N
3
= 0 (3.99)
and
(l + 1) y
N
3
+y
N
4
= 0 (3.100)
at the surface. Since this is an eigenvalue problem, this system will only have
solutions at specic values of . In order to solve the system as well as nd the
eigenfrequencies, we need to impose a normalisation condition, for instance
y
N
1
= 1. (3.101)
We may solve the system with the normalisation condition replacing one of the
boundary conditions, say (3.99). We do this by putting the coecients of the ys
into a matrix. In this case, we get a staircase matrix. This system may be solved
by matrix inversion or by gauss elimination and since most of the elements are zero,
sparse routines may be used in order to reduce memory used and to increase the
speed in computation (at the eigenfrequencies, the solution to the system gives a
numerical solution to the original dierential equations at every point on the mesh).
The remaining boundary condition may be used to look for eigenfrequencies if we
solve the above linear system of equations while allowing to vary continuously. In
other words,in order to look for eigenfrequencies, let
D( ) = y
N
1
y
N
2
+y
N
3
, (3.102)
keep solving the system with the normalisation (3.101) by Gauss elimination while
continuously varying until the deviation (3.102) changes sign since D( ) = 0 only
when is an eigenfrequency. The solution at the points where D( ) is close to zero
may be used as an initial trial solution when applying the Henyey relaxation method
(described in chapter 18 of Unno et al [63]) to improve accuracy. If the equations
described above are applied to a polytrope with index =
4
3
, the solutions behave
as shown in gure 3.2, which shows the behaviour of the f-mode and lower order
p-modes. In this particular instance, the zeroes of D( ) were located by using the
bisection method. The Henyey method was not used.
23
Fig. 3.2: Oscillation modes of polytrope with polytropic index 4/3. These modes were
calculated with the code in section B.3 which also requires the code in section
B.2 of appendix B for the nite dierence calculations.
24
4. DENSE NUCLEAR MATTER INSIDE NEUTRON STARS
This chapter is a review of the literature. The rst section is a review of equations
of state of the nuclear matter in the interior of neutron stars and the second section
is a literature review of neutron star oscillations.
Before we can discuss oscillations in neutron stars, like any discussion of stellar
oscillation, an equilibrium model is needed. Since neutron star interiors are made
up of dense nuclear matter, this means that we need equations of state for such
matter to replace that of gases discussed in the previous two chapters. The internal
structure of a neutron star can be divided into a crust, outer core and inner core.
Generally, the crust of a neutron star consists of a metallic lattice. Deeper into
the crust, inverse beta processes between the electrons and protons in the nuclei
result in the lattice having atoms with more neutron rich nuclei. At a certain depth
there is a point where there is not only a gas of free electrons but free neutrons as
well (this occurs at a density of 4 10
11
g cm
3
and is called neutron drip, see
Chapter 2 of Shapiro and Teukolsky [60]). At the depth of the outer core, there are
no more atomic nuclei but rather just neutrons and some protons that interact via
the strong nuclear force forming a superuid. The composition of the inner core
of the neutron star is not well understood but could be composed of deconned
quarks. The simplest model for the outer core is a mixture of protons and neutrons
but a more realistic one could contain other particles such as hyperons and strange
matter. If deconned quarks which interact via the colour force compose the inner
core, it is most likely to consist of strange quark matter. The following is a review
of papers describing equations of state of the dense nuclear matter inside neutron
stars.
4.1 Review of equations of state of neutron star matter
Shapiro and Teukolsky [60] have discussed the variational method for calculating
the equation of state of dense nuclear matter. Global attributes of neutron stars,
such as the radius for a given mass, depend on the internal pressure (as is also
the case in ordinary stars). In the case of neutron stars, the equation of state and
the composition in the core depend on the nature of strong interactions in dense
nuclear matter. One way to calculate the equation of state of nuclear matter, taking
into account correlations between fermions, is the variational method. A variational
calculation is usually done by constructing a trial many body wave function
v
(also
called the Jastrow trial function), which when incorporating two-body correlations
is written as a product

v
(r
1
, . . . , r
N
) = A

i<j
f
ij
([r
i
r
j
[)

m
(r
m
) , (4.1)
where A is the antisymmetrization operator which acts on the spins, isospins and
coordinates of the particles, f
ij
are the Jastrow factors which prevent the particles
from getting too close (the strong nuclear force becomes repulsive at close range
i.e. when [r
i
r
j
[ decreases to a minimum nonzero value). This wave function is
then used to calculate the expectation value of the hamiltonian. The expectation
value is then minimised by varying the factors f
ij
in the wave function in order to
estimate the ground state energy, since by the Rayleigh-Ritz upper bound

v
[H[
v
)

v
[
v
)
E
0
, (4.2)
where
v
is the trial wave function, H is the hamiltonian and E
0
is the ground state
energy.
Baym, Pethick and Sutherland (1971) [14] determined an equation of state for
high density matter below neutron drip that takes into account shell eects and
lattice energy. The BPS equation of state can describe the crust of neutron stars up
to the density where neutron drip occurs. The energy density in the BPS equation
of state is given by
= n(1 Y
n
)
M (A, Z)
A
+

e
(n
e
) +
n
(n
n
) +
L
(4.3)
where n is the baryon number density, Y
n
= n
n
/n is the ratio of neutrons out of the
number of baryons at a given density, A is the number of nucleons in the nucleus,
M (A, Z) is the energy of a nucleus with Z protons and A Z neutrons,

e
is the
energy density of the electrons,
n
is the energy density of free neutrons and
L
is
the lattice energy given by

L
= 1.444Z
2
3
e
2
n
4
3
e
. (4.4)
The pressure is given by
p = p
e
+p
L
(4.5)
where p
e
is the electron degeneracy pressure and
pL =
1
3

L
. (4.6)
In the BPS equation of state, the composition of the matter in beta equilibrium is
determined by the values of A and Z which minimize at a given baryon density n.
Later in the paper, they use this equation of state to construct models of nonrotating
stars (both neutron stars and white dwarfs) and then they use properties from the
nonrotating conguration to calculate the properties of slowly rotating stars.
Friedman and Pandharipande (1981) [25] did some variational calculations of the
equation of state of nuclear and neutron matter over a wide density range. They
use a hamiltonian which contains both two and three nucleon interactions. They
also examine the eects of the three nucleon interactions.
Wiringa, Fiks and Fabrocini (1988) [64] calculated some equations of state of
dense nuclear matter from ve dierent Hamiltonians containing potentials for two-
nucleon as well as three-nucleon interactions given as
H =

i
h
2m

2
i
+

i<j
v
ij
+

i<j<k
V
ijk
, (4.7)
where v
ij
is the two-nucleon potential and V
ijk
is the three-nucleon potential.
Wiringa, Fiks and Fabrocini used a variational approach to many body calcula-
tions. By use of the variational method, they calculated relations of energy in
terms of density, E () and provided some tables for interpolation. They used an
approximation for the energy of asymmetric nuclear matter given by
E (, x) = T
F
(, x) +V
0
() + (1 2x)
2
V
2
() , (4.8)
26
where x =
p

is the proton fraction, is the total number density of nucleons, T


F
is the Fermi-gas kinetic energy given by
T
F
(, x) =
3
5
h
2
2m
_
3
2

_2
3
_
x
5
3
+ (1 x)
5
3
_
(4.9)
and V
0
() and V
2
() are functions obtained from the results for pure neutron matter
(x = 0) and symmetric nuclear matter (equal numbers of protons and neutrons,
x =
1
2
) respectively. From there, they used the relation 4.8 to tabulate values of
energy E (, x) and proton fraction x() with respect to a given number density
(which they calculated by assuming beta equilibrium or n p + e

). The table
is then interpolated to get E () in order to calculate the energy density, given by:
() =
_
E () +mc
2

. (4.10)
They also used the interpolated function E () in order to calculate the pressure in
terms of number density, given by
p () =
2
E ()

. (4.11)
The equation of state in the form of pressure in terms of energy density p () is
obtained by combining equations 4.10 and 4.11 in order to eliminate between
them. Using this equation of state, they then calculated neutron star structure
in the context of general relativity, in which case the stellar structure is given
by the Oppenheimer-Volko equation (e.g. Shapiro and Teukolsky [60]), which is
derived from Einsteins eld equations. Later in the paper, pion condensation is
also discussed in order to explain softening in one of the equations of state.
Akmal and Pandharipande (1997) [1] also used the variational method to do
many body calculations with two and three nucleon interactions (with a hamiltonian
like that in equation 4.7) for symmetric and pure neutron matter. More specically,
they used the hamiltonians
H
SNM
=

i
h
2
4
_
1
m
p
+
1
m
n
_

2
i
+

i<j
14

p=1
v
p
(r
ij
) O
p
ij
+

i<j<k
V
ijk
(4.12)
for symmetric nuclear matter and
H
PNM
=

i
h
2
2m
n

2
i
+

i<j
7

q=1
v
2q1
(r
ij
) O
2q1
ij
+

i<j<k
V
ijk
(4.13)
for pure neutron matter, where in both equations O
p
ij
are operators, the v
p
are
terms dependent on the particle separation r
ij
, v
1
= v
1
+ v
2
+ 2v
15
2v
18
, v
3
=
v
3
+v
4
+2v
16
, v
5
= v
5
+v
6
+2v
17
and v
2q1
= v
2q1
+v
2q
for q 4. The variational
calculations were discussed in detail in their paper, which is concerned with phase
transition and pion condensation in dense nuclear matter. Further results for the
equation of state with these authors (including the one with relativistic corrections)
are given in a later paper (see Akmal, Prakash and Ravenhall (1998) [2]). In this
paper, the authors describe calculations which include the relativistic corrections
after giving a summary of the nonrelativistic calculations described in Akmal and
Panderipande [1] using the variational approach. They also use the results of the
calculation to calculate the equation of state of cold catalyzed nucleon matter at
densities which require that the matter is composed of charge neutral mixtures of
neutrons, protons, electrons and muons. Beta equilibrium which includes muons
requires that n p +e

and

.
27
Serot (1979) [59] extended an earlier quantum eld theory of nuclear interactions
to include interactions with and mesons. Serot constructed the Lagrangian
for the theory by adding terms for the and a doublet of scalar elds to the
Lagrangian of the earlier theory. A theory containing a non-abelian vector eld like
this one (i.e. the eld for the mesons) is nonrenormalizable but in this case it is
made renormalizable by allowing spontantaneous symmetry breaking via the Higgs
mechanism in order to generate mass for the vector gauge eld. In order to get an
equation of state, the eld operators in this theory are replaced by their expectation
values in order to get the eld equations. The eld equations are linear and can be
solved to get the energy density and pressure in dense nuclear matter as
=
_
g
2
v
2m
2
v
_

2
B
+
_
m
2
S
2g
2
s
_
(M M

)
2
+
_
g
2

8m
2

2
3
+
2
(2)
3
_
_
k
Fp
0
+
_
k
Fn
0
_
d
3
k
_
k
2
+M
2
1
2
(4.14)
and
p =
_
g
2
v
2m
2
v
_

2
B

_
m
2
S
2g
2
S
_
(M M

)
2
+
_
g
2

8m
2

2
3
+
1
3
2
(2)
3
_
_
k
Fp
0
+
_
k
Fn
0
_
d
3
k k
2
_
k
2
+M
2

1
2
(4.15)
respectively, where M

is the eective mass determined by


M

= M
_
g
2
S
m
2
S
_
2
(2)
3
_
_
k
Fp
0
+
_
k
Fn
0
_
d
3
k M

_
k
2
+M
2

1
2
, (4.16)
M is the mass of the nucleons, m
v
is the mass of the vector mesons, m
S
is the mass
of the scalar mesons, m

is the mass of the mesons,

B
=
k
3
Fp
+k
3
Fn
3
2
(4.17)
and

3
=
k
3
Fp
k
3
Fn
3
2
(4.18)
with k
Fp
and k
Fn
being the Fermi momenta of protons and neutrons respectively.
Glendenning and Moszkowski (1991) [27] approached the idea of a mixture of
neutrons, protons and hyperons in the composition of neutron stars from a eld
theoretical point of view. Their model resolves a discrepancy between previously
calculated binding of hyperons in nuclear matter and observed neutron star masses
(prior calculations with this mixture led to maximum neutron star masses which
were too small, see [26] and [33]).
Prakash, Cooke and Lattimer (1995) [55] investigated the eects of trapped
neutrinos on the composition of quark-hadron phase transitions in protoneutron
stars (the collapse of the core of a massive star just before the formation of a
neutron star, see Burrows and Lattimer [16]). The equation of state that they
discussed contained a mixed phase of nucleons, hyperons and quarks. They found
that the presence of trapped neutrinos causes a shift in the phase transition to
higher baryon densities. They also found that when negative electric charges (other
28
than the ones due to leptons) are present then the maximum masses of stars with
trapped neutrinos are higher than those without neutrinos.
M uller and Serot (1996) [53] also used a eld theoretical approach to calculate
the equation of state. For the equation of state, they eventually get the following
for the pressure and energy density,
p =
1
3
2
_
k
Fp
0
dk
k
4
(k
2
+M
2
)
1
2
+
1
3
2
_
k
Fn
0
dk
k
4
(k
2
+M
2
)
1
2
+
1
2c
2
v
W
2
+
1
2c
2

R
2

1
2c
2
s

2
+

i,j,k
a
ijk

W
2j
R
2k
(4.19)
and
=
1

2
_
k
Fp
0
dkk
2
_
k
2
+M
2
_1
2
+
1

2
_
k
Fn
0
dkk
2
_
k
2
+M
2
_1
2
+W +
1
2
R
3

1
2c
2
v
W
2

1
2c
2

R
2
+
1
2c
2
s

i,j,k
a
ijk

W
2j
R
2k
,
(4.20)
where k
Fp
and k
Fn
are the Fermi momenta for protons and neutrons respectively,
, W and R are the scaled meson elds, M M is the eective nucleon mass
and c
2
i
and a
ijk
are the coupling constants. They then extrapolate the high density
limit in order to discuss the equation of state in relation to neutron stars. Finally
they conclude that the extrapolation of the equation of state to high densities is
not sucient to give precise predictions of the properties of neutron stars.
Glendenning and Schaner-Bielich (1999) [28] used a eld theoretical calculation
in order to get an equation of state that includes kaon condensation. They discuss
the dierences between a Maxwell construction and the Gibbs criteria. A Maxwell
construction as they describe is useful when there is a single chemical potential
because it ensures that only one chemical potential is common to multiple phases.
Since neutron star matter has two chemical potentials, a Maxwell construction cant
be used for neutron stars. For isospin asymmetric nuclear matter, Gibbs conditions
can be satised if the charge density in the two dierent phases have opposite
sign at phase equilibrium. Later in the paper Glendenning and Schaner-Bielich
discuss the mixed phase region in neutron stars. They nd that when kaons start
to condense, the neutron density appears almost constant on a logarithmic scale,
although it varies slowly. This is because the kaons are more favourably produced
in association with protons (because of the negative charge in the K

kaons) and so
in order to maintain beta equilibrium, the neutron density remains almost constant.
In the condensed phase, the energy favours the production of proton-K

pairs over
the production of neutrons although their growth is not uninhibited.
M uther, Prakash and Ainsworth (1987) [54] extended Brueckner-Hartree-Fock
calculations for nuclear matter to dense neutron matter, taking into account inter-
actions between nucleons due to the exchange of and mesons as well as the
dependency on the asymmetry. They also discussed the role of the nuclear symme-
try energy in the context of neutron star structure.
Engvik et al (1994) [23] calculated an equation of state containing just neutrons
and protons using Dirac-Brueckner-Hartree-Fock analysis and not the variational
method as described above. For particle interactions, they use a potential described
by Machleidt [48]. They used their equation of state to calculate global properties
of neutron stars such as mass and radius in order to compare them to the observed
masses and radii of real stars. For pure neutron matter, their equation of state gave
29
a maximum mass of M
MAX
2.4M

at a radius of R = 12 km but can be reduced


to M
MAX
2.0M

at a radius of R = 10 km when including the eects of pion


and kaon condensation (which increases the proton fraction up to 40%).
Prakash, Ainsworth and Lattimer (1988) [56] investigated the relationship be-
tween other parameters in the equation of state, such as nuclear incompressibility,
symmetric nuclear energy, and the maximum mass of neutron stars. They did this
by parameterising the function describing the energy per particle E (n) and using
the nuclear incompressibility given as K
0
as an input parameter. They found that
the observed neutron-star masses cannot constrain K
0
by a large amount for real-
istic symmetry energies and therefore dont give useful constraints on the possible
equations of state. As a result they suggested a number of directions for further
study, including the eect of of hyperonic interactions and whether observations of
properties other than the mass can constrain the equation of state.
Haensel and Potekhin (2004) [29] derived analytical representations for two equa-
tions of state. These equations of state are unied in the sense that they describe
the crust and the core with the same model. The derivation was done by interpo-
lating tabulated values of the equations of state in such a way as to respect the rst
law of thermodynamics everywhere. They describe how the equations of state can
be parameterized for both rotating and non-rotating neutron star congurations.
Lattimer and Prakash (2001) [42] examined a wide variety of models for the
equation of state of neutron star matter (originally from some of the papers re-
viewed above, i.e. [1], [23], [25], [27], [28], [53], [54], [55], [56] and [64]). They
determined that useful constraints on the possible forms of the equations of state
may be obtained experimentally by a measurement of radius for a single neutron
star to an accuracy of 1 km with a given mass (general relativity was used for
gravity in the calculation of radii). This could be done with an observation of a
single neutron star because Lattimer and Prakash were able to establish a general
correlation
R
M
C (n, M) [p (n)]
0.230.26
, (4.21)
where R
M
is the total radius of the star, p (n) is the pressure at a particle number
density (of both leptons and baryons) n and C (n, M) is a coecient dependent on
the number density at which the pressure was calculated (using a particular equation
of state) and the total mass M. This correlation was found by approximating the
equations of state as polytropes (most of the ones examined turned out to have an
eective polytropic index of n = 1 in the approximations). Lattimer and Prakash
also discussed some other quantities such as moments of inertia and binding energy
and found that they were mainly independent of the equations of state.
4.2 Oscillations in neutron stars
Although neutrons stars have a solid crust, the core consists of superuid protons
and neutrons (other particles, including strange matter, may also exist at higher
densities). Oscillations may occur in these regions and have been studied in the
context of Newtonian gravity ([5], [44], [45], [46], [57], [58], [61], [65]). They have
also been studied in the context of general relativity ([3], [4], [9], [10], [11], [21], [35],
[38]).
In addition to the p-modes and the g-modes, another class of modes exist in the
superuid region of neutron stars due to the extra degrees of freedom introduced
by two dierent uids (i.e. the proton and electron uid and the neutron uid) as
well as the superuidity in that region. Superuidity also has eects on oscillations
because of the dierences in the dynamics of a superuid as opposed to an ordinary
uid. The idea of a new set of modes due to the superuidity in neutron stars was
30
rst suggested by Epstein (1988) [24]. Lindblom and Mendell (1994) [46] investi-
gated the eects of superuidity on the oscillations of neutron stars using Newtonian
gravity. They started o by providing some equations for the oscillations of the su-
peruid matter in neutron stars and then derived the boundary conditions for these
equations (the boundary conditions also include jump conditions at the interface
between the superuid core and ordinary uid envelope). For the equation of state,
they used the Harrison-Wheeler equation of state in the low density region of the
star, 2 10
12
g cm
3
, and a variation of the Serot equation of state [59] in the
high density region 3 10
13
g cm
3
. The main dierence between the variation
of the Serot equation of state used by Lindblom and Mendell and the original one
given by Serot is that it contains both protons and neutrons, with the ratio being
determined by imposing beta equilibrium, whereas Serot originally assumed pure
neutron matter. In the densities between these two regions, 210
12
310
13
,
they matched the two equations of state by interpolating with a polytrope
p = 8.49 10
16

1.09
. (4.22)
Since it will be important in the next chapter, this version of the Serot equation of
state will be given here. The mass densities of the proton and neutron uids are
respectively given in terms of the Fermi momenta,k
p
and k
n
as

p
=
m
p
k
3
p
3
2
h
3
(4.23)
and

n
=
m
n
k
3
n
3
2
h
3
. (4.24)
The electron mass density is determined in terms of the Fermi momentum of the
protons, k
p
, due to the condition of charge neutrality,

e
=
m
e
k
3
p
3
2
h
3
. (4.25)
The Serot equation of state requires an eective mass, m

, which in this case is


determined in terms of k
p
and k
n
as
m

= m
b
534.2
m
3

m
2
b
_

_
k
n
m

c
_
+
_
k
p
m

c
__
(4.26)
where m
b
1.675 10
24
g is the average baryon mass and the denition of
appears below. The eective mass in equation (4.26) can be solved for numerically
with a root seeking algorithm. The energy density in this case is given by
=
m
4

c
5
h
3
_

_
k
n
m

c
_
+
_
k
P
m

c
__
+
_
k
3
n
+k
3
p
_
2
8.950m
2
b
h
3
c
+
m
2
b
(m
b
m

)
2
c
5
534.2 h
3
+
_
k
3
n
k
3
p
_
2
128.2m
2
b
h
3
c
.
(4.27)
The denition of appears below. The number of neutrons and protons are deter-
mined at a given density by imposing beta equilibrium (i.e. the condition that the
reaction p +e

n is in equilibrium). This requires that


m
e

e
+m
p

p
= m
n

n
(4.28)
where the chemical potentials are given by

n
=
_

n
_
p
, (4.29)
31

p
=
_

p
_
n
(4.30)
and

e
= c
2

1 +
k
2
p
m
2
e
c
2
(4.31)
for neutrons, protons and electrons respectively. The pressure is given by
p =
m
4

c
5
h
3
_

_
k
n
m

c
_
+
_
k
p
m

c
__
+
m
4
e
c
5
h
3

_
k
P
m
e
c
_
+
_
k
3
n
+k
3
p
_
2
8.950m
2
b
h
3
c

m
2
b
(m
b
m

)
2
c
5
534.2 h
3
+
_
k
3
n
k
3
p
_
2
128.2m
2
b
h
3
c
.
(4.32)
In the above equations is given by
(x) =
1
4
2
_
x
_
1 +x
2
ln
_
x +
_
1 +x
2
__
, (4.33)
the function that determines the energy density of an ideal Fermi gas is given by
(x) =
1
8
2
_
x
_
1 +x
2
_
1 + 2x
2
_
ln
_
x +
_
1 +x
2
__
(4.34)
and the function that determines the pressure of an ideal Fermi gas is given by
(x) =
1
8
2
_
x
_
1 +x
2
_
2x
2
3
1
_
+ ln
_
x +
_
1 +x
2
_
_
. (4.35)
The equations 4.23 to 4.35 taken together can be used to calculate the pressure at
any given mass density, i.e. the total mass density given by
=
n
+
_
1 +
m
e
m
p
_

p
. (4.36)
Lindblom and Mendell then demonstrate the existence of the new set of modes
(which they called s-modes for superuid) caused by the oscillations of the neutron
and proton uids in the core. They do this by solving the superuid oscillation
equations analytically in the special case of spatially uniform matter in the star,
although they failed to nd them numerically in the more realistic model.
Lee (1995) [44] also calculated the oscillations in superuid neutron stars with
Newtonian gravity and used the same equation of state as Lindblom and Mendell.
Lee rst provides some equations for waves propagating in superuids. The veloc-
ities of the two uids in the neutron star core are not independent because there
is an eect called entrainment whereby the velocity of one uid induces a current
in the other (e.g. Andreev and Bashkin (1975) [12] for the case of a mixture of
liquid helium 3 and helium 4). A full derivation of the oscillation equations will be
given in the next chapter. Lee wrote the oscillation equations in terms of dimen-
sionless variables for the numerical calculations and found the superuid modes.
Lee calculated the oscillations for two dierent models. One of the models was a
neutron star with a mass of 0.5M

(M

is for solar masses) and the other one


has a mass of 1.4M

(same as Lindblom and Mendell). In the 0.5M

model,
the calculations were done assuming that the Schwarzschild discriminant and the
Brunt-Vaisala frequency are both zero (i.e. A = 0 and N
2
= 0). In this case no
g-modes exist. In the 1.4M

model, the calculation was done for two cases. One


was for zero Schwarzchild discriminant, like in the 0.5M

model, and the other one


32
was for a negative Schwarzschild discriminant which is given by taking into account
the composition gradient of the proton and neutron uids. Lee only calculated the
composition gradient in the high density region 310
13
g cm
3
, where the Serot
equation of state is used for the proton and neutron uid mixture and assumed that
A = 0 in the rest of the star. In the case where A < 0, g-modes only propagate in
the region between the superuid-normal uid boundary and the density threshold
of 3 10
13
g cm
3
. In conclusion Lee found that the superuidity prevents g-modes
from propagating. Andersson and Comer (2001) [5] later conrmed the result that
g-modes dont propagate in the superuid core of neutron stars.
33
5. OSCILLATIONS IN THE CORES OF SUPERFLUID NEUTRON
STARS
This chapter describes the neutron star models and numerical methods used in this
work to calculate the oscillations and also shows the results of those calculations.
A neutron star consists of a solid crust and a core. In the simplest model, the
core consists of a mixture of neutrons, protons and electrons. Even when considering
the possibility of other particles in the core such as hyperons (strange matter) and
deconned quarks (in the inner core), these particles will still be in a superuid
state. Superuidity has important eects on the oscillations in the cores of neutron
stars. In particular, it results in a new class of modes (called s-modes by Lindblom
and Mendell [46] and -modes by Lee [44]). Up to now, the determination of the
matter composition inside neutron stars has been made primarily by observations of
phenomena called glitches (when the spinning rate of a pulsar suddenly speeds up)
[47], [41], and of neutron star cooling rates. Oscillations in neutron star interiors are
important because if detected, they provide another window into the composition
of neutron star interiors. Although it is unlikely that oscillations of the interiors
might be observed in electromagnetic radiation, gravitational wave data (if detected)
might have signatures of oscillations in them (e.g. Comer [19]). This is because
there is a class of modes (called w-modes) emitted as gravitational radiation which
are strongly related to the oscillations of the matter inside neutron stars when
the calculations are done for rotating relativistic neutron stars ( e.g. [38], [11],
[9]). This chapter shows the results of calculations done for the oscillations of
superuid neutron stars. It extends the work done by Lee [44] to a more densely
packed grid of neutron star masses and oscillation modes respectively. Firstly, the
equilibrium model will be described before derivations of the oscillation equations
for a superuid are presented.
5.1 Equilibrium model and equation of state
All the equations, except for the ones describing the Harrison-Wheeler equation
of state, presented in this section are taken from Lee (1995) [44]. The Harrison-
Wheeler equation of state is also given in Shapiro and Teukolsky [60]. The equi-
librium model used here is the same as the one that was used by Lee (1995)
[44] and Lindblom and Mendell (1994) [46]. The Serot equation of state (de-
scribed by equations (4.23) - (4.36) in chapter 4) is used in the density region
of 3 10
13
g cm
3
, while the Harrison-Wheeler equation of state is used in the
density region of 2 10
12
g cm
3
. In the Serot equation of state, the chemical
potentials (4.29) and (4.30) can be given explicitly as

n
=
4m
3

c
5
h
3
_

_
k
n
m

c
_
+
_
k
p
m

c
__
m

n
+
m
2

c
2
m
n

1 +
_
k
n
m

c
_
2

c
2
k
3
n

2
h
3

1 +
_
k
n
m

c
_
2
m

m
2

c
4
k
p
h
3
1

2
_
k
p
m

c
_
2

1 +
_
k
p
m

c
_
2
m

n
+
6
2
_
k
3
n
+k
3
p
_
8.950m
2
u
m
n
c

2m
2
u
(m
u
m

) c
5
534.2 h
3
m

n
+
6
2
_
k
3
n
k
3
p
_
128.2m
2
u
m
n
c
(5.1)
and

p
=
4m
3

c
5
h
3
_

_
k
n
m

c
_
+
_
k
p
m

c
__
m

p
+
m

c
2
m
p

1 +
_
k
p
m

c
_
2

c
2
k
3
p

2
h
3

1 +
_
k
p
m

c
_
2
m

m
2

c
4
k
n
h
3
1

2
_
k
n
m

c
_
2

1 +
_
k
n
m

c
_
m

p
+
6
2
_
k
3
n
+k
3
p
_
8.950m
2
u
m
p
c

2m
2
u
(m
u
m

) c
5
534.2 h
3
m

6
2
_
k
3
n
k
3
p
_
128.2m
2
u
m
p
c
.
(5.2)
In the density region 2 10
12
3 10
13
an interpolation is used with a
polytrope given by
p = 8.49 10
16

1.09
. (5.3)
The Harrison-Wheeler equation of state describes a mixture of nuclei and free elec-
trons at the lowest densities and includes free neutrons above neutron drip. The
Harrison-Wheeler equation of state (taken from 2.6 of Shapiro and Teukolsky [60])
is summarised in what follows. The mass density is given by
=
n
e
M (A, Z) /Z +

e
+
n
c
2
(5.4)
where n
e
is the electron number density given by
n
e
=
m
3
e
c
3
3
2
h
3
x
3
e
. (5.5)
The M (A, Z) in equation 5.4 is the energy of an atomic nucleus given by the semi-
empirical mass formula
M (Z, A) = m

c
2
_
b
1
A+b
2
A
2
3
b
3
Z +b
4
A
_
1
2

Z
A
_
2
+
b
5
Z
2
A
1
3
_
, (5.6)
where A is the baryon number, Z is the number of protons and the bs are given by
b
1
= 0.991749, (5.7)
b
2
= 0.01911, (5.8)
b
3
= 0.000840, (5.9)
b
4
= 0.10175 (5.10)
35
and
b
5
= 0.000763. (5.11)
The electron energy density

e
is given by

e
=
m
4
e
c
5
h
3
(x
e
) n
e
m
e
c
2
, (5.12)
where the rest energy n
e
m
e
c
2
is subtracted because it is included in the term
M (A, Z). The neutron energy density
n
is given by

n
=
m
4
n
c
5
h
3
(x
n
) . (5.13)
In all the above equations, c is the speed of light. The function is given by
(x) =
1

2
_
x
_
1 +x
2
_1
2
_
1 + 2x
2
_
ln
_
x +
_
1 +x
2
_1
2
__
. (5.14)
When beta equilibrium is assumed, then
Z =
_
b
2
2b
5
_1
2
A
1
2
. (5.15)
The terms x
e
and x
n
are given by
b
3
+b
4
_
1
2Z
A
_
2b
5
Z
A
1
3
=
_
_
1 +x
2
e
_1
2
1
_
m
e
m
u
(5.16)
and
b
1
+
2b
2
A

1
3
3
+b
4
_
1
4

Z
2
A
2
_

b
5
Z
2
3A
4
3
=
_
1 +x
2
n
_1
2
m
n
m
u
. (5.17)
The total pressure is
p = p
e
+p
n
, (5.18)
where the electron pressure is given by
p
e
=
m
4
e
c
5
h
3
(x
e
) (5.19)
and the neutron pressure is given by
p
n
=
m
4
n
c
5
h
3
(x
n
) , (5.20)
where the function is given by
(x) =
1
8
2
_
x
_
1 +x
2
_1
2
_
2
3
x
2
1
_
+ ln
_
x +
_
1 +x
2
_1
2
_
_
. (5.21)
The Harrison-Wheeler equation of state gives the pressure in terms of density cal-
culated from equations (5.4) - (5.21) and is parameterised by A. In order to use the
Harrison-Wheeler equation of state to calculate the pressure at any given density,
rst choose a value of A > 56 and then use it to calculate Z and x
n
from equations
(5.15) and (5.17). If x
n
> 0, then neutron drip has been reached, so use the value
of x
n
to calculate
n
and p
n
from equations (5.13) and (5.20). If neutron drip has
not been reached, then set
n
and p
n
to zero. Now use equation (5.16) in order
to calculate x
e
and from there calculate

e
and p
e
from (5.12) and (5.19). Now
36
7 8 9 10 11 12 13 14 15 16
22
24
26
28
30
32
34
36
38
log()

l
o
g
(
P
)
Combined equation of state
Fig. 5.1: This is the relationship between the pressure and density of the combined equa-
tion of state. It is in good agreement with the graph given by Lindblom and
Mendell (1994) but was calculated with the code in section B.4 of appendix B.
substitute all these numbers into equations (5.4) and (5.18) in order to get the den-
sity and pressure for that value of A. Pressure was calculated in terms of density
using the combined equation of state and then these points were interpolated with
cubic splines. Figure 5.1 shows the relationship between pressure and density on
a logarithmic scale as calculated using the equations described here. The graph
appears exactly the same as the one given by Lindblom and Mendell [46].
In the model used in this thesis, the core is composed of a mixture of two uids,
the neutron superuid and the proton-electron plasma (in which protons are also
in a superuid state). Due to entrainment, the ow of one uid induces a current
in the other. The mass currents of the neutron and proton uids respectively are
given by

j
n
=
nn
v
n
+
np
v
p
(5.22)
and

j
n
=
pn
v
n
+
pp
v
p
(5.23)
where v
n
is the velocity of the neutron uid, v
p
is the velocity of the proton uid,
and the terms
nn
,
np
=
pn
, and
pp
are the induced densities and are given by

nn
=
n
m
n
m

n
(5.24)
and likewise for
pp
,

np
=
n
m

n
m
n
m

n
=
p
m

p
m
p
m

p
=
pn
(5.25)
where m

n
and m

p
are the eective masses of the neutrons and protons respectively.
They also satisfy the relations

nn
+
np
=
n
(5.26)
and

pp
+
pn
=
p
(5.27)
where
n
is the mass density of the neutron uid and
p
is mass density of the
proton uid. The equations of continuity of the two uids are given by

n
t
+

j
n
= 0 (5.28)
37
and

p
t
+

j
p
= 0. (5.29)
The time derivatives of the superuid velocities v
n
and v
p
(e.g. Landau and Lifschitz
[39]) are given by
v
n
t
=

_
v
2
n
2
+
n
+
_
(5.30)
and
v
p
t
=

_
v
2
p
2
+
p
+
_
(5.31)
where
n
and
p
are the chemical potentials of the neutrons and protons respectively
and is the gravitational potential. Assuming perfect charge neutrality of the
proton-electron plasma, we have for the continuity equation applying to the normal
uid electrons

e
t
+

(
e
v
e
) = 0 (5.32)
where
e
is the electron mass density and v
e
the velocity of the electron uid. We
also have for the time derivative of the velocity of the electron uid:
v
e
t
+v
e


v
e
=

(
e
+ ) s
e

T
e
, (5.33)
where
e
, s
e
and T
e
are the chemical potential, specic entropy and temperature
of the electrons respectively. If we take
pp
(5.22)
np
(5.23) and
nn
(5.23)

pn
(5.22) and divide by

2
=
nn

pp

np

pn
(5.34)
we nd the velocities of the neutron and proton velocities in terms of the mass
currents as
v
n
=

11

2
n

j
n
+

12

j
p
(5.35)
and
v
p
=

12

j
n
+

22

2
p

j
p
(5.36)
where

11
=

pp

2
n

2
, (5.37)

22
=

nn

2
p

2
(5.38)
and

12
=

np

p

2
, (5.39)
with these quantities satisfying
11
+
12
=
n
and
22
+
12
=
p
. Since we
are working with Newtonian gravity, the gravitational eld is given by the Poisson
equation (2.27) but in this case the density in the Poisson equation refers to the total
mass density =
n
+
p
+
e
. The current neutron star model being considered can
be divided into two sections; the superuid core and a normal uid envelope. The
oscillation equations used for the normal uid envelope region are the same ones as
derived earlier. The oscillation equations used in the superuid region are derived
from the superuid equations just given in the current chapter. If we rst consider
the star as nonrotating, then there is no motion in the equilibrium conguration
of the uids. This means that the velocities and mass currents in the equilibrium
congurations are zero.
38
5.2 Oscillations in spherically symmetric superuid neutron stars
In order to get the superuid oscillation equations, we superimpose small pertur-
bations on each of the equilibrium variables (i.e. replace v
n
with v
n
+v

n
, v
p
with
v
p
+v

p
,
n
with
n
+

n
,
p
with
p
+

p
and with +

) and then linearize


the oscillation equations by considering the perturbations as small enough that all
terms containing a product of perturbations may be neglected. This is the same as
what was done in the derivation of the oscillation equations for the normal uid.
Equations 5.28 to 5.31 then become

n
t
+

n
= 0, (5.40)

p
t
+

p
= 0, (5.41)
v

n
t
=

n
+

) , (5.42)
v

p
t
=

p
+

_
, (5.43)

e
t
+

(
e
v

e
) = 0 (5.44)
and
v

e
t
=

e
+

) s

T
e
s
e

e
(5.45)
where the terms containing the products of perturbations were discarded. Since the
perturbations in the uid are considered as harmonic oscillations, the time depen-
dence in all perturbed quantities is proportional to e
it
, where is the oscillation
frequency. This means that we can take
f
t
= if for all time-dependent functions
f. The neutron and proton velocities (5.35 and 5.36) are written in terms of the
perturbed quantities as
v

n
=

11

2
n

n
+

12

p
(5.46)
and
v

p
=

12

n
+

22

2
p

p
. (5.47)
The displacements in the neutron and proton superuids are dened respectively
by

n
i
n
(5.48)
and

p
i
p
. (5.49)
If equations (5.48) and (5.49) are rearranged to make

j

n
and

j

p
the subject and
are then substituted into equations (5.46) and (5.47) then the velocities can be
rewritten in terms of the displacements as
v

n
= i
_

11

n
+

12

p
_
(5.50)
and
v

p
= i
_

12

n
+

22

p
_
. (5.51)
39
Substituting equations (5.50) and (5.51) into equations (5.42) and (5.43), we have

2
_

11

n
+

12

p
_
=

n
+

) (5.52)
and

2
_

12

n
+

22

p
_
=

p
+

_
. (5.53)
Substituting the mass currents,

n
and

p
from equations (5.48) and (5.49) into the
continuity equations (5.40) and (5.41) we obtain

n
+

n
_
= 0 (5.54)
and

p
+

p
_
= 0. (5.55)
Since the velocity of the electron normal uid is the time derivative of its displace-
ment, we have for the continuity equation (5.44)

e
+

e
_
= 0 (5.56)
and the time derivative of the velocity (equation (5.45)) becomes

e
=

e
+

) s

T
e
s
e

e
. (5.57)
The interior of the neutron star of the current model is close to isothermal so that
the terms containing the gradients

T
e
and

T

e
in equation (5.57) are negligibly
small compared to the others and so are ignored. If we assume perfect charge
neutrality in the proton electron plasma, we get

p
m
p
=

e
m
e
(5.58)
for the equilibrium densities,

p
m
p
=

e
m
e
(5.59)
for the density perturbations and

p
=

e
(5.60)
for the displacements. From equation (5.58), the electron density
e
is equal to
me
mp
times the proton density
p
. Therefore if we consider the total momentum of the
proton-electron plasma, the momentum contribution of the electron normal uid is
me
mp
times the momentum contribution of the proton superuid. We may therefore
combine the momentum conservation equations of the electron and proton uids
as (5.53) +
me
mp
(5.57) in order to get the momentum conservation equation of the
proton-electron plasma

2
_

12

n
+
_

22

p
+
m
e
m
p
_

p
_
=

+
_
1 +
m
e
m
p
_

_
(5.61)
where

is the chemical potential of the proton-electron plasma, given by


p
+
m
e
m
p

e
. (5.62)
40
If the continuity equations (5.54) and (5.55) are rewritten in terms of radial and
horizontal components, we obtain

n
+
n
r
d
n
dr
+

n
r
2
d
_
r
2

n
r
_
dr
+
n

n
= 0 (5.63)
and

p
+
p
r
d
p
dr
+

p
r
2
d
_
r
2

p
r
_
dr
+
p

p
= 0 (5.64)
where
n
r
and
p
r
are the radial components of the displacements of the neutron and
proton uids respectively and

is the angular part of the gradient operator. Since


the star is not rotating, the problem is spherically symmetric and therefore the an-
gular dependence of the perturbed variables are the spherical harmonics Y
m
l
(, ).
The density perturbations can then be written as

n
(r, , , t) =

n
(r) Y
m
l
(, ) e
it
(5.65)
and

p
(r, , , t) =

p
(r) Y
m
l
(, ) e
it
(5.66)
for the neutron and proton uids respectively. The displacements of the neutron
uid

n
and the proton uid

p
can be written in component form, in spherical
coordinates, as

n
=
_

n
r
(r) ,
n
h
(r)

,
n
h
(r)
1
sin

_
Y
m
l
(, ) e
it
(5.67)
and

p
=
_

p
r
(r) ,
p
h
(r)

,
p
h
(r)
1
sin

_
Y
m
l
(, ) e
it
. (5.68)
Substituting equations (5.65), (5.66), (5.67) and (5.68) into the continuity equations
(5.63) and (5.64) and then rearranging, we obtain
r

n
h
_

n
+

n
r
r
d ln
n
d lnr
+

n
r
2
d
dr
_
r
2

n
r
_
_
=
r
2

Y
m
l
(, )
Y
m
l
(, )
(5.69)
and
r

n
h
_

p
+

p
r
r
d ln
p
d lnr
+

p
r
2
d
dr
_
r
2

p
r
_
_
=
r
2

Y
m
l
(, )
Y
m
l
(, )
(5.70)
where
2

is the angular part of the Laplacian operator and given by

=
1
r
2
1
sin
2

_
sin

_
sin

_
+

2

2
_
. (5.71)
The left hand sides of the equations (5.69) and (5.70) are only dependent on the
radial coordinate r and the right hand sides are only dependent on the angular
coordinates ( and ). Therefore both sides must be equal to a separation constant.
In this case the separation constant is l (l + 1) where l is an integer (see the section
on spherical harmonics in chapter 3). The continuity equations (5.69) and (5.70) in
the radial directions can then be written

n
+
1
r
2
d
dr
_
r
2

n
r
_
l (l + 1)

n
h
r
+

n
r
r
d ln
n
d lnr
= 0 (5.72)
and

p
+
1
r
2
d
dr
_
r
2

p
r
_
l (l + 1)

p
h
r
+

p
r
r
d ln
n
d lnr
= 0. (5.73)
41
The perturbations of the chemical potentials

n
and

p
as well as the perturbation
of the gravitational potential

can be written as products of their radial, angular


and time dependences in the same way as the densities (5.65) and (5.66) above. Con-
sequently, the radial dependence of the momentum conservation equations (5.52)
and (5.61) can be written in component form as

2
_

11

n
r
+

12

p
r
_
=
d
dr
(

n
+

) (5.74)
and

2
_

12

n
r
+
_

22

p
+
m
e
m
p
_

p
r
_
=
d
dr
(

) (5.75)
for the radial components and

2
_

11

n
h
+

12

p
h
_
=

n
+

r
(5.76)
and

2
_

12

n
h
+
_

22

p
+
m
e
m
p
_

p
h
_
=
+

r
(5.77)
for the horizontal components. The in equations (5.75) and (5.77) is dened as
= 1 +
m
e
m
p
. (5.78)
The Poisson equation is given by

= 4G
_

n
+

p
_
. (5.79)
When written in component form, equation (5.79) becomes
1
r
2

r
_
r
2

r
_
+
2

= 4G
_

n
+

p
_
. (5.80)
As in the other oscillation equations, the radial and angular dependences of the
Poisson equation are separable. Separating the variables, we obtain
1

_
d
dr
_
r
2
d

dr
_
4Gr
2
_

n
+

p
_
_
=
r
2

Y
m
l
(, )
Y
m
l
(, )
(5.81)
and therefore the Poisson equation in the radial direction is
d
dr
_
r
2
d

dr
_
= l (l + 1)

+ 4Gr
2
_

n
+

p
_
. (5.82)
The seven equations (5.72), (5.73), (5.74), (5.75), (5.76), (5.77) and (5.82) are the
linearized nonradial oscillation equations for the superuid core of neutron stars.
5.3 Form of superuid oscillation equations used for numerical
calculation
In the model, the chemical potentials of the uids,
n
and , are dependent on
the densities,
n
and
p
, so then by the mean value theorem we may write the
perturbations of the chemical potentials in terms of the density perturbations as
_

_
=
_
P
11
P
12
P
21
P
22
_ _

p
_
(5.83)
42
where the terms P
ij
in the matrix in the above equation are dened as
P
11
=
_

n
_
p
, (5.84)
P
12
=
_

p
_
n
, (5.85)
P
21
=
_

n
_
p
(5.86)
and
P
22
=
_

p
_
n
. (5.87)
We may invert the P matrix in equation 5.83 in order to get the density pertur-
bations in terms of the perturbations of the chemical potentials, provided that the
determinant

P
11
P
12
P
21
P
22

is non-zero. The density perturbations are then obtained


as
_

p
_
=
_
Q
11
Q
12
Q
21
Q
22
_ _

_
(5.88)
where
_
Q
11
Q
12
Q
21
Q
22
_
=
_
P
11
P
12
P
21
P
22
_
1
. (5.89)
For the calculations, the oscillation equations can be written in terms of dimen-
sionless variables in line with the form used for the numerical calculations of the
oscillations of a normal uid. The dimensionless variables dened follow the deni-
tions in Lee (1995) for the superuid oscillations:
y
n
1
=

n
r
r
, (5.90)
y
p
1
=

p
r
r
, (5.91)
y
n
2
=

n
+

gr
, (5.92)
y
p
2
=

gr
, (5.93)
y
3
=

gr
(5.94)
and
y
4
=
1
g
d

dr
(5.95)
where g =

is the gravitational acceleration (3.48). In order to write the linear


adiabatic superuid oscillation equations (5.72) - (5.77) and the Poisson equation
(5.79) in terms of the dimensionless variables, we rst need to eliminate the hori-
zontal displacements
n
h
and
p
h
between the equations. In order to do this, lets take
_
22
p
+
me
mp
_
(5.76)
12
n
(5.77) and
12
p
(5.76)
11
n
(5.77) in order to get

n
h
=
_

22

p
+
m
e
m
p
_

n
+

r
+

12

r
(5.96)
43
and

p
h
=

12

n
+

r
+

11

r
(5.97)
where


11

n
_

22

p
+
m
e
m
p
_


2
12

p
(5.98)
was dened as a shorthand symbol. If we make use of the equation (5.89) to
eliminate the density perturbations ,
n
and
p
, in favor of the chemical potential
perturbations ,

n
and

, in the continuity equations, (5.72) and (5.73), and then


combine them with equations (5.96) and (5.97) in order to eliminate
n
h
and
p
h
, we
obtain
1
r
2
d
dr
_
r
2

n
r
_
=

n
r
r
d ln
n
d lnr

Q
11

Q
12

+
l (l + 1)

2
r
_

22

p
+
m
e
m
p
_

n
+

r

l (l + 1)

2
r

12

r
(5.99)
and
1
r
2
d
dr
_
r
2

p
r
_
=

p
r
r
d ln
p
d lnr

Q
21

Q
22

l (l + 1)
r
2

n
+

r
+
l (l + 1)
r
2

11

r
.
(5.100)
If we rearrange equations (5.90) - (5.95) in order to get
n
r
,
p
r
,

n
,

and d

/dr
in terms of the dimensionless variables, we obtain

n
r
= ry
n
1
, (5.101)

p
r
= ry
p
1
, (5.102)

n
= gr (y
n
2
y
3
) , (5.103)

= gr (y
p
2
y
3
) , (5.104)

= gry
3
(5.105)
and
d

dr
= gy
4
. (5.106)
Substituting equations (5.101)-(5.106) into equations (5.99), (5.100), (5.74) and
(5.75) and rearranging, we obtain
r
dy
n
1
dr
=
_
3
d ln
n
d lnr
_
y
n
1
+
_
1

l (l + 1)
c
1

2
_

22

p
+
m
e
m
p
_

gr

n
Q
11
_
y
n
2

_
1

l (l + 1)
c
1

2

12

n
+
gr

n
Q
12
_
y
p
2
+
gr

n
(Q
11
+Q
12
) y
3
,
(5.107)
r
dy
p
1
dr
=
_
3
d ln
p
d lnr
_
y
p
1
+
_
1

l (l + 1)
c
1

2

11

gr

p
Q
22
_
y
p
2

_
1

l (l + 1)
c
1

2

12

p
+
gr

p
Q
21
_
y
n
2
+
gr

p
(Q
21
+Q
22
) y
3
,
(5.108)
44
r
dy
n
2
dr
= c
1

2
_

11

n
y
n
1
+

12

n
y
p
1
_
+ (1 U) y
n
2
(5.109)
and
r
dy
p
2
dr
= c
1

2
_

12

p
y
n
1
+
_

22

p
+
m
e
m
p
_
y
p
1
_
+ (1 U) y
p
2
(5.110)
where

2
=
R
3

GM

2
(5.111)
is the square of the dimensionless frequency and c
1
and U are the dimensionless
variables dened by (3.80) and (3.81). R

and M

are the stellar radius and mass


respectively. If equation (5.89) is used to eliminate the density perturbations in
favour of the chemical potential perturbations in the Poisson equation (5.82), we
obtain
d
dr
_
r
2
d

dr
_
= l (l + 1)

+ 4Gr
2
[(Q
11
+Q
21
)

n
+ (Q
12
+Q
22
)

] . (5.112)
Since equation (5.112) is a second order equation, it splits up into two rst order
dierential equations when written in terms of the dimensionless variables. To
obtain them, combine equations (5.94) and (5.95) in order to obtain
r
dy
3
dr
= (1 U) y
3
+y
4
(5.113)
and substitute equations (5.103), (5.104), (5.105) and (5.106) into equation (5.112)
and rearrange to obtain
r
dy
4
dr
= R
n
y
n
2
+R
p
y
p
2
+ [l (l + 1) R
n
R
p
] y
3
Uy
4
(5.114)
where R
n
and R
p
are dened as
R
n
= 4Gr
2
(Q
11
+Q
21
) (5.115)
and
R
p
= 4Gr
2
(Q
12
+Q
22
) . (5.116)
The six equations (5.107), (5.108), (5.109), (5.110), (5.113) and (5.114) are the
linear adiabatic oscillation equations for the superuid core of neutron stars in
the dimensionless form used for numerical calculation. In order to get the central
boundary conditions, take the densities
n
and
p
to be approximately constant
towards the centre. Therefore when r 0, we have for the continuity equations
(5.72) and (5.73)
d
dr
_
r
2

n
r
_
l (l + 1) r
n
h
= 0 (5.117)
and
d
dr
_
r
2

p
r
_
l (l + 1) r
p
h
= 0. (5.118)
It will be useful to now dene two functions


n

y
n
2
+

p

y
p
2
=
1
gr
_

n
+

p

_
(5.119)
and
y
n
2
y
p
2
=

gr

m
e
m
p

gr
. (5.120)
45
Physically is a measure of the deviation of the protons, neutrons and electrons
from -equilibrium due to perturbations in the chemical potentials. The eigenfunc-
tion is the same quantity as y
2
in the envelope but is measured throughout the
interior of the star. With regards to the eigenfunctions dened by equations (5.119)
and (5.120), can only be dened in the superuid core while is dened in the
entire interior of the star. With these eigenfunctions now dened, we can get two
of the central boundary conditions by requiring that they are regular at the centre.
For the eigenfunction , take
n

(5.74) +
p

(5.75) and
n

(5.76) +
p

(5.77)
in order to obtain

2
_


n
r
+


p
r
_
=
d
dr
_

n
+

p

_
(5.121)
and

2
_


n
h
+


p
h
_
=
1
r
_

n
+

p

_
. (5.122)
Eliminating the terms
n
h
and
p
h
from equation (5.122) with equations (5.117) and
(5.118), we obtain
d
dr
_
r
2
d
dr
(gr)
_
l (l + 1) gr = 0 (5.123)
which has a general solution of gr = C
1
r
l
+C
2
r
(l+1)
. If we assume regularity in
the centre, then the term proportional to r
(l+1)
is unphysical, so set C
2
= 0 and
we get
d (gr)
dr
lg = 0. (5.124)
Combining equations (5.124) and (5.121), we obtain

2
_


n
r
+


p
r
_
l
_

n
+

p

_
= 0 (5.125)
or in dimensionless form

y
n
1
+

y
p
1
l

n

2
c
1

y
n
2
l

p

2
c
1

y
p
2
= 0. (5.126)
In order to get the regularity of the eigenfunction , take (5.74) - (5.75) and (5.76)
- (5.77) to obtain

2
__

11


12

p
_

n
r
+
_

12


22

m
e
m
p
_

p
r
_
=
d
dr
_

m
e
m
p

_
(5.127)
and

2
__

11


12

p
_

n
h
+
_

12


22

m
e
m
p
_

P
h
_
=
1
r
_

m
e
m
p

_
. (5.128)
Eliminating
n
h
and
p
h
from equation 5.128 with the equations 5.117 and 5.118, we
obtain
d
dr
_
r
2
d
dr
(gr)
_
l (l + 1) gr = 0 (5.129)
which has a general solution of gr = K
1
r
l
+ K
2
r
(l+1)
. The term proportional
to r
(l+1)
is considered unphysical (if regularity of in the centre is assumed).
Therefore we have for the second central boundary condition
d
dr
(gr) lg = 0. (5.130)
46
Combining (5.130) with (5.127), it becomes

2
__

11



12

n
r
+
_

12


22

m
e
m
p
_

p
r
_
l
_

m
e
m
p

_
= 0 (5.131)
or in dimensionless form
_

11


22

p
_
y
n
1

_

22

m
e
m
p
_
y
p
1

l
c
1

2
y
n
2
+
l
c
1

2
y
p
2
= 0. (5.132)
The third central boundary condition is the same as the rst central boundary
condition for a normal uid (3.87),
ly
3
y
4
= 0. (5.133)
For the boundary conditions at the interface between the superuid core and the
normal uid envelope, we have the continuity conditions
_
v
n

r
(r
s
)
_
+

= 0, (5.134)
_
v
p

r
(r
s
)
_
+

= 0, (5.135)
[p

(r
s
)]
+

= 0, (5.136)
_

(r
s
)
gr
_
+

= 0 (5.137)
and
_
1
g
d

(r
s
)
dr
_
+

= 0 (5.138)
which in dimensionless form become

11

n
y
n
1
(r
c
)

12

n
y
p
1
(r
c
) +y
1
(r
e
) = 0, (5.139)

12

p
y
n
1
(r
c
)

22

p
y
p
1
(r
c
) +y
1
(r
e
) = 0, (5.140)

y
n
1
(r
c
)

p

y
p
1
(r
c
) +ly
3
(r
c
) +y
2
(r
e
) y
3
(r
e
) = 0, (5.141)
y
3
(r
c
) +y
3
(r
e
) = 0 (5.142)
and
y
4
(r
c
) +y
4
(r
e
) = 0 (5.143)
where the subscript c in r
c
is used to mean the superuid core and the subscript
e in r
e
is used to indicate the normal uid envelope (also note that r
c
= r
e
= r
s
where r
s
is the radius at the interface boundary between the superuid core and the
normal uid envelope). The linear adiabatic oscillation equations used to describe
the normal uid envelope are exactly the same ones that were derived for the normal
uid (i.e. equations (3.83) - (3.86)). The boundary conditions at the surface of the
neutron star are therefore also the same boundary conditions that were derived for
the normal uid given by equations (3.89) and (3.90)).
47
5.4 Results of the oscillation calculations
In the oscillation equations above, it might have been noticed that separate eective
masses for the neutrons and protons are needed for some of the variables. The Serot
equation of state, however can only provide one eective mass for the baryons. In
this case we use the same analytic expression for the proton eective mass m

p
that
was used by Lee [44] as well as Lindblom and Mendell [46]. This expression is given
by
m

p
= m
p
_
0.588 0.447y + 0.210y
2
_
, (5.144)
where
y = log
10
_

10
14
_
. (5.145)
The derivatives of the chemical potentials needed for the Qs in the oscillation
equations will now be written out before we give the results. If you calculate the
derivatives of equations (5.1) and (5.2), you will nd

n
=
12m

c
5
h
3
_

_
k
n
m
n
c
_
+
_
k
p
m
p
c
___
k
p
m
p
c
__
m

n
_
2
+
4c
2
k
3
n
3
2
h
3

1 +
_
k
p
m

c
_
2
m

4c
2
k
3
n

2
h
3
m

1 +
_
k
n
m

c
_
2
_
m

n
_
2

4c
2
k
3
p

2
h
3
m

1 +
_
k
p
m

c
_
2
_
m

n
_
+
4m
3

c
5
h
3
_

_
k
n
m
n
c
_
+
_
k
p
m
p
c
__

2
m

2
n
+
c
2
m
n

1 +
_
k
n
m

c
_
2
m

n
+
k
2
n
3m
n
m

n
_
1 +
_
kn
mc
_
2

k
2
n
m
n
m
2

_
1 +
_
kn
mc
_
2
m

3c
2
m
n

1 +
_
k
n
m

c
_
m

k
5
n
3
2
h
3

n
m
2

_
1 +
_
kn
mc
_
2
m

n
+
k
5
n

2
h
3
m
3

_
1 +
_
kn
mc
_
2
_
m

n
_
2

c
2
k
3
n

2
h
3
_
1 +
_
kn
mc
_
2

2
n
+
k
5
p

2
h
3
m

_
1 +
_
kp
mc
_

2
m

2
n

c
2
k
3
p

2
h
3

1 +
_
k
p
m

c
_

2
m

2
n
+
18
4
h
3
8.950m
2
u
m
2
n
c
+
2m
2
u
c
5
534.2 h
3
_
m

n
_
2

2m
2
u
(m
u
m

) c
5
534.2 h
3

2
m

2
n
+
18
4
h
3
128.2m
2
u
m
2
n
c
,
(5.146)
48

p
=

n
=
12m
2

c
5
h
3
_

_
k
n
m
n
c
_
+
_
k
p
m
p
c
__
m

n
m

4c
2
k
3
n

2
h
3
m

1 +
_
k
n
m

c
_
2
m

n
m

p
+
4c
2
k
3
p
3
2
h
3

1 +
_
k
p
m

c
_
2
m

4c
2
k
3
p

2
h
3
m

1
_
k
p
m

c
_
2
m

n
m

p
+
4m
3

c
5
h
3
_

_
k
n
m
n
c
_
+
_
k
p
m
p
c
__

2
m

p
+
c
2
m
n

1 +
_
k
n
m

c
_
2
m

k
2
n
m
n
m
2

_
1 +
_
kn
mc
_
m

p
m

c
2
kn
3

2
h
3

1 +
_
k
n
m

c
_
2

2
m

k
5
p
3
2
h
3
m
2

p
_
1 +
_
kp
mc
_
2
m

n
+
k
5
p

2
h
3
m
3

1 +
_
k
p
m

c
_
2
m

n
m

c
2
k
3
p

2
h
3

1 +
_
k
p
m

c
_
2

2
m

p
+
18
4
h
3
8.950m
2
u
m
n
m
p
c
+
2m
2
u
c
5
534.2 h
3
m

n
m

2m
2
u
(m
u
m

) c
5
534.2 h
3

2
m

18
4
h
3
128.2m
2
u
m
n
m
p
c
(5.147)
and

p
=
12m
2
u
c
5
h
3
_

_
k
n
m
n
c
_
+
_
k
p
m
p
c
___
m

p
_
2

4k
3
n
c
2

2
h
3
m
u

1 +
_
k
n
m

c
_
2
_
m

p
_
2
+
4k
3
p
c
2
3
2
h
3

1 +
_
k
p
m

c
_
2
m

4k
3
p
c
2

2
h
3
m
u

1 +
_
k
p
m
u
c
_
2
_
m

p
_
2
+
4m
3

c
5
h
3
_

_
k
n
m
n
c
_
+
_
k
p
m
p
c
__

2
m

2
p
+
c
2
m
p

1 +
_
k
p
m

c
_
2
m

p
+
k
2
p
3m
p
m

p
_
1 +
_
kp
mc
_
2

k
2
p
m
p
m
2
u
_
1 +
_
kp
mc
_
2
m

3c
2
m
p

1 +
_
k
p
m

c
_
2
m

k
5
p
3
2
h
3
m
2

p
_
1 +
_
kp
mc
_
2
m

p
+
k
5
p

2
h
3
m
3
u
_
1 +
_
kp
mc
_
2
_
m

p
_
2

k
3
p
c
2

2
h
3
_
1 +
_
kp
mc
_
2

2
m

2
p
+
k
5
n

2
h
3
m
3

_
1 +
_
kn
mc
_
2
_
m
p

p
_
2

k
3
n
c
2

2
h
3

1 +
_
k
n
m

c
_
2

2
m

2
p
+
18
4
h
3
8.950m
2
u
m
2
p
c
+
2m
2
u
c
5
534.2 h
3
_
m

p
_
2

2m
2
u
(m
u
m

) c
5
534.2 h
3

2
m

2
p
+
18
4
h
3
128.2m
2
u
m
2
p
c
+
k
2
p
3m
p
m
e

p
_
1 +
_
kp
mec
_
2
.
(5.148)
Numerical calculations of the oscillation modes were performed using a nite dif-
ference method, where the dierential equations were approximated with dierence
49
equations using the -method described in chapter 3. However, the problem is
slightly dierent from the example given in chapter 3 because there are two dier-
ent sets of coupled dierential equations corresponding to two dierent regions in
the star. They are the six linear adiabatic superuid oscillation equations (5.107),
(5.108), (5.109), (5.110), (5.113) and (5.114) for the superuid core, and the four
linear adiabatic oscillation equations (3.83), (3.84), (3.85) and (3.86) for the normal
uid envelope. This numeric scheme is implemented by the C++ program in section
B.6 of appendix B. The program takes as input, some variables in the output data
le created by the program in section B.4 together with variables added to that le
by the program in section B.5.
The interface boundary conditions (5.139), (5.140), (5.141), (5.142) and (5.143)
are continuity conditions between the superuid core and normal uid envelope.
This problem can be solved by putting the set of dierence equations into a matrix
where the matrix can be divided into two regions. The rst region contains the
dierence equations for the superuid oscillation equations for all the mesh points
from the centre of the star up to the core-envelope interface. The second region of
the matrix contains the nite dierence approximations to the oscillation equations
for the normal uid for all the mesh points from the interface to the surface of the
star. A block in between these two regions of the matrix contains the interface
boundary conditions in order to connect the superuid oscillation equations with
the normal uid oscillation equations at the interface. The matrix can be arranged
so that it still appears as a staircase matrix in each of the two separate regions.
This problem is really like two boundary value problems where the boundary at the
end of the one problem generates the boundary conditions at the beginning of the
other. Because of this, care must be taken that the matching at the interface is
correct.
Eigenfrequencies are looked for in the same way as was done in the example in
chapter 3, by replacing one of the surface boundary conditions with a normalisation
condition and then using that boundary to scan for modes. The extra set of modes
associated with the superuid core were called -modes by Lee (1995) [44] and s-
modes by Lindblom and Mendell (1994) [46], they will be referred to as s-modes
here. Oscillation modes were calculated for l = 1, 2, 3 for twenty dierent models
having masses between 0.5 and 2 solar masses.
The gure 5.2 is a graph showing how the eigenfrequencies of the f, p
1
and s
0
modes vary with mass for the case of l = 2. As shown in gure 5.2, the eigenfre-
quency of the p
1
-mode increases with an increase in mass. This can be explained
easily because the sound velocity increases with an increase in density (the p-modes
are acoustic). The frequencies of the f-modes increase with the square root of den-
sity; therefore, the dimensionless frequency of the f-mode remains constant (also see
Kokkotas and Schmidt, specically the graphs on page 41 [36], and Benhar et al, the
graphs on page 9 [15]). The eigenfrequency of the rst superuid mode (s
0
-mode)
decreases with an increase in mass. This is probably because they are associated
with the superuid core and so have more room to propagate in stars with larger
masses because of the increased size of the superuid region.
Tables 5.1, 5.2 and 5.3 show the eigenfrequencies of the modes with respect to
the masses of the dierent models for l = 1, 2, 3 respectively. The graphs in gures
5.5 to 5.28 show eigenfunctions and versus the dimensionless radius r/R for
the f, p
1
and s
0
modes of the 0.5M

, 1.4M

and 2.0M

solar mass neutron star


models. In each of these graphs, the eigenfunction is terminated at the boundary
between the superuid core and the normal uid envelope of the neutron star. Since
the central boundary conditions (5.124) and (5.129) imply that & r
l2
, the
eigenfuntions and contain a singularity at the centre of the star when l = 1.
This is not unphysical, since the chemical potentials are still regular at the centre,
but rather an artifact of the dimensionless units used. In order to normalize the
50
M

p
1
p
2
p
3
p
4
p
5
p
6
p
7
p
8
p
9
s
0
s
1
s
2
0.5 3.868 5.300 6.059 7.064 8.551 10.068 11.247 12.556 13.953 8.158 - -
0.6 4.128 5.389 6.658 7.393 9.023 10.390 11.795 12.930 - 6.230 - -
0.7 4.360 5.825 6.618 7.633 9.468 10.700 12.253 13.333 - 5.349 - -
0.8 4.567 5.720 6.833 7.905 9.876 10.997 12.515 13.864 - 5.006 12.899 -
0.9 4.787 5.779 7.046 8.176 10.196 11.217 11.731 - - 4.634 12.948 -
1.0 4.956 5.852 7.247 8.437 10.447 10.871 13.131 - - 4.370 11.574 -
1.1 5.122 5.930 7.436 8.688 10.193 11.781 13.266 - - 4.151 10.767 -
1.2 5.276 6.009 7.614 8.926 10.914 11.984 13.375 - - 3.972 9.275 -
1.3 5.421 6.086 7.782 9.128 11.012 12.175 13.482 - - 3.823 9.350 -
1.4 5.554 6.163 7.939 9.393 11.056 12.359 - - - 3.698 8.963 -
1.43 5.592 6.186 7.984 9.106 11.061 12.412 - - - 3.664 8.876 -
1.46 5.629 6.209 8.028 9.509 11.063 12.465 - - - 3.632 8.792 13.569
1.49 5.666 6.232 8.070 9.567 11.062 12.518 - - - 3.601 8.712 13.528
1.52 5.703 6.254 8.111 9.623 11.059 12.567 - - - 3.571 8.636 13.463
1.55 5.738 6.278 8.149 9.679 11.055 12.615 - - - 3.542 8.565 13.386
1.6 5.793 6.316 8.201 9.768 11.046 12.615 - - - 3.497 8.462 13.254
1.7 5.896 6.359 8.162 9.932 11.031 12.699 - - - 3.415 8.416 13.106
1.8 5.987 6.476 7.993 10.070 11.028 13.187 - - - 3.343 8.206 12.506
1.9 6.068 6.560 7.828 10.178 11.050 13.332 - - - 3.278 8.630 12.271
2.0 6.180 6.646 7.677 10.253 11.101 13.482 - - - 3.220 8.736 12.052
Tab. 5.1: This table shows the eigenfrequencies of the dierent modes for l = 1 for dierent
masses
eigenfuntions at the centre, the gures depicting and are plotted as (r/R)
and (r/R) versus the dimensionless radius whenever l = 1. The gure 5.3 shows
how the frequency of the p
1
-mode changes with the mass of the neutron star for
the cases l = 1, 2, 3 and gure 5.4 shows the same thing for the s
0
-mode. In the
cases when l = 1 and l = 3, the gures 5.3 and 5.4 show a similar trend to the case
when l = 2 but the frequencies are dierent. For instance as shown in gure 5.4,
the frequencies of the s
0
-mode are generally higher for higher values of l.
51
M

f p
1
p
2
p
3
p
4
p
5
p
6
p
7
p
8
s
0
s
1
0.5 1.510 3.890 6.406 7.635 8.630 10.283 11.387 - - 12.476 -
0.6 1.483 4.149 5.745 6.654 7.708 9.080 10.755 11.995 13.3073 10.057 -
0.7 1.474 4.383 5.916 6.870 7.824 9.572 10.999 12.484 13.636 8.775 -
0.8 1.472 4.598 6.046 7.034 8.242 9.965 11.288 12.913 - 7.743 -
0.9 1.473 4.793 6.138 7.470 8.368 10.330 11.578 13.272 - 7.003 -
1.0 1.476 4.979 6.165 7.545 8.583 10.661 11.850 13.275 - 6.736 13.613
1.1 1.479 5.150 6.597 7.692 8.812 10.958 12.103 12.527 - 6.065 13.843
1.2 1.483 5.308 6.599 7.846 9.042 11.219 11.875 - - 5.870 12.318
1.3 1.487 5.450 6.648 8.001 9.266 11.324 - - - 5.677 -
1.4 1.491 5.637 6.708 8.151 9.485 11.664 12.814 - - 5.450 10.920
1.43 1.492 5.670 6.726 8.196 9.548 11.716 12.879 - - 5.407 10.805
1.46 1.493 5.707 6.745 8.240 9.611 11.764 12.929 - - 5.362 10.694
1.49 1.494 5.746 6.764 8.283 9.674 11.809 12.985 - - 5.317 10.588
1.52 1.495 5.786 6.782 8.327 9.734 11.851 13.037 - - 5.274 10.487
1.55 1.496 5.826 6.800 8.370 9.795 11.889 13.089 - - 5.231 10.390
1.6 1.498 5.889 6.831 8.440 9.893 11.945 13.172 - - 5.163 10.238
1.7 1.501 6.012 6.893 8.576 9.945 12.030 13.321 - - 5.038 10.103
1.8 1.504 6.130 6.953 8.710 9.710 12.079 13.448 - - 4.926 10.281
1.9 1.507 6.244 7.012 8.836 9.490 12.096 13.530 - - 4.825 9.534
2.0 1.510 6.350 7.073 8.955 9.297 12.097 13.501 - - 4.734 9.333
Tab. 5.2: These are the eigenfrequencies of the dierent modes for l = 2 with respect to
dierent neutron star messes
M

f p
1
p
2
p
3
p
4
p
5
p
6
p
7
p
8
p
9
p
10
p
11
s
0
s
1
0.5 2.063 3.915 5.598 6.549 8.029 8.840 10.502 11.612 13.292 14.225 15.34 17.418 16.785 -
0.6 1.945 4.170 5.844 6.814 8.073 9.201 10.988 12.071 13.111 14.993 16.630 - 13.929 -
0.7 1.859 4.401 6.039 7.051 8.131 9.617 10.981 12.710 13.967 15.660 17.111 - 11.612 -
0.8 1.792 4.610 6.194 7.256 8.249 9.947 11.549 13.186 14.316 16.351 17.642 - 10.325 -
0.9 1.741 4.808 6.329 7.428 8.401 10.449 11.808 13.545 14.675 16.795 - - 9.436 -
1.0 1.700 4.993 6.437 7.474 8.484 10.781 12.086 13.893 15.081 15.605 - - 8.992 17.283
1.1 1.665 5.165 6.528 7.666 8.988 11.095 12.366 14.199 15.495 17.631 - - 8.314 14.667
1.2 1.637 5.326 6.598 7.629 8.209 11.385 12.639 14.475 15.898 17.840 - - 8.190 13.914
1.3 1.613 5.479 6.643 8.240 9.373 11.653 13.294 14.717 16.275 17.837 - - 7.474 12.903
1.4 1.593 5.623 6.648 8.358 9.584 11.899 13.155 14.932 16.605 17.595 - - 7.329 12.774
1.43 1.588 5.664 6.639 8.390 9.647 11.969 13.227 14.991 16.683 - - - 7.298 12.633
1.46 1.582 5.705 6.625 8.429 9.709 12.038 13.299 15.046 16.735 - - - 7.273 12.499
1.49 1.577 5.746 6.606 8.468 9.771 12.104 13.370 15.096 16.782 - - - 7.255 12.371
1.52 1.573 5.788 6.583 8.508 9.831 12.169 13.438 15.142 16.777 - - - 7.242 12.247
1.55 1.568 5.828 6.556 8.548 9.892 12.228 13.505 15.815 16.732 - - - 7.236 12.133
1.6 1.561 5.891 6.506 8.614 9.994 12.329 13.615 15.251 16.602 - - - 7.235 11.946
1.7 1.548 6.009 6.398 8.747 10.192 12.512 13.821 15.343 16.299 - - - 7.258 11.611
1.8 1.537 6.099 7.301 8.879 10.384 12.676 14.005 15.361 17.541 - - - 6.310 11.314
1.9 1.528 6.322 7.351 9.007 10.570 12.814 14.164 15.951 17.621 - - - 6.090 11.051
2.0 1.519 6.410 7.407 9.132 10.753 12.927 14.910 15.119 17.713 - - - 6.005 10.813
Tab. 5.3: These are the eigenfrequencies of the dierent modes for l = 3 with respect to
mass
52
2 4 6 8
1
0
1
2
0
.
6
0
.
8
1
1
.
2
1
.
4
1
.
6
1
.
8
2
f r e q u e n c y ( d i m e n s i o n l e s s u n i t s
m
a
s
s

(
s
o
la
r

m
a
s
s
e
s
)
f
r
e
q
u
e
n
c
y

o
f

m
o
d
e
s

w
it
h

r
e
s
p
e
c
t

t
o

m
a
s
s

o
f

s
t
a
r
F
i
g
.
5
.
2
:
T
h
e
e
i
g
e
n
f
r
e
q
u
e
n
c
i
e
s
o
f
t
h
e
d
i

e
r
e
n
t
m
o
d
e
s
v
a
r
y
w
i
t
h
m
a
s
s
o
f
t
h
e
n
e
u
t
r
o
n
s
t
a
r
f
o
r
l
=
2
m
o
d
e
s
a
s
s
h
o
w
n
.
T
h
e
r
e
d
l
i
n
e
s
h
o
w
s
t
h
e
e
i
g
e
n
f
r
e
q
u
e
n
c
y
o
f
t
h
e
f
-
m
o
d
e
,
g
r
e
e
n
i
s
t
h
e
e
i
g
e
n
f
r
e
q
u
e
n
c
y
o
f
t
h
e
p
1
-
m
o
d
e
a
n
d
b
l
u
e
i
s
t
h
e
e
i
g
e
n
f
r
e
-
q
u
e
n
c
y
o
f
t
h
e
s
0
-
m
o
d
e
4
4
.
5 5
5
.
5 6
6
.
5
0
.
6
0
.
8
1
1
.
2
1
.
4
1
.
6
1
.
8
2
f r e q u e n c y o f p
1
- m o d e ( d i m e n s i o n l e s s u n i t s )
m
a
s
s

(
s
o
la
r

m
a
s
s
e
s
)
f
r
e
q
u
e
n
c
y

o
f

p
1
-
m
o
d
e

v
e
r
s
e
s

m
a
s
s

f
o
r

l
=

1
,

2
,

3
l

=

1
l

=

2
l

=

3
F
i
g
.
5
.
3
:
T
h
e
c
h
a
n
g
e
o
f
t
h
e
f
r
e
q
u
e
n
c
y
o
f
t
h
e
p
1
-
m
o
d
e
w
i
t
h
r
e
s
p
e
c
t
t
o
m
a
s
s
f
o
r
l
=
1
,
2
,
3
i
s
s
h
o
w
n
.
4 6 8
1
0
1
2
1
4
1
6
0
.
6
0
.
8
1
1
.
2
1
.
4
1
.
6
1
.
8
2
f r e q u e n c y o f s
0
- m o d e ( d i m e n s i o n l e s s u n i t s )
m
a
s
s

(
s
o
la
r

m
a
s
s
e
s
)
F
r
e
q
u
e
n
c
y

o
f

s
0
-
m
o
d
e

v
e
r
s
e
s

m
a
s
s

f
o
r

l
=

1
,

2
,

3
l

=

1
l

=

2
l

=

3
F
i
g
.
5
.
4
:
T
h
e
c
h
a
n
g
e
o
f
t
h
e
f
r
e
q
u
e
n
c
y
o
f
t
h
e
s
0
-
m
o
d
e
c
h
a
n
g
e
s
w
i
t
h
r
e
s
p
e
c
t
t
o
m
a
s
s
o
f
t
h
e
n
e
u
t
r
o
n
s
t
a
r
f
o
r
l
=
1
,
2
,
3
i
s
s
h
o
w
n
.
53
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
( r / R ) * a n d ( r / R ) *
r
/
R


a
n
d


v
s

r
a
d
i
u
s

f
o
r

p
1
-
m
o
d
e
,

l

=

1

i
n

0
.
5

s
o
l
a
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
5
:
T
h
e
e
i
g
e
n
f
u
n
c
t
i
o
n
s

a
n
d

f
o
r
t
h
e
p
1
-
m
o
d
e
i
n
t
h
e
0
.
5
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
1
.
N
o
t
e
t
h
a
t
d
u
e
t
o
t
h
e
c
e
n
t
r
a
l
b
o
u
n
d
a
r
y
c
o
n
d
i
t
i
o
n
s
,

a
n
d

h
a
v
e
a
s
i
n
g
u
l
a
r
i
t
y
a
t
t
h
e
c
e
n
t
r
e
o
f
t
h
e
s
t
a
r
w
h
e
n
l
=
1
,
a
s
s
u
c
h
t
h
e
v
e
r
t
i
c
a
l
a
x
i
s
s
h
o
w
s
rR

a
n
d
rR

r
a
t
h
e
r
t
h
a
n

a
n
d

i
n
o
r
d
e
r
t
o
n
o
r
m
a
l
i
z
e
t
h
e
e
i
g
e
n
f
u
n
c
t
i
o
n
s
a
t
t
h
e
c
e
n
t
r
e
.
-
0
.
2 0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
( r / R ) * a n d ( r / R ) *
r
/
R


a
n
d


v
s

r
a
d
i
u
s

f
o
r

s
0
-
m
o
d
e
,

l

=

1

i
n

0
.
5

s
o
l
a
r

m
a
s
s

m
o
d
e
l
F
i
g
.
5
.
6
:
rR

a
n
d
rR

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
d
i
u
s
f
o
r
t
h
e
s
0
-
m
o
d
e
i
n
t
h
e
0
.
5
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
1
.
54
0
.
1
0
.
2
0
.
3
0
.
4
0
.
5
0
.
6
0
.
7
0
.
8
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


f
o
r

f
-
m
o
d
e
,

l
=

2

in

0
.
5

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
7
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
d
i
u
s
f
o
r
t
h
e
f
-
m
o
d
e
i
n
t
h
e
0
.
5
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
2
.
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


f
o
r

p
1
-
m
o
d
e
,

l
=

2

in

0
.
5

s
o
la
r

m
a
s
s

m
o
d
e
l
F
i
g
.
5
.
8
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
d
i
u
s
f
o
r
t
h
e
p
1
-
m
o
d
e
i
n
t
h
e
0
.
5
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
2
.
-
0
.
4
-
0
.
2 0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

s
0
-
m
o
d
e
,

l
=

2

f
o
r

0
.
5

s
o
la
r

m
a
s
s

m
o
d
e
l
F
i
g
.
5
.
9
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
d
i
u
s
f
o
r
t
h
e
s
0
-
m
o
d
e
i
n
t
h
e
0
.
5
s
o
l
a
r
m
a
s
s
m
o
d
e
l
w
h
e
n
l
=
2
55
0
0
.
1
0
.
2
0
.
3
0
.
4
0
.
5
0
.
6
0
.
7
0
.
8
0
.
9
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

f
-
m
o
d
e
,

l
=

3

in

0
.
5

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
1
0
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
f
-
m
o
d
e
i
n
t
h
e
0
.
5
s
o
l
a
r
m
a
s
s
m
o
d
e
l
w
h
e
n
l
=
3
.
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

p
1
-
m
o
d
e
,

l
=

3

in

0
.
5

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
1
1
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
p
1
-
m
o
d
e
i
n
t
h
e
0
.
5
s
o
l
a
r
m
a
s
s
m
o
d
e
l
w
h
e
n
l
=
3
.
-
0
.
6
-
0
.
4
-
0
.
2 0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

s
0
-
m
o
d
e
,

l
=

3

f
o
r

0
.
5

s
o
la
r

m
a
s
s

m
o
d
e
l
F
i
g
.
5
.
1
2
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
s
0
-
m
o
d
e
i
n
t
h
e
0
.
5
s
o
l
a
r
m
a
s
s
m
o
d
e
l
w
h
e
n
l
=
3
.
56
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


f
o
r

p
1
-
m
o
d
e
,

l

=

1

i
n

1
.
4

s
o
l
a
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
1
3
:
rR

a
n
d
rR

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
d
i
u
s
f
o
r
t
h
e
p
1
-
m
o
d
e
i
n
t
h
e
1
.
4
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
1
.
-
2 0 2 4 6 8
1
0
1
2
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
i
u
s

f
o
r

s
0
-
m
o
d
e
,

l

=

1

f
o
r

1
.
4

s
o
l
a
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
1
4
:
rR

a
n
d
rR

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
d
i
u
s
f
o
r
t
h
e
s
0
-
m
o
d
e
i
n
t
h
e
1
.
4
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
1
.
57
0
.
1
0
.
2
0
.
3
0
.
4
0
.
5
0
.
6
0
.
7
0
.
8
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

f
-
m
o
d
e
,

l
=

2

in

1
.
4

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
1
5
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
f
-
m
o
d
e
i
n
t
h
e
1
.
4
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
2
.
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

p
1
-
m
o
d
e
,

l
=

2

in

1
.
4

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
1
6
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
p
1
-
m
o
d
e
i
n
t
h
e
1
.
4
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
2
.
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


f
o
r

s
0
-
m
o
d
e
,

l
=

2

in

1
.
4

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
1
7
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
s
0
-
m
o
d
e
i
n
t
h
e
1
.
4
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
2
.
58
0
0
.
1
0
.
2
0
.
3
0
.
4
0
.
5
0
.
6
0
.
7
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

f
-
m
o
d
e
,

l
=

3

in

1
.
4

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
1
8
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
f
-
m
o
d
e
i
n
t
h
e
1
.
4
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
3
.
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


f
o
r

p
1
-
m
o
d
e
,

l
=

3

in

1
.
4

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
1
9
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
p
1
-
m
o
d
e
i
n
t
h
e
1
.
4
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
3
.
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

s
0
-
m
o
d
e
,

l
=

3

in

1
.
4

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
2
0
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
s
0
-
m
o
d
e
i
n
t
h
e
1
.
4
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
3
.
59
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
( r / R ) * a n d ( r / R ) *
r
/
R


a
n
d


v
s

r
a
d
i
u
s

f
o
r

p
1
-
m
o
d
e
,

l

=

1

i
n

2

s
o
l
a
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
2
1
:
rR

a
n
d
rR

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
d
i
u
s
f
o
r
t
h
e
p
1
-
m
o
d
e
i
n
t
h
e
2
s
o
l
a
r
m
a
s
s
m
o
d
e
l
w
h
e
n
l
=
1
.
-
5 0 5
1
0
1
5
2
0
0
0
.
2
0
.
4
0
.
6
0
.
8
1
( r / R ) * a n d ( r / R ) *
r
/
R


a
n
d


v
s

r
a
d
i
u
s

f
o
r

s
0
-
m
o
d
e
,

l

=

1

i
n

2

s
o
l
a
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
2
2
:
rR

a
n
d
rR

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
d
i
u
s
f
o
r
t
h
e
s
0
-
m
o
d
e
i
n
t
h
e
2
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
1
.
60
0
.
1
0
.
2
0
.
3
0
.
4
0
.
5
0
.
6
0
.
7
0
.
8
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
r
(
e
n
d
)


a
n
d


v
s

r
a
d
iu
s

f
o
r

f
-
m
o
d
e
,

l
=

2

in

2

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
2
3
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
f
-
m
o
d
e
i
n
t
h
e
2
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
2
.
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


f
o
r

p
1
-
m
o
d
e
,

l
=

2

in

2

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
2
4
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
p
1
-
m
o
d
e
i
n
t
h
e
2
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
2
.
-
1 0 1 2 3 4 5 6
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

s
0
-
m
o
d
e
,

l
=

2

in

2

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
2
5
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
s
0
-
m
o
d
e
i
n
t
h
e
2
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
2
.
61
0
0
.
1
0
.
2
0
.
3
0
.
4
0
.
5
0
.
6
0
.
7
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

f
-
m
o
d
e
,

l
=

3

in

2

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
2
6
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
f
-
m
o
d
e
i
n
t
h
e
2
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
3
.
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

p
1
-
m
o
d
e
,

l
=

3

in

2

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
2
7
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
p
1
-
m
o
d
e
i
n
t
h
e
2
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
3
.
0
0
.
2
0
.
4
0
.
6
0
.
8 1
0
0
.
2
0
.
4
0
.
6
0
.
8
1
a n d b
r
/
R


a
n
d


v
s

r
a
d
iu
s

f
o
r

s
0
-
m
o
d
e
,

l
=

3

in

2

s
o
la
r

m
a
s
s

m
o
d
e
l

F
i
g
.
5
.
2
8
:

a
n
d

v
e
r
s
u
s
t
h
e
d
i
m
e
n
s
i
o
n
l
e
s
s
r
a
-
d
i
u
s
f
o
r
t
h
e
s
0
-
m
o
d
e
i
n
t
h
e
2
s
o
l
a
r
m
a
s
s
n
e
u
t
r
o
n
s
t
a
r
m
o
d
e
l
w
h
e
n
l
=
3
.
62
6. RESULTS AND DISCUSSION
This chapter gives a summary and discussion of results.
The results in chapter 5 were all calculated in the context of Newtonian gravity.
Lees work [44] was chosen as a basis for the work done here because he, along
with Lindblom and Mendell [46], attempted specically to investigate the eects of
superuidity on the oscillations of neutron stars. Although such calculations are
useful for understanding the physical eects of superuidity on the oscillations, real
neutron stars have densities in a regime where post-Newtonian eects of gravity
become signicant. The possible incorporation of general relativity as well as dis-
cussion of rotatation and strong electromagnetic elds will be discussed in chapter
7.
Neutron stars have superuid cores. In this work, oscillations of neutron stars
with superuid cores were calculated for twenty dierent models, having the same
combined Serot & Harrison-Wheeler equation of state, but dierent masses ranging
between 0.5 and 2 solar masses. Figures 5.2, 5.3 and 5.4 in Chapter 5 show how
the dimensionless frequencies of the f-mode, p
1
-mode and s
0
-mode vary with the
mass of the neutron star when calculated using the combined equation of state. In
Figure 5.2, the atness of the graph describing the frequency of the f-mode indicates
that, for the l = 2 mode, the f-mode retains the same dimensionless frequency; the
absolute value of the frequency therefore rises as the square root of the density of
the star. The linearity is weaker in the case of l = 3 mode, however. Since the
sound velocity increases with an increase in density, it would be expected that the
absolute frequencies of the p-modes would increase with an increase in mass. Figure
5.2 indicates that the dimensionless frequencies of the p
1
-modes also increase with
mass. The s-modes exist due to properties of the superuid and are driven by slight
dierences between the perturbations of the chemical potentials of the protons and
the neutrons and a slight shift from beta equilibrium. (The timescale of the weak
interaction in neutron stars is much longer than the timescales of the oscillations so
it does make physical sense that this can cause a dierence in the relative velocities
between the proton and neutron uids [24], [46]). The oscillations due to the s-
modes are transmitted into the normal uid envelope when the medium changes
from a superuid to a normal uid at the core-envelope boundary. In the envelope,
the s-modes take on the characteristics of the fand p-modes. The frequencies of
the s-modes seem to decrease with an increase in the mass of the neutron star for
the calculated models (as shown to be the case for the s
0
-mode in gure 5.2).
The gures 5.3 and 5.4 show how the frequencies of the p
1
-mode and the s
0
-
mode change with mass respectively for l = 1, 2, 3. For all three values of l,
they show the same behaviour as shown in gure 5.2 except that the frequencies
increase with an increase in l. Recall the denition of the eigenfunction given in
Equation (5.120). Physically is a measure of the deviation of the protons, neutrons
and electrons from -equilibrium due to perturbations in the chemical potentials.
The eigenfunction is the same quantity as y
2
in the envelope but is measured
throughout the interior of the star. When the medium is in a superuid state, the
neutron superuid and the proton-electron plasma can ow separately whereas in
the normal uid medium in the envelope the velocities of the protons and neutrons
are equal and so ow together as a single uid. This means that in the p-modes
Mode Lee this work
l = 1
p
1
3.867 3.868
p
2
5.279 5.300
p
3
5.981 6.059
s
0
7.915 8.158
l = 2
f 1.470 1.510
p
1
3.888 3.890
p
2
5.532 6.406
p
3
6.378 7.635
s
0
13.06 12.476
l = 3
f 2.103 2.063
p
1
3.914 3.915
p
2
5.620 5.598
p
3
6.576 6.549
s
0
17.32 16.785
Tab. 6.1: A comparison between the eigenfrequencies calculated in the previous chapter
and those calculated by Lee for the 0.5 solar mass model.
and f-modes (i.e. normal uid modes), the protons and neutrons ow in the same
directions while in the s-modes (the superuid modes) there exists a relative velocity
between the neutrons and protons (according to Lindblom and Mendell [46] ). The
fact that relative velocities between the protons and the neutrons cause a shift from
-equilibrium explains why the amplitudes of the eigenfunction are much larger
than those of in the superuid core for the s-modes but not the for the f and
p-modes. (In Figures 5.5 - 5.28 compare the s-modes shown by the gures 5.6, 5.9,
5.12, 5.14, 5.17, 5.20, 5.22, 5.25 and 5.28 with the rest). In some of the graphs (but
not all) in the gures 5.5 - 5.28, the eigenfunction has comparable amplitudes to
those given by Lee [44] but with opposite sign; this is dicult to explain. Apart
from this dierence, the eigenfrequencies calculated are in good agreement with
Lees (Lee only published the results for the 0.5 and 1.4 solar mass models). Tables
6.1 and 6.2 show a comparison between the eigenfrequencies calculated in chapter 5
and those calculated by Lee. In table 6.3 I compare my results for the f-modes with
Lees results, and with those of Lindblom and Mendell. Table 6.4 lists the physical
parameters of all twenty models. The rst column in table 6.4 lists the masses of
the models as measured in solar masses and the second column lists their respective
radii. The third and fourth columns list the mass and volume ratios respectively of
the superuid core to those of the star. The last two columns list the logarithms of
the central density and pressure respectively (in cgs units, as is customary).
64
Mode Lee this work
l = 1
p
1
4.924 5.544
p
2
5.680 6.163
p
3
7.417 7.939
s
0
3.293 3.698
s
1
9.172 8.963
l = 2
f 1.175 1.491
p
1
5.587 5.637
p
2
6.060 6.708
p
3
7.781 8.151
s
0
4.938 5.450
s
1
11.03 10.920
l = 3
f 1.695 1.593
p
1
5.605 5.623
p
2
6.157 6.643
p
3
8.055 8.358
s
0
7.020 7.329
s
1
12.71 12.774
Tab. 6.2: A comparison between the eigenfrequencies calculated in the previous chapter
and those calculated by Lee for the 1.4 solar mass model.
l Lee Lindblom & Mendell this work
2 1.175 1.177 1.491
3 1.695 1.692 1.593
Tab. 6.3: A comparison between the eigenfrequencies for the f-modes of l = 2 and l = 3
given by Lee, Lindblom and Mendell and the current work of the 1.4 solar mass
model. The dimensionless eigenfrequencies listed in Lindblom and Mendells
original paper had a dierent normalization to Lee and hence the frequencies
listed in the current work. As a result the frequencies listed under Lindblom &
Mendell are not exactly the same as the ones listed in their original paper but
rather those results multiplied a factor of
q
3
4
.
65
M

(Solar Masses) R(km)


M
sfc
M
_
R
sfc
R
_
3
log (
c
) log (p
c
)
0.5 13.441 0.19989 0.00661 14.503 33.989
0.6 13.560 0.29185 0.11016 14.524 34.071
0.7 13.722 0.36627 0.15254 14.542 34.139
0.8 13.902 0.42699 0.19190 14.557 34.199
0.9 14.088 0.47724 0.22801 14.571 34.251
1.0 14.276 0.51942 0.26099 14.583 34.298
1.1 14.461 0.55531 0.29110 14.595 34.340
1.2 14.642 0.58619 0.31864 14.605 34.379
1.3 14.820 0.61305 0.34389 14.614 34.415
1.4 14.993 0.63662 0.36710 14.623 34.448
1.43 15.044 0.64314 0.37370 14.626 34.457
1.46 15.094 0.64943 0.38015 14.628 34.467
1.49 15.144 0.65550 0.38645 14.631 34.476
1.52 15.193 0.66136 0.39260 14.633 34.485
1.55 15.242 0.66702 0.39860 14.636 34.493
1.6 15.323 0.67605 0.40832 14.639 34.508
1.7 15.482 0.69271 0.42669 14.647 34.535
1.8 15.635 0.70774 0.44379 14.654 34.560
1.9 15.795 0.72136 0.45973 14.660 34.585
2.0 15.930 0.73377 0.47465 14.667 34.608
Tab. 6.4: The physical parameters of the neutron star models as calculated in this work.
66
7. CONCLUSIONS AND PLANS FOR THE FUTURE
This chapter describes how the work can be taken further.
The analysis of the oscillations of neutron stars has already been carried out in
the context of general relativity ([21], [37], [7], [9], [4], [6], [11]). In order to calculate
the oscillations of neutron stars in the context of general relativity, the authors in
the above citations used a mathematical framework for general relativistic uids
originally developed by Carter [17] but also described elsewhere [20], [8]. Carter re-
formulated general-relativistic uid dynamics into a Lagrangian framework in order
to be able to describe the motion of uids in curved space-times. This chapter briey
describes Carters general relativistic uid framework and then briey describes the
eects of rotatation and electromagnetic.
Carters framework for general relativistic uids relies on a variational principle
of the type initially proposed by Taub [62]. This Lagrangian framework for uid
mechanics is not found in standard texts. Before Carters framework can be dis-
cussed, a basic understanding of Einsteins general relativity is needed. A good
introduction to general relativity is given by Hartle [30] and a more advanced de-
scription is given by Misner, Thorne and Wheeler (MTW) [52]. In the following
discussion, geometrised units are used (c = G = 1). MTW conventions [52] are also
used. General relativity describes gravity as a curvature in spacetime due to the
presence of mass-energy. Freely moving objects follow geodesic paths in the curved
spacetime. Events in spacetime are identied by a set of four coordinates x

, where
= t, x, y, z. Separations in spacetime are measured by a metric tensor g

with
separation between innitesimally close events given by a line element ds, with
ds
2
= g

dx

dx

, (7.1)
where the Einstein summation convention is assumed. The motion of freely moving
objects of non-zero mass is described in any spacetime by worldlines of extremal
proper time (the time measured on an on-board ideal clock, not coordinate clocks)
between two given events. Worldlines that satisfy this condition are called geodesics.
This motion is described by the geodesic equations
d
2
x

d
2
=

dx

d
dx

d
(7.2)
where the coecients

are the Christoel symbols determined by the metric g

.
In the absence of mass (i.e. no gravitation present), the metric g

is just the at
spacetime metric (the Minkowski spacetime of special relativity)
g

=
_
_
_
_
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
_
_
_
_
(7.3)
and the line element 7.1 is
ds
2
= dt
2
+dx
2
+dy
2
+dz
2
. (7.4)
The presence of matter however, curves spacetime, producing a more general metric
than the Minkowski spacetime metric given by equation (7.3). The equations that
determine g

in this case are the Einstein eld equations:


G

= 8T

, (7.5)
where G

is a measure of the spacetime curvature called the Einstein curvature


tensor and is given by
G

= R

1
2
g

R, (7.6)
where R

is the Ricci tensor determined by the metric g

, and R is the Ricci


scalar, which is the trace of the Ricci curvature tensor. T

in the Einstein eld


equations is the stress-energy tensor which gives a description of the distribution of
mass-energy which acts as a source of the spacetime curvature. The components of
the stress-energy tensor are as follows: the time-time component T
00
is the energy
density of the mass-energy, the T
0
components give the energy-momentum four-
vector per unit volume, the T
0k
components (where the index k indicates just the
spatial coordinates) is the energy ux, and the purely spatial components make up
the stress tensor. For a single ideal uid the stress-energy tensor is given by
T

= ( +p) u

+g

p, (7.7)
where u

is the four-velocity eld of the uid, p is the uid pressure and is the
energy density of the uid. If p and are related by an equation of the form
p = p (), the tensor T

contains only four independent uid variables and so


the uid equations of motion can be obtained directly from the conservation of
energy-momentum equations

= 0 (7.8)
where

indicates the covariant derivative. Equation (7.8) follows from the fact
that

must vanish identically. The equations of motion of the uid can


be obtained from (7.8) only if a single uid is present. If there are multiple uids
present then equations (7.8) are not sucient. The system is undetermined because
equation (7.8) provides only four equations for more than four unknowns, dierent
uids having independent velocities. A description of the motion of a many-uid
system requires an equation of motion for each uid constrained by the further
requirement that equation (7.8) holds.
Carters framework consists of a Lagrangian formulation of uid mechanics in
which he uses a variational principle to obtain the equations of motion. For a single
uid, Carters action integral is given by
I =
_
M

gd
4
x (7.9)
over a space-time four-volume M, where g is the determinant of the metric g

,
and the negative sign under the square root is due to our choice of metric signature
(+ ++). The Lagrangian-density function is given by
= . (7.10)
is also called the master function, and depends only on n

= n
2
in the single
uid case, where n

is the number four-density of the uid. The function is the


central quantity in Carters framework. We also dene the momentum covector
given in terms of the master function as

= Bn

, (7.11)
68
where
B = 2

n
2
. (7.12)
The magnitude of

is the chemical potential of the uid and points in the direction


of the uid ow. When not described in terms of the Lagrangian it is dened as

= u

(7.13)
where is the chemical potential and u

is the four-velocity of the uid (remember


in geometerised units, mass and energy have the same units). When given in terms
of the Lagrangian (7.10), it can be seen to have the right units if we notice that
corresponds to the energy density in this case. We can also dene the generalised
pressure given as
= n

. (7.14)
The stress-energy tensor in this case may be given in terms of the master function
as
T

= g

+n

. (7.15)
If we note that for a single uid, as in this case, is just the uid pressure p and that
for low temperatures, since we havent considered the eects of heat conduction, we
have the thermodynamic relation
n = p +, (7.16)
the stress energy tensor in (7.15) is the same as the one given earlier (7.7). In the
case of a mixture of two uids, then each of the uids have separate currents. In this
case constituent indices X, Y etc are attached to each of the currents which range
over the values X, Y = 1, 2. These indices do not satisfy the Einstein summation
convention and are only summed when explicitly indicated. The master function in
this case is a function of all the scalars that can be formed from the two number
currents (i.e. the contractions n

X
n
X

for X = 1, 2 as well as a mixed term n

X
n
Y

).
The momentum covectors
X

in this case, are given as

= g

_
B
X
n

X
+/
XY
n

Y
_
, (7.17)
where the B
X
is dened the same way as in (7.12) for each of the separate uids
and /
XY
is a mixed term given by
/
XY
=

n
2
XY
, X ,= Y. (7.18)
The mixed term n
2
XY
= n

X
n
Y

is due to entrainment between the two uids. The


generalised pressure is given by
=

X={1, 2}
n

. (7.19)
In this case, the stress-energy tensor of this mixture is given in a similar form as in
(7.15);
T

X={1, 2}
n

. (7.20)
The main reason for discussing this framework is in its possible use for incorpo-
rating general relativity in the study of neutron star oscillations [7], [9]. Further
development of of the work described in this thesis would require the application of
general relativistic gravity instead of Newtonian gravity to the interior of neutron
69
stars. The rst results in this context for non-rotating stars have been published
by Andersson, Comer and Langlois [9] using Carters approach summarised above.
If rotation is taken into account, the equilibrium structure of a star no longer
has spherical symmetry because centrifugal forces will cause it to bulge out at the
equator. With regards to oscillations, rotation results in a new class of modes
called r-modes. The r-modes are caused by a coupling between the Coriolis force
and the radial component of vorticity and their eigenfrequencies are proportional
to the angular velocity of the star. In addition the Coriolis force also changes the
eigenfrequencies of the other modes. Section 19.4 in Unno et al [63] provides more
information about r-modes in general rotating stars. Rotating neutron stars with
superuid cores also have r-modes and are discussed in terms of Newtonian gravity
by Mendell (1991) [51] as well as by Lee and Yoshida (2003) [45]. In another paper,
Yoshida and Lee (2003) [66] discuss r-modes in neutron stars with general relativity
taken into account. When general relativity is taken into account, gravitational
waves emitted by rotating neutron stars give rise to yet another class of modes
called w-modes. The w-modes are associated with the r-modes (eg. Kokkotas and
Schutz (1992) [38].
Electromagnetic elds eect both the equilibrium conguration as well as the
oscillation modes in stars (sections 19.4 and 19.5 of Unno et al [63]. In general,
an electromagnetic contribution to both the equilibrium conguration as well as
the eigenfrequencies of the oscillation modes are proportional to the square of the
magnetic induction B
2
. The eects of electromagnetic elds on neutron star os-
cillations are discussed by Mendell (1991) [51]. In addition, Jones and Andersson
(2002) [32] discuss eects of electromagnetic elds on precession in neutron stars.
If general relativity is to be included in any calculations, an exact solution to Ein-
steins eld equation has already been derived for rotating neutron stars with a
strong electromagnetic eld by Manko et al (2000) [49].
70
BIBLIOGRAPHY
[1] A. Akmal and V. R. Pandharipande. Spin-isospin structure and pion conden-
sation in nucleon matter. Phys. Rev. C, 56:2261, October 1997.
[2] A. Akmal, V. R. Pandharipande, and D. G. Ravenhall. Equation of state of
nucleon matter and neutron star structure. Phys. Rev. C, 58:1804, September
1998.
[3] G. Allen, N. Andersson, K. D. Kokkotas, and B. F. Schutz. Gravitational waves
from pulsating stars: Evolving the perturbation equations for a relativistic star.
Phys. Rev. D, 58(12):124012, December 1998.
[4] N. Andersson. A New Class of Unstable Modes of Rotating Relativistic Stars.
ApJ, 502:708, August 1998.
[5] N. Andersson and G. L. Comer. On the dynamics of superuid neutron star
cores. MNRAS, 328:1129, December 2001.
[6] N. Andersson and G. L. Comer. Probing Neutron-Star Superuidity with
Gravitational-Wave Data. Phys. Rev. Lett., 87(24):241101, December 2001.
[7] N. Andersson and G. L. Comer. Slowly rotating general relativistic superuid
neutron stars. Classical and Quantum Gravity, 18:969, March 2001.
[8] N. Andersson and G. L. Comer. Relativistic Fluid Dynamics: Physics for Many
Dierent Scales. Living Reviews in Relativity, 10:1, January 2007.
[9] N. Andersson, G. L. Comer, and D. Langlois. Oscillations of general relativistic
superuid neutron stars. Phys. Rev. D, 66(10):104002, November 2002.
[10] N. Andersson and K. D. Kokkotas. Pulsation modes for increasingly relativistic
polytropes. MNRAS, 297:493, June 1998.
[11] N. Andersson, K. D. Kokkotas, and B. F. Schutz. Space-time modes of rela-
tivistic stars. MNRAS, 280:1230, June 1996.
[12] A. F. Andreev and E. P. Bashkin. Three-velocity hydrodynamics of superuid
solutions. Soviet Physics JETP, 42:164, July 1975.
[13] U. M. Ascher, R. M. M. Mattheij, and R. D. Russell. Numerical Solution
of Boundary Value Problems for Ordinary Dierential Equations. Society for
Industrial and Applied Mathematics., 1995.
[14] G. Baym, C. Pethick, and P. Sutherland. The Ground State of Matter at High
Densities: Equation of State and Stellar Models. ApJ, 170:299, December 1971.
[15] O. Benhar, V. Ferrari, and L. Gualtieri. Gravitational wave asteroseismology
reexamined. Phys. Rev. D, 70(12):124015, December 2004.
[16] A. Burrows and J. M. Lattimer. The birth of neutron stars. ApJ, 307:178,
August 1986.
[17] B. Carter. Covariant theory of conductivity in ideal uid or solid media. In
A. Anile and Y. Choquet-Bruhat, editors, Relativistic Fluid Dynamics, volume
1385 of Lecture Notes in Mathematics, pages 164, Springer. Berlin, Germany;
New York, U.S.A., 1989.
[18] S. Chandrasekhar. An Introduction to the Study of Stellar Structure. Dover
Publications, inc., 1957.
[19] G. L. Comer. Do Neutron Star Gravitational Waves Carry Superuid Imprints?
Found. Phys., 32:1903, July 2002.
[20] G. L. Comer and D. Langlois. Hamiltonian formulation for relativistic super-
uids. Classical and Quantum Gravity, 11:709, March 1994.
[21] G. L. Comer, D. Langlois, and L. M. Lin. Quasinormal modes of general
relativistic superuid neutron stars. Phys. Rev. D, 60(10):104025, November
1999.
[22] J. Cox. Theory of Stellar Pulsation. Princeton University Press, 1980.
[23] L. Engvik, M. Hjorth-Jensen, E. Osnes, G. Bao, and E. stgaard. Asym-
metric nuclear matter and neutron star properties. Phys. Rev. Lett., 73:2650,
November 1994.
[24] R. I. Epstein. Acoustic properties of neutron stars. ApJ, 333:880, October
1988.
[25] B. Friedman and V. R. Pandharipande. Hot and cold, nuclear and neutron
matter. Nucl. Phys. A, 361:502, 1981.
[26] N. K. Glendenning. Vacuum polarization eects on nuclear matter and neutron
stars. Nucl. Phys. A, 493:521, March 1989.
[27] N. K. Glendenning and S. A. Moszkowski. Reconciliation of neutron-star
masses and binding of the Lambda in hypernuclei. Phys. Rev. Lett., 67:2414,
October 1991.
[28] N. K. Glendenning and J. Schaner-Bielich. First order kaon condensate.
Phys. Rev. C, 60(2):025803, August 1999.
[29] P. Haensel and A. Y. Potekhin. Analytical representations of unied equations
of state of neutron-star matter. A&A, 428:191, December 2004.
[30] J. B. Hartle. Gravity: An Introduction to Einsteins General Relativity. Addi-
son Wesley, 2003.
[31] G. P. Horedt. Seven-digit tables of Lane-Emden functions. Ap&SS, 126:357,
October 1986.
[32] D. I. Jones and N. Andersson. Gravitational waves from freely precessing
neutron stars. MNRAS, 331:203, March 2002.
[33] J. I. Kapusta and K. A. Olive. Eects of strange particles on neutron-star
cores. Phys. Rev. Lett., 64:13, January 1990.
[34] H. B. Keller. Numerical Methods for Two-Point Boundary-Value Problems.
Blaisdell Publishing Company, January 1968.
[35] Y. Kojima and M. Hosonuma. The r-Mode Oscillations in Relativistic Rotating
Stars. ApJ, 520:788, August 1999.
72
[36] K. Kokkotas and B. Schmidt. Quasi-Normal Modes of Stars and Black Holes.
Living Reviews in Relativity, 2:2, September 1999.
[37] K. D. Kokkotas and N. Andersson. Oscillation and instabilities of relativistic
stars. In R. Cianci, R. Collina, M. Francaviglia, and P. Fre, editors, Recent
developments in general relativity. 14th SIGRAV Conference on General Rela-
tivity and Gravitational Physics, Genova, Italy, September 18-22, 2000, pages
121139, Milano: Springer, 2002.
[38] K. D. Kokkotas and B. F. Schutz. W-modes - A new family of normal modes
of pulsating relativistic stars. MNRAS, 255:119, March 1992.
[39] L. D. Landau and E. M. Lifshitz. Fluid Mechanics, volume 6 of Course of
Theoretical Physics. Pergamon Press, 2nd edition, 1987.
[40] D. Langlois. Superuid neutron stars. Proceedings of the MGIXMM Meeting
held at the University of Rome La Sapienza, Eds.: Vahe G. Gurzadyan,
Robert T. Janzen, Remo Ruen., 2-8 July 2000, Singapore: World Scientic
Publishing, Part B, p. 1643-1644, 2002.
[41] M. B. Larson and B. Link. Superuid Friction and Late-Time Thermal Evo-
lution of Neutron Stars. ApJ, 521:271, August 1999.
[42] J. M. Lattimer and M. Prakash. Neutron Star Structure and the Equation of
State. ApJ, 550:426, March 2001.
[43] P. Ledoux and T. Walraven. Variable stars. In Handbuch der Physik, volume 51,
chapter IV, pages 353604. Springer-Verlag, 1958.
[44] U. Lee. Nonradial oscillations of neutron stars with the superuid core. A&A,
303:515, November 1995.
[45] U. Lee and S. Yoshida. r-Modes of Neutron Stars with Superuid Cores. ApJ,
586:403, March 2003.
[46] L. Lindblom and G. Mendell. The oscillations of superuid neutron stars. ApJ,
421:689, February 1994.
[47] B. Link. Constraining Hadronic Superuidity with Neutron Star Precession.
Phys. Rev. Lett., 91(10):101101, September 2003.
[48] R. Machleidt. The Meson theory of nuclear forces and nuclear structure. Adv.
Nucl. Phys., 19:189, 1989.
[49] V. S. Manko, E. W. Mielke, and J. D. Sanabria-Gomez. Exact solution for
the exterior eld of a rotating neutron star. Phys. Rev. D, 61(8):081501, April
2000.
[50] P. N. McDermott and R. E. Taam. Nonradial g-mode oscillations in X-ray
bursting neutron stars. ApJ, 318:278, July 1987.
[51] G. Mendell. Superuid hydrodynamics in rotating neutron stars. I - Nondissi-
pative equations. ApJ, 380:515, October 1991.
[52] C. W. Misner, K. S. Thorne, and J. A. Wheeler. Gravitation. W.H.Freemen
and Company., 1973.
[53] H. Mueller and B. D. Serot. Relativistic mean-eld theory and the high-density
nuclear equation of state. Nucl. Phys. A, 606:508, September 1996.
73
[54] H. Muther, M. Prakash, and T. L. Ainsworth. The nuclear symmetry energy
in relativistic Brueckner-Hartree-Fock calculations. Physics Letters B, 199:469,
1987.
[55] M. Prakash, J. R. Cooke, and J. M. Lattimer. Quark-hadron phase transition
in protoneutron stars. Phys. Rev. D, 52:661, July 1995.
[56] M. Prakash, J. M. Lattimer, and T. L. Ainsworth. Equation of state and the
maximum mass of neutron stars. Phys. Rev. Lett., 61:2518, November 1988.
[57] R. Prix, G. L. Comer, and N. Andersson. Inertial modes of non-stratied
superuid neutron stars. MNRAS, 348:625, February 2004.
[58] R. Prix and M. Rieutord. Adiabatic oscillations of non-rotating superuid
neutron stars. A&A, 393:949, October 2002.
[59] B. D. Serot. A relativistic nuclear eld theory with and mesons. Physics
Letters, 86 B(2):146, September 1979.
[60] S. L. Shapiro and S. A. Teukolsky. Black Holes, White Dwarfs, and Neutron
Stars. John Wiley & Sons, Inc., 1983.
[61] N. Stergioulas and J. L. Friedman. Nonaxisymmetric Neutral Modes in Rotat-
ing Relativistic Stars. ApJ, 492:301, January 1998.
[62] A. H. Taub. General Relativistic Variational Principle for Perfect Fluids. Phys-
ical Review, 94:1468, June 1954.
[63] W. Unno, Y. Osaki, H. Ando, H. Saio, and H. Shibahashi. Nonradial Oscilla-
tions of Stars. University of Tokyo Press, 2nd edition, 1989.
[64] R. B. Wiringa, V. Fiks, and A. Fabrocini. Equation of state for dense nucleon
matter. Phys. Rev. C, 38:1010, August 1988.
[65] S. Yoshida and U. Lee. Inertial modes of neutron stars with a superuid core.
MNRAS, 344:207, September 2003.
[66] S. Yoshida and U. Lee. r-modes in relativistic superuid stars. Phys. Rev. D,
67(12):124019, June 2003.
[67] V. E. Zavlin, G. G. Pavlov, D. Sanwal, and J. Tr umper. Discovery of 424
Millisecond Pulsations from the Radio-quiet Neutron Star in the Supernova
Remnant PKS 1209-51/52. ApJ, 540:L25, September 2000.
74
APPENDIX
A. DERIVATION OF SPHERICAL HARMONICS
This appendix shows the derivation of the spherical harmonics given in chapter 3.
Since the left hand side of equations (3.28), (3.29), (3.30), (3.31) and (3.32)
are only dependent on the radius r, while the right hand side is dependent on the
angular coordinates and but independent of the radius r, both sides must be
constant. Calling this separation constant we nd that the angular dependency
of the wave equations satises
_
r
2

+
_
Y (, ) = 0, thus giving us the following
dierential equation:
1
sin

_
sin
Y

_
+
1
sin
2

2
Y

2
+ Y = 0. (A.1)
In order to solve this equation, note that its form suggests it can be further separated
into the azimuthal and colatitude directions: Y (, ) = y
1
() y
2
(). Substituting
this in (A.1) and rearranging, we get

1
y
1
()
sin
d
d
_
sin
dy
1
()
d
_
=
1
y
2
()
d
2
y
2
()
d
2
. (A.2)
This time if we let be the separation constant we get the azimuthal equation given
as
d
2
y
2
()
d
2
y
2
() = 0, (A.3)
it is then simple to solve this dierential equation with the solution being y
2
() =
e

, but notice that in order for this solution to be continuous around the sphere,
it must be periodic so y
2
(0) = y
2
(2) and hence = m
2
where m is an integer.
So if we allow m to run negative in order to cover the negative sign, (A.3) has the
solution
y
2
() = e
im
. (A.4)
If we substitute (A.4) back into (A.2) and use the transformation = cos and
d =
1

1
2
d, rearranging we get
d
d
_
_
1
2
_
dy
1
()
d
_
+
_

m
2
1
2
_
y
1
() = 0. (A.5)
A dierential equation of the form given in (A.5) is an associated Legendre equation
and has two linearly independent solutions
P
m
l
() =
_
1
2
_m
2
d
m
d
m
P
l
(A.6)
and
Q
m
l
() =
_
1
2
_m
2
d
m
d
m
Q
l
(A.7)
with = l (l + 1) which are called the associated Legendre functions of the rst
kind and second kind respectively, while P
l
and Q
l
are just called the Legendre
functions of the rst and second kind and are the solutions to the specic case of
(A.5) where m = 0, which can be solved with a series expansion where we would
nd the general solution to be a linear combination of two power series
U
l
= 1 +

n=1
(1)
n
[(l 2n + 2) (l 2) l] [(l + 1) (l + 3) (l + 2n 1)]
(2n)!

2n
(A.8)
and
V
l
= +

n=1
(1)
n
[(l 2n + 1) (l 3) (l 1)] [(l + 2) (l + 4) (l + 2n)]
(2n + 1)!

2n+1
.
(A.9)
If l is an integer, one of the two series will reduce to a polynomial of degree l since
the coecients in the terms of degree higher than l will be zero, but if not, they
will remain an innite series and will diverge at = 1, so the solutions can only
be accepted if l is an integer since they need to be regular. If we dene P
l
()
to be which ever series terminates when l is an integer (though normalised such
that P
l
(1) = 1 ) and Q
l
() as the non-terminating series, then we nd that P
1
()
is given by a series of polynomials called the Legendre polynomials and although
Q
l
() is an innite series can be given in closed form. The Legendre functions of the
second kind are physically unacceptable however, due to singularities when = 1
(y
1
must be regular at the poles), for instance Q
0
=
1
2
ln
_
1+
1
_
. The Legendre
polynomials can be given by Rodrigues formula
1
2
l
l!
d
l
d
l
_

2
1
_
l
. (A.10)
Putting all this together, we nd the solution to the wave equations in the an-
gular directions to be given by the spherical harmonic functions, Y
m
l
(, ) =
c
m
l
P
|m|
l
() e
im
, where
c
m
l
= (1)
m+|m|
2
_
2l + 1
2
(l [m[)!
(l +[m[)!
_1
2
(A.11)
is the constant resulting from the normalization
_
2
0
_

0
Y
m
l
(, ) Y
m

l
(, ) sindd =
ll
mm

. (A.12)
In full the spherical harmonics are written as
Y
m
l
(, ) = (1)
(m+|m|)
2
_
2l + 1
2
(l [m[)!
(l +[m[)!
_1
2
P
|m|
l
(cos ) e
im
. (A.13)
Since the spherical harmonics are the solution to the angular part of Laplaces
equation in spherical coordinates, they also occur when ever Laplaces equation is
encountered and solved in the case of spherical symmetry (they are the same spher-
ical harmonics that are found in solutions to Schroedingers equation in spherically
symmetric problems for instance). In this dissertation, the spherical harmonics
represent the oscillations in the angular directions of a spherical star.
77
B. COMPUTER CODE
This appendix contains all the computer code that was used for the calculations.
Just before each code, there is a paragraph describing what the program does and
any extra numerical procedures used for computational eciency.
B.1 Matlab/Octave programme that calculates the Lane Emden
functions for the polytrope
This programme was the one that was written for calculating the Lane Emden
function for the polytrope in the example in chapter 2.
1 /Matlab/Octave programme that c a l c ul a t e s the Lane Emden
f unc t i ons of the pol yt r ope i n the f i r s t example /
2
3 C = 1; A = 0; k = 0; m = 1; x = 1; d = 1; S = 1; xi 0 = 1;
xi pr i me 0 = 0; z = 0 . 0 1 ;
4
5 %the f ol l owi ng bl ock of code c a l ul a t e s the i n i t i a l val ues by
s e r i e s
6 %expansi on , z i s the mesh si ze .
7 while abs ( x) (1 e 13(2k) )>eps ( 1. 0 e 180)
8 T = repmat (C , [ ( k+1) 1 ] ) ;
9 U = repmat ( S , [ 1 ( k+1) ] ) ;
10 V = (U. d) . T;
11 x = (1) (sum(sum(V) ) /( ( ( 2 k) +2) ( ( 2 k) +3) ) ) ;
12 C = [ C; x ] ;
13 k = k + 1;
14 m = [ ( k+1) m] ;
15 S = C(m, : ) ;
16 d = [ d A; S ] ;
17 A = [ A; 0 ] ;
18 xi 0 = [ xi 0 1e 13(2k) ] ;
19 xi pr i me 0 = [ xi pr i me 0 (2k) (1 e 13((2k) 1) ) ] ;
20 end
21 type LanEm
22 t he t a 0 = xi 0 C;
23 t het a pr i me 0 = xi pr i me 0 C;
24
25 %the s o l ut i o n of the LaneEmden equat i on
26 global xi ; global t het a ;
27 xi = [ ] ; t het a = zeros ( 0 , 2) ; g = 1e 13;
28 for n = 1:(13( log10( z ) ) )
29 [ s , t ] = ode113 (@LanEm, [ g : g : ( 10 g ) ] , [ t het a 0 ,
t het a pr i me 0 ] , odes et ( abs t ol , 1e 18, r e l t o l , 1e 13)
) ;
30 t he t a 0 = t (end, 1 ) ; t het a pr i me 0 = t (end, 2 )
31 s ( 1) = [ ] ; t ( 1 , : ) = [ ] ;
32 xi = [ xi ; s ] ; t het a = [ t het a ; t ] ;
33 g = 10g ;
34 end
35 [ s , t ] = ode113 (@LanEm, [ z : z : 1 0 ] , [ t het a 0 , t het a pr i me 0 ] ,
odes et ( abs t ol , 1e 18, r e l t o l , 1e 13) ) ;
36 xi = [ xi ; s ] ; t het a = [ t het a ; t ] ;
37
38 for n = 1: 12
39 i = 1;
40 z = 0. 1 z ;
41 while ( t het a ( i , 1 ) t het a ( ( i +1) , 1) )>0
42 i = i +1;
79
43 end
44 [ s , t ] = ode113 (@LanEm, [ xi ( i ) : z : xi ( i +1) ] , [ t het a ( i , 1 ) ,
t het a ( i , 2 ) ] , odes et ( abs t ol , 1e 18, r e l t o l , 1e
13) ) ;
45 s ( 1) = [ ] ; t ( 1 , : ) = [ ] ;
46 xi = [ xi ( 1 : i ) ; s ] ; t het a = [ t het a ( 1 : i , 1) t het a ( 1 : i , 2) ;
t ] ;
47 end
48 [ t het a 1 , I ] = min( abs ( t het a ( : , 1 ) ) ) ;
49 global xi 1 ;
50 xi 1 = xi ( I ) ;
51 t het a pr i me 1 = t het a ( I , 2 ) ;
52 xi = xi ( 1 : I ) ; t het a = [ t het a ( 1 : I , 1) t het a ( 1 : I , 2) ] ;
53
54 global U; global c1 ; global Vg;
55 U = ( xi . ( ( t het a ( : , 1 ) . 3) . / t het a ( : , 2 ) ) ) ;
56 c1 = ( ( xi / xi 1 ) t het a pr i me 1 ) . / t het a ( : , 2 ) ;
80
B.2 Matlab/Octave programme that implements the nite-dierence
scheme for the oscillations in the polytrope model
This programme implements the nite-dierence scheme used for calculating the
oscillations of the polytropic model in chapter 3. It uses the equilibrium variables
that were calculated by the programme in section B.1 of this appendix.
1 /Matlab/Octave programme that i mpl ements the f i ni t e
di f f e r e nc e t echni que i n the pol yt r ope model /
2
3 An = zeros ( ( 4N) , ( 4N) ) ;
4 An( 1 , 1) = ( c1 ( 1) ( omega2) ) ; An( 1 , 2) = l ; An( 2 , 3) = l ;
An( 2 , 4) = 1;
5 for i = 1 : (N1)
6 j = i ; k = i 1;
7 A = [ ( Vg( j ) 3) ( ( ( l ( l +1) ) /( c1 ( j ) ( omega2) ) )Vg( j ) ) Vg(
j ) 0; ( ( c1 ( j ) ( omega2) )Ast ( j ) ) ( Ast ( j )U( j ) +1) Ast
( j ) 0; 0 0 (1U( j ) ) 1; (U( j ) Ast ( j ) ) (U( j ) Vg( j ) ) ( (
l ( l +1) ) (U( j ) Vg( j ) ) ) U( j ) ] / x( j ) ;
8 S = (eye ( 4) /( x( i +1)(x( i ) ) ) ) ((1/2) A) ; j = j +1;
9 R = ( eye ( 4) /( x( i +1)x( i ) ) ) ((1/2) A) ;
10 for m = 1: 4
11 for n = 1: 4
12 An( ( ( 4 k)+n+2) , ( ( 4 k)+m) ) = S( n , m) ;
13 An( ( ( 4 k)+n+2) , ( ( 4 k)+m+4) ) = R( n , m) ;
14 end
15 end
16 end
17
18 An( ( ( 4N) 1) , ( ( 4N) 3) ) = 1; An( ( 4N) , ( ( 4N) 3) ) = 1; An
( ( 4N) , ( ( 4N) 2) ) = 1; An( ( 4N) , ( ( 4N) 1) ) = 1;
19 beta = zeros ( ( 4N) , 1) ;
20 beta ( ( 4N) 1) = 1;
21 Yn = Anbeta ;
81
B.3 Matlab/Octave programme used for calculating the oscillations
in the polytrope model
This programme calculates the oscillations of the polytrope model in the example
in chapter 3. The programme uses the equilibrium variables calculated by the pro-
gramme in section B.1 of this appendix. This programme also uses the programme
in section B.2 of this appendix in order to implement the nite dierence scheme.
1 /Matlab/Octave programme used f o c a l c ul a t i ng the
o s c i l l a t i o n s i n the pol yt r ope model /
2
3 l = 1; omega = 1; Gamma 1 = ( 4/3) ;
4 LaneEmden ;
5 x = xi / xi 1 ; N = length( xi ) ; Ast = ( ( 4/Gamma 1) 3) ( xi . /
t het a ( : , 1) ) . t het a ( : , 2) ; Vg = ((((4/Gamma 1) xi ) . /
t het a ( : , 1 ) ) . t het a ( : , 2 ) ) ;
6 D = [ ] ; Omega = [ ] ;
7
8 for z = 1: 100
9 Fi ni t e Di f f e r e nc e ;
10 Omega = [ Omega ; omega ] ; D = [D; ( ( ( l +1)Yn( ( 4N) 1)+Yn(4N) )
) ] ;
11 omega = omega + 0 . 1 ;
12 end
13
14 I = 43;
15 while D( I ) D( I +1)>0
16 I = I +1;
17 end
18
19 a = Omega( I ) ; b = Omega( I +1) ; Da = D( I ) ; Db = ( I +1) ; d = 1;
20 while abs ( d)>1e15
21 omega = ( (Dba ) (Dab) ) /(DbDa) ;
22 Fi ni t e Di f f e r e nc e ;
23 d1 = d ;
24 d = ( ( ( l +1)Yn( ( 4N) 1)+Yn(4N) ) )
25 di s pl ay ( omega) ;
26 i f dDa<0
27 b = omega ; Db = d ;
28 i f d1=1
29 i f d1d>0
30 Da = 0. 5Da;
31 end
32 end
33 el se
34 a = omega ; Da = d ;
35 i f d1=1
36 i f d1d>0
37 Db = 0. 5Db;
38 end
39 end
40 end
41 end
82
B.4 C++ programme used for calculating equilibrium models
The following programme calculates the equilibrium structure of neutron stars using
the combined equation of state used by Lee [44] and Lindblom and Mendell [46].
The programme does this by rst calculating the values of the equation of state
at 300000 interpolation points and then interpolates them with a cubic spline. A
table used for interpolation was not included because this programme does all of
it internally. The programme then uses the cubic spline interpolation to calculate
all the needed variables of the equilibrium structure and then writes them to le in
Matlabs binary format (it will ask you to name it). When the programme is run,
it will ask for the mass of the neutron star and then the number of mesh points (for
when the data is used to calculate the oscillations). The programme also outputs
the interpolation points used in calculating the spline (when opening the data le in
Matlab or Octave, they are variables named pEOS and rhoEOS for the pressure and
density respectively). The reason for writing the data to these formats is so that it
is possible open the le in Matlab or Octave in order to rename the variables as well
as add the point at the core-envelope boundary in each of them. The extra point
is added because it is needed in the matrix for the interface boundary conditions in
eigenvalue problem used to calculate the oscillations.
1 /C++ programme f or c a l c u l a t i ng t he e q ui l i b r i um s t r uc t ur e of
neut ron s t ar model s /
2
3 #include <s t dl i b . h>
4 #include <math . h>
5 #include <i ostream>
6 #include <s t r i ng . h>
7 #include <g s l / g s l c o ns t . h>
8 #include <g s l / gsl math . h>
9 #include <g s l / g s l r o o t s . h>
10 #include <g s l / g s l o de i v . h>
11 #include <g s l / gs l mat r i x . h>
12 #include <g s l / g s l s p l i n e . h>
13 #include <g s l / g s l e r r no . h>
14 #include mat . h
15 #include matri x . h
16 #include engi ne . h
17
18 long double const m n = GSL CONST CGS MASS NEUTRON;
19 long double const m p = GSL CONST CGS MASS PROTON;
20 long double const m e = GSL CONST CGS MASS ELECTRON;
21 long double const m b = GSL CONST CGS UNIFIED ATOMIC MASS;
22 long double const hbar = GSL CONST CGS PLANCKS CONSTANT HBAR
;
23 long double const c = GSL CONST CGS SPEED OF LIGHT;
24 long double const Ms = GSL CONST CGS SOLAR MASS;
25 long double const G = GSL CONST CGS GRAVITATIONAL CONSTANT;
26 long double const pi = M PI ;
27 long double const b1 = 0. 991749;
28 long double const b2 = 0. 01911;
29 long double const b3 = 0. 000840;
30 long double const b4 = 0. 10175;
31 long double const b5 = 0. 000763;
32
83
33 using namespace std ;
34
35 struct e f f e c t i ve mas s par ams double kn ; double kp ; ;
36 struct bet a equi l i br i um par am double dens ; ;
37 struct baryon number param double dens ; ;
38 struct pol ytrope params double C; double K; double sm;
double rho ; double p ; ;
39 struct s pl i ne par ams g s l s p l i n e s pl i ne ; g s l i n t e r p a c c e l
acc ; ;
40
41 long double ps i pr i me ( long double x)
42
43 long double ps i pr i me ;
44
45 i f ( x<=1.0e 13)
46
47 ps i pr i me = ( 1. 0/( 4pow( pi , 2 ) ) ) ( ( 2pow( x , 2 ) )pow( x
, 4 ) +( ( 3. 0/4. 0) pow( x , 6 ) ) ) ;
48
49
50 el se
51
52 ps i pr i me = ( 1. 0/( 2pow( pi , 2 ) ) ) (pow( x , 2 ) / s qr t (1+pow
( x , 2 ) ) ) ;
53
54
55 return ps i pr i me ;
56
57
58 long double chi pr i me ( long double x)
59
60 long double chi pr i me ;
61
62 i f ( x<=1.0e 6)
63
64 chi pr i me = ( 1. 0/pow( pi , 2 ) ) (pow( x , 2 ) +(0. 5pow( x , 4 ) )
( ( 1. 0/8. 0) pow( x , 6 ) ) ) ;
65
66
67 el se
68
69 chi pr i me = ( 1. 0/pow( pi , 2 ) ) pow( x , 2 ) s qr t (1+pow( x , 2 )
) ;
70
71
72 return chi pr i me ;
73
74
75 long double phi ( long double x)
76
77 long double phi ;
78
79 i f ( x<=1.0e 6)
80
84
81 phi = ( 1. 0/( 8pow( pi , 2 ) ) ) ( ( ( 8 . 0 / 1 5 . 0 ) pow( x , 5 ) )
( ( 4. 0/21. 0) pow( x , 7 ) ) +( ( 1. 0/9. 0) pow( x , 9 ) ) ) ;
82
83
84 el se
85
86 phi = ( 1. 0/( 8pow( pi , 2 ) ) ) ( ( x s qr t (1+pow( x , 2 ) )
( ( ( 2 . 0 / 3 . 0 ) pow( x , 2 ) ) 1) )+l og ( x+s qr t (1+pow( x , 2 )
) ) ) ;
87
88
89 return phi ;
90
91
92 long double ps i ( long double x)
93
94 long double ps i ;
95
96 i f ( x<=1.0e 6)
97
98 ps i = ( 1. 0/( 4pow( pi , 2 ) ) ) ( ( ( 2 . 0 / 3 . 0 ) pow( x , 3 ) )
( ( 1. 0/5. 0) pow( x , 5 ) ) +( ( 3. 0/28. 0) pow( x , 7 ) ) ) ;
99
100
101 el se
102
103 ps i = ( 1. 0/( 4pow( pi , 2 ) ) ) ( ( x s qr t (1+pow( x , 2 ) ) )l og (
x+s qr t (1+pow( x , 2 ) ) ) ) ;
104
105
106 return ps i ;
107
108
109 long double chi ( long double x)
110
111 long double chi ;
112
113 i f ( x<=1.0e 6)
114 chi = ( 1. 0/( 8pow( pi , 2 ) ) ) ( ( ( 8 . 0 / 3 . 0 ) pow( x , 3 ) )
+( ( 4. 0/5. 0) pow( x , 5 ) ) ( ( 1. 0/7. 0) pow( x , 7 ) ) ) ;
115
116
117 el se
118
119 chi = ( 1. 0/( 8pow( pi , 2 ) ) ) ( ( ( ( 2pow( x , 3 ) )+x) s qr t (1+
pow( x , 2 ) ) )l og ( x+s qr t (1+pow( x , 2 ) ) ) ) ;
120
121
122 return chi ;
123
124
125 // Functi on f or c a l c u l a t i ng A
126 double baryon number f uncti on ( double baryon number i ni t ,
void param)
85
127
128 struct baryon number param d = ( struct
baryon number param ) param;
129 double dens = ( d>dens ) ;
130
131 long double xn2 , xn , xe , e l e c t r on e ne r gy de ns i t y ,
neut r on ener gy dens i t y , ne ;
132
133 xn2 = pow( ( ( m b/m n) ( b1+((2b2 ) /(3pow(
baryon number i ni t , ( 1 . 0 / 3 . 0 ) ) ) ) +(b4 ( ( 1 . 0 / 4 . 0 ) (b2
/(2 b5 baryon number i ni t ) ) ) ) ( ( 1. 0/6. 0) ( b2/pow(
baryon number i ni t , ( 1 . 0 / 3 . 0 ) ) ) ) ) ) , 2) 1;
134
135 i f ( xn2<=0)
136 xn = 0;
137
138
139 el se
140
141 xn = s qr t ( xn2 ) ;
142
143
144 xe = s qr t (pow( ( ( ( m b/m e ) ( b3+(b4(1s qr t ( ( 2 b2 ) /( b5
baryon number i ni t ) ) ) ) ( s qr t (2 b2b5 ) pow(
baryon number i ni t , ( 1 . 0 / 6 . 0 ) ) ) ) ) +1) , 2) 1) ;
145 ne = ( ( pow( m e , 3 ) pow( c , 3 ) ) /(3pow( pi , 2 ) pow( hbar , 3 ) ) )
pow( xe , 3 ) ;
146 ne ut r on e ne r gy de ns i t y = ( ( pow(m n , 4 ) pow( c , 5 ) ) /pow( hbar
, 3 ) ) chi ( xn) ;
147 e l e c t r o n e ne r g y de ns i t y = ( ( ( pow( m e , 4 ) pow( c , 5 ) ) /pow(
hbar , 3 ) ) chi ( xe ) ) (nem epow( c , 2 ) ) ;
148
149 double d i f f = dens (nem b( s qr t ( ( 2pow( b1 , 2 ) b5
baryon number i ni t ) /b2 ) +( s qr t (2 b2b5 ) pow(
baryon number i ni t , ( 1 . 0 / 6 . 0 ) ) )b3+( s qr t ( ( 2pow( b4 , 2 )
b5 baryon number i ni t ) /b2 ) pow((0. 5 s qr t ( b2 /(2 b5
baryon number i ni t ) ) ) , 2) )+s qr t ( 0. 5 b2b5 ) ) ) (
e l e c t r o n e ne r g y de ns i t y /pow( c , 2 ) ) (
ne ut r on e ne r gy de ns i t y /pow( c , 2 ) ) ;
150
151 return d i f f ;
152
153
154 //Rootf i ndi ng s ubr out i ne f o c a l c u l a t i ng A
155 double baryon number ( double baryon number l ow , double
baryon number hi gh , g s l f unc t i o n F)
156
157 const g s l r o o t f s o l v e r t y p e T; g s l r o o t f s o l v e r s ;
158 T = g s l r o o t f s o l v e r b r e n t ;
159 s = g s l r o o t f s o l v e r a l l o c (T) ;
160
161 i nt s t at us ;
162 double baryon number root ;
86
163 g s l r o o t f s o l v e r s e t ( s , &F, baryon number l ow ,
baryon number hi gh ) ;
164
165 do
166 s t at us = g s l r o o t f s o l v e r i t e r a t e ( s ) ;
167 baryon number root = g s l r o o t f s o l v e r r o o t ( s ) ;
168 baryon number l ow = g s l r o o t f s o l v e r x l o we r ( s ) ;
169 baryon number hi gh = g s l r o o t f s o l v e r x uppe r ( s ) ;
170 s t at us = g s l r o o t t e s t i n t e r v a l ( baryon number l ow ,
baryon number hi gh , 0 , 1. 0 e 15) ;
171 while ( s t at us == GSL CONTINUE) ;
172
173 i f ( s t at us != GSL SUCCESS)
174
175 cout << r et ur ned s t at us << s t at us << i n baryon
number << endl ;
176 e xi t ( 0) ;
177
178
179 g s l r o o t f s o l v e r f r e e ( s ) ;
180
181 return baryon number root ;
182
183
184 double HW( double rho )
185
186 long double A, xn , xn2 , xe , Pe , Pn;
187
188 g s l f unc t i o n baryon ;
189 struct baryon number param param = rho ;
190
191 baryon . f unc t i on = &baryon number f uncti on ;
192 baryon . params = &param;
193
194 double A hi =63, A l o =62;
195 while (GSL FN EVAL(&baryon , A hi ) GSL FN EVAL(&baryon ,
A l o ) >0)
196
197 A l o = A hi ;
198 A hi = 2 A hi ;
199 ;
200
201 A = baryon number ( A l o , A hi , baryon ) ;
202 xn2 = pow( ( ( m b/m n) ( b1+((2b2 ) /(3pow(A, ( 1 . 0 / 3 . 0 ) ) ) ) +(
b4 ( ( 1 . 0 / 4 . 0 ) (b2/(2 b5A) ) ) ) ( ( 1. 0/6. 0) ( b2/pow(A
, ( 1 . 0 / 3 . 0 ) ) ) ) ) ) , 2) 1;
203
204 i f ( xn2<=0)
205 xn = 0;
206
207
208 el se
209
210 xn = s qr t ( xn2 ) ;
87
211
212
213 xe = s qr t (pow( ( ( ( m b/m e ) ( b3+(b4(1s qr t ( ( 2 b2 ) /( b5A) )
) ) ( s qr t (2 b2b5 ) pow(A, ( 1 . 0 / 6 . 0 ) ) ) ) ) +1) , 2) 1) ;
214 Pe = ( ( pow( m e , 4 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) phi ( xe ) ;
215 Pn = ( ( pow(m n , 4 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) phi ( xn) ;
216
217 return Pe + Pn;
218
219
220
221 // Functi on f or c a l c u l a t i ng e f f e c t i v e mass
222
223 double e f f e c t i ve ma s s f unc t i o n ( double m i ni t , void params
)
224
225 struct e f f e c t i ve mas s par ams k = ( struct
e f f e c t i ve mas s par ams ) params ;
226 double kn = ( k>kn) ;
227 double kp = ( k>kp) ;
228 long double xn = ( kn/( m i ni t c ) ) ;
229 long double xp = ( kp/( m i ni t c ) ) ;
230 long double ps i n = ps i ( xn) ;
231 long double ps i p = ps i ( xp) ;
232
233 return m i ni t + ( 534. 2( pow( m i ni t , 3 ) /pow(m b , 2 ) ) ( ps i n
+ ps i p ) )m b ;
234
235
236 //Rootf i ndi ng s ubr out i ne f or c a l c u l a t i ng e f f e c t i v e mass
237 double e f f e c t i ve ma s s ( double kn , double kp , double mass hi gh
, double mass low , g s l f unc t i o n F)
238
239 const g s l r o o t f s o l v e r t y p e T2 ; g s l r o o t f s o l v e r s2 ;
240 T2 = g s l r o o t f s o l v e r b r e n t ;
241 s2 = g s l r o o t f s o l v e r a l l o c (T2) ;
242 i nt s t at us ;
243 double mass root ;
244 i nt i = 0;
245 g s l r o o t f s o l v e r s e t ( s2 , &F, mass low , mass hi gh ) ;
246
247 do
248 s t at us = g s l r o o t f s o l v e r i t e r a t e ( s2 ) ;
249 mass root = g s l r o o t f s o l v e r r o o t ( s2 ) ;
250 mass l ow = g s l r o o t f s o l v e r x l o we r ( s2 ) ;
251 mass hi gh = g s l r o o t f s o l v e r x uppe r ( s2 ) ;
252 s t at us = g s l r o o t t e s t i n t e r v a l ( mass low , mass hi gh ,
0 , 1. 0 e 15) ;
253 i = i + 1;
254 while ( s t at us == GSL CONTINUE) ;
255
256 i f ( s t at us != GSL SUCCESS)
257
88
258 cout << r et ur ned s t at us << s t at us << i n e f f e c t i v e
mass <<endl ;
259 e xi t ( 0) ;
260 ;
261
262 g s l r o o t f s o l v e r f r e e ( s2 ) ;
263
264 return mass root ;
265
266
267 //Rootf i ndi ng s ubr out i ne f or c a l c u l a t i ng k n at
b e t a e q ui l i b r i um
268 double be t a e qui l i br i um ( double neut r on dens i t y hi gh , double
neut r on dens i t y l ow , g s l f unc t i o n F)
269
270 const g s l r o o t f s o l v e r t y p e T1 ; g s l r o o t f s o l v e r s1 ;
271 T1 = g s l r o o t f s o l v e r b r e n t ;
272 s1 = g s l r o o t f s o l v e r a l l o c (T1) ;
273
274 i nt s t at us ;
275 double ne ut r on de ns i t y r oot ;
276 g s l r o o t f s o l v e r s e t ( s1 , &F, neut r on dens i t y l ow ,
ne ut r on de ns i t y hi gh ) ;
277
278 do
279 s t at us = g s l r o o t f s o l v e r i t e r a t e ( s1 ) ;
280 ne ut r on de ns i t y r oot = g s l r o o t f s o l v e r r o o t ( s1 ) ;
281 ne ut r on dens i t y l ow = g s l r o o t f s o l v e r x l o we r ( s1 ) ;
282 ne ut r on de ns i t y hi gh = g s l r o o t f s o l v e r x uppe r ( s1 ) ;
283 s t at us = g s l r o o t t e s t i n t e r v a l ( neut r on dens i t y l ow ,
neut r on dens i t y hi gh , 0 , 1. 0 e 15) ;
284 while ( s t at us == GSL CONTINUE) ;
285
286 i f ( s t at us != GSL SUCCESS)
287
288 cout << r et ur ned s t at us << s t at us << i n beta
e qui l i br i um << endl ;
289 e xi t ( 0) ;
290 ;
291
292 g s l r o o t f s o l v e r f r e e ( s1 ) ;
293
294 return ne ut r on de ns i t y r oot ;
295
296
297 // Functi on f or c a l c u l a t i ng bet ae q ui l l i b r i um
298
299 double be t a e qui l i br i um f unc t i on ( double neut r on dens i t y ,
void param)
300
301 struct bet a equi l i br i um par am d = ( struct
bet a equi l i br i um par am ) param;
302 double dens = ( d>dens ) ;
303
89
304 double m ef f , m kn , m kp , m rhon , m rhop ;
305 long double kn , kp , kn3 , kp3 , xn , xp , mu n , mu p , mu e ,
ps i n , ps i p , chi n , chi p , ps i pr i me n , ps i pr i me p
, chi pr i me n , chi pr i me p ;
306
307 kn3 = (3pow( pi , 2 ) pow( hbar , 3 ) neut r on dens i t y ) /m n ;
308 kn = pow( kn3 , ( 1 . 0 / 3 . 0 ) ) ;
309
310 double pr ot on de ns i t y = ( m p/( m p+m e ) ) ( dens
neut r on dens i t y ) ;
311
312 kp3 = (3pow( pi , 2 ) pow( hbar , 3 ) pr ot on de ns i t y ) /m p ;
313 kp = pow( kp3 , ( 1 . 0 / 3 . 0 ) ) ;
314
315 g s l f unc t i o n m;
316 struct e f f e c t i ve mas s par ams params = kn , kp ;
317
318 m. f unc t i on = &e f f e c t i ve ma s s f unc t i o n ;
319 m. params = &params ;
320
321 double m hi = 1 , m l o = 1;
322 while (GSL FN EVAL(&m, m hi ) GSL FN EVAL(&m, m l o ) >0)
323
324 m hi = m l o ;
325 m l o = m l o /10;
326 ;
327
328 m ef f = e f f e c t i ve ma s s ( kn , kp , m hi , m lo , m) ;
329
330 xn = ( kn/( m ef f c ) ) ; xp = ( kp/( m ef f c ) ) ;
331 ps i n = ps i ( xn) ;
332 ps i p = ps i ( xp) ;
333 c hi n = chi ( xn) ;
334 c hi p = chi ( xp) ;
335 ps i pr i me n = ps i pr i me ( xn) ;
336 chi pr i me n = chi pr i me ( xn) ;
337 ps i pr i me p = ps i pr i me ( xp) ;
338 chi pr i me p = chi pr i me ( xp) ;
339 m rhon = (( 534. 2pow( hbar , 3 ) ) /(2pow(m b , 2 ) m npow( c
, 3 ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) ) /(1+(1602. 6pow( (
m ef f /m b) , 2) ( ps i n+ps i p ) ) (534. 2( m ef f /(pow(m b
, 2 ) c ) ) ( ( kn ps i pr i me n ) +(kp ps i pr i me p ) ) ) ) ;
340 m rhop = (( 534. 2pow( hbar , 3 ) ) /(2m ppow(m b , 2 ) pow( c
, 3 ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) /(1+(1602. 6pow( (
m ef f /m b) , 2) ( ps i n+ps i p ) ) (534. 2( m ef f /(pow(m b
, 2 ) c ) ) ( ( kn ps i pr i me n ) +(kp ps i pr i me p ) ) ) ) ;
341
342 mu n = ( ( ( 4pow( m ef f , 3 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) ( c hi n+
c hi p ) m rhon) +((( m ef f pow( c , 2 ) ) /m n) s qr t (1+pow( (
kn/( m ef f c ) ) , 2) ) ) (((pow( c , 2 ) kn3 ) /(pow( pi , 2 ) pow(
hbar , 3 ) ) ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) m rhon) (((
pow( m ef f , 2 ) pow( c , 4 ) kp) /pow( hbar , 3 ) ) chi pr i me p
m rhon) +((6pow( pi , 2 ) ( kn3+kp3 ) ) /( 8. 950pow(m b , 2 )
m nc ) ) (((2pow(m b , 2 ) (m bm ef f ) pow( c , 5 ) )
90
/( 534. 2pow( hbar , 3 ) ) ) m rhon) +((6pow( pi , 2 ) ( kn3kp3
) ) /( 128. 2pow(m b , 2 ) m nc ) ) ;
343 mu p = ( ( ( 4pow( m ef f , 3 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) ( c hi n+
c hi p ) m rhop) +((( m ef f pow( c , 2 ) ) /m p) s qr t (1+pow( (
kp/( m ef f c ) ) , 2) ) ) (((pow( c , 2 ) kp3 ) /(pow( pi , 2 ) pow(
hbar , 3 ) ) ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) m rhop) (((
pow( m ef f , 2 ) pow( c , 4 ) kn) /pow( hbar , 3 ) ) chi pr i me n
m rhop) +((6pow( pi , 2 ) ( kn3+kp3 ) ) /( 8. 950pow(m b , 2 )
m pc ) ) (((2pow(m b , 2 ) (m bm ef f ) pow( c , 5 ) )
/( 534. 2pow( hbar , 3 ) ) ) m rhop) ((6pow( pi , 2 ) ( kn3kp3
) ) /( 128. 2pow(m b , 2 ) m pc ) ) ;
344 mu e = pow( c , 2 ) s qr t (1+pow( ( kp/( m ec ) ) , 2) ) ;
345
346 return ( m emu e ) +(m pmu p) (m nmu n) ;
347
348
349 double s e r ot ( double rho , void p)
350
351 long double k n , k p , k n3 , k p3 ;
352 double rho n , rho p , m ef f ;
353 long double x n , x p , x e ;
354 long double exp phi n , exp phi p , exp phi e ;
355 long double phi n , phi p , phi e ;
356
357 g s l f unc t i o n beta ;
358 struct bet a equi l i br i um par am param = rho ;
359
360 beta . f unc t i on = &be t a e qui l i br i um f unc t i on ;
361 beta . params = &param;
362
363 double ne ut r on de ns i t y hi = rho ;
364 double ne ut r on de ns i t y l o = 0;
365
366 rho n = be t a e qui l i br i um ( ne ut r on de ns i t y hi ,
ne ut r on de ns i t y l o , beta ) ;
367 k n3 = (3pow( pi , 2 ) pow( hbar , 3 ) rho n ) /m n ;
368 k n = pow( k n3 , ( 1 . 0 / 3 . 0 ) ) ;
369 rho p = ( m p/( m p+m e ) ) ( rho rho n ) ;
370 k p3 = (3pow( pi , 2 ) pow( hbar , 3 ) rho p ) /m p ;
371 k p = pow( k p3 , ( 1 . 0 / 3 . 0 ) ) ;
372
373 g s l f unc t i o n m;
374 struct e f f e c t i ve mas s par ams params = k n , k p ;
375
376 m. f unc t i on = &e f f e c t i ve ma s s f unc t i o n ;
377 m. params = &params ;
378
379 double m hi = 1 , m l o = 1;
380 while (GSL FN EVAL(&m, m hi ) GSL FN EVAL(&m, m l o ) >0)
381
382 m hi = m l o ;
383 m l o = m l o /10;
384 ;
385
91
386 m ef f = e f f e c t i ve ma s s ( k n , k p , m hi , m lo , m) ;
387
388 x n = k n /( m ef f c ) ; x p = k p /( m ef f c ) ; x e = k p /( m e
c ) ;
389
390 phi n = phi ( x n ) ;
391 phi p = phi ( x p ) ;
392 phi e = phi ( x e ) ;
393
394 double P = ( ( ( pow( m ef f , 4 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) ( phi n
+phi p ) ) +(((pow( m e , 4 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) phi e
) +(pow( ( k n3+k p3 ) , 2) /( 8. 950pow(m b , 2 ) pow( hbar , 3 )
c ) ) ((pow(m b , 2 ) pow( ( m bm ef f ) , 2) pow( c , 5 ) )
/( 534. 2pow( hbar , 3 ) ) ) +(pow( ( k n3k p3 ) , 2) /( 128. 2pow
(m b , 2 ) pow( hbar , 3 ) c ) ) ;
395
396 return P;
397
398
399
400 i nt f unc ( double r , const double y , double f , void params
)
401
402
403 struct s pl i ne par ams c= ( struct s pl i ne par ams ) params
;
404
405 g s l s p l i n e s pl i ne = ( c>s pl i ne ) ;
406 g s l i n t e r p a c c e l acc = ( c>acc ) ;
407
408 i f ( r == 0)
409
410 f [ 0 ] = 0;
411
412 el se
413
414 f [ 0 ] = ( y [ 0 ] y [ 1 ] ) /(pow( r , 2 ) g s l s p l i n e e v a l d e r i v (&
s pl i ne , y [ 0 ] , &acc ) ) ;
415
416
417 f [ 1 ] = 4pi Gpow( r , 2 ) y [ 0 ] ;
418 return GSL SUCCESS;
419
420
421 double nsmass ( double rhoc , double rho , double p , double
rI , double R, double mI , double dpdrhoI )
422
423 const g s l o de i v s t e p t ype T = g s l o de i v s t e p r k 4 ;
424 g s l o de i v s t e p s = g s l o d e i v s t e p a l l o c (T, 2) ;
425 g s l o de i v c o nt r o l con = gs l ode i v c ont r ol y ne w ( 0 . 0 ,
1e 12) ;
426 g s l o de i v e vo l ve e = g s l o d e i v e v o l v e a l l o c ( 2) ;
427
428 g s l i n t e r p a c c e l acc = g s l i n t e r p a c c e l a l l o c ( ) ;
92
429 g s l s p l i n e s pl i ne = g s l s p l i n e a l l o c (
g s l i nt e r p c s p l i ne , 299998) ;
430
431 struct s pl i ne par ams params = s pl i ne , acc ;
432
433 g s l s p l i n e i n i t ( s pl i ne , rho , p , 299998) ;
434
435 gs l ode i v s ys t e m s ys = func , NULL, 2 , &params ;
436
437 double r = 0. 0 , r0 = 0. 0 , r1 = 1e7 ;
438 double h = ( r1r ) /100000;
439 double y [ 2 ] = rhoc , 0 . 0 ;
440 double y1 , y2 , rb1 , rb2 , rb3 ;
441
442 while ( ( f abs ( 2. 8 e14y [ 0 ] ) /2. 8 e14 ) >= 1e 14)
443
444 while ( y [ 0 ] > 2. 8 e14 )
445
446 r0 = r ;
447 y1 = y [ 0 ] ;
448 y2 = y [ 1 ] ;
449 i nt s t at us = g s l o de i v e vo l ve a ppl y ( e , con , s , &
sys , &r , r1 , &h , y) ;
450 i f ( h == 0)
451
452 break ;
453
454
455 i f ( s t at us != GSL SUCCESS)
456
457 break ;
458
459
460
461 i f ( r == 0)
462
463 break ;
464
465
466 i f ( ( f abs ( 2. 8 e14y [ 0 ] ) /2. 8 e14 ) >= 1e 14)
467
468 r1 = r ;
469 r = r0 ;
470 y [ 0 ] = y1 ;
471 y [ 1 ] = y2 ;
472 h = ( r1r ) /10;
473
474
475
476 r I = r ;
477 mI = (y [ 1 ] /G) ;
478 dpdrhoI = g s l s p l i n e e v a l d e r i v ( s pl i ne , y [ 0 ] , acc ) ;
479
480 r1 = 1e7 ;
93
481 h = ( r1r ) /100000;
482
483 while ( ( f abs ( 6. 44 e7y [ 0 ] ) /6. 44 e7 ) >= 1e 14)
484
485 while ( y [ 0 ] > 6. 44 e7 )
486
487 r0 = r ;
488 y1 = y [ 0 ] ;
489 y2 = y [ 1 ] ;
490
491 i nt s t at us = g s l o de i v e vo l ve a ppl y ( e , con , s , &
sys , &r , r1 , &h , y) ;
492
493 i f ( h == 0)
494
495 break ;
496
497
498 i f ( s t at us != GSL SUCCESS)
499
500 e xi t ( 0) ;
501
502
503
504 i f ( h == 0)
505
506 i f ( ( f abs ( 6. 44 e7y1 ) /6. 44 e7 ) < ( f abs ( 6. 44 e7y
[ 0 ] ) /6. 44 e7 ) )
507
508 r = r0 ;
509 y [ 0 ] = y1 ;
510 y [ 1 ] = y2 ;
511
512
513 break ;
514
515
516 i f ( ( f abs ( 6. 44 e7y [ 0 ] ) /6. 44 e7 ) >= 1e 14)
517
518 r1 = r ;
519 r = r0 ;
520 y [ 0 ] = y1 ;
521 y [ 1 ] = y2 ;
522 h = ( r1r ) /10;
523
524
525
526 cout << endl << r << << y [ 0 ] << endl ;
527
528 R = r ;
529
530 g s l o d e i v e v o l v e f r e e ( e ) ;
531 g s l o d e i v c o n t r o l f r e e ( con ) ;
532 g s l o d e i v s t e p f r e e ( s ) ;
94
533 g s l s p l i n e f r e e ( s pl i ne ) ;
534
535 return y [ 1 ] /G;
536
537
538 double cdens ( double r hoci , void params )
539
540 struct pol ytrope params c = ( struct pol ytrope params
) params ;
541 double sm = ( c>sm) ;
542 double rho ;
543 double p ;
544 double rI , mI , dpdrhoI , R;
545
546 rho = ( c>rho ) ;
547 p = ( c>p) ;
548
549 return (smMs)nsmass ( r hoci , rho , p , &rI , &R, &mI , &
dpdrhoI ) ;
550
551
552 double c de ns r oot ( double cdens hi , double cdens l o ,
g s l f unc t i o n F, double C, double K, double sm)
553
554 const g s l r o o t f s o l v e r t y p e T; g s l r o o t f s o l v e r s ;
555 T = g s l r o o t f s o l v e r b r e n t ;
556 s = g s l r o o t f s o l v e r a l l o c (T) ;
557 i nt s t at us ;
558 double c de ns r oot ;
559 i nt i = 0;
560 g s l r o o t f s o l v e r s e t ( s , &F, cdens l o , c de ns hi ) ;
561
562 do
563 s t at us = g s l r o o t f s o l v e r i t e r a t e ( s ) ;
564 c de ns r oot = g s l r o o t f s o l v e r r o o t ( s ) ;
565 c de ns hi = g s l r o o t f s o l v e r x uppe r ( s ) ;
566 c de ns l o = g s l r o o t f s o l v e r x l o we r ( s ) ;
567 s t at us = g s l r o o t t e s t i n t e r v a l ( cdens l o , cdens hi ,
0 , 1e 15) ;
568 i = i +1;
569 while ( s t at us == GSL CONTINUE) ;
570
571 i f ( s t at us != GSL SUCCESS)
572
573 e xi t ( 0) ;
574 ;
575
576 return c de ns r oot ;
577
578
579 i nt main ( )
580
581 MATFile mat ;
95
582 mxArray rho1 , rho2 , rhoI , p1 , p2 , pI , rhom, rho ,
p , pm, mr , r , rse , mse , dpdrhose , dpdrho ,
pse ;
583 double prho1 , prho2 , prhoI , prho , prhom, ppm, pp1
, pp2 , ppI , pp , pm r , C, K, a , b , c , y [ 2 ] , sm,
rhoc , m, pr , pr1 , pr2 , pr3 , re , h , rI , R, mI ,
dpdrhoI , pdpdrho , r0 , ps e r ot I ;
584 i nt mesh ;
585 char f [ 4 0 ] ;
586
587 cout << endl << Name the MAT f i l e to be cr eat ed f or
s t or i ng the va r i a bl e s : << endl << > ;
588 ci n >> f ;
589
590 char f i l e = s t r c a t ( f , . mat ) ;
591 ci n . i gnor e ( ) ;
592 mat = matOpen( f i l e , w ) ;
593
594 g s l f unc t i o n Ser ot ;
595 Ser ot . f unc t i on = &s e r ot ;
596 Ser ot . params = NULL;
597
598 rho1 = mxCreateDoubleMatrix (100000 , 1 , mxREAL) ;
599 rho2 = mxCreateDoubleMatrix (100000 , 1 , mxREAL) ;
600 r hoI = mxCreateDoubleMatrix (100000 , 1 , mxREAL) ;
601 p1 = mxCreateDoubleMatrix (100000 , 1 , mxREAL) ;
602 p2 = mxCreateDoubleMatrix (100000 , 1 , mxREAL) ;
603 pI = mxCreateDoubleMatrix (100000 , 1 , mxREAL) ;
604 rho = mxCreateDoubleMatrix (299998 , 1 , mxREAL) ;
605 p = mxCreateDoubleMatrix (299998 , 1 , mxREAL) ;
606 r = mxCreateDoubleMatrix (299998 , 1 , mxREAL) ;
607
608 prho1 = mxGetPr ( rho1 ) ;
609 prho2 = mxGetPr ( rho2 ) ;
610 prhoI = mxGetPr ( r hoI ) ;
611 pp1 = mxGetPr ( p1 ) ;
612 pp2 = mxGetPr ( p2 ) ;
613 ppI = mxGetPr ( pI ) ;
614 prho = mxGetPr ( rho ) ;
615 pp = mxGetPr ( p) ;
616 pr = mxGetPr ( r ) ;
617
618 a = (5 e143e13 ) /99999;
619 b = (2 e12 6.44 e7 ) /99999;
620 c = (3 e132e12 ) /99999;
621
622 C = l og (HW(2 e12 ) /GSL FN EVAL(&Serot , 3e13 ) ) / l og (2 e12 /3
e13 ) ;
623 K = (GSL FN EVAL(&Serot , 3e13 )HW(2 e12 ) ) /(pow(3 e13 , C)
pow(2 e12 , C) ) ;
624
625 cout << endl << Enter mass of s t ar i n s o l a r masses : <<
endl << > ;
626 ci n >> sm;
96
627 ci n . i gnor e ( ) ;
628
629 struct pol ytrope params params = C, K, sm, prho , pp ;
630
631 g s l f unc t i o n c e nt r a l de ns i t y ;
632 c e nt r a l de ns i t y . f unc t i on = &cdens ;
633 c e nt r a l de ns i t y . params = &params ;
634
635 for ( i nt i = 0; i <= 99999; i ++)
636
637 prho2 [ i ] = 3e13+( i a ) ;
638 prho1 [ i ] = 1e7+( i b) ;
639 prhoI [ i ] = 2e12+( i c ) ;
640 pp2 [ i ] = GSL FN EVAL(&Serot , prho2 [ i ] ) ;
641 pp1 [ i ] = HW( prho1 [ i ] ) ;
642 ppI [ i ] = Kpow( prhoI [ i ] , C) ;
643 prho [ i ] = prho1 [ i ] ;
644 pp [ i ] = pp1 [ i ] ;
645
646
647 for ( i nt i = 0; i <= 99998; i ++)
648
649 prho [ i +100000] = prhoI [ i +1] ;
650 prho [ i +199999] = prho2 [ i +1] ;
651 pp [ i +100000] = ppI [ i +1] ;
652 pp [ i +199999] = pp2 [ i +1] ;
653
654
655 cout << endl << C << << K << endl ;
656
657 matPutVari abl e ( mat , rho1 , rho1 ) ;
658 matPutVari abl e ( mat , rho2 , rho2 ) ;
659 matPutVari abl e ( mat , r hoI , r hoI ) ;
660 matPutVari abl e ( mat , p1 , p1 ) ;
661 matPutVari abl e ( mat , p2 , p2 ) ;
662 matPutVari abl e ( mat , pI , pI ) ;
663
664 mxDestroyArray ( rho1 ) ;
665 mxDestroyArray ( rho2 ) ;
666 mxDestroyArray ( r hoI ) ;
667 mxDestroyArray ( p1 ) ;
668 mxDestroyArray ( p2 ) ;
669 mxDestroyArray ( pI ) ;
670
671 rhoc = c de ns r oot (5 e14 , 4e13 , c e nt r al de ns i t y , C, K, sm)
;
672
673 cout << endl << i nput number of meshpoi nts : << endl
<< > ;
674 ci n >> mesh ;
675 ci n . i gnor e ( ) ;
676
677 r s e = mxCreateDoubleMatrix ( 1 , 1 , mxREAL) ;
678 mse = mxCreateDoubleMatrix ( 1 , 1 , mxREAL) ;
97
679 dpdrhose = mxCreateDoubleMatrix ( 1 , 1 , mxREAL) ;
680 pse = mxCreateDoubleMatrix ( 1 , 1 , mxREAL) ;
681 mr = mxCreateDoubleMatrix ( mesh , 1 , mxREAL) ;
682 rhom = mxCreateDoubleMatrix ( mesh , 1 , mxREAL) ;
683 pm = mxCreateDoubleMatrix ( mesh , 1 , mxREAL) ;
684 r = mxCreateDoubleMatrix ( mesh , 1 , mxREAL) ;
685 dpdrho = mxCreateDoubleMatrix ( mesh , 1 , mxREAL) ;
686
687 pm r = mxGetPr (mr) ;
688 prhom = mxGetPr ( rhom) ;
689 ppm = mxGetPr (pm) ;
690 pr = mxGetPr ( r ) ;
691 dpdrhoI = mxGetPr ( dpdrhose ) ;
692 r I = mxGetPr ( r s e ) ;
693 mI = mxGetPr ( mse ) ;
694 pdpdrho = mxGetPr ( dpdrho ) ;
695 ps e r ot I = mxGetPr ( pse ) ;
696
697 cout << endl << rhoc << f or << sm << s o l a r masses
<< endl ;
698
699 m = nsmass ( rhoc , prho , pp , rI , &R, mI , dpdrhoI ) ;
700
701 const g s l o de i v s t e p t ype T = g s l o de i v s t e p r k 4 ;
702 g s l o de i v s t e p s = g s l o d e i v s t e p a l l o c (T, 2) ;
703 g s l o de i v c o nt r o l con = gs l ode i v c ont r ol y ne w ( 0 . 0 ,
1e 12) ;
704 g s l o de i v e vo l ve e = g s l o d e i v e v o l v e a l l o c ( 2) ;
705
706 g s l i n t e r p a c c e l acc = g s l i n t e r p a c c e l a l l o c ( ) ;
707 g s l s p l i n e s pl i ne = g s l s p l i n e a l l o c (
g s l i nt e r p c s p l i ne , 299998) ;
708
709 g s l s p l i n e i n i t ( s pl i ne , prho , pp , 299998) ;
710
711 struct s pl i ne par ams spl i neparams = s pl i ne , acc ;
712
713 gs l ode i v s ys t e m s ys = func , NULL, 2 , &spl i neparams ;
714
715 r0 = 0; r e = R;
716 h = r e /( ( double) ( mesh1) ) ;
717 y [ 0 ] = rhoc ;
718 y [ 1 ] = 0;
719 prhom [ 0 ] = rhoc ;
720 pm r [ 0 ] = 0;
721 ppm[ 0 ] = g s l s p l i n e e v a l ( s pl i ne , y [ 0 ] , acc ) ;
722 pdpdrho [ 0 ] = g s l s p l i n e e v a l d e r i v ( s pl i ne , y [ 0 ] , acc ) ;
723 pr [ 0 ] = 0;
724
725 ps e r ot I = GSL FN EVAL(&Serot , 2. 8 e14 ) ;
726
727 for ( i nt i = 1; i <= ( mesh1) ; i ++)
728
729 double r i = ( i r e ) /( ( double) ( mesh1) ) ;
98
730
731 while ( r0 < r i )
732
733 i nt s t at us = g s l o de i v e vo l ve a ppl y ( e , con , s , &
sys , &r0 , r i , &h , y) ;
734
735 i f ( s t at us != GSL SUCCESS)
736
737 e xi t ( 0) ;
738
739
740
741 cout << endl << r0 << << y [ 0 ] << << y [ 1 ] /G
<< endl ;
742
743 pr [ i ] = r0 ;
744 prhom[ i ] = y [ 0 ] ;
745 pm r [ i ] = y [ 1 ] /G;
746 ppm[ i ] = g s l s p l i n e e v a l ( s pl i ne , y [ 0 ] , acc ) ;
747 pdpdrho [ i ] = g s l s p l i n e e v a l d e r i v ( s pl i ne , y [ 0 ] , acc
) ;
748
749
750 g s l o d e i v e v o l v e f r e e ( e ) ;
751 g s l o d e i v c o n t r o l f r e e ( con ) ;
752 g s l o d e i v s t e p f r e e ( s ) ;
753
754 cout << endl << addi ng rhoEOS << endl ;
755
756 matPutVari abl e ( mat , rhoEOS , rho ) ;
757
758 cout << endl << addi ng pEOS << endl ;
759
760 matPutVari abl e ( mat , pEOS , p) ;
761
762 cout << endl << addi ng rho << endl ;
763
764 matPutVari abl e ( mat , rho , rhom) ;
765
766 cout << endl << addi ng p << endl ;
767
768 matPutVari abl e ( mat , p , pm) ;
769
770 cout << endl << addi ng m r << endl ;
771
772 matPutVari abl e ( mat , m r , mr) ;
773
774 cout << endl << addi ng r << endl ;
775
776 matPutVari abl e ( mat , r , r ) ;
777
778 cout << endl << addi ng r adi us at cor e envel ope boundary
r I << endl ;
779
99
780 matPutVari abl e ( mat , r I , r s e ) ;
781
782 cout << endl << addi ng t o t a l mass wi t hi n r adi us at cor e
envel ope boundary mI << endl ;
783
784 matPutVari abl e ( mat , mI , mse ) ;
785
786 cout << endl << addi ng the f i r s t de r i va t i ve of pr e s s ur e
wi th r e s pe c t to dens i t y at cor e envel ope boundary
dpdrhoI << endl ;
787
788 matPutVari abl e ( mat , dpdrhoI , dpdrhose ) ;
789
790 cout << endl << addi ng pr e s s ur e at cor e envel ope
boundary pse << endl ;
791
792 matPutVari abl e ( mat , pse , pse ) ;
793
794 cout << endl << addi ng dpdrho << endl ;
795
796 matPutVari abl e ( mat , dpdrho , dpdrho ) ;
797
798 g s l s p l i n e f r e e ( s pl i ne ) ;
799 g s l i n t e r p a c c e l f r e e ( acc ) ;
800
801 mxDestroyArray ( r s e ) ;
802 mxDestroyArray ( mse ) ;
803 mxDestroyArray ( rho ) ;
804 mxDestroyArray ( p) ;
805 mxDestroyArray (mr) ;
806 mxDestroyArray ( r ) ;
807 mxDestroyArray ( dpdrho ) ;
808 mxDestroyArray ( dpdrhose ) ;
809 mxDestroyArray (pm) ;
810 mxDestroyArray ( rhom) ;
811 mxDestroyArray ( pse ) ;
812
813 i f ( matClose ( mat ) != 0)
814
815 cout << endl << cannot c l o s e MAT f i l e << endl ;
816
817
818 cout << endl << done << endl ;
819
100
B.5 Programme for adding neutron and proton densities to MAT le
This programme adds a few extra variables to the data le containing the equilib-
rium variables. After running the programme in section B.4 of this appendix, it will
then be possible to open the created data le in Matlab or in Octave. This must
be done in order be able to plot the functions in the equilibrium model as well as
renaming some of the variables so that they can be read by the programme used to
calculate the oscillations (section B.6). This programme adds a few extra variables
that are needed.
1 /Programme t hat adds neut ron and prot on d e ns i t i e s t o MAT
f i l e /
2
3 #include <s t dl i b . h>
4 #include <math . h>
5 #include <i ostream>
6 #include <s t r i ng . h>
7 #include <g s l / g s l c o ns t . h>
8 #include <g s l / gsl math . h>
9 #include <g s l / g s l r o o t s . h>
10 #include <g s l / g s l e r r no . h>
11 #include mat . h
12 #include matri x . h
13
14 long double const m n = GSL CONST CGS MASS NEUTRON;
15 long double const m p = GSL CONST CGS MASS PROTON;
16 long double const m e = GSL CONST CGS MASS ELECTRON;
17 long double const m b = GSL CONST CGS UNIFIED ATOMIC MASS;
18 long double const hbar = GSL CONST CGS PLANCKS CONSTANT HBAR
;
19 long double const c = GSL CONST CGS SPEED OF LIGHT;
20 long double const pi = M PI ;
21
22 struct e f f e c t i ve mas s par ams double kn ; double kp ; ;
23 struct bet a equi l i br i um par am double dens ; ;
24
25 using namespace std ;
26
27 long double chi ( long double x)
28
29 long double chi ;
30
31 i f ( x<=1.0e 6)
32 chi = ( 1. 0/( 8pow( pi , 2 ) ) ) ( ( ( 8 . 0 / 3 . 0 ) pow( x , 3 ) )
+( ( 4. 0/5. 0) pow( x , 5 ) ) ( ( 1. 0/7. 0) pow( x , 7 ) ) ) ;
33
34
35 el se
36
37 chi = ( 1. 0/( 8pow( pi , 2 ) ) ) ( ( ( ( 2pow( x , 3 ) )+x) s qr t (1+
pow( x , 2 ) ) )l og ( x+s qr t (1+pow( x , 2 ) ) ) ) ;
38
39
40 return chi ;
101
41
42
43 long double ps i ( long double x)
44
45 long double ps i ;
46
47 i f ( x<=1.0e 6)
48
49 ps i = ( 1. 0/( 4pow( pi , 2 ) ) ) ( ( ( 2 . 0 / 3 . 0 ) pow( x , 3 ) )
( ( 1. 0/5. 0) pow( x , 5 ) ) +( ( 3. 0/28. 0) pow( x , 7 ) ) ) ;
50
51
52 el se
53
54 ps i = ( 1. 0/( 4pow( pi , 2 ) ) ) ( ( x s qr t (1+pow( x , 2 ) ) )l og (
x+s qr t (1+pow( x , 2 ) ) ) ) ;
55
56
57 return ps i ;
58
59
60 long double phi ( long double x)
61
62 long double phi ;
63
64 i f ( x<=1.0e 6)
65
66 phi = ( 1. 0/( 8pow( pi , 2 ) ) ) ( ( ( 8 . 0 / 1 5 . 0 ) pow( x , 5 ) )
( ( 4. 0/21. 0) pow( x , 7 ) ) +( ( 1. 0/9. 0) pow( x , 9 ) ) ) ;
67
68
69 el se
70
71 phi = ( 1. 0/( 8pow( pi , 2 ) ) ) ( ( x s qr t (1+pow( x , 2 ) )
( ( ( 2 . 0 / 3 . 0 ) pow( x , 2 ) ) 1) )+l og ( x+s qr t (1+pow( x , 2 )
) ) ) ;
72
73
74 return phi ;
75
76
77 long double chi pr i me ( long double x)
78
79 long double chi pr i me ;
80
81 i f ( x<=1.0e 6)
82
83 chi pr i me = ( 1. 0/pow( pi , 2 ) ) (pow( x , 2 ) +(0. 5pow( x , 4 ) )
( ( 1. 0/8. 0) pow( x , 6 ) ) ) ;
84
85
86 el se
87
102
88 chi pr i me = ( 1. 0/pow( pi , 2 ) ) pow( x , 2 ) s qr t (1+pow( x , 2 )
) ;
89
90
91 return chi pr i me ;
92
93
94 long double ps i pr i me ( long double x)
95
96 long double ps i pr i me ;
97
98 i f ( x<=1.0e 13)
99
100 ps i pr i me = ( 1. 0/( 4pow( pi , 2 ) ) ) ( ( 2pow( x , 2 ) )pow( x
, 4 ) +( ( 3. 0/4. 0) pow( x , 6 ) ) ) ;
101
102
103 el se
104
105 ps i pr i me = ( 1. 0/( 2pow( pi , 2 ) ) ) (pow( x , 2 ) / s qr t (1+pow
( x , 2 ) ) ) ;
106
107
108 return ps i pr i me ;
109
110
111 double e f f e c t i ve ma s s f unc t i o n ( double m i ni t , void params
)
112
113 struct e f f e c t i ve mas s par ams k = ( struct
e f f e c t i ve mas s par ams ) params ;
114 double kn = ( k>kn) ;
115 double kp = ( k>kp) ;
116 long double xn = ( kn/( m i ni t c ) ) ;
117 long double xp = ( kp/( m i ni t c ) ) ;
118 long double ps i n = ps i ( xn) ;
119 long double ps i p = ps i ( xp) ;
120
121 return m i ni t + ( 534. 2( pow( m i ni t , 3 ) /pow(m b , 2 ) ) ( ps i n
+ ps i p ) )m b ;
122
123
124 double e f f e c t i ve ma s s ( double kn , double kp , double mass hi gh
, double mass low , g s l f unc t i o n F)
125
126 const g s l r o o t f s o l v e r t y p e T2 ; g s l r o o t f s o l v e r s2 ;
127 T2 = g s l r o o t f s o l v e r b r e n t ;
128 s2 = g s l r o o t f s o l v e r a l l o c (T2) ;
129 i nt s t at us ;
130 double mass root ;
131 i nt i = 0;
132 g s l r o o t f s o l v e r s e t ( s2 , &F, mass low , mass hi gh ) ;
133
134 do
103
135 s t at us = g s l r o o t f s o l v e r i t e r a t e ( s2 ) ;
136 mass root = g s l r o o t f s o l v e r r o o t ( s2 ) ;
137 mass l ow = g s l r o o t f s o l v e r x l o we r ( s2 ) ;
138 mass hi gh = g s l r o o t f s o l v e r x uppe r ( s2 ) ;
139 s t at us = g s l r o o t t e s t i n t e r v a l ( mass low , mass hi gh ,
0 , 1. 0 e 15) ;
140 i = i + 1;
141 while ( s t at us == GSL CONTINUE) ;
142
143 i f ( s t at us != GSL SUCCESS)
144
145 cout << r et ur ned s t at us << s t at us << i n e f f e c t i v e
mass <<endl ;
146 e xi t ( 0) ;
147 ;
148
149 return mass root ;
150
151
152 double be t a e qui l i br i um f unc t i on ( double neut r on dens i t y ,
void param)
153
154 struct bet a equi l i br i um par am d = ( struct
bet a equi l i br i um par am ) param;
155 double dens = ( d>dens ) ;
156
157 double m ef f , m kn , m kp , m rhon , m rhop ;
158 long double kn , kp , kn3 , kp3 , xn , xp , mu n , mu p , mu e ,
ps i n , ps i p , chi n , chi p , ps i pr i me n , ps i pr i me p
, chi pr i me n , chi pr i me p ;
159
160 kn3 = (3pow( pi , 2 ) pow( hbar , 3 ) neut r on dens i t y ) /m n ;
161 kn = pow( kn3 , ( 1 . 0 / 3 . 0 ) ) ;
162
163 double pr ot on de ns i t y = ( m p/( m p+m e ) ) ( dens
neut r on dens i t y ) ;
164
165 kp3 = (3pow( pi , 2 ) pow( hbar , 3 ) pr ot on de ns i t y ) /m p ;
166 kp = pow( kp3 , ( 1 . 0 / 3 . 0 ) ) ;
167
168 g s l f unc t i o n m;
169 struct e f f e c t i ve mas s par ams params = kn , kp ;
170
171 m. f unc t i on = &e f f e c t i ve ma s s f unc t i o n ;
172 m. params = &params ;
173
174 double m hi = 1 , m l o = 1;
175 while (GSL FN EVAL(&m, m hi ) GSL FN EVAL(&m, m l o ) >0)
176
177 m hi = m l o ;
178 m l o = m l o /10;
179 ;
180
181 m ef f = e f f e c t i ve ma s s ( kn , kp , m hi , m lo , m) ;
104
182
183 xn = ( kn/( m ef f c ) ) ; xp = ( kp/( m ef f c ) ) ;
184 ps i n = ps i ( xn) ;
185 ps i p = ps i ( xp) ;
186 c hi n = chi ( xn) ;
187 c hi p = chi ( xp) ;
188 ps i pr i me n = ps i pr i me ( xn) ;
189 chi pr i me n = chi pr i me ( xn) ;
190 ps i pr i me p = ps i pr i me ( xp) ;
191 chi pr i me p = chi pr i me ( xp) ;
192 m rhon = (( 534. 2pow( hbar , 3 ) ) /(2pow(m b , 2 ) m npow( c
, 3 ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) ) /(1+(1602. 6pow( (
m ef f /m b) , 2) ( ps i n+ps i p ) ) (534. 2( m ef f /(pow(m b
, 2 ) c ) ) ( ( kn ps i pr i me n ) +(kp ps i pr i me p ) ) ) ) ;
193 m rhop = (( 534. 2pow( hbar , 3 ) ) /(2m ppow(m b , 2 ) pow( c
, 3 ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) /(1+(1602. 6pow( (
m ef f /m b) , 2) ( ps i n+ps i p ) ) (534. 2( m ef f /(pow(m b
, 2 ) c ) ) ( ( kn ps i pr i me n ) +(kp ps i pr i me p ) ) ) ) ;
194
195 mu n = ( ( ( 4pow( m ef f , 3 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) ( c hi n+
c hi p ) m rhon) +((( m ef f pow( c , 2 ) ) /m n) s qr t (1+pow( (
kn/( m ef f c ) ) , 2) ) ) (((pow( c , 2 ) kn3 ) /(pow( pi , 2 ) pow(
hbar , 3 ) ) ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) m rhon) (((
pow( m ef f , 2 ) pow( c , 4 ) kp) /pow( hbar , 3 ) ) chi pr i me p
m rhon) +((6pow( pi , 2 ) ( kn3+kp3 ) ) /( 8. 950pow(m b , 2 )
m nc ) ) (((2pow(m b , 2 ) (m bm ef f ) pow( c , 5 ) )
/( 534. 2pow( hbar , 3 ) ) ) m rhon) +((6pow( pi , 2 ) ( kn3kp3
) ) /( 128. 2pow(m b , 2 ) m nc ) ) ;
196 mu p = ( ( ( 4pow( m ef f , 3 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) ( c hi n+
c hi p ) m rhop) +((( m ef f pow( c , 2 ) ) /m p) s qr t (1+pow( (
kp/( m ef f c ) ) , 2) ) ) (((pow( c , 2 ) kp3 ) /(pow( pi , 2 ) pow(
hbar , 3 ) ) ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) m rhop) (((
pow( m ef f , 2 ) pow( c , 4 ) kn) /pow( hbar , 3 ) ) chi pr i me n
m rhop) +((6pow( pi , 2 ) ( kn3+kp3 ) ) /( 8. 950pow(m b , 2 )
m pc ) ) (((2pow(m b , 2 ) (m bm ef f ) pow( c , 5 ) )
/( 534. 2pow( hbar , 3 ) ) ) m rhop) ((6pow( pi , 2 ) ( kn3kp3
) ) /( 128. 2pow(m b , 2 ) m pc ) ) ;
197 mu e = pow( c , 2 ) s qr t (1+pow( ( kp/( m ec ) ) , 2) ) ;
198
199 return ( m emu e ) +(m pmu p) (m nmu n) ;
200
201
202 double be t a e qui l i br i um ( double neut r on dens i t y hi gh , double
neut r on dens i t y l ow , g s l f unc t i o n F)
203
204 const g s l r o o t f s o l v e r t y p e T1 ; g s l r o o t f s o l v e r s1 ;
205 T1 = g s l r o o t f s o l v e r b r e n t ;
206 s1 = g s l r o o t f s o l v e r a l l o c (T1) ;
207
208 i nt s t at us ;
209 double ne ut r on de ns i t y r oot ;
210 g s l r o o t f s o l v e r s e t ( s1 , &F, neut r on dens i t y l ow ,
ne ut r on de ns i t y hi gh ) ;
211
105
212 do
213 s t at us = g s l r o o t f s o l v e r i t e r a t e ( s1 ) ;
214 ne ut r on de ns i t y r oot = g s l r o o t f s o l v e r r o o t ( s1 ) ;
215 ne ut r on dens i t y l ow = g s l r o o t f s o l v e r x l o we r ( s1 ) ;
216 ne ut r on de ns i t y hi gh = g s l r o o t f s o l v e r x uppe r ( s1 ) ;
217 s t at us = g s l r o o t t e s t i n t e r v a l ( neut r on dens i t y l ow ,
neut r on dens i t y hi gh , 0 , 1. 0 e 15) ;
218 while ( s t at us == GSL CONTINUE) ;
219
220 i f ( s t at us != GSL SUCCESS)
221
222 cout << r et ur ned s t at us << s t at us << i n beta
e qui l i br i um << endl ;
223 e xi t ( 0) ;
224 ;
225
226 return ne ut r on de ns i t y r oot ;
227
228
229 i nt main ( )
230
231 MATFile mat ;
232 mxArray rho , rho n , rho p , munrhon , munrhop ,
murhop ;
233 i nt l , s t at us ;
234 double rhos , rhon , mu n rhon , mu n rhop , mu rhop ,
prhon , prhop , pmunrhon , pmunrhop , pmurhop , rhop
;
235 long double r hos i , kn , kp , kn3 , kp3 , m ef f , psi n , psi p ,
chi n , chi p , psi pri men , psi pri mep , chi pri men ,
chi pri mep , xn , xp , ne ut r on de ns i t y l o ,
ne ut r on de ns i t y hi , m rhon , m rhop , m rhon rhon ,
m rhon rhop , m rhop rhop , num1, num2, num3, num4,
num5, num6, num7, num8, num9, num10 , num11 , num12 ,
num13 , num14 , num15 , dmu1, dmu2, dmu3, dmu4, dmu5,
dmu6, dmu7, dmu8, dmu9, dmu10 , dmu11 , dmu12 , dmu13 ,
dmu14 , dmu15 , dmu16 , dmu17 , dmu18 , dmu19 ;
236 double prho ;
237 char f [ 4 0 ] ;
238
239 cout << endl << Enter name of MAT f i l e : << endl << >
;
240 ci n >> f ;
241
242 char f i l e = s t r c a t ( f , . mat ) ;
243 ci n . i gnor e ( ) ;
244 mat = matOpen( f i l e , u ) ;
245 i f ( mat == NULL)
246 cout << endl << cannot open MAT f i l e << f i l e <<
or f i l e does not e x i s t << endl ;
247 return(EXIT FAILURE) ;
248
249
250 rho = matGetVari abl e ( mat , rho2 ) ;
106
251 i f ( rho == NULL)
252 cout << endl << cannot r e t r i e v e var i abl e << endl ;
253 return(EXIT FAILURE) ;
254
255
256 prho = mxGetPr ( rho ) ;
257 l = mxGetM( rho ) ;
258
259 rhos = new double [ l ] ;
260 for ( i nt i = 0; i <= ( l 1) ; i ++)
261
262 r hos i = ( prho + i ) ;
263 rhos [ i ] = r hos i ;
264
265
266 rho n = mxCreateDoubleMatrix ( l , 1 , mxREAL) ;
267 rho p = mxCreateDoubleMatrix ( l , 1 , mxREAL) ;
268 munrhon = mxCreateDoubleMatrix ( l , 1 , mxREAL) ;
269 munrhop = mxCreateDoubleMatrix ( l , 1 , mxREAL) ;
270 murhop = mxCreateDoubleMatrix ( l , 1 , mxREAL) ;
271
272 rhon = new double [ l ] ; rhop = new double [ l ] ; mu n rhon
= new double [ l ] ; mu n rhop = new double [ l ] ;
mu rhop = new double [ l ] ;
273
274 for ( i nt j = 0; j <= ( l 1) ; j ++)
275
276 g s l f unc t i o n beta ;
277 struct bet a equi l i br i um par am param = rhos [ j ] ;
278
279 beta . f unc t i on = &be t a e qui l i br i um f unc t i on ;
280 beta . params = &param;
281
282 ne ut r on de ns i t y hi = rhos [ j ] ;
283 ne ut r on de ns i t y l o = 0;
284
285 rhon [ j ] = be t a e qui l i br i um ( ne ut r on de ns i t y hi ,
ne ut r on de ns i t y l o , beta ) ;
286 kn3 = (3pow( pi , 2 ) pow( hbar , 3 ) rhon [ j ] ) /m n ;
287 kn = pow( kn3 , ( 1 . 0 / 3 . 0 ) ) ;
288
289 rhop [ j ] = ( m p/( m p+m e ) ) ( rhos [ j ] rhon [ j ] ) ;
290
291 kp3 = (3pow( pi , 2 ) pow( hbar , 3 ) rhop [ j ] ) /m p ;
292 kp = pow( kp3 , ( 1 . 0 / 3 . 0 ) ) ;
293
294 g s l f unc t i o n m;
295 struct e f f e c t i ve mas s par ams params = kn , kp ;
296
297 m. f unc t i on = &e f f e c t i ve ma s s f unc t i o n ;
298 m. params = &params ;
299
300 double m hi = 1 , m l o = 1;
301 while (GSL FN EVAL(&m, m hi ) GSL FN EVAL(&m, m l o ) >0)
107
302
303 m hi = m l o ;
304 m l o = m l o /10;
305 ;
306
307 m ef f = e f f e c t i ve ma s s ( kn , kp , m hi , m lo , m) ;
308
309 xn = ( kn/( m ef f c ) ) ; xp = ( kp/( m ef f c ) ) ;
310 ps i n = ps i ( xn) ; ps i p = ps i ( xp) ; chi n = chi ( xn) ; chi p
= chi ( xp) ; psi pri men = ps i pr i me ( xn) ; chi pri men
= chi pr i me ( xn) ; psi pri mep = ps i pr i me ( xp) ;
chi pri mep = chi pr i me ( xp) ;
311
312 m rhon = ( 534. 2pow( hbar , 3 ) ) /( ( 2pow(m b , 2 ) m npow
( c , 3 ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) +(3205. 2pow
( m ef f , 2 ) m npow( c , 3 ) ( ps i n+ps i p ) s qr t (1+pow( (
kn/( m ef f c ) ) , 2) ) ) (1602. 6((pow( hbar , 3 ) rhon [ j
] ) / m ef f ) ) (1602. 6(( m npow( hbar , 3 ) rhop [ j ]
s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) /(m p m ef f s qr t
(1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) ) ) ;
313 m rhop = ( 534. 2pow( hbar , 3 ) ) /( ( 2m ppow(m b , 2 ) pow
( c , 3 ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) +(3205. 2m p
pow( c , 3 ) pow( m ef f , 2 ) ( ps i n+ps i p ) s qr t (1+pow( (
kp/( m ef f c ) ) , 2) ) ) (1602. 6(( m ppow( hbar , 3 )
rhon [ j ] s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) /(m n
m ef f s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) ) )
(1602. 6((pow( hbar , 3 ) rhop [ j ] ) / m ef f ) ) ) ;
314
315 num1 = 1068. 4((pow( hbar , 3 ) pow(m b , 2 ) m ncpow( kn
, 2 ) ) /(3pow( m ef f , 2 ) rhon [ j ] s qr t (1+pow( ( kn/(
m ef f c ) ) , 2) ) ) ) ;
316 num2 = 1068. 4( ( pow( hbar , 3 ) pow(m b , 2 ) m ncpow( kn
, 2 ) m rhon) /(pow( m ef f , 3 ) s qr t (1+pow( ( kn/( m ef f
c ) ) , 2) ) ) ) ;
317 num3 = 3424435.68pow( hbar , 3 ) m npow( c , 3 ) m ef f (
ps i n+ps i p ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) m rhon ;
318 num4 = 570739. 28((pow( hbar , 3 ) m ncpow( kn , 2 ) (
ps i n+ps i p ) ) /( rhon [ j ] s qr t (1+pow( ( kn/( m ef f c ) )
, 2) ) ) ) ;
319 num5 = 1712217. 84( ( pow( hbar , 3 ) m ncpow( kn , 2 ) (
ps i n+ps i p ) m rhon) /( m ef f s qr t (1+pow( ( kn/( m ef f
c ) ) , 2) ) ) ) ;
320 num6 = 856108. 92(pow( hbar , 6 ) / m ef f ) ;
321 num7 = 2568326. 76( ( pow( hbar , 6 ) rhon [ j ] m rhon) /pow(
m ef f , 2 ) ) ;
322 num8 = 2568326. 76( ( pow( hbar , 6 ) m nrhop [ j ] s qr t (1+
pow( ( kn/( m ef f c ) ) , 2) ) m rhon) /( m ppow( m ef f , 2 )
s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) ;
323 num9 = 856108. 92( pow( hbar , 6 ) / m ef f ) ;
324 num10 = 856108. 92((pow( hbar , 6 ) rhon [ j ] m rhon) /pow
( m ef f , 2 ) ) ;
325 num11 = 285369. 64( ( pow( hbar , 6 ) m nrhop [ j ] pow( kn
, 2 ) ) /(m ppow( m ef f , 3 ) pow( c , 2 ) rhon [ j ] s qr t (1+
pow( ( kn/( m ef f c ) ) , 2) ) s qr t (1+pow( ( kp/( m ef f c ) )
108
, 2) ) ) ) ;
326 num12 = 856108. 92((pow( hbar , 6 ) m nrhop [ j ] pow( kn
, 2 ) m rhon) /( m ppow( m ef f , 4 ) pow( c , 2 ) s qr t (1+
pow( ( kn/( m ef f c ) ) , 2) ) s qr t (1+pow( ( kp/( m ef f c ) )
, 2) ) ) ) ;
327 num13 = 856108. 92((pow( hbar , 6 ) m nrhop [ j ] s qr t (1+
pow( ( kn/( m ef f c ) ) , 2) ) m rhon) /( m ppow( m ef f , 2 )
s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) ;
328 num14 = 856108. 92( ( pow( hbar , 6 ) m nrhop [ j ] pow( kp
, 2 ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) m rhon) /( m p
pow( m ef f , 4 ) pow( c , 2 ) pow((1+pow( ( kp/( m ef f c ) )
, 2) ) , 1 . 5 ) ) ) ;
329
330 m rhon rhon = (num1+num2+num3+num4+num5+num6+num7+
num8+num9+num10+num11+num12+num13+num14) /pow
( ( ( 2pow(m b , 2 ) m npow( c , 3 ) s qr t (1+pow( ( kn/(
m ef f c ) ) , 2) ) ) +(3205. 2pow( m ef f , 2 ) m npow( c , 3 )
( ps i n+ps i p ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) )
(1602. 6((pow( hbar , 3 ) rhon [ j ] ) / m ef f ) )
(1602. 6(( m npow( hbar , 3 ) rhop [ j ] s qr t (1+pow( (
kn/( m ef f c ) ) , 2) ) ) /(m p m ef f s qr t (1+pow( ( kp/(
m ef f c ) ) , 2) ) ) ) ) ) , 2) ;
331
332 num1 = 1068. 4( ( pow( hbar , 3 ) pow(m b , 2 ) m ncpow( kn
, 2 ) m rhop) /(pow( m ef f , 3 ) s qr t (1+pow( ( kn/( m ef f
c ) ) , 2) ) ) ) ;
333 num2 = 3424435.68pow( hbar , 3 ) m npow( c , 3 ) m ef f (
ps i n+ps i p ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) m rhop ;
334 num3 = 2568326. 76( ( pow( hbar , 6 ) rhon [ j ] m rhop) /pow(
m ef f , 2 ) ) ;
335 num4 = 856108. 92((pow( hbar , 6 ) m n s qr t (1+pow( ( kn/(
m ef f c ) ) , 2) ) ) /( m p m ef f s qr t (1+pow( ( kp/( m ef f
c ) ) , 2) ) ) ) ;
336 num5 = 2568326. 76( ( pow( hbar , 6 ) m nrhop [ j ] s qr t (1+
pow( ( kn/( m ef f c ) ) , 2) ) m rhop) /( m ppow( m ef f , 2 )
s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) ;
337 num6 = 1712217. 84( ( pow( hbar , 3 ) m ncpow( kn , 2 ) ) /(
m ef f s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) ) ( ps i n+ps i p
) m rhop ;
338 num7 = 856108. 92((pow( hbar , 6 ) rhon [ j ] m rhop) /pow(
m ef f , 2 ) ) ;
339 num8 = 856108. 92( ( pow( hbar , 6 ) m n s qr t (1+pow( ( kn/(
m ef f c ) ) , 2) ) ) /( m p m ef f s qr t (1+pow( ( kp/( m ef f
c ) ) , 2) ) ) ) ;
340 num9 = 856108. 92((pow( hbar , 6 ) m nrhop [ j ] s qr t (1+
pow( ( kn/( m ef f c ) ) , 2) ) m rhop) /( m ppow( m ef f , 2 )
s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) ;
341 num10 = 856108. 92((pow( hbar , 6 ) m nrhop [ j ] pow( kn
, 2 ) m rhop) /( m ppow( m ef f , 4 ) pow( c , 2 ) s qr t (1+
pow( ( kn/( m ef f c ) ) , 2) ) s qr t (1+pow( ( kp/( m ef f c ) )
, 2) ) ) ) ;
342 num11 = 285369. 64((pow( hbar , 6 ) m npow( kp , 2 ) s qr t
(1+pow( ( kn/( m ef f c ) ) , 2) ) ) /(m ppow( m ef f , 3 ) pow
( c , 2 ) pow((1+pow( ( kp/( m ef f c ) ) , 2) ) , 1 . 5 ) ) ) ;
109
343 num12 = 856108. 92( ( pow( hbar , 6 ) m nrhop [ j ] pow( kp
, 2 ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) m rhop) /( m p
pow( m ef f , 4 ) pow( c , 2 ) pow((1+pow( ( kp/( m ef f c ) )
, 2) ) , 1 . 5 ) ) ) ;
344
345 m rhon rhop = (num1+num2+num3+num4+num5+num6+num7+
num8+num9+num10+num11+num12) /pow( ( ( 2pow(m b , 2 )
m npow( c , 3 ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) )
+(3205. 2pow( m ef f , 2 ) m npow( c , 3 ) ( ps i n+ps i p )
s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) (1602. 6((pow(
hbar , 3 ) rhon [ j ] ) / m ef f ) ) (1602. 6(( m npow( hbar
, 3 ) rhop [ j ] s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) /( m p
m ef f s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) ) ) , 2) ;
346
347 num1 = 1068. 4((pow( hbar , 3 ) m ppow(m b , 2 ) cpow( kp
, 2 ) ) /(3pow( m ef f , 2 ) rhop [ j ] s qr t (1+pow( ( kp/(
m ef f c ) ) , 2) ) ) ) ;
348 num2 = 1068. 4( ( pow( hbar , 3 ) m ppow(m b , 2 ) cpow( kp
, 2 ) m rhop) /(pow( m ef f , 3 ) s qr t (1+pow( ( kp/( m ef f
c ) ) , 2) ) ) ) ;
349 num3 = 3424435. 68((pow( hbar , 3 ) m ppow( c , 3 ) m ef f
( ps i n+ps i p ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) )
m rhop) ) ;
350 num4 = 2568326. 76( ( pow( hbar , 6 ) m prhon [ j ] s qr t (1+
pow( ( kp/( m ef f c ) ) , 2) ) m rhop) /( m npow( m ef f , 2 )
s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) ) ;
351 num5 = 856108. 92(pow( hbar , 6 ) / m ef f ) ;
352 num6 = 2568326. 76( ( pow( hbar , 6 ) rhop [ j ] m rhop) /pow(
m ef f , 2 ) ) ;
353 num7 = 570739. 28((pow( hbar , 3 ) m pcpow( kp , 2 ) ) /(
rhop [ j ] s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) ( ps i n+
ps i p ) ;
354 num8 = 1712217. 84( ( pow( hbar , 3 ) m pcpow( kp , 2 ) ) /(
m ef f s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) ( ps i n+ps i p
) m rhop ;
355 num9 = 285369. 64( ( pow( hbar , 6 ) m prhon [ j ] pow( kp , 2 )
) /(m npow( m ef f , 3 ) pow( c , 2 ) rhop [ j ] s qr t (1+pow
( ( kn/( m ef f c ) ) , 2) ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2)
) ) ) ;
356 num10 = 856108. 92((pow( hbar , 6 ) m prhon [ j ] pow( kp
, 2 ) m rhop) /( m npow( m ef f , 4 ) pow( c , 2 ) s qr t (1+
pow( ( kn/( m ef f c ) ) , 2) ) s qr t (1+pow( ( kp/( m ef f c ) )
, 2) ) ) ) ;
357 num11 = 856108. 92((pow( hbar , 6 ) m prhon [ j ] s qr t (1+
pow( ( kp/( m ef f c ) ) , 2) ) m rhop) /( m npow( m ef f , 2 )
s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) ) ;
358 num12 = 856108. 92((pow( hbar , 6 ) m ppow( kn , 2 ) rhon [
j ] s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) m rhop) /( m n
pow( m ef f , 4 ) pow( c , 2 ) pow((1+pow( ( kn/( m ef f c ) )
, 2) ) , 1 . 5 ) ) ) ;
359 num13 = 856108. 92( pow( hbar , 6 ) / m ef f ) ;
360 num14 = 856108. 92((pow( hbar , 6 ) rhop [ j ] m rhop) /pow
( m ef f , 2 ) ) ;
361
110
362 m rhop rhop = (num1+num2+num3+num4+num5+num6+num7+
num8+num9+num10+num11+num12+num13+num14) /pow
( ( ( 2 m ppow(m b , 2 ) pow( c , 3 ) s qr t (1+pow( ( kp/(
m ef f c ) ) , 2) ) ) +(3205. 2m ppow( c , 3 ) pow( m ef f , 2 )
( ps i n+ps i p ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) )
(1602. 6(( m ppow( hbar , 3 ) rhon [ j ] s qr t (1+pow( (
kp/( m ef f c ) ) , 2) ) ) /(m n m ef f s qr t (1+pow( ( kn/(
m ef f c ) ) , 2) ) ) ) ) (1602. 6((pow( hbar , 3 ) rhop [ j ] ) /
m ef f ) ) ) , 2) ;
363
364 dmu1 = ( ( 12pow( m ef f , 2 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) (
chi n+chi p ) pow( m rhon , 2 ) ;
365 dmu2 = ( ( 4pow( c , 2 ) kn3 ) /(3pow( pi , 2 ) pow( hbar , 3 )
rhon [ j ] ) ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) m rhon ;
366 dmu3 = ((4pow( c , 2 ) kn3 ) /(pow( pi , 2 ) pow( hbar , 3 )
m ef f ) ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) pow( m rhon
, 2 ) ;
367 dmu4 = ((4pow( c , 2 ) kp3 ) /(pow( pi , 2 ) pow( hbar , 3 )
m ef f ) ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) pow( m rhon
, 2 ) ;
368 dmu5 = ( ( 4pow( m ef f , 3 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) ( chi n
+chi p ) m rhon rhon ;
369 dmu6 = (pow( c , 2 ) /m n) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) )
m rhon ;
370 dmu7 = (pow( kn , 2 ) /(3m n m ef f rhon [ j ] s qr t (1+pow( (
kn/( m ef f c ) ) , 2) ) ) ) ;
371 dmu8 = (pow( kn , 2 ) /(m npow( m ef f , 2 ) s qr t (1+pow( ( kn
/( m ef f c ) ) , 2) ) ) ) m rhon ;
372 dmu9 = ((3pow( c , 2 ) ) /m n) s qr t (1+pow( ( kn/( m ef f c ) )
, 2) ) m rhon ;
373 dmu10 = (pow( kn , 5 ) /(3pow( pi , 2 ) pow( hbar , 3 ) rhon [ j
] pow( m ef f , 2 ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) )
m rhon ;
374 dmu11 = (pow( kn , 5 ) /(pow( pi , 2 ) pow( hbar , 3 ) pow( m ef f
, 3 ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) ) pow( m rhon
, 2 ) ;
375 dmu12 = ((pow( c , 2 ) kn3 ) /(pow( pi , 2 ) pow( hbar , 3 ) ) )
s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) m rhon rhon ;
376 dmu13 = (pow( kp , 5 ) /(pow( pi , 2 ) pow( hbar , 3 ) pow( m ef f
, 3 ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) pow( m rhon
, 2 ) ;
377 dmu14 = ((pow( c , 2 ) kp3 ) /(pow( pi , 2 ) pow( hbar , 3 ) ) )
s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) m rhon rhon ;
378 dmu15 = (18pow( pi , 4 ) pow( hbar , 3 ) ) /( 8. 950pow(m b , 2 )
pow(m n , 2 ) c ) ;
379 dmu16 = ( ( 2pow(m b , 2 ) pow( c , 5 ) ) /( 534. 2pow( hbar , 3 ) )
) pow( m rhon , 2 ) ;
380 dmu17 = ((2pow(m b , 2 ) (m bm ef f ) pow( c , 5 ) )
/( 534. 2pow( hbar , 3 ) ) ) m rhon rhon ;
381 dmu18 = (18pow( pi , 4 ) pow( hbar , 3 ) ) /( 128. 2pow(m b , 2 )
pow(m n , 2 ) c ) ;
382
383 mu n rhon [ j ] = dmu1+dmu2+dmu3+dmu4+dmu5+dmu6+dmu7+
dmu8+dmu9+dmu10+dmu11+dmu12+dmu13+dmu14+dmu15+
111
dmu16+dmu17+dmu18 ;
384
385 dmu1 = ( ( 12pow( m ef f , 2 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) (
chi n+chi p ) m rhonm rhop ;
386 dmu2 = ((4pow( c , 2 ) kn3 ) /(pow( pi , 2 ) pow( hbar , 3 )
m ef f ) ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) m rhon
m rhop ;
387 dmu3 = ( ( 4pow( c , 2 ) kp3 ) /(3pow( pi , 2 ) pow( hbar , 3 )
rhop [ j ] ) ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) m rhon ;
388 dmu4 = ((4pow( c , 2 ) kp3 ) /(pow( pi , 2 ) pow( hbar , 3 )
m ef f ) ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) m rhon
m rhop ;
389 dmu5 = ( ( 4pow( m ef f , 3 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) ( chi n
+chi p ) m rhon rhop ;
390 dmu6 = (pow( c , 2 ) /m n) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) )
m rhop ;
391 dmu7 = (pow( kn , 2 ) /(m npow( m ef f , 2 ) s qr t (1+pow( ( kn
/( m ef f c ) ) , 2) ) ) ) m rhop ;
392 dmu8 = (pow( kn , 5 ) /(pow( pi , 2 ) pow( hbar , 3 ) pow( m ef f
, 3 ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) ) m rhon
m rhop ;
393 dmu9 = ((pow( c , 2 ) kn3 ) /(pow( pi , 2 ) pow( hbar , 3 ) ) )
s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) m rhon rhop ;
394 dmu10 = ((3pow( c , 2 ) ) /m p) s qr t (1+pow( ( kp/( m ef f c )
) , 2) ) m rhon ;
395 dmu11 = (pow( kp , 5 ) /(3pow( pi , 2 ) pow( hbar , 3 ) pow(
m ef f , 2 ) rhop [ j ] s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) )
m rhon ;
396 dmu12 = (pow( kp , 5 ) /(pow( pi , 2 ) pow( hbar , 3 ) pow( m ef f
, 3 ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) m rhon
m rhop ;
397 dmu13 = ((pow( c , 2 ) kp3 ) /(pow( pi , 2 ) pow( hbar , 3 ) ) )
s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) m rhon rhop ;
398 dmu14 = (18pow( pi , 4 ) pow( hbar , 3 ) ) /( 8. 950pow(m b , 2 )
m nm pc ) ;
399 dmu15 = ( ( 2pow(m b , 2 ) pow( c , 5 ) ) /( 534. 2pow( hbar , 3 ) )
) m rhonm rhop ;
400 dmu16 = ((2pow(m b , 2 ) (m bm ef f ) pow( c , 5 ) )
/( 534. 2pow( hbar , 3 ) ) ) m rhon rhop ;
401 dmu17 = (18pow( pi , 4 ) pow( hbar , 3 ) ) /( 128. 2pow(m b
, 2 ) m nm pc ) ;
402
403
404 mu n rhop [ j ] = dmu1+dmu2+dmu3+dmu4+dmu5+dmu6+dmu7+
dmu8+dmu9+dmu10+dmu11+dmu12+dmu13+dmu14+dmu15+
dmu16+dmu17 ;
405
406 dmu1 = ( ( 12pow( m ef f , 2 ) pow( c , 5 ) ) /(pow( hbar , 3 ) ) ) (
chi n+chi p ) pow( m rhop , 2 ) ;
407 dmu2 = ((4kn3pow( c , 2 ) ) /(pow( pi , 2 ) pow( hbar , 3 )
m ef f ) ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) pow( m rhop
, 2 ) ;
408 dmu3 = ( ( 4 kp3pow( c , 2 ) ) /(3pow( pi , 2 ) pow( hbar , 3 )
rhop [ j ] ) ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) m rhop ;
112
409 dmu4 = ((4kp3pow( c , 2 ) ) /(pow( pi , 2 ) pow( hbar , 3 )
m ef f ) ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) pow( m rhop
, 2 ) ;
410 dmu5 = ( ( 4pow( m ef f , 3 ) pow( c , 5 ) ) /pow( hbar , 3 ) ) ( chi n
+chi p ) m rhop rhop ;
411 dmu6 = (pow( c , 2 ) /m p) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) )
m rhop ;
412 dmu7 = pow( kp , 2 ) /(3m p m ef f rhop [ j ] s qr t (1+pow( ( kp
/( m ef f c ) ) , 2) ) ) ;
413 dmu8 = (pow( kp , 2 ) /(m ppow( m ef f , 2 ) s qr t (1+pow( ( kp
/( m ef f c ) ) , 2) ) ) ) m rhop ;
414 dmu9 = ((3pow( c , 2 ) ) /m p) s qr t (1+pow( ( kp/( m ef f c ) )
, 2) ) m rhop ;
415 dmu10 = (pow( kp , 5 ) /(3pow( pi , 2 ) pow( hbar , 3 ) pow(
m ef f , 2 ) rhop [ j ] s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) )
m rhop ;
416 dmu11 = ( ( pow( kp , 5 ) ) /(pow( pi , 2 ) pow( hbar , 3 ) pow(
m ef f , 3 ) s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) ) ) pow(
m rhop , 2 ) ;
417 dmu12 = ((kp3pow( c , 2 ) ) /(pow( pi , 2 ) pow( hbar , 3 ) ) )
s qr t (1+pow( ( kp/( m ef f c ) ) , 2) ) m rhop rhop ;
418 dmu13 = (pow( kn , 5 ) /(pow( pi , 2 ) pow( hbar , 3 ) pow( m ef f
, 3 ) s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) ) ) pow( m rhop
, 2 ) ;
419 dmu14 = ((kn3pow( c , 2 ) ) /(pow( pi , 2 ) pow( hbar , 3 ) ) )
s qr t (1+pow( ( kn/( m ef f c ) ) , 2) ) m rhop rhop ;
420 dmu15 = (18pow( pi , 4 ) pow( hbar , 3 ) ) /( 8. 950pow(m b , 2 )
pow(m p , 2 ) c ) ;
421 dmu16 = ( ( 2pow(m b , 2 ) pow( c , 5 ) ) /( 534. 2pow( hbar , 3 ) )
) pow( m rhop , 2 ) ;
422 dmu17 = ((2pow(m b , 2 ) (m bm ef f ) pow( c , 5 ) )
/( 534. 2pow( hbar , 3 ) ) ) m rhop rhop ;
423 dmu18 = (18pow( pi , 4 ) pow( hbar , 3 ) ) /( 128. 2pow(m b , 2 )
pow(m p , 2 ) c ) ;
424 dmu19 = pow( kp , 2 ) /(3m pm erhop [ j ] s qr t (1+pow( ( kp
/( m ec ) ) , 2) ) ) ;
425
426 mu rhop [ j ] = dmu1+dmu2+dmu3+dmu4+dmu5+dmu6+dmu7+dmu8
+dmu9+dmu10+dmu11+dmu12+dmu13+dmu14+dmu15+dmu16+
dmu17+dmu18+dmu19 ;
427
428 prhon = mxGetPr ( rho n ) ; prhop = mxGetPr ( rho p ) ; pmunrhon
= mxGetPr ( munrhon) ; pmunrhop = mxGetPr ( munrhop) ;
pmurhop = mxGetPr ( murhop) ;
429
430 for ( i nt k = 0; k<=(l 1) ; k++)
431
432 memcpy( ( void ) ( prhon+k) , ( void ) ( rhon+k) , si zeof (
rhon [ k ] ) ) ;
433 memcpy( ( void ) ( prhop+k) , ( void ) ( rhop+k) , si zeof (
rhop [ k ] ) ) ;
434 memcpy( ( void ) ( pmunrhon+k) , ( void ) ( mu n rhon+k) ,
si zeof ( mu n rhon [ k ] ) ) ;
113
435 memcpy( ( void ) ( pmunrhop+k) , ( void ) ( mu n rhop+k) ,
si zeof ( mu n rhop [ k ] ) ) ;
436 memcpy( ( void ) ( pmurhop+k) , ( void ) ( mu rhop+k) ,
si zeof ( mu rhop [ k ] ) ) ;
437
438
439 cout << endl << addi ng neutron dens i t y rhon << endl ;
440 s t at us = matPutVari abl e ( mat , rhon , rho n ) ;
441 i f ( s t at us != 0)
442 cout << endl << cannot add var i abl e or no ac c e s s to
MAT f i l e << endl ;
443 return(EXIT FAILURE) ;
444
445
446 cout << endl << addi ng proton dens i t y rhop << endl ;
447 s t at us = matPutVari abl e ( mat , rhop , rho p ) ;
448 i f ( s t at us != 0)
449 cout << endl << cannot add var i abl e or no ac c e s s to
mat f i l e << endl ;
450 return(EXIT FAILURE) ;
451
452
453 cout << endl << addi ng pa r t i a l de r i va t i ve of neutron
chemi cal po t e nt i a l wi th r e s pe c t to neuron densi t y ,
munrhon << endl ;
454 s t at us = matPutVari abl e ( mat , munrhon , munrhon) ;
455 i f ( s t at us != 0)
456 cout << endl << cannot add var i abl e or no ac c e s s to
MAT f i l e << endl ;
457 return(EXIT FAILURE) ;
458
459
460 cout << endl << addi ng pa r t i a l de r i va t i ve of neutron
chemi cal po t e nt i a l wi th r e s pe c t to proton densi t y ,
munrhop << endl ;
461 s t at us = matPutVari abl e ( mat , munrhop , munrhop) ;
462 i f ( s t at us != 0)
463 cout << endl << cannot add var i abl e or no ac c e s s to
MAT f i l e << endl ;
464 return(EXIT FAILURE) ;
465
466
467 cout << endl << addi ng pa r t i a l de r i va t i ve of combined
praton and e l e c t r on chemi cal po t e nt i a l wi th r e s pe c t
to proton densi t y , murhop << endl ;
468 s t at us = matPutVari abl e ( mat , murhop , murhop) ;
469 i f ( s t at us ! =0)
470 cout << endl << cannot add var i abl e or no ac c e s s to
MAT f i l e << endl ;
471 return(EXIT FAILURE) ;
472
473
474 cout << endl << done << endl ;
475 mxDestroyArray ( rho n ) ;
114
476 mxDestroyArray ( rho p ) ;
477 mxDestroyArray ( rho ) ;
478 mxDestroyArray ( munrhon) ;
479 mxDestroyArray ( munrhop) ;
480 mxDestroyArray ( murhop) ;
481 delete rhos ; delete rhon ; delete mu n rhon ; delete
mu n rhop ; delete mu rhop ;
482
483 return(EXIT SUCCESS) ;
484
115
B.6 C++ programme for neutron star oscillations
The following C++ program was the one that was used for calculating the neutron
star oscillations. It takes the data for the equilibrium model from a le in Matlabs
binary format. Numerically, the eigenvalue problem is solved by setting aside one
of the boundary conditions at the surface of the star and replacing it with the
normalisation condition. The remaining boundary condition is used to look for
eigenvalues by varying it continuously. For computational eciency, we exploit the
fact that most of elements in the matrix is zero. Because it is a staircase matrix, the
matrix is divided into a series of overlapping blocks. This programme only stores
and performs gauss elimination on the numbers in those blocks, which it puts into
a three dimensional array. This reduces the memory required, and the memory
storage only increases linearly as the size of the matrix is increased. When the
programme is run, it will rst ask for the name of that le, then ask for a value
of l before asking for the two frequencies between which it will look for the modes.
It will then ask an integer specifying how many points at which to calculate the
deviation from the last boundary condition. A mode exists when the deviation is
zero, the programme looks for these by looking for a change in sign and then uses
one of the root seeking algorithms supplied in th GSL library to nd them. In
calculating each of the modes it ask you to name the data le in which to store the
modes.
1
2 / C++ programme f or c a l c u l a t i ng o s c i l l a t i o n modes /
3
4 #include <s t dl i b . h>
5 #include <math . h>
6 #include <i ostream>
7 #include <s t r i ng . h>
8 #include <g s l / g s l c o ns t . h>
9 #include <g s l / gsl math . h>
10 #include <g s l / g s l r o o t s . h>
11 #include <g s l / g s l e r r no . h>
12 #include <g s l / gs l machi ne . h>
13 #include mat . h
14 #include matri x . h
15 #include engi ne . h
16
17 long double const m n = GSL CONST CGS MASS NEUTRON;
18 long double const m p = GSL CONST CGS MASS PROTON;
19 long double const m e = GSL CONST CGS MASS ELECTRON;
20 long double const pi = M PI ;
21 long double const G = GSL CONST CGS GRAVITATIONAL CONSTANT;
22 long double const e ps i l on = GSL DBL EPSILON;
23
24 using namespace std ;
25
26 struct f i ni t e di f f e r e nc e pa r a ms double rp ; double rhop ;
double rho n ; double rho p ; double munrhop ; double
munrhon ; double murhop ; double P; double p rho ;
double mr ; i nt n ; i nt l ; i nt lm; i nt s ; double y1n ;
double y1p ; double y2n ; double y2p ; double y3c ;
double y4c ; double y1e ; double y2e ; double y3e ;
double y4e ; ;
116
27
28 // appl y t he f i n i t e d i f f e r e nc e method f or s o l v i ng t he
boundary val ue probl em
29 double f i n i t e d i f f e r e n c e ( double rp , double rhop , double
rho n , double rho p , double munrhop , double munrhon ,
double murhop , double P, double p rho , double mr ,
i nt n , i nt l , i nt lm, i nt s , double sigma , double y1n ,
double y1p , double y2n , double y2p , double y3c ,
double y4c , double y1e , double y2e , double y3e ,
double y4e )
30
31
32 double c1 , U, cor e [ 9 ] [ 1 3 ] , V, dpdr , Gamma1, g ,
m p ef f , m n ef f , rho11 , rho12 , rho22 , Del ta ,
Q11 , Q12 , Q21 , Q22 , Rn, Rp, i nt e r [ 8 ] [ 1 1 ] , env
[ 6 ] [ 9 ] , a , s ur f [ 8 ] [ 9 ] , D, A, rhon r , rhop r ,
r ho r ;
33 i nt c ;
34 c1 = new double [ l ] ; U = new double [ l ] ; V = new double
[ l ] ; dpdr = new double [ l ] ; Gamma1 = new double [ l ] ;
g = new double [ l ] ; m p ef f = new double [ s ] ;
m n ef f = new double [ s ] ; rho11 = new double [ s ] ;
rho12 = new double [ s ] ; rho22 = new double [ s ] ;
Del ta = new double [ s ] ; Q11 = new double [ s ] ; Q12 =
new double [ s ] ; Q21 = new double [ s ] ; Q22 = new
double [ s ] ; Rn = new double [ s ] ; Rp = new double [ s
] ; A = new double [ l ] ; r hon r = new double [ s ] ;
r hop r = new double [ s ] ; r ho r = new double [ l ] ;
35
36 for ( i nt i = 0; i <= ( l 1) ; i ++)
37
38 dpdr [ i ] = (Gmr [ i ] rhop [ i ] ) /pow( rp [ i ] , 2 ) ;
39 c1 [ i ] = pow( ( rp [ i ] / rp [ l 1] ) , 3) /(mr [ i ] /mr [ l 1] ) ;
40 U[ i ] = (4 pi pow( rp [ i ] , 3 ) rhop [ i ] ) /mr [ i ] ;
41 V[ i ] = (rp [ i ] /P[ i ] ) dpdr [ i ] ;
42 g [ i ] = (Gmr [ i ] ) /pow( rp [ i ] , 2 ) ;
43 Gamma1[ i ] = ( rhop [ i ] /P[ i ] ) p rho [ i ] ;
44 r ho r [ i ] = ((Gmr [ i ] rhop [ i ] ) /(pow( rp [ i ] , 2 ) p rho [ i
] ) ) ;
45
46
47 c1 [ 0 ] = mr [ l 1] /( ( 4. 0/3. 0) pi rhop [ 0 ] pow( rp [ l 1] , 3) ) ; U
[ 0 ] = 3 . 0 ; g [ 0 ] = 0; dpdr [ 0 ] = 0; r ho r [ 0 ] = 0;
48
49 for ( i nt j = 0; j <= ( s 1) ; j ++)
50
51 r hon r [ j ] = ( ( ( m pmurhop [ j ] ) (m nmunrhop [ j ] ) ) /( (
m pmurhop [ j ] ) (m nmunrhop [ j ] ) +((1+(m e/m p) )
( ( m nmunrhon [ j ] ) (m pmunrhop [ j ] ) ) ) ) ) r ho r [ j
] ;
52 r hop r [ j ] = ( ( ( m nmunrhon [ j ] ) (m pmunrhop [ j ] ) ) /( (
m pmurhop [ j ] ) (m nmunrhop [ j ] ) +((1+(m e/m p) )
( ( m nmunrhon [ j ] ) (m pmunrhop [ j ] ) ) ) ) ) r ho r [ j
] ;
117
53 m p ef f [ j ] = m p(0. 588 (0. 447 l og10 ( rhop [ j ] /1 e14 ) )
+(0. 210pow( l og10 ( rhop [ j ] /1 e14 ) , 2) ) ) ;
54 m n ef f [ j ] = ( m n rho n [ j ] m p ef f [ j ] ) /( ( m p ef f [ j ]
rho n [ j ] ) (( m p ef f [ j ]m p) rho p [ j ] ) ) ;
55 rho22 [ j ] = ( ( m n m p ef f [ j ] ) /(( m n ef f [ j ] m p ef f [ j
] ) +(m n m p ef f [ j ] ) +(m p m n ef f [ j ] ) ) ) rho p [ j ] ;
56 rho11 [ j ] = ( ( m p m n ef f [ j ] ) /(( m n ef f [ j ] m p ef f [ j
] ) +(m n m p ef f [ j ] ) +(m p m n ef f [ j ] ) ) ) rho n [ j ] ;
57 rho12 [ j ] = ( ( m n ef f [ j ] ( m pm p ef f [ j ] ) ) /(( m n ef f
[ j ] m p ef f [ j ] ) +(m n m p ef f [ j ] ) +(m p m n ef f [ j
] ) ) ) rho p [ j ] ;
58 Del ta [ j ] = ( ( rho11 [ j ] / rho n [ j ] ) ( ( rho22 [ j ] / rho p [ j ] )
+(m e/m p) ) ) (pow( rho12 [ j ] , 2 ) /( rho n [ j ] rho p [ j
] ) ) ;
59 Q11 [ j ] = murhop [ j ] / ( ( munrhon [ j ] murhop [ j ] )pow(
munrhop [ j ] , 2 ) ) ;
60 Q12 [ j ] = munrhop [ j ] / ( ( munrhon [ j ] murhop [ j ] )pow(
munrhop [ j ] , 2 ) ) ;
61 Q21 [ j ] = Q12 [ j ] ;
62 Q22 [ j ] = munrhon [ j ] / ( ( munrhon [ j ] murhop [ j ] )pow(
munrhop [ j ] , 2 ) ) ;
63 Rn[ j ] = 4 pi Gpow( rp [ j ] , 2 ) (Q11 [ j ]+(1+(m e/m p) )
Q21 [ j ] ) ;
64 Rp[ j ] = 4 pi Gpow( rp [ j ] , 2 ) (Q12 [ j ]+(1+(m e/m p) )
Q22 [ j ] ) ;
65 A[ j ] = 0;
66
67
68 for ( i nt i = s ; i <= ( l 1) ; i ++)
69
70 A[ i ] = 0;
71
72
73 for ( i nt i = 0; i <= 8; i ++)
74
75 for ( i nt j = 0; j <= 12; j ++)
76
77 cor e [ i ] [ j ] = new double [ n1] ;
78
79
80
81 // s up e r f l ui d core
82
83 cor e [ 0 ] [ 0 ] [ 0 ] = ( rho n [ 0 ] ) /rhop [ 0 ] ;
84 cor e [ 0 ] [ 1 ] [ 0 ] = ( rho p [ 0 ] / rhop [ 0 ] ) (1+(m e/m p) ) ;
85 cor e [ 0 ] [ 2 ] [ 0 ] = (lm rho n [ 0 ] ) /( c1 [ 0 ] rhop [ 0 ] pow( sigma
, 2 ) ) ;
86 cor e [ 0 ] [ 3 ] [ 0 ] = ((lm rho p [ 0 ] ) /( c1 [ 0 ] rhop [ 0 ] pow( sigma
, 2 ) ) ) ;
87 cor e [ 0 ] [ 4 ] [ 0 ] = 0;
88 cor e [ 0 ] [ 5 ] [ 0 ] = 0;
89 cor e [ 0 ] [ 6 ] [ 0 ] = 0;
90 cor e [ 0 ] [ 7 ] [ 0 ] = 0;
91 cor e [ 0 ] [ 8 ] [ 0 ] = 0;
118
92 cor e [ 0 ] [ 9 ] [ 0 ] = 0;
93 cor e [ 0 ] [ 1 0 ] [ 0 ] = 0;
94 cor e [ 0 ] [ 1 1 ] [ 0 ] = 0;
95 cor e [ 0 ] [ 1 2 ] [ 0 ] = 0;
96 cor e [ 1 ] [ 0 ] [ 0 ] = ( rho11 [ 0 ] / rho n [ 0 ] ) (rho12 [ 0 ] / rho p [ 0 ] ) ;
97 cor e [ 1 ] [ 1 ] [ 0 ] = ( rho12 [ 0 ] / rho n [ 0 ] ) (( rho22 [ 0 ] / rho p [ 0 ] )
+(m e/m p) ) ;
98 cor e [ 1 ] [ 2 ] [ 0 ] = lm/( c1 [ 0 ] pow( sigma , 2 ) ) ;
99 cor e [ 1 ] [ 3 ] [ 0 ] = lm/( c1 [ 0 ] pow( sigma , 2 ) ) ;
100 cor e [ 1 ] [ 4 ] [ 0 ] = 0;
101 cor e [ 1 ] [ 5 ] [ 0 ] = 0;
102 cor e [ 1 ] [ 6 ] [ 0 ] = 0;
103 cor e [ 1 ] [ 7 ] [ 0 ] = 0;
104 cor e [ 1 ] [ 8 ] [ 0 ] = 0;
105 cor e [ 1 ] [ 9 ] [ 0 ] = 0;
106 cor e [ 1 ] [ 1 0 ] [ 0 ] = 0;
107 cor e [ 1 ] [ 1 1 ] [ 0 ] = 0;
108 cor e [ 1 ] [ 1 2 ] [ 0 ] = 0;
109 cor e [ 2 ] [ 0 ] [ 0 ] = 0;
110 cor e [ 2 ] [ 1 ] [ 0 ] = 0;
111 cor e [ 2 ] [ 2 ] [ 0 ] = 0;
112 cor e [ 2 ] [ 3 ] [ 0 ] = 0;
113 cor e [ 2 ] [ 4 ] [ 0 ] = lm;
114 cor e [ 2 ] [ 5 ] [ 0 ] = 1;
115 cor e [ 2 ] [ 6 ] [ 0 ] = 0;
116 cor e [ 2 ] [ 7 ] [ 0 ] = 0;
117 cor e [ 2 ] [ 8 ] [ 0 ] = 0;
118 cor e [ 2 ] [ 9 ] [ 0 ] = 0;
119 cor e [ 2 ] [ 1 0 ] [ 0 ] = 0;
120 cor e [ 2 ] [ 1 1 ] [ 0 ] = 0;
121 cor e [ 2 ] [ 1 2 ] [ 0 ] = 0;
122 cor e [ 3 ] [ 0 ] [ 0 ] = (0. 5( 3 (( rp [ 0 ] / rho n [ 0 ] ) r hon r [ 0 ] ) ) )
+( ( 0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp [ 1] rp [ 0 ] ) ) ;
123 cor e [ 3 ] [ 1 ] [ 0 ] = 0;
124 cor e [ 3 ] [ 2 ] [ 0 ] = 0. 5( ( 1/ Del ta [ 0 ] ) ( ( lm( lm+1) ) /( c1 [ 0 ]
pow( sigma , 2 ) ) ) ( ( rho22 [ 0 ] / rho p [ 0 ] ) +(m e/m p) ) ) ;
125 cor e [ 3 ] [ 3 ] [ 0 ] = 0. 5(1/ Del ta [ 0 ] ) ( ( lm( lm+1) ) /( c1 [ 0 ]
pow( sigma , 2 ) ) ) ( rho12 [ 0 ] / rho n [ 0 ] ) ;
126 cor e [ 3 ] [ 4 ] [ 0 ] = 0;
127 cor e [ 3 ] [ 5 ] [ 0 ] = 0;
128 cor e [ 3 ] [ 6 ] [ 0 ] = (0. 5( 3 (( rp [ 1 ] / rho n [ 1 ] ) r hon r [ 1 ] ) ) )
((0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp [ 1] rp [ 0 ] ) ) ;
129 cor e [ 3 ] [ 7 ] [ 0 ] = 0;
130 cor e [ 3 ] [ 8 ] [ 0 ] = 0. 5( ( ( 1/ Del ta [ 1 ] ) ( ( lm( lm+1) ) /( c1 [ 1 ]
pow( sigma , 2 ) ) ) ( ( rho22 [ 1 ] / rho p [ 1 ] ) +(m e/m p) ) ) ((( g
[ 1 ] rp [ 1 ] ) / rho n [ 1 ] ) Q11 [ 1 ] ) ) ;
131 cor e [ 3 ] [ 9 ] [ 0 ] = 0. 5(((1/ Del ta [ 1 ] ) ( ( lm( lm+1) ) /( c1 [ 1 ]
pow( sigma , 2 ) ) ) ( rho12 [ 1 ] / rho n [ 1 ] ) ) +((( g [ 1 ] rp [ 1 ] ) /
rho n [ 1 ] ) Q12 [ 1 ] ) ) ;
132 cor e [ 3 ] [ 1 0 ] [ 0 ] = 0. 5( ( g [ 1 ] rp [ 1 ] ) / rho n [ 1 ] ) (Q11
[ 1] +((1+( m e/m p) ) Q12 [ 1 ] ) ) ;
133 cor e [ 3 ] [ 1 1 ] [ 0 ] = 0;
134 cor e [ 3 ] [ 1 2 ] [ 0 ] = 0;
135 cor e [ 4 ] [ 0 ] [ 0 ] = 0;
119
136 cor e [ 4 ] [ 1 ] [ 0 ] = (0. 5( 3 (( rp [ 0 ] / rho p [ 0 ] ) r hop r [ 0 ] ) ) )
+( ( 0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp [ 1] rp [ 0 ] ) ) ;
137 cor e [ 4 ] [ 2 ] [ 0 ] = 0. 5(1/ Del ta [ 0 ] ) ( ( lm( lm+1) ) /( c1 [ 0 ]
pow( sigma , 2 ) ) ) ( rho12 [ 0 ] / rho p [ 0 ] ) ;
138 cor e [ 4 ] [ 3 ] [ 0 ] = 0. 5( 1/ Del ta [ 0 ] ) ( ( lm( lm+1) ) /( c1 [ 0 ] pow
( sigma , 2 ) ) ) ( rho11 [ 0 ] / rho n [ 0 ] ) ;
139 cor e [ 4 ] [ 4 ] [ 0 ] = 0;
140 cor e [ 4 ] [ 5 ] [ 0 ] = 0;
141 cor e [ 4 ] [ 6 ] [ 0 ] = 0;
142 cor e [ 4 ] [ 7 ] [ 0 ] = (0. 5( 3 (( rp [ 1 ] / rho p [ 1 ] ) r hop r [ 1 ] ) ) )
((0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp [ 1] rp [ 0 ] ) ) ;
143 cor e [ 4 ] [ 8 ] [ 0 ] = 0. 5(((1/ Del ta [ 1 ] ) ( ( lm( lm+1) ) /( c1 [ 1 ]
pow( sigma , 2 ) ) ) ( rho12 [ 1 ] / rho p [ 1 ] ) ) +((( g [ 1 ] rp [ 1 ] ) /
rho p [ 1 ] ) Q21 [ 1 ] ) ) ;
144 cor e [ 4 ] [ 9 ] [ 0 ] = 0. 5( ( ( 1/ Del ta [ 1 ] ) ( ( lm( lm+1) ) /( c1 [ 1 ]
pow( sigma , 2 ) ) ) ( rho11 [ 1 ] / rho n [ 1 ] ) ) ((( g [ 1 ] rp [ 1 ] ) /
rho p [ 1 ] ) Q22 [ 1 ] ) ) ;
145 cor e [ 4 ] [ 1 0 ] [ 0 ] = 0. 5( ( g [ 1 ] rp [ 1 ] ) / rho p [ 1 ] ) (Q21
[ 1] +((1+( m e/m p) ) Q22 [ 1 ] ) ) ;
146 cor e [ 4 ] [ 1 1 ] [ 0 ] = 0;
147 cor e [ 4 ] [ 1 2 ] [ 0 ] = 0;
148 cor e [ 5 ] [ 0 ] [ 0 ] = 0. 5 c1 [ 0 ] pow( sigma , 2 ) ( rho11 [ 0 ] / rho n
[ 0 ] ) ;
149 cor e [ 5 ] [ 1 ] [ 0 ] = 0. 5 c1 [ 0 ] pow( sigma , 2 ) ( rho12 [ 0 ] / rho n
[ 0 ] ) ;
150 cor e [ 5 ] [ 2 ] [ 0 ] = (0. 5(1 U[ 0 ] ) ) +( ( 0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp
[ 1] rp [ 0 ] ) ) ;
151 cor e [ 5 ] [ 3 ] [ 0 ] = 0;
152 cor e [ 5 ] [ 4 ] [ 0 ] = 0;
153 cor e [ 5 ] [ 5 ] [ 0 ] = 0;
154 cor e [ 5 ] [ 6 ] [ 0 ] = 0. 5 c1 [ 1 ] pow( sigma , 2 ) ( rho11 [ 1 ] / rho n
[ 1 ] ) ;
155 cor e [ 5 ] [ 7 ] [ 0 ] = 0. 5 c1 [ 1 ] pow( sigma , 2 ) ( rho12 [ 1 ] / rho n
[ 1 ] ) ;
156 cor e [ 5 ] [ 8 ] [ 0 ] = (0. 5(1 U[ 1 ] ) ) ((0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp
[ 1] rp [ 0 ] ) ) ;
157 cor e [ 5 ] [ 9 ] [ 0 ] = 0;
158 cor e [ 5 ] [ 1 0 ] [ 0 ] = 0;
159 cor e [ 5 ] [ 1 1 ] [ 0 ] = 0;
160 cor e [ 5 ] [ 1 2 ] [ 0 ] = 0;
161 cor e [ 6 ] [ 0 ] [ 0 ] = 0. 5 c1 [ 0 ] pow( sigma , 2 ) ( rho12 [ 0 ] / rho p
[ 0 ] ) ;
162 cor e [ 6 ] [ 1 ] [ 0 ] = 0. 5 c1 [ 0 ] pow( sigma , 2 ) ( ( rho22 [ 0 ] / rho p
[ 0 ] ) +(m e/m p) ) ;
163 cor e [ 6 ] [ 2 ] [ 0 ] = 0;
164 cor e [ 6 ] [ 3 ] [ 0 ] = (0. 5(1 U[ 0 ] ) ) +( ( 0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp
[ 1] rp [ 0 ] ) ) ;
165 cor e [ 6 ] [ 4 ] [ 0 ] = 0;
166 cor e [ 6 ] [ 5 ] [ 0 ] = 0;
167 cor e [ 6 ] [ 6 ] [ 0 ] = 0. 5 c1 [ 1 ] pow( sigma , 2 ) ( rho12 [ 1 ] / rho p
[ 1 ] ) ;
168 cor e [ 6 ] [ 7 ] [ 0 ] = 0. 5 c1 [ 1 ] pow( sigma , 2 ) ( ( rho22 [ 1 ] / rho p
[ 1 ] ) +(m e/m p) ) ;
169 cor e [ 6 ] [ 8 ] [ 0 ] = 0;
120
170 cor e [ 6 ] [ 9 ] [ 0 ] = (0. 5(1 U[ 1 ] ) ) ((0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp
[ 1] rp [ 0 ] ) ) ;
171 cor e [ 6 ] [ 1 0 ] [ 0 ] = 0;
172 cor e [ 6 ] [ 1 1 ] [ 0 ] = 0;
173 cor e [ 6 ] [ 1 2 ] [ 0 ] = 0;
174 cor e [ 7 ] [ 0 ] [ 0 ] = 0;
175 cor e [ 7 ] [ 1 ] [ 0 ] = 0;
176 cor e [ 7 ] [ 2 ] [ 0 ] = 0;
177 cor e [ 7 ] [ 3 ] [ 0 ] = 0;
178 cor e [ 7 ] [ 4 ] [ 0 ] = (0. 5(1 U[ 0 ] ) ) +( ( 0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp
[ 1] rp [ 0 ] ) ) ;
179 cor e [ 7 ] [ 5 ] [ 0 ] = 0 . 5 ;
180 cor e [ 7 ] [ 6 ] [ 0 ] = 0;
181 cor e [ 7 ] [ 7 ] [ 0 ] = 0;
182 cor e [ 7 ] [ 8 ] [ 0 ] = 0;
183 cor e [ 7 ] [ 9 ] [ 0 ] = 0;
184 cor e [ 7 ] [ 1 0 ] [ 0 ] = (0. 5(1 U[ 1 ] ) ) ((0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp
[ 1] rp [ 0 ] ) ) ;
185 cor e [ 7 ] [ 1 1 ] [ 0 ] = 0 . 5 ;
186 cor e [ 7 ] [ 1 2 ] [ 0 ] = 0;
187 cor e [ 8 ] [ 0 ] [ 0 ] = 0;
188 cor e [ 8 ] [ 1 ] [ 0 ] = 0;
189 cor e [ 8 ] [ 2 ] [ 0 ] = 0. 5Rn [ 0 ] ;
190 cor e [ 8 ] [ 3 ] [ 0 ] = 0. 5Rp [ 0 ] ;
191 cor e [ 8 ] [ 4 ] [ 0 ] = 0. 5( ( lm( lm+1) )Rn[ 0] Rp[ 0 ] ) ;
192 cor e [ 8 ] [ 5 ] [ 0 ] = (0.5U[ 0 ] ) +( ( 0. 5( rp [ 0] +rp [ 1 ] ) ) /( rp [ 1]
rp [ 0 ] ) ) ;
193 cor e [ 8 ] [ 8 ] [ 0 ] = 0. 5Rn [ 1 ] ;
194 cor e [ 8 ] [ 9 ] [ 0 ] = 0. 5Rp [ 1 ] ;
195 cor e [ 8 ] [ 1 0 ] [ 0 ] = 0. 5( ( lm( lm+1) )Rn[ 1] Rp[ 1 ] ) ;
196 cor e [ 8 ] [ 1 1 ] [ 0 ] = (0.5U[ 1 ] ) ((0. 5( rp [ 1] +rp [ 0 ] ) ) /( rp
[ 1] rp [ 0 ] ) ) ;
197 cor e [ 8 ] [ 1 2 ] [ 0 ] = 0;
198
199 for ( i nt k = 1; k <= ( n2) ; k++)
200
201 for ( i nt i = 0; i <= 2; i ++)
202
203 for ( i nt j = 0; j <= 5; j ++)
204
205 cor e [ i ] [ j ] [ k ] = cor e [ i +6] [ j +6] [ k 1] ;
206
207
208
209 for ( i nt i = 0; i <= 2; i ++)
210
211 for ( i nt j = 6; j <= 12; j ++)
212
213 cor e [ i ] [ j ] [ k ] = 0;
214
215
216
217 cor e [ 3 ] [ 0 ] [ k ] = (0. 5( 3 (( rp [ k ] / rho n [ k ] ) r hon r [ k
] ) ) ) +( ( 0. 5( rp [ k]+rp [ k+1] ) ) /( rp [ k+1]rp [ k ] ) ) ;
121
218 cor e [ 3 ] [ 1 ] [ k ] = 0;
219 cor e [ 3 ] [ 2 ] [ k ] = 0. 5( ( ( 1/ Del ta [ k ] ) ( ( lm( lm+1) ) /( c1 [
k ] pow( sigma , 2 ) ) ) ( ( rho22 [ k ] / rho p [ k ] ) +(m e/m p)
) ) ((( g [ k ] rp [ k ] ) / rho n [ k ] ) Q11 [ k ] ) ) ;
220 cor e [ 3 ] [ 3 ] [ k ] = 0. 5(((1/ Del ta [ k ] ) ( ( lm( lm+1) ) /( c1
[ k ] pow( sigma , 2 ) ) ) ( rho12 [ k ] / rho n [ k ] ) ) +((( g [ k ]
rp [ k ] ) / rho n [ k ] ) Q12 [ k ] ) ) ;
221 cor e [ 3 ] [ 4 ] [ k ] = 0. 5( ( g [ k ] rp [ k ] ) / rho n [ k ] ) (Q11 [ k
] +((1+( m e/m p) ) Q12 [ k ] ) ) ;
222 cor e [ 3 ] [ 5 ] [ k ] = 0;
223 cor e [ 3 ] [ 6 ] [ k ] = (0. 5( 3 (( rp [ k+1]/ rho n [ k+1] )
r hon r [ k+1] ) ) ) ((0. 5( rp [ k]+rp [ k+1] ) ) /( rp [ k+1]
rp [ k ] ) ) ;
224 cor e [ 3 ] [ 7 ] [ k ] = 0;
225 cor e [ 3 ] [ 8 ] [ k ] = 0. 5( ( ( 1/ Del ta [ k+1] ) ( ( lm( lm+1) ) /(
c1 [ k+1]pow( sigma , 2 ) ) ) ( ( rho22 [ k+1]/ rho p [ k+1] )
+(m e/m p) ) ) ((( g [ k+1] rp [ k+1] ) / rho n [ k+1] ) Q11 [
k+1] ) ) ;
226 cor e [ 3 ] [ 9 ] [ k ] = 0. 5(((1/ Del ta [ k+1] ) ( ( lm( lm+1) ) /(
c1 [ k+1]pow( sigma , 2 ) ) ) ( rho12 [ k+1]/ rho n [ k+1] ) )
+((( g [ k+1] rp [ k+1] ) / rho n [ k+1] ) Q12 [ k+1] ) ) ;
227 cor e [ 3 ] [ 1 0 ] [ k ] = 0. 5( ( g [ k+1] rp [ k+1] ) / rho n [ k+1] ) (
Q11 [ k+1]+((1+(m e/m p) ) Q12 [ k+1] ) ) ;
228 cor e [ 3 ] [ 1 1 ] [ k ] = 0;
229 cor e [ 3 ] [ 1 2 ] [ k ] = 0;
230 cor e [ 4 ] [ 0 ] [ k ] = 0;
231 cor e [ 4 ] [ 1 ] [ k ] = (0. 5( 3 (( rp [ k ] / rho p [ k ] ) r hop r [ k
] ) ) ) +( ( 0. 5( rp [ k]+rp [ k+1] ) ) /( rp [ k+1]rp [ k ] ) ) ;
232 cor e [ 4 ] [ 2 ] [ k ] = 0. 5(((1/ Del ta [ k ] ) ( ( lm( lm+1) ) /( c1
[ k ] pow( sigma , 2 ) ) ) ( rho12 [ k ] / rho p [ k ] ) ) +((( g [ k ]
rp [ k ] ) / rho p [ k ] ) Q21 [ k ] ) ) ;
233 cor e [ 4 ] [ 3 ] [ k ] = 0. 5( ( ( 1/ Del ta [ k ] ) ( ( lm( lm+1) ) /( c1 [
k ] pow( sigma , 2 ) ) ) ( rho11 [ k ] / rho n [ k ] ) ) ((( g [ k ]
rp [ k ] ) / rho p [ k ] ) Q22 [ k ] ) ) ;
234 cor e [ 4 ] [ 4 ] [ k ] = 0. 5( ( g [ k ] rp [ k ] ) / rho p [ k ] ) (Q21 [ k
] +((1+( m e/m p) ) Q22 [ k ] ) ) ;
235 cor e [ 4 ] [ 5 ] [ k ] = 0;
236 cor e [ 4 ] [ 6 ] [ k ] = 0;
237 cor e [ 4 ] [ 7 ] [ k ] = (0. 5( 3 (( rp [ k+1]/ rho p [ k+1] )
r hop r [ k+1] ) ) ) ((0. 5( rp [ k]+rp [ k+1] ) ) /( rp [ k+1]
rp [ k ] ) ) ;
238 cor e [ 4 ] [ 8 ] [ k ] = 0. 5(((1/ Del ta [ k+1] ) ( ( lm( lm+1) ) /(
c1 [ k+1]pow( sigma , 2 ) ) ) ( rho12 [ k+1]/ rho p [ k+1] ) )
+((( g [ k+1] rp [ k+1] ) / rho p [ k+1] ) Q21 [ k+1] ) ) ;
239 cor e [ 4 ] [ 9 ] [ k ] = 0. 5( ( ( 1/ Del ta [ k+1] ) ( ( lm( lm+1) ) /(
c1 [ k+1]pow( sigma , 2 ) ) ) ( rho11 [ k+1]/ rho n [ k+1] ) )
((( g [ k+1] rp [ k+1] ) / rho p [ k+1] ) Q22 [ k+1] ) ) ;
240 cor e [ 4 ] [ 1 0 ] [ k ] = 0. 5( ( g [ k+1] rp [ k+1] ) / rho p [ k+1] ) (
Q21 [ k+1]+((1+(m e/m p) ) Q22 [ k+1] ) ) ;
241 cor e [ 4 ] [ 1 1 ] [ k ] = 0;
242 cor e [ 4 ] [ 1 2 ] [ k ] = 0;
243 cor e [ 5 ] [ 0 ] [ k ] = 0. 5 c1 [ k ] pow( sigma , 2 ) ( rho11 [ k ] /
rho n [ k ] ) ;
122
244 cor e [ 5 ] [ 1 ] [ k ] = 0. 5 c1 [ k ] pow( sigma , 2 ) ( rho12 [ k ] /
rho n [ k ] ) ;
245 cor e [ 5 ] [ 2 ] [ k ] = (0. 5(1 U[ k ] ) ) +( ( 0. 5( rp [ k]+rp [ k+1] )
) /( rp [ k+1]rp [ k ] ) ) ;
246 cor e [ 5 ] [ 3 ] [ k ] = 0;
247 cor e [ 5 ] [ 4 ] [ k ] = 0;
248 cor e [ 5 ] [ 5 ] [ k ] = 0;
249 cor e [ 5 ] [ 6 ] [ k ] = 0. 5 c1 [ k+1]pow( sigma , 2 ) ( rho11 [ k
+1]/ rho n [ k+1] ) ;
250 cor e [ 5 ] [ 7 ] [ k ] = 0. 5 c1 [ k+1]pow( sigma , 2 ) ( rho12 [ k
+1]/ rho n [ k+1] ) ;
251 cor e [ 5 ] [ 8 ] [ k ] = (0. 5(1 U[ k+1] ) ) ((0. 5( rp [ k]+rp [ k
+1] ) ) /( rp [ k+1]rp [ k ] ) ) ;
252 cor e [ 5 ] [ 9 ] [ k ] = 0;
253 cor e [ 5 ] [ 1 0 ] [ k ] = 0;
254 cor e [ 5 ] [ 1 1 ] [ k ] = 0;
255 cor e [ 5 ] [ 1 2 ] [ k ] = 0;
256 cor e [ 6 ] [ 0 ] [ k ] = 0. 5 c1 [ k ] pow( sigma , 2 ) ( rho12 [ k ] /
rho p [ k ] ) ;
257 cor e [ 6 ] [ 1 ] [ k ] = 0. 5 c1 [ k ] pow( sigma , 2 ) ( ( rho22 [ k ] /
rho p [ k ] ) +(m e/m p) ) ;
258 cor e [ 6 ] [ 2 ] [ k ] = 0;
259 cor e [ 6 ] [ 3 ] [ k ] = (0. 5(1 U[ k ] ) ) +( ( 0. 5( rp [ k]+rp [ k+1] )
) /( rp [ k+1]rp [ k ] ) ) ;
260 cor e [ 6 ] [ 4 ] [ k ] = 0;
261 cor e [ 6 ] [ 5 ] [ k ] = 0;
262 cor e [ 6 ] [ 6 ] [ k ] = ( 0. 5 c1 [ k+1]pow( sigma , 2 ) ) ( rho12 [ k
+1]/ rho p [ k+1] ) ;
263 cor e [ 6 ] [ 7 ] [ k ] = ( 0. 5 c1 [ k+1]pow( sigma , 2 ) ) ( ( rho22 [ k
+1]/ rho p [ k+1] )+(m e/m p) ) ;
264 cor e [ 6 ] [ 8 ] [ k ] = 0;
265 cor e [ 6 ] [ 9 ] [ k ] = (0. 5(1 U[ k+1] ) ) (0. 5( rp [ k]+rp [ k
+1] ) /( rp [ k+1]rp [ k ] ) ) ;
266 cor e [ 6 ] [ 1 0 ] [ k ] = 0;
267 cor e [ 6 ] [ 1 1 ] [ k ] = 0;
268 cor e [ 6 ] [ 1 2 ] [ k ] = 0;
269 cor e [ 7 ] [ 0 ] [ k ] = 0;
270 cor e [ 7 ] [ 1 ] [ k ] = 0;
271 cor e [ 7 ] [ 2 ] [ k ] = 0;
272 cor e [ 7 ] [ 3 ] [ k ] = 0;
273 cor e [ 7 ] [ 4 ] [ k ] = (0. 5(1 U[ k ] ) ) +( ( 0. 5( rp [ k]+rp [ k+1] )
) /( rp [ k+1]rp [ k ] ) ) ;
274 cor e [ 7 ] [ 5 ] [ k ] = 0 . 5 ;
275 cor e [ 7 ] [ 6 ] [ k ] = 0;
276 cor e [ 7 ] [ 7 ] [ k ] = 0;
277 cor e [ 7 ] [ 8 ] [ k ] = 0;
278 cor e [ 7 ] [ 9 ] [ k ] = 0;
279 cor e [ 7 ] [ 1 0 ] [ k ] = (0. 5(1 U[ k+1] ) ) ((0. 5( rp [ k]+rp [ k
+1] ) ) /( rp [ k+1]rp [ k ] ) ) ;
280 cor e [ 7 ] [ 1 1 ] [ k ] = 0 . 5 ;
281 cor e [ 7 ] [ 1 2 ] [ k ] = 0;
282 cor e [ 8 ] [ 0 ] [ k ] = 0;
283 cor e [ 8 ] [ 1 ] [ k ] = 0;
284 cor e [ 8 ] [ 2 ] [ k ] = 0. 5Rn[ k ] ;
123
285 cor e [ 8 ] [ 3 ] [ k ] = 0. 5Rp[ k ] ;
286 cor e [ 8 ] [ 4 ] [ k ] = 0. 5( ( lm( lm+1) )Rn[ k]Rp[ k ] ) ;
287 cor e [ 8 ] [ 5 ] [ k ] = (0.5U[ k ] ) +( ( 0. 5( rp [ k]+rp [ k+1] ) ) /(
rp [ k+1]rp [ k ] ) ) ;
288 cor e [ 8 ] [ 8 ] [ k ] = 0. 5Rn[ k+1] ;
289 cor e [ 8 ] [ 9 ] [ k ] = 0. 5Rp[ k+1] ;
290 cor e [ 8 ] [ 1 0 ] [ k ] = 0. 5( ( lm( lm+1) )Rn[ k+1]Rp[ k+1] ) ;
291 cor e [ 8 ] [ 1 1 ] [ k ] = (0.5U[ k+1] ) ((0. 5( rp [ k]+rp [ k+1] )
) /( rp [ k+1]rp [ k ] ) ) ;
292 cor e [ 8 ] [ 1 2 ] [ k ] = 0;
293
294
295 //jump c ondi t i ons . i . e boudary c o nt i t i o ns at t he
i nt e r f a c e bet ween s up e r f l ui d core and normal f l u i d
envel ope
296
297 for ( i nt i = 0; i <= 2; i ++)
298
299 for ( i nt j = 0; j <= 5; j ++)
300
301 i nt e r [ i ] [ j ] = cor e [ i +6] [ j +6] [ n2] ;
302
303
304
305 for ( i nt i = 0; i <= 2; i ++)
306
307 for ( i nt j = 6; j <= 12; j ++)
308
309 i nt e r [ i ] [ j ] = 0;
310
311
312
313 i nt e r [ 3 ] [ 0 ] = (rho11 [ n1]/ rho n [ n1] ) ;
314 i nt e r [ 3 ] [ 1 ] = (rho12 [ n1]/ rho n [ n1] ) ;
315 i nt e r [ 3 ] [ 2 ] = 0;
316 i nt e r [ 3 ] [ 3 ] = 0;
317 i nt e r [ 3 ] [ 4 ] = 0;
318 i nt e r [ 3 ] [ 5 ] = 0;
319 i nt e r [ 3 ] [ 6 ] = 1;
320 i nt e r [ 3 ] [ 7 ] = 0;
321 i nt e r [ 3 ] [ 8 ] = 0;
322 i nt e r [ 3 ] [ 9 ] = 0;
323 i nt e r [ 3 ] [ 1 0 ] = 0;
324 i nt e r [ 4 ] [ 0 ] = (rho12 [ n1]/ rho p [ n1] ) ;
325 i nt e r [ 4 ] [ 1 ] = (rho22 [ n1]/ rho p [ n1] ) ;
326 i nt e r [ 4 ] [ 2 ] = 0;
327 i nt e r [ 4 ] [ 3 ] = 0;
328 i nt e r [ 4 ] [ 4 ] = 0;
329 i nt e r [ 4 ] [ 5 ] = 0;
330 i nt e r [ 4 ] [ 6 ] = 1;
331 i nt e r [ 4 ] [ 7 ] = 0;
332 i nt e r [ 4 ] [ 8 ] = 0;
333 i nt e r [ 4 ] [ 9 ] = 0;
334 i nt e r [ 4 ] [ 1 0 ] = 0;
124
335 i nt e r [ 5 ] [ 0 ] = 0;
336 i nt e r [ 5 ] [ 1 ] = 0;
337 i nt e r [ 5 ] [ 2 ] = (rho n [ n1]/rhop [ n1] ) ;
338 i nt e r [ 5 ] [ 3 ] = (rho p [ n1]/rhop [ n1] ) ;
339 i nt e r [ 5 ] [ 4 ] = 1;
340 i nt e r [ 5 ] [ 5 ] = 0;
341 i nt e r [ 5 ] [ 6 ] = 0;
342 i nt e r [ 5 ] [ 7 ] = 1;
343 i nt e r [ 5 ] [ 8 ] = 1;
344 i nt e r [ 5 ] [ 9 ] = 0;
345 i nt e r [ 5 ] [ 1 0 ] = 0;
346 i nt e r [ 6 ] [ 0 ] = 0;
347 i nt e r [ 6 ] [ 1 ] = 0;
348 i nt e r [ 6 ] [ 2 ] = 0;
349 i nt e r [ 6 ] [ 3 ] = 0;
350 i nt e r [ 6 ] [ 4 ] = 1;
351 i nt e r [ 6 ] [ 5 ] = 0;
352 i nt e r [ 6 ] [ 6 ] = 0;
353 i nt e r [ 6 ] [ 7 ] = 0;
354 i nt e r [ 6 ] [ 8 ] = 1;
355 i nt e r [ 6 ] [ 9 ] = 0;
356 i nt e r [ 6 ] [ 1 0 ] = 0;
357 i nt e r [ 7 ] [ 0 ] = 0;
358 i nt e r [ 7 ] [ 1 ] = 0;
359 i nt e r [ 7 ] [ 2 ] = 0;
360 i nt e r [ 7 ] [ 3 ] = 0;
361 i nt e r [ 7 ] [ 4 ] = 0;
362 i nt e r [ 7 ] [ 5 ] = 1;
363 i nt e r [ 7 ] [ 6 ] = 0;
364 i nt e r [ 7 ] [ 7 ] = 0;
365 i nt e r [ 7 ] [ 8 ] = 0;
366 i nt e r [ 7 ] [ 9 ] = 1;
367 i nt e r [ 7 ] [ 1 0 ] = 0;
368
369 delete [ ] m p ef f ;
370 delete [ ] m n ef f ;
371 delete [ ] rho22 ;
372 delete [ ] rho11 ;
373 delete [ ] rho12 ;
374 delete [ ] Del ta ;
375 delete [ ] Q11 ;
376 delete [ ] Q12 ;
377 delete [ ] Q21 ;
378 delete [ ] Rn;
379 delete [ ] Rp;
380
381 for ( i nt i = 0; i <= 5; i ++)
382
383 for ( i nt j = 0; j <= 8; j ++)
384
385 env [ i ] [ j ] = new double [ l n1] ;
386
387
388
125
389 //normal f l u i d envel ope
390
391 for ( i nt i = 0; i <= 1; i ++)
392
393 for ( i nt j = 0; j <= 3; j ++)
394
395 env [ i ] [ j ] [ 0 ] = i nt e r [6+ i ] [ 6+ j ] ;
396
397
398
399 for ( i nt i = 0; i <= 1; i ++)
400
401 for ( i nt j = 4; j <= 8; j ++)
402
403 env [ i ] [ j ] [ 0 ] = 0;
404
405
406
407 env [ 2 ] [ 0 ] [ 0 ] = ( 0 . 5 ( (V[ n1]/Gamma1[ n1] ) 3) ) +( ( 0. 5( rp [
n1]+rp [ n ] ) ) /( rp [ n]rp [ n1] ) ) ;
408 env [ 2 ] [ 1 ] [ 0 ] = 0 . 5 ( ( ( lm( lm+1) ) /( c1 [ n1]pow( sigma , 2 ) ) )
(V[ n1]/Gamma1[ n1] ) ) ;
409 env [ 2 ] [ 2 ] [ 0 ] = 0. 5(V[ n1]/Gamma1[ n1] ) ;
410 env [ 2 ] [ 3 ] [ 0 ] = 0;
411 env [ 2 ] [ 4 ] [ 0 ] = ( 0 . 5 ( (V[ n] /Gamma1[ n ] ) 3) ) ((0. 5( rp [ n
1]+rp [ n ] ) ) /( rp [ n]rp [ n1] ) ) ;
412 env [ 2 ] [ 5 ] [ 0 ] = 0 . 5 ( ( ( lm( lm+1) ) /( c1 [ n] pow( sigma , 2 ) ) ) (
V[ n] /Gamma1[ n ] ) ) ;
413 env [ 2 ] [ 6 ] [ 0 ] = 0. 5(V[ n] /Gamma1[ n ] ) ;
414 env [ 2 ] [ 7 ] [ 0 ] = 0;
415 env [ 2 ] [ 8 ] [ 0 ] = 0;
416 env [ 3 ] [ 0 ] [ 0 ] = 0. 5( ( c1 [ n1]pow( sigma , 2 ) ) +(rp [ n1]A[ n
1] ) ) ;
417 env [ 3 ] [ 1 ] [ 0 ] = (0. 5(1 U[ n1]( rp [ n1]A[ n1] ) ) ) +( ( 0. 5(
rp [ n1]+rp [ n ] ) ) /( rp [ n]rp [ n1] ) ) ;
418 env [ 3 ] [ 2 ] [ 0 ] = 0. 5( rp [ n1]A[ n1] ) ;
419 env [ 3 ] [ 3 ] [ 0 ] = 0;
420 env [ 3 ] [ 4 ] [ 0 ] = 0. 5( ( c1 [ n] pow( sigma , 2 ) ) +(rp [ n] A[ n ] ) ) ;
421 env [ 3 ] [ 5 ] [ 0 ] = (0. 5(1 U[ n] ( rp [ n] A[ n ] ) ) ) ((0. 5( rp [ n
1]+rp [ n ] ) ) /( rp [ n]rp [ n1] ) ) ;
422 env [ 3 ] [ 6 ] [ 0 ] = 0. 5 rp [ n] A[ n ] ;
423 env [ 3 ] [ 7 ] [ 0 ] = 0;
424 env [ 3 ] [ 8 ] [ 0 ] = 0;
425 env [ 4 ] [ 0 ] [ 0 ] = 0;
426 env [ 4 ] [ 1 ] [ 0 ] = 0;
427 env [ 4 ] [ 2 ] [ 0 ] = (0. 5(1 U[ n1] ) ) +( ( 0. 5( rp [ n1]+rp [ n ] ) ) /(
rp [ n]rp [ n1] ) ) ;
428 env [ 4 ] [ 3 ] [ 0 ] = 0 . 5 ;
429 env [ 4 ] [ 4 ] [ 0 ] = 0;
430 env [ 4 ] [ 5 ] [ 0 ] = 0;
431 env [ 4 ] [ 6 ] [ 0 ] = (0. 5(1 U[ n ] ) ) ((0. 5( rp [ n1]+rp [ n ] ) ) /( rp
[ n]rp [ n1] ) ) ;
432 env [ 4 ] [ 7 ] [ 0 ] = 0 . 5 ;
433 env [ 4 ] [ 8 ] [ 0 ] = 0;
126
434 env [ 5 ] [ 0 ] [ 0 ] = 0.5rp [ n1]A[ n1]U[ n1] ;
435 env [ 5 ] [ 1 ] [ 0 ] = 0. 5U[ n1] (V[ n1]/Gamma1[ n1] ) ;
436 env [ 5 ] [ 2 ] [ 0 ] = 0. 5( ( lm( lm+1) ) ((U[ n1]V[ n1] ) /Gamma1[
n1] ) ) ;
437 env [ 5 ] [ 3 ] [ 0 ] = (0.5U[ n1] ) +( ( 0. 5( rp [ n1]+rp [ n ] ) ) /( rp [
n]rp [ n1] ) ) ;
438 env [ 5 ] [ 4 ] [ 0 ] = 0.5rp [ n] A[ n] U[ n ] ;
439 env [ 5 ] [ 5 ] [ 0 ] = 0. 5U[ n ] (V[ n] /Gamma1[ n ] ) ;
440 env [ 5 ] [ 6 ] [ 0 ] = 0. 5( ( lm( lm+1) ) ((U[ n] V[ n ] ) /Gamma1[ n ] ) )
;
441 env [ 5 ] [ 7 ] [ 0 ] = (0.5U[ n ] ) ((0. 5( rp [ n1]+rp [ n ] ) ) /( rp [ n
]rp [ n1] ) ) ;
442 env [ 5 ] [ 8 ] [ 0 ] = 0;
443
444 for ( i nt k = 0; k <= ( l n3) ; k++)
445
446 for ( i nt i = 0; i <= 1; i ++)
447
448 for ( i nt j = 0; j <= 3; j ++)
449
450 env [ i ] [ j ] [ k+1] = env [ i +4] [ j +4] [ k ] ;
451
452
453
454 for ( i nt i = 0; i <= 1; i ++)
455
456 for ( i nt j = 4; j <= 8; j ++)
457
458 env [ i ] [ j ] [ k+1] = 0;
459
460
461
462 env [ 2 ] [ 0 ] [ k+1] = ( 0 . 5 ( (V[ k+n] /Gamma1[ k+n ] ) 3) )
+( ( 0. 5( rp [ k+n]+rp [ k+n+1] ) ) /( rp [ k+n+1]rp [ k+n ] ) )
;
463 env [ 2 ] [ 1 ] [ k+1] = 0 . 5 ( ( ( lm( lm+1) ) /( c1 [ k+n] pow(
sigma , 2 ) ) ) (V[ k+n] /Gamma1[ k+n ] ) ) ;
464 env [ 2 ] [ 2 ] [ k+1] = 0. 5(V[ k+n] /Gamma1[ k+n ] ) ;
465 env [ 2 ] [ 3 ] [ k+1] = 0;
466 env [ 2 ] [ 4 ] [ k+1] = 0. 5( (V[ k+n+1]/Gamma1[ k+n+1] ) 3)
((0. 5( rp [ k+n]+rp [ k+n+1] ) ) /( rp [ k+n+1]rp [ k+n ] ) )
;
467 env [ 2 ] [ 5 ] [ k+1] = 0 . 5 ( ( ( lm( lm+1) ) /( c1 [ k+n+1]pow(
sigma , 2 ) ) ) (V[ k+n+1]/Gamma1[ k+n+1] ) ) ;
468 env [ 2 ] [ 6 ] [ k+1] = 0. 5(V[ k+n+1]/Gamma1[ k+n+1] ) ;
469 env [ 2 ] [ 7 ] [ k+1] = 0;
470 env [ 2 ] [ 8 ] [ k+1] = 0;
471 env [ 3 ] [ 0 ] [ k+1] = 0. 5( ( c1 [ k+n] pow( sigma , 2 ) ) +(rp [ k+n
] A[ k+n ] ) ) ;
472 env [ 3 ] [ 1 ] [ k+1] = (0. 5(1 U[ k+n] ( rp [ k+n] A[ k+n ] ) ) )
+( ( 0. 5( rp [ k+n]+rp [ k+n+1] ) ) /( rp [ k+n+1]rp [ k+n ] ) )
;
473 env [ 3 ] [ 2 ] [ k+1] = 0. 5 rp [ k+n] A[ k+n ] ;
474 env [ 3 ] [ 3 ] [ k+1] = 0;
127
475 env [ 3 ] [ 4 ] [ k+1] = 0. 5( ( c1 [ k+n+1]pow( sigma , 2 ) ) +(rp [ k
+n+1]A[ k+n+1] ) ) ;
476 env [ 3 ] [ 5 ] [ k+1] = (0. 5(1 U[ k+n+1]( rp [ k+n+1]A[ k+n
+1] ) ) ) ((0. 5( rp [ k+n]+rp [ k+n+1] ) ) /( rp [ k+n+1]rp [
k+n ] ) ) ;
477 env [ 3 ] [ 6 ] [ k+1] = 0. 5 rp [ k+n+1]A[ k+n+1] ;
478 env [ 3 ] [ 7 ] [ k+1] = 0;
479 env [ 3 ] [ 8 ] [ k+1] = 0;
480 env [ 4 ] [ 0 ] [ k+1] = 0;
481 env [ 4 ] [ 1 ] [ k+1] = 0;
482 env [ 4 ] [ 2 ] [ k+1] = (0. 5(1 U[ k+n ] ) ) +( ( 0. 5( rp [ k+n]+rp [
k+n+1] ) ) /( rp [ k+n+1]rp [ k+n ] ) ) ;
483 env [ 4 ] [ 3 ] [ k+1] = 0 . 5 ;
484 env [ 4 ] [ 4 ] [ k+1] = 0;
485 env [ 4 ] [ 5 ] [ k+1] = 0;
486 env [ 4 ] [ 6 ] [ k+1] = (0. 5(1 U[ k+n+1] ) ) ((0. 5( rp [ k+n]+
rp [ k+n+1] ) ) /( rp [ k+n+1]rp [ k+n ] ) ) ;
487 env [ 4 ] [ 7 ] [ k+1] = 0 . 5 ;
488 env [ 4 ] [ 8 ] [ k+1] = 0;
489 env [ 5 ] [ 0 ] [ k+1] = 0.5rp [ k+n] A[ k+n] U[ k+n ] ;
490 env [ 5 ] [ 1 ] [ k+1] = 0. 5U[ k+n ] (V[ k+n] /Gamma1[ k+n ] ) ;
491 env [ 5 ] [ 2 ] [ k+1] = 0. 5( ( lm( lm+1) ) ((U[ k+n] V[ k+n ] ) /
Gamma1[ k+n ] ) ) ;
492 env [ 5 ] [ 3 ] [ k+1] = (0.5U[ k+n ] ) +( ( 0. 5( rp [ k+n]+rp [ k+n
+1] ) ) /( rp [ k+n+1]rp [ k+n ] ) ) ;
493 env [ 5 ] [ 4 ] [ k+1] = 0.5rp [ k+n+1]A[ k+n+1]U[ k+n+1] ;
494 env [ 5 ] [ 5 ] [ k+1] = 0. 5U[ k+n+1] (V[ k+n+1]/Gamma1[ k+n
+1] ) ;
495 env [ 5 ] [ 6 ] [ k+1] = 0. 5( ( lm( lm+1) ) ((U[ k+n+1]V[ k+n
+1] ) /Gamma1[ k+n+1] ) ) ;
496 env [ 5 ] [ 7 ] [ k+1] = (0.5U[ k+n+1] ) ((0. 5( rp [ k+n]+rp [ k
+n+1] ) ) /( rp [ k+n+1]rp [ k+n ] ) ) ;
497 env [ 5 ] [ 8 ] [ k+1] = 0;
498
499
500 // s ur f ace val ues and boundary c ondi t i ons
501
502 for ( i nt i = 0; i <= 1; i ++)
503
504 for ( i nt j = 0; j <= 3; j ++)
505
506 s ur f [ i ] [ j ] = env [ i +4] [ j +4] [ l n3] ;
507
508
509
510 for ( i nt i = 0; i <= 1; i ++)
511
512 for ( i nt j = 4; j <= 8; j ++)
513
514 s ur f [ i ] [ j ] = 0;
515
516
517
128
518 s ur f [ 2 ] [ 0 ] = ( 0 . 5 ( (V[ l 2]/Gamma1[ l 2] ) 3) ) +( ( 0. 5( rp [ l
2]+rp [ l 1] ) ) /( rp [ l 1]rp [ l 2] ) ) ;
519 s ur f [ 2 ] [ 1 ] = 0 . 5 ( ( ( lm( lm+1) ) /( c1 [ l 2]pow( sigma , 2 ) ) ) (
V[ l 2]/Gamma1[ l 2] ) ) ;
520 s ur f [ 2 ] [ 2 ] = 0. 5(V[ l 2]/Gamma1[ l 2] ) ;
521 s ur f [ 2 ] [ 3 ] = 0;
522 s ur f [ 2 ] [ 4 ] = ( 0 . 5 ( (V[ l 1]/Gamma1[ l 1] ) 3) ) ((0. 5( rp [ l
2]+rp [ l 1] ) ) /( rp [ l 1]rp [ l 2] ) ) ;
523 s ur f [ 2 ] [ 5 ] = 0 . 5 ( ( ( lm( lm+1) ) /( c1 [ l 1]pow( sigma , 2 ) ) ) (
V[ l 1]/Gamma1[ l 1] ) ) ;
524 s ur f [ 2 ] [ 6 ] = 0. 5(V[ l 1]/Gamma1[ l 1] ) ;
525 s ur f [ 2 ] [ 7 ] = 0;
526 s ur f [ 2 ] [ 8 ] = 0;
527 s ur f [ 3 ] [ 0 ] = 0. 5( ( c1 [ l 2]pow( sigma , 2 ) ) +(rp [ l 2]A[ l
2] ) ) ;
528 s ur f [ 3 ] [ 1 ] = (0. 5(1 U[ l 2]( rp [ l 2]A[ l 2] ) ) ) +( ( 0. 5( rp
[ l 2]+rp [ l 1] ) ) /( rp [ l 1]rp [ l 2] ) ) ;
529 s ur f [ 3 ] [ 2 ] = 0. 5 rp [ l 2]A[ l 2] ;
530 s ur f [ 3 ] [ 3 ] = 0;
531 s ur f [ 3 ] [ 4 ] = 0. 5( ( c1 [ l 1]pow( sigma , 2 ) ) +(rp [ l 1]A[ l
1] ) ) ;
532 s ur f [ 3 ] [ 5 ] = (0. 5(1 U[ l 1]( rp [ l 1]A[ l 1] ) ) ) ((0. 5( rp
[ l 2]+rp [ l 1] ) ) /( rp [ l 1]rp [ l 2] ) ) ;
533 s ur f [ 3 ] [ 6 ] = 0. 5 rp [ l 1]A[ l 1] ;
534 s ur f [ 3 ] [ 7 ] = 0;
535 s ur f [ 3 ] [ 8 ] = 0;
536 s ur f [ 4 ] [ 0 ] = 0;
537 s ur f [ 4 ] [ 1 ] = 0;
538 s ur f [ 4 ] [ 2 ] = (0. 5(1 U[ l 2] ) ) +( ( 0. 5( rp [ l 2]+rp [ l 1] ) ) /(
rp [ l 1]rp [ l 2] ) ) ;
539 s ur f [ 4 ] [ 3 ] = 0 . 5 ;
540 s ur f [ 4 ] [ 4 ] = 0;
541 s ur f [ 4 ] [ 5 ] = 0;
542 s ur f [ 4 ] [ 6 ] = (0. 5(1 U[ l 1] ) ) ((0. 5( rp [ l 2]+rp [ l 1] ) ) /(
rp [ l 1]rp [ l 2] ) ) ;
543 s ur f [ 4 ] [ 7 ] = 0 . 5 ;
544 s ur f [ 4 ] [ 8 ] = 0;
545 s ur f [ 5 ] [ 0 ] = 0.5rp [ l 2]A[ l 2]U[ l 2] ;
546 s ur f [ 5 ] [ 1 ] = 0. 5U[ l 2] (V[ l 2]/Gamma1[ l 2] ) ;
547 s ur f [ 5 ] [ 2 ] = 0. 5( ( lm( lm+1) ) ((U[ l 2]V[ l 2] ) /Gamma1[ l
2] ) ) ;
548 s ur f [ 5 ] [ 3 ] = (0.5U[ l 2] ) +( 0. 5( ( rp [ l 2]+rp [ l 1] ) ) /( rp [
l 1]rp [ l 2] ) ) ;
549 s ur f [ 5 ] [ 4 ] = 0.5rp [ l 1]A[ l 1]U[ l 1] ;
550 s ur f [ 5 ] [ 5 ] = 0. 5U[ l 1] (V[ l 1]/Gamma1[ l 1] ) ;
551 s ur f [ 5 ] [ 6 ] = 0. 5( ( lm( lm+1) ) ((U[ l 1]V[ l 1] ) /Gamma1[ l
1] ) ) ;
552 s ur f [ 5 ] [ 7 ] = (0.5U[ l 1] ) ((0. 5( rp [ l 2]+rp [ l 1] ) ) /( rp [
l 1]rp [ l 2] ) ) ;
553 s ur f [ 5 ] [ 8 ] = 0;
554 s ur f [ 6 ] [ 0 ] = 0;
555 s ur f [ 6 ] [ 1 ] = 0;
556 s ur f [ 6 ] [ 2 ] = 0;
557 s ur f [ 6 ] [ 3 ] = 0;
129
558 s ur f [ 6 ] [ 4 ] = 1;
559 s ur f [ 6 ] [ 5 ] = 1;
560 s ur f [ 6 ] [ 6 ] = 1;
561 s ur f [ 6 ] [ 7 ] = 0;
562 s ur f [ 6 ] [ 8 ] = 0;
563 s ur f [ 7 ] [ 0 ] = 0;
564 s ur f [ 7 ] [ 1 ] = 0;
565 s ur f [ 7 ] [ 2 ] = 0;
566 s ur f [ 7 ] [ 3 ] = 0;
567 s ur f [ 7 ] [ 4 ] = 1;
568 s ur f [ 7 ] [ 5 ] = 0;
569 s ur f [ 7 ] [ 6 ] = 0;
570 s ur f [ 7 ] [ 7 ] = 0;
571 s ur f [ 7 ] [ 8 ] = 1;
572
573 for ( i nt k = 0; k <= ( n2) ; k++)
574
575 for ( i nt i = 0; i <= 7; i ++)
576
577 c = i ;
578
579 i f ( cor e [ i ] [ i ] [ k ] == 0)
580
581 while ( cor e [ c ] [ i ] [ k ] == 0)
582
583 c++;
584
585
586 for ( i nt m = i ; m <= 12; m++)
587
588 a = cor e [ c ] [ m] [ k ] ;
589 cor e [ c ] [ m] [ k ] = cor e [ i ] [ m] [ k ] ;
590 cor e [ i ] [ m] [ k ] = a ;
591
592
593
594 for ( i nt j = i +1; j <= 7; j ++)
595
596 a = cor e [ j ] [ i ] [ k ] ;
597
598 for ( i nt m = i ; m <= 12; m++)
599
600
601 cor e [ j ] [ m] [ k ] = cor e [ j ] [ m] [ k ] ( ( a/ cor e
[ i ] [ i ] [ k ] ) cor e [ i ] [ m] [ k ] ) ;
602
603
604
605
606
607 i f ( f abs ( cor e [ i ] [ i ] [ k ] ) == 0)
608
609 cout << s ol ut i on not uni que or no s ol ut i on
<< i << << k << endl ;
130
610 ci n . get ( ) ;
611
612
613
614 i f ( k < ( n2) )
615
616 for ( i nt i = 0; i <= 2; i ++)
617
618 for ( i nt j = 0; j <= 5; j ++)
619
620 cor e [ i ] [ j ] [ k+1] = cor e [ i +6] [ j +6] [ k ] ;
621
622
623
624
625
626 for ( i nt i = 0; i <= 2; i ++)
627
628 for ( i nt j = 0; j <= 5; j ++)
629
630 i nt e r [ i ] [ j ] = cor e [ i +6] [ j +6] [ n2] ;
631
632
633
634 for ( i nt i = 0; i <= 6; i ++)
635
636 c = i ;
637
638 i f ( i nt e r [ i ] [ i ] == 0)
639
640 while ( i nt e r [ c ] [ i ] == 0)
641
642 c++;
643
644
645 for ( i nt m = i ; m <= 10; m++)
646
647 a = i nt e r [ c ] [ m] ;
648 i nt e r [ c ] [ m] = i nt e r [ i ] [ m] ;
649 i nt e r [ i ] [ m] = a ;
650
651
652
653 for ( i nt j = i +1; j <= 7; j ++)
654
655 a = i nt e r [ j ] [ i ] ;
656
657 for ( i nt m = i ; m <= 10; m++)
658
659
660 i nt e r [ j ] [ m] = i nt e r [ j ] [ m] ( ( a/ i nt e r [ i ] [ i ] )
i nt e r [ i ] [ m] ) ;
661
662
131
663
664
665 i f ( f abs ( i nt e r [ i ] [ i ] ) == 0)
666
667 cout << not uni que or no s ol ut i on << endl ;
668 ci n . get ( ) ;
669
670
671
672 for ( i nt i = 0; i <= 1; i ++)
673
674 for ( i nt j = 0; j <= 3; j ++)
675
676 env [ i ] [ j ] [ 0 ] = i nt e r [6+ i ] [ 6+ j ] ;
677
678
679
680 for ( i nt k = 0; k <= ( l n2) ; k++)
681
682 for ( i nt i = 0; i <= 4; i ++)
683
684 c = i ;
685
686 i f ( env [ i ] [ i ] [ k ] == 0)
687
688 while ( env [ c ] [ i ] [ k ] == 0)
689
690 c++;
691
692
693 for ( i nt m = i ; m <= 8; m++)
694
695 a = env [ c ] [ i ] [ k ] ;
696 env [ c ] [ i ] [ k ] = env [ i ] [ i ] [ k ] ;
697 env [ i ] [ i ] [ k ] = a ;
698
699
700
701 for ( i nt j = i +1; j <= 5; j ++)
702
703 a = env [ j ] [ i ] [ k ] ;
704
705 for ( i nt m = i ; m <= 8; m++)
706
707
708 env [ j ] [ m] [ k ] = env [ j ] [ m] [ k ] ( ( a/env [ i
] [ i ] [ k ] ) env [ i ] [ m] [ k ] ) ;
709
710
711
712
713 i f ( f abs ( env [ i ] [ i ] [ k ] ) == 0)
714
132
715 cout << not uni que or no s ol ut i on << i <<
<< k << endl ;
716
717
718
719 i f ( k < ( l n2) )
720
721 for ( i nt i = 0; i <= 1; i ++)
722
723 for ( i nt j = 0; j <= 3; j ++)
724
725 env [ i ] [ j ] [ k+1] = env [ i +4] [ j +4] [ k ] ;
726
727
728
729
730
731 for ( i nt i = 0; i <= 1; i ++)
732
733 for ( i nt j = 0; j <= 3; j ++)
734
735 s ur f [ i ] [ j ] = env [ i +4] [ j +4] [ l n3] ;
736
737
738
739 for ( i nt i = 0; i <= 6; i ++)
740
741 c = i ;
742
743 i f ( s ur f [ i ] [ i ] == 0)
744
745 while ( s ur f [ c ] [ i ] == 0)
746
747 c++;
748
749
750 for ( i nt m = i ; m <= 8; m++)
751
752 a = s ur f [ c ] [ m] ;
753 s ur f [ c ] [ m] = s ur f [ i ] [ m] ;
754 s ur f [ i ] [ m] = a ;
755
756
757
758 for ( i nt j = i +1; j <= 7; j ++)
759
760 a = s ur f [ j ] [ i ] ;
761
762 for ( i nt m = i ; m <= 8; m++)
763
764
765 s ur f [ j ] [ m] = s ur f [ j ] [ m] ( ( a/ s ur f [ i ] [ i ] )
s ur f [ i ] [ m] ) ;
766
133
767
768
769
770 i f ( s ur f [ i ] [ i ] == 0)
771
772 cout << not uni que or no s ol ut i on << endl ;
773
774
775
776
777 y4e [ l n ] = s ur f [ 7 ] [ 8 ] / s ur f [ 7 ] [ 7 ] ;
778 y3e [ l n ] = ( s ur f [ 6 ] [ 8 ] ( s ur f [ 6 ] [ 7 ] y4e [ l n ] ) ) / s ur f
[ 6 ] [ 6 ] ;
779 y2e [ l n ] = ( s ur f [ 5 ] [ 8 ] ( s ur f [ 5 ] [ 7 ] y4e [ l n ] ) ( s ur f
[ 5 ] [ 6 ] y3e [ l n ] ) ) / s ur f [ 5 ] [ 5 ] ;
780 y1e [ l n ] = ( s ur f [ 4 ] [ 8 ] ( s ur f [ 4 ] [ 7 ] y4e [ l n ] ) ( s ur f
[ 4 ] [ 6 ] y3e [ l n ] ) ( s ur f [ 4 ] [ 5 ] y2e [ l n ] ) ) / s ur f [ 4 ] [ 4 ] ;
781 y4e [ l n1] = ( s ur f [ 3 ] [ 8 ] ( s ur f [ 3 ] [ 7 ] y4e [ l n ] ) ( s ur f
[ 3 ] [ 6 ] y3e [ l n ] ) ( s ur f [ 3 ] [ 5 ] y2e [ l n ] ) ( s ur f [ 3 ] [ 4 ]
y1e [ l n ] ) ) / s ur f [ 3 ] [ 3 ] ;
782 y3e [ l n1] = ( s ur f [ 2 ] [ 8 ] ( s ur f [ 2 ] [ 7 ] y4e [ l n ] ) ( s ur f
[ 2 ] [ 6 ] y3e [ l n ] ) ( s ur f [ 2 ] [ 5 ] y2e [ l n ] ) ( s ur f [ 2 ] [ 4 ]
y1e [ l n ] ) ( s ur f [ 2 ] [ 3 ] y4e [ l n1] ) ) / s ur f [ 2 ] [ 2 ] ;
783 y2e [ l n1] = ( s ur f [ 1 ] [ 8 ] ( s ur f [ 1 ] [ 7 ] y4e [ l n ] ) ( s ur f
[ 1 ] [ 6 ] y3e [ l n ] ) ( s ur f [ 1 ] [ 5 ] y2e [ l n ] ) ( s ur f [ 1 ] [ 4 ]
y1e [ l n ] ) ( s ur f [ 1 ] [ 3 ] y4e [ l n1] )( s ur f [ 1 ] [ 2 ] y3e [ l
n1] ) ) / s ur f [ 1 ] [ 1 ] ;
784 y1e [ l n1] = ( s ur f [ 0 ] [ 8 ] ( s ur f [ 0 ] [ 7 ] y4e [ l n ] ) ( s ur f
[ 0 ] [ 6 ] y3e [ l n ] ) ( s ur f [ 0 ] [ 5 ] y2e [ l n ] ) ( s ur f [ 0 ] [ 4 ]
y1e [ l n ] ) ( s ur f [ 0 ] [ 3 ] y4e [ l n1] )( s ur f [ 0 ] [ 2 ] y3e [ l
n1] )( s ur f [ 0 ] [ 1 ] y2e [ l n1] ) ) / s ur f [ 0 ] [ 0 ] ;
785
786 for ( i nt k = l n2; k >= 0; k)
787
788 y4e [ k ] = ( env [ 3 ] [ 8 ] [ k] ( env [ 3 ] [ 7 ] [ k ] y4e [ k+1] )(env
[ 3 ] [ 6 ] [ k ] y3e [ k+1] )(env [ 3 ] [ 5 ] [ k ] y2e [ k+1] )(env
[ 3 ] [ 4 ] [ k ] y1e [ k+1] ) ) /env [ 3 ] [ 3 ] [ k ] ;
789 y3e [ k ] = ( env [ 2 ] [ 8 ] [ k] ( env [ 2 ] [ 7 ] [ k ] y4e [ k+1] )(env
[ 2 ] [ 6 ] [ k ] y3e [ k+1] )(env [ 2 ] [ 5 ] [ k ] y2e [ k+1] )(env
[ 2 ] [ 4 ] [ k ] y1e [ k+1] )(env [ 2 ] [ 3 ] [ k ] y4e [ k ] ) ) /env
[ 2 ] [ 2 ] [ k ] ;
790 y2e [ k ] = ( env [ 1 ] [ 8 ] [ k] ( env [ 1 ] [ 7 ] [ k ] y4e [ k+1] )(env
[ 1 ] [ 6 ] [ k ] y3e [ k+1] )(env [ 1 ] [ 5 ] [ k ] y2e [ k+1] )(env
[ 1 ] [ 4 ] [ k ] y1e [ k+1] )(env [ 1 ] [ 3 ] [ k ] y4e [ k ] ) (env
[ 1 ] [ 2 ] [ k ] y3e [ k ] ) ) /env [ 1 ] [ 1 ] [ k ] ;
791 y1e [ k ] = ( env [ 0 ] [ 8 ] [ k] ( env [ 0 ] [ 7 ] [ k ] y4e [ k+1] )(env
[ 0 ] [ 6 ] [ k ] y3e [ k+1] )(env [ 0 ] [ 5 ] [ k ] y2e [ k+1] )(env
[ 0 ] [ 4 ] [ k ] y1e [ k+1] )(env [ 0 ] [ 3 ] [ k ] y4e [ k ] ) (env
[ 0 ] [ 2 ] [ k ] y3e [ k ] ) (env [ 0 ] [ 1 ] [ k ] y2e [ k ] ) ) /env
[ 0 ] [ 0 ] [ k ] ;
792
793
794 y4c [ n1] = ( i nt e r [ 5] [ 10] ( i nt e r [ 5 ] [ 9 ] y4e [ 0 ] ) ( i nt e r
[ 5 ] [ 8 ] y3e [ 0 ] ) ( i nt e r [ 5 ] [ 7 ] y2e [ 0 ] ) ( i nt e r [ 5 ] [ 6 ] y1e
134
[ 0 ] ) ) / i nt e r [ 5 ] [ 5 ] ;
795 y3c [ n1] = ( i nt e r [ 4] [ 10] ( i nt e r [ 4 ] [ 9 ] y4e [ 0 ] ) ( i nt e r
[ 4 ] [ 8 ] y3e [ 0 ] ) ( i nt e r [ 4 ] [ 7 ] y2e [ 0 ] ) ( i nt e r [ 4 ] [ 6 ] y1e
[ 0 ] ) ( i nt e r [ 4 ] [ 5 ] y4c [ n1] ) ) / i nt e r [ 4 ] [ 4 ] ;
796 y2p [ n1] = ( i nt e r [ 3] [ 10] ( i nt e r [ 3 ] [ 9 ] y4e [ 0 ] ) ( i nt e r
[ 3 ] [ 8 ] y3e [ 0 ] ) ( i nt e r [ 3 ] [ 7 ] y2e [ 0 ] ) ( i nt e r [ 3 ] [ 6 ] y1e
[ 0 ] ) ( i nt e r [ 3 ] [ 5 ] y4c [ n1] )( i nt e r [ 3 ] [ 4 ] y3c [ n1] ) ) /
i nt e r [ 3 ] [ 3 ] ;
797 y2n [ n1] = ( i nt e r [ 2] [ 10] ( i nt e r [ 2 ] [ 9 ] y4e [ 0 ] ) ( i nt e r
[ 2 ] [ 8 ] y3e [ 0 ] ) ( i nt e r [ 2 ] [ 7 ] y2e [ 0 ] ) ( i nt e r [ 2 ] [ 6 ] y1e
[ 0 ] ) ( i nt e r [ 2 ] [ 5 ] y4c [ n1] )( i nt e r [ 2 ] [ 4 ] y3c [ n1] )(
i nt e r [ 2 ] [ 3 ] y2p [ n1] ) ) / i nt e r [ 2 ] [ 2 ] ;
798 y1p [ n1] = ( i nt e r [ 1] [ 10] ( i nt e r [ 1 ] [ 9 ] y4e [ 0 ] ) ( i nt e r
[ 1 ] [ 8 ] y3e [ 0 ] ) ( i nt e r [ 1 ] [ 7 ] y2e [ 0 ] ) ( i nt e r [ 1 ] [ 6 ] y1e
[ 0 ] ) ( i nt e r [ 1 ] [ 5 ] y4c [ n1] )( i nt e r [ 1 ] [ 4 ] y3c [ n1] )(
i nt e r [ 1 ] [ 3 ] y2p [ n1] )( i nt e r [ 1 ] [ 2 ] y2n [ n1] ) ) / i nt e r
[ 1 ] [ 1 ] ;
799 y1n [ n1] = ( i nt e r [ 0] [ 10] ( i nt e r [ 0 ] [ 9 ] y4e [ 0 ] ) ( i nt e r
[ 0 ] [ 8 ] y3e [ 0 ] ) ( i nt e r [ 0 ] [ 7 ] y2e [ 0 ] ) ( i nt e r [ 0 ] [ 6 ] y1e
[ 0 ] ) ( i nt e r [ 0 ] [ 5 ] y4c [ n1] )( i nt e r [ 0 ] [ 4 ] y3c [ n1] )(
i nt e r [ 0 ] [ 3 ] y2p [ n1] )( i nt e r [ 0 ] [ 2 ] y2n [ n1] )( i nt e r
[ 0 ] [ 1 ] y1p [ n1] ) ) / i nt e r [ 0 ] [ 0 ] ;
800
801 for ( i nt k = n2; k >= 0; k)
802
803 y4c [ k ] = ( cor e [ 5 ] [ 1 2 ] [ k] ( cor e [ 5 ] [ 1 1 ] [ k ] y4c [ k+1] )(
cor e [ 5 ] [ 1 0 ] [ k ] y3c [ k+1] )( cor e [ 5 ] [ 9 ] [ k ] y2p [ k
+1] )( cor e [ 5 ] [ 8 ] [ k ] y2n [ k+1] )( cor e [ 5 ] [ 7 ] [ k ] y1p
[ k+1] )( cor e [ 5 ] [ 6 ] [ k ] y1n [ k+1] ) ) / cor e [ 5 ] [ 5 ] [ k ] ;
804 y3c [ k ] = ( cor e [ 4 ] [ 1 2 ] [ k] ( cor e [ 4 ] [ 1 1 ] [ k ] y4c [ k+1] )(
cor e [ 4 ] [ 1 0 ] [ k ] y3c [ k+1] )( cor e [ 4 ] [ 9 ] [ k ] y2p [ k
+1] )( cor e [ 4 ] [ 8 ] [ k ] y2n [ k+1] )( cor e [ 4 ] [ 7 ] [ k ] y1p
[ k+1] )( cor e [ 4 ] [ 6 ] [ k ] y1n [ k+1] )( cor e [ 4 ] [ 5 ] [ k ]
y4c [ k ] ) ) / cor e [ 4 ] [ 4 ] [ k ] ;
805 y2p [ k ] = ( cor e [ 3 ] [ 1 2 ] [ k] ( cor e [ 3 ] [ 1 1 ] [ k ] y4c [ k+1] )(
cor e [ 3 ] [ 1 0 ] [ k ] y3c [ k+1] )( cor e [ 3 ] [ 9 ] [ k ] y2p [ k
+1] )( cor e [ 3 ] [ 8 ] [ k ] y2n [ k+1] )( cor e [ 3 ] [ 7 ] [ k ] y1p
[ k+1] )( cor e [ 3 ] [ 6 ] [ k ] y1n [ k+1] )( cor e [ 3 ] [ 5 ] [ k ]
y4c [ k ] ) ( cor e [ 3 ] [ 4 ] [ k ] y3c [ k ] ) ) / cor e [ 3 ] [ 3 ] [ k ] ;
806 y2n [ k ] = ( cor e [ 2 ] [ 1 2 ] [ k] ( cor e [ 2 ] [ 1 1 ] [ k ] y4c [ k+1] )(
cor e [ 2 ] [ 1 0 ] [ k ] y3c [ k+1] )( cor e [ 2 ] [ 9 ] [ k ] y2p [ k
+1] )( cor e [ 2 ] [ 8 ] [ k ] y2n [ k+1] )( cor e [ 2 ] [ 7 ] [ k ] y1p
[ k+1] )( cor e [ 2 ] [ 6 ] [ k ] y1n [ k+1] )( cor e [ 2 ] [ 5 ] [ k ]
y4c [ k ] ) ( cor e [ 2 ] [ 4 ] [ k ] y3c [ k ] ) ( cor e [ 2 ] [ 3 ] [ k ]
y2p [ k ] ) ) / cor e [ 2 ] [ 2 ] [ k ] ;
807 y1p [ k ] = ( cor e [ 1 ] [ 1 2 ] [ k] ( cor e [ 1 ] [ 1 1 ] [ k ] y4c [ k+1] )(
cor e [ 1 ] [ 1 0 ] [ k ] y3c [ k+1] )( cor e [ 1 ] [ 9 ] [ k ] y2p [ k
+1] )( cor e [ 1 ] [ 8 ] [ k ] y2n [ k+1] )( cor e [ 1 ] [ 7 ] [ k ] y1p
[ k+1] )( cor e [ 1 ] [ 6 ] [ k ] y1n [ k+1] )( cor e [ 1 ] [ 5 ] [ k ]
y4c [ k ] ) ( cor e [ 1 ] [ 4 ] [ k ] y3c [ k ] ) ( cor e [ 1 ] [ 3 ] [ k ]
y2p [ k ] ) ( cor e [ 1 ] [ 2 ] [ k ] y2n [ k ] ) ) / cor e [ 1 ] [ 1 ] [ k ] ;
808 y1n [ k ] = ( cor e [ 0 ] [ 1 2 ] [ k] ( cor e [ 0 ] [ 1 1 ] [ k ] y4c [ k+1] )(
cor e [ 0 ] [ 1 0 ] [ k ] y3c [ k+1] )( cor e [ 0 ] [ 9 ] [ k ] y2p [ k
+1] )( cor e [ 0 ] [ 8 ] [ k ] y2n [ k+1] )( cor e [ 0 ] [ 7 ] [ k ] y1p
135
[ k+1] )( cor e [ 0 ] [ 6 ] [ k ] y1n [ k+1] )( cor e [ 0 ] [ 5 ] [ k ]
y4c [ k ] ) ( cor e [ 0 ] [ 4 ] [ k ] y3c [ k ] ) ( cor e [ 0 ] [ 3 ] [ k ]
y2p [ k ] ) ( cor e [ 0 ] [ 2 ] [ k ] y2n [ k ] ) ( cor e [ 0 ] [ 1 ] [ k ]
y1p [ k ] ) ) / cor e [ 0 ] [ 0 ] [ k ] ;
809
810
811 D = ( ( lm+1)y3e [ l n ] )+y4e [ l n ] ;
812
813 delete [ ] c1 ;
814 delete [ ] U;
815 delete [ ] V;
816 delete [ ] dpdr ;
817 delete [ ] Gamma1;
818 delete [ ] g ;
819 delete [ ] A;
820
821 for ( i nt i = 0; i <= 8; i ++)
822
823 for ( i nt j = 0; j <= 12; j ++)
824
825 delete [ ] cor e [ i ] [ j ] ;
826
827
828
829 for ( i nt i = 0; i <= 5; i ++)
830
831 for ( i nt j = 0; j <= 8; j ++)
832
833 delete [ ] env [ i ] [ j ] ;
834
835
836
837 return D;
838
839
840
841 //The f o l l o wi ng f unct i on i s provi ded i n order t o al l ow t he
f i n i t e d i f f e r e nc e f unct i on t o be used wi t h numeri cal
r out i ne s provi ded by t he GSL l i b r a r y .
842 double f i n i t e d i f f e r e n c e g s l ( double sigma , void params )
843
844 struct f i ni t e di f f e r e nc e pa r a ms p = ( struct
f i ni t e di f f e r e nc e pa r a ms ) params ;
845
846 double rp ;
847 double rhop ;
848 double rho n ;
849 double rho p ;
850 double munrhop ;
851 double munrhon ;
852 double murhop ;
853 double P;
854 double p rho ;
855 double mr ;
136
856 double y1n ;
857 double y1p ;
858 double y2n ;
859 double y2p ;
860 double y3c ;
861 double y4c ;
862 double y1e ;
863 double y2e ;
864 double y3e ;
865 double y4e ;
866
867 i nt n = ( p>n) ;
868 i nt l = ( p>l ) ;
869 i nt s = ( p>s ) ;
870 i nt lm = ( p>lm) ;
871
872 rp = ( p>rp ) ;
873 rhop = ( p>rhop ) ;
874 rho n = ( p>rho n ) ;
875 rho p = ( p>rho p ) ;
876 munrhop = ( p>munrhop) ;
877 munrhon = ( p>munrhon) ;
878 murhop = ( p>murhop) ;
879 P = ( p>P) ;
880 p rho = ( p>p rho ) ;
881 mr = ( p>mr) ;
882 y1n = ( p>y1n) ;
883 y1p = ( p>y1p) ;
884 y2n = ( p>y2n) ;
885 y2p = ( p>y2p) ;
886 y3c = ( p>y3c ) ;
887 y4c = ( p>y4c ) ;
888 y1e = ( p>y1e ) ;
889 y2e = ( p>y2e ) ;
890 y3e = ( p>y3e ) ;
891 y4e = ( p>y4e ) ;
892
893 return f i n i t e d i f f e r e n c e ( rp , rhop , rho n , rho p , munrhop ,
munrhon , murhop , P, p rho , mr , n , l , lm, s , sigma ,
y1n , y1p , y2n , y2p , y3c , y4c , y1e , y2e , y3e , y4e ) ;
894
895
896 // f unct i on t o det ermi ne t he e i g e nv al ue s and modes
897
898 void o s c i l l a t i o n s ( double rp , double rhop , double rho n ,
double rho p , double munrhop , double munrhon , double
murhop , double p , double p rho , double mr , i nt n ,
i nt l , i nt s )
899
900 i nt lm, res , j , s t at us , i t e r , modes ;
901 double sigma , dev , y1n , y1p , y2n , y2p , y3c , y4c ,
y1e , y2e , y3e , y4e , D, s i z e , Sigma , si gmahi ,
si gmal o , Alpha , Beta , e i g e nf r e q ;
137
902 mxArray f r eq , di s , al pha , beta , r , y1nmat , y1pmat
, y2nmat , y2pmat , y1 , y2 , y3 , y4 , y5 , y6 ,
ei genf r eqmat ;
903 engi ne ep ;
904 char f [ 4 0 ] ;
905 MATFile r e s ul t , mode ;
906 const g s l r o o t f s o l v e r t y p e T;
907 g s l r o o t f s o l v e r S ;
908 g s l f unc t i o n F;
909
910 cout << endl << ent er l mode : << endl << > ;
911 ci n >> lm;
912 ci n . i gnor e ( ) ;
913 cout << endl << f r e que nc i e s from ;
914 ci n >> si gmal o ;
915 ci n . i gnor e ( ) ;
916 cout << endl << to ;
917 ci n >> si gmahi ;
918 ci n . i gnor e ( ) ;
919 cout << endl << ent er r e s o l ut i o n ( i nt e ge r ) : << endl <<
> ;
920 ci n >> r e s ;
921 ci n . i gnor e ( ) ;
922
923 D = new double [ r e s ] ;
924 Sigma = new double [ r e s ] ;
925
926 r = mxCreateDoubleMatrix ( 1 , l , mxREAL) ;
927 di s = mxCreateDoubleMatrix ( 1 , res , mxREAL) ;
928 f r e q = mxCreateDoubleMatrix ( 1 , res , mxREAL) ;
929
930 y1nmat = mxCreateDoubleMatrix ( 1 , n , mxREAL) ;
931 y1pmat = mxCreateDoubleMatrix ( 1 , n , mxREAL) ;
932 y2nmat = mxCreateDoubleMatrix ( 1 , n , mxREAL) ;
933 y2pmat = mxCreateDoubleMatrix ( 1 , n , mxREAL) ;
934 y3 = mxCreateDoubleMatrix ( 1 , n , mxREAL) ;
935 y4 = mxCreateDoubleMatrix ( 1 , n , mxREAL) ;
936 y1 = mxCreateDoubleMatrix ( 1 , l n+1, mxREAL) ;
937 y2 = mxCreateDoubleMatrix ( 1 , l n+1, mxREAL) ;
938 y5 = mxCreateDoubleMatrix ( 1 , l n+1, mxREAL) ;
939 y6 = mxCreateDoubleMatrix ( 1 , l n+1, mxREAL) ;
940
941 sigma = si gmal o ;
942 s i z e = ( si gmahi si gmal o ) / r e s ;
943
944 for ( i nt m = 0; m <= ( res 1) ; m++)
945
946 y1n = new double [ n ] ;
947 y1p = new double [ n ] ;
948 y2n = new double [ n ] ;
949 y2p = new double [ n ] ;
950 y3c = new double [ n ] ;
951 y4c = new double [ n ] ;
952 y1e = new double [ l n+1] ;
138
953 y2e = new double [ l n+1] ;
954 y3e = new double [ l n+1] ;
955 y4e = new double [ l n+1] ;
956
957 D[m] = f i n i t e d i f f e r e n c e ( rp , rhop , rho n , rho p ,
munrhop , munrhon , murhop , p , p rho , mr , n , l , lm
, s , sigma , y1n , y1p , y2n , y2p , y3c , y4c , y1e ,
y2e , y3e , y4e ) ;
958
959 cout << endl << m << << sigma << << D[m] <<
endl ;
960
961 Sigma [m] = sigma ;
962 sigma = sigma+s i z e ;
963
964 delete [ ] y1n ;
965 delete [ ] y1p ;
966 delete [ ] y2n ;
967 delete [ ] y2p ;
968 delete [ ] y3c ;
969 delete [ ] y4c ;
970 delete [ ] y1e ;
971 delete [ ] y2e ;
972 delete [ ] y3e ;
973 delete [ ] y4e ;
974
975
976 f r e q = mxCreateDoubleMatrix ( 1 , res , mxREAL) ;
977 di s = mxCreateDoubleMatrix ( 1 , res , mxREAL) ;
978
979 for ( i nt m = 0; m <= ( res 1) ; m++)
980
981 memcpy( ( void ) ( mxGetPr ( di s )+m) , ( void ) (D+m) ,
si zeof (D[m] ) ) ;
982 memcpy( ( void ) ( mxGetPr ( f r e q )+m) , ( void ) ( Sigma+m) ,
si zeof ( Sigma [m] ) ) ;
983
984
985 f g e t c ( s t di n ) ;
986
987 cout << endl << Name the MAT f i l e to be cr eat ed f or
s t or i ng the va r i a bl e s : << endl << > ;
988 ci n >> f ;
989
990 char f i l e 1 = s t r c a t ( f , . mat ) ;
991 ci n . i gnor e ( ) ;
992 r e s ul t = matOpen( f i l e 1 , w ) ;
993
994 matPutVari abl e ( r e s ul t , Sigma , f r e q ) ;
995 matPutVari abl e ( r e s ul t , D , di s ) ;
996
997 modes = 0;
998
999 for ( i nt m = 0; m <= ( res 2) ; m++)
139
1000
1001 i f ( (D[m] D[m+1] ) <= 0)
1002
1003 modes++;
1004
1005
1006
1007 ei genf r eqmat = mxCreateDoubleMatrix ( 1 , modes , mxREAL) ;
1008 e i g e nf r e q = mxGetPr ( ei genf r eqmat ) ;
1009
1010 y1n = mxGetPr ( y1nmat ) ;
1011 y1p = mxGetPr ( y1pmat ) ;
1012 y2n = mxGetPr ( y2nmat ) ;
1013 y2p = mxGetPr ( y2pmat ) ;
1014 y3c = mxGetPr ( y3 ) ;
1015 y4c = mxGetPr ( y4 ) ;
1016 y1e = mxGetPr ( y1 ) ;
1017 y2e = mxGetPr ( y2 ) ;
1018 y3e = mxGetPr ( y5 ) ;
1019 y4e = mxGetPr ( y6 ) ;
1020
1021 for ( i nt i = 0; i <= ( l 1) ; i ++)
1022
1023 memcpy( ( void ) ( mxGetPr ( r )+i ) , ( void ) ( rp+i ) ,
si zeof ( rp [ i ] ) ) ;
1024
1025
1026 struct f i ni t e di f f e r e nc e pa r a ms params = rp , rhop , rho n
, rho p , munrhop , munrhon , murhop , p , p rho , mr , n ,
l , lm, s , y1n , y1p , y2n , y2p , y3c , y4c , y1e , y2e ,
y3e , y4e ;
1027
1028 F. f unc t i on = &f i n i t e d i f f e r e n c e g s l ;
1029 F. params = &params ;
1030
1031 T = g s l r o o t f s o l v e r b r e n t ;
1032 S = g s l r o o t f s o l v e r a l l o c (T) ;
1033 modes = 0;
1034
1035 char f i l e 2 ;
1036
1037 for ( i nt m = 0; m <= ( res 2) ; m++)
1038
1039 i f ( (D[m] D[m+1] ) <= 0)
1040
1041 si gmal o = Sigma [m] ;
1042 si gmahi = Sigma [m+1] ;
1043
1044 g s l r o o t f s o l v e r s e t ( S , &F, si gmal o , si gmahi ) ;
1045 i t e r = 0;
1046
1047 do
1048
1049 i t e r ++;
140
1050 s t at us = g s l r o o t f s o l v e r i t e r a t e ( S) ;
1051 sigma = g s l r o o t f s o l v e r r o o t ( S) ;
1052 si gmal o = g s l r o o t f s o l v e r x l o we r ( S) ;
1053 si gmahi = g s l r o o t f s o l v e r x uppe r ( S) ;
1054 s t at us = g s l r o o t t e s t i n t e r v a l ( si gmal o ,
si gmahi , 0 , 1e 10) ;
1055
1056 cout << endl << sigma << endl ;
1057
1058 while ( s t at us == GSL CONTINUE) ;
1059
1060 i f ( s t at us == GSL SUCCESS)
1061
1062 cout << endl << Found ei genf r equenc y at
<< sigma << endl ;
1063
1064 el se
1065
1066 cout << endl << Found s i ngul ar poi nt at
<< sigma << endl ;
1067
1068
1069 al pha = mxCreateDoubleMatrix ( 1 , l , mxREAL) ;
1070 beta = mxCreateDoubleMatrix ( 1 , n , mxREAL) ;
1071 Alpha = mxGetPr ( al pha ) ;
1072 Beta = mxGetPr ( beta ) ;
1073
1074 for ( i nt i = 0; i <= ( n1) ; i ++)
1075
1076 Alpha [ i ] = ( ( rho n [ i ] / rhop [ i ] ) y2n [ i ] ) +((
rho p [ i ] / rhop [ i ] ) y2p [ i ] ) ;
1077 Beta [ i ] = y2n [ i ]y2p [ i ] ;
1078
1079
1080 for ( i nt i = 0; i <= ( l n1) ; i ++)
1081
1082 Alpha [ n+i ] = y2e [ i +1] ;
1083
1084
1085 f g e t c ( s t di n ) ;
1086
1087 cout << endl << Name MAT f i l e to be cr eat ed f or
s t or i ng the mode : << endl << > ;
1088 ci n >> f ;
1089
1090 f i l e 2 = s t r c a t ( f , . mat ) ;
1091 ci n . i gnor e ( ) ;
1092 mode = matOpen( f i l e 2 , w ) ;
1093
1094 matPutVari abl e ( mode , al pha , al pha ) ;
1095 matPutVari abl e ( mode , beta , beta ) ;
1096 matPutVari abl e ( mode , r , r ) ;
1097 matPutVari abl e ( mode , y1n , y1nmat ) ;
1098 matPutVari abl e ( mode , y1p , y1pmat ) ;
141
1099 matPutVari abl e ( mode , y2n , y2nmat ) ;
1100 matPutVari abl e ( mode , y2p , y2pmat ) ;
1101 matPutVari abl e ( mode , y3 , y3 ) ;
1102 matPutVari abl e ( mode , y4 , y4 ) ;
1103 matPutVari abl e ( mode , y1 , y1 ) ;
1104 matPutVari abl e ( mode , y2 , y2 ) ;
1105 matPutVari abl e ( mode , y5 , y5 ) ;
1106 matPutVari abl e ( mode , y6 , y6 ) ;
1107
1108 i f ( matClose ( mode) != 0)
1109
1110 cout << endl << cannot c l o s e MAT f i l e . <<
endl ;
1111
1112
1113 mxDestroyArray ( al pha ) ;
1114 mxDestroyArray ( beta ) ;
1115
1116 e i g e nf r e q [ modes ] = sigma ;
1117 modes++;
1118
1119
1120
1121 matPutVari abl e ( r e s ul t , e i g e nf r e q , ei genf r eqmat ) ;
1122
1123 i f ( matClose ( r e s ul t ) != 0)
1124
1125 cout << endl << cannot c l o s e MAT f i l e . << endl ;
1126
1127
1128 mxDestroyArray ( di s ) ;
1129 mxDestroyArray ( f r e q ) ;
1130 mxDestroyArray ( r ) ;
1131 mxDestroyArray ( ei genf r eqmat ) ;
1132 mxDestroyArray ( y1nmat ) ;
1133 mxDestroyArray ( y1pmat ) ;
1134 mxDestroyArray ( y2nmat ) ;
1135 mxDestroyArray ( y2pmat ) ;
1136 mxDestroyArray ( y3 ) ;
1137 mxDestroyArray ( y4 ) ;
1138 mxDestroyArray ( y1 ) ;
1139 mxDestroyArray ( y2 ) ;
1140 mxDestroyArray ( y5 ) ;
1141 mxDestroyArray ( y6 ) ;
1142
1143 delete [ ] Sigma ;
1144 delete [ ] D;
1145
1146
1147 i nt main ( )
1148
1149 MATFile mat ;
1150 mxArray r , rho , n , rhonc , rhopc , munrhopc ,
munrhonc , murhopc , m r , P, rhos , dpdrho ;
142
1151 double rp , rhop , rho n , rho p , munrhop , munrhon ,
murhop , mr , p , p rho ;
1152 double r1 , rho1 ;
1153 i nt l , n1 , s ;
1154 char f [ 4 0 ] ;
1155
1156 cout << endl << Enter name of MAT f i l e : << endl << >
;
1157 ci n >> f ;
1158
1159 char f i l e = s t r c a t ( f , . mat ) ;
1160 ci n . i gnor e ( ) ;
1161 mat = matOpen( f i l e , r ) ;
1162 i f ( mat == NULL)
1163 cout << endl << cannot open f i l e << f i l e << or
f i l e does not e x i s t << endl ;
1164 return(EXIT FAILURE) ;
1165
1166
1167 // r e t r i e v e v a r i a b l e s from MAT f i l e
1168
1169 r = matGetVari abl e ( mat , r ) ;
1170 i f ( r == NULL)
1171 cout << endl << cannot r e t r i e v e var i abl e r << endl
;
1172
1173
1174 rho = matGetVari abl e ( mat , rho ) ;
1175 i f ( rho == NULL)
1176 cout << endl << cannot r e t r i e v e var i abl e rho <<
endl ;
1177
1178
1179 n = matGetVari abl e ( mat , n ) ;
1180 i f ( n == NULL)
1181 cout << endl << cannot r e t r i e v e var i abl e n << endl
;
1182
1183
1184 rhonc = matGetVari abl e ( mat , rhon ) ;
1185 i f ( rhonc == NULL)
1186 cout << endl << cannot r e t r i e v e var i abl e rhon <<
endl ;
1187
1188 rhopc = matGetVari abl e ( mat , rhop ) ;
1189 i f ( rhopc == NULL)
1190 cout << endl << cannot r e t r i e v e var i abl e rhop <<
endl ;
1191
1192
1193 munrhopc = matGetVari abl e ( mat , munrhop ) ;
1194 i f ( munrhopc == NULL)
1195 cout << endl << cannot r e t r i e v e var i abl e munrhop
<< endl ;
143
1196
1197
1198 munrhonc = matGetVari abl e ( mat , munrhon ) ;
1199 i f ( munrhonc == NULL)
1200 cout << endl << cannot r e t r i e v e var i abl e munrhon
<< endl ;
1201
1202
1203 murhopc = matGetVari abl e ( mat , murhop ) ;
1204 i f ( murhopc == NULL)
1205 cout << endl << cannot r e t r i e v e var i abl e murhop <<
endl ;
1206
1207
1208 m r = matGetVari abl e ( mat , m r ) ;
1209 i f ( m r == NULL)
1210 cout << endl << cannot r e t r i e v e var i abl e m r <<
endl ;
1211
1212
1213 P = matGetVari abl e ( mat , p ) ;
1214 i f (P == NULL)
1215 cout << endl << cannot r e t r i e v e var i abl e p << endl
;
1216
1217
1218 dpdrho = matGetVari abl e ( mat , dpdrho ) ;
1219 i f ( dpdrho == NULL)
1220 cout << endl << cannot r e t r i e v e var i abl e dpdrho <<
endl ;
1221
1222
1223 rhos = matGetVari abl e ( mat , rho2 ) ;
1224 i f ( rhos == NULL)
1225 cout << endl << cannot r e t r i e v e var i abl e rhos <<
endl ;
1226
1227
1228 rp = mxGetPr ( r ) ; rhop = mxGetPr ( rho ) ; rho n = mxGetPr (
rhonc ) ; rho p = mxGetPr ( rhopc ) ; munrhop = mxGetPr (
munrhopc ) ; munrhon = mxGetPr ( munrhonc ) ; murhop =
mxGetPr ( murhopc ) ; mr = mxGetPr ( m r ) ; p = mxGetPr (P) ;
p rho = mxGetPr ( dpdrho ) ;
1229
1230 l = mxGetM( r ) ;
1231 s = mxGetM( rhos ) ;
1232 r1 = rp ; rho1 = rhop ; n1 = ( i nt ) mxGetScalar ( n) ;
1233
1234 // c a l l of f unct i on t o c a l c u l a t e t he e i g e nv al ue s
1235 o s c i l l a t i o n s ( rp , rhop , rho n , rho p , munrhop , munrhon ,
murhop , p , p rho , mr , n1 , l , s ) ;
1236
1237 mxDestroyArray ( r ) ;
1238 mxDestroyArray ( rho ) ;
144
1239 mxDestroyArray ( n) ;
1240 mxDestroyArray ( rhonc ) ;
1241 mxDestroyArray ( munrhopc ) ;
1242 mxDestroyArray ( munrhonc ) ;
1243 mxDestroyArray ( murhopc ) ;
1244 mxDestroyArray ( m r ) ;
1245 mxDestroyArray (P) ;
1246
1247 i f ( matClose ( mat ) != 0)
1248
1249 cout << cannot c l o s e f i l e << endl ;
1250 return(EXIT FAILURE) ;
1251
1252
1253 cout << r1 << << rho1 << << n1 << << l <<
endl ;
1254 cout << endl << pr e s s ent er << endl ;
1255 ci n . get ( ) ;
1256
145
B.7 Matlab/Octave programme used to calculate neutron star
oscillations
This programme calculates the neutron star oscillations and is implemented in Mat-
lab code. This was used before sorting out problems with the C++ programme.
Note that it is not recommended that Matlab or Octave be used for this kind
of computation since it runs too slowly because Matlab and Octave are inter-
preted languages. The set up of the matrix in this programme is dierent from
the one in the C++ programme (section B.6). The elements of the matrix are
arranged such that the elements across each row and down each column represent
y
n,0
1
, y
n,1
1
, y
n,N
2
, y
p,0
1
, y
p,1
1
, , y
p,N
1
etc.
1 /Matlab/Octave code used to c a l c ul a t e the neutron s t ar
o s c i l l t i o n s /
2
3 global G m n m p m e ;
4 G = 6. 673 e 8; m n = 1. 67492716 e 24; m p = 1. 67262158 e 24;
m e = 9. 10938188 e 28;
5
6 x = r / r (end) ;
7 c1 = m r (end) /( ( 4/3) pi rho ( 1) ( r (end) 3) ) ;
8 c1 = [ c1 ; ( ( r ( 2 : end) / r (end) ) . 3) . / ( m r ( 2 : end) /m r (end) ) ] ;
9 U = [ 3 ; 4pi ( r ( 2 : end) . 2) . rho ( 2 : end) . ( r ( 2 : end) . / m r ( 2 : end
) ) ] ;
10 drhodr = [ 0; ( (Gm r ( 2 : end) . rho ( 2 : end) ) . / ( ( r ( 2 : end) . 2) .
dpdrho ( 2 : end) ) ) ] ;
11 Vg = (r . / rho ) . drhodr ;
12 drhondr = ( ( ( m pmurhop) (m nmunrhop) ) . / ( ( m pmurhop) (m n
munrhop) +((m nmunrhon) (m pmunrhop) ) ) ) . drhodr ( 1 :
length( rhon ) ) ;
13 drhopdr = ( ( ( m nmunrhon) (m pmunrhop) ) . / ( ( m pmurhop) (m n
munrhop) +((m nmunrhop) (m pmunrhop) ) ) ) . drhodr ( 1 :
length( rhop ) ) ;
14 m p ef f = m p(0. 588 (0. 447 log10( rho ( 1 : length( rhon ) ) /1 e14 ) )
+(0. 210( log10( rho ( 1 : length( rhon ) ) ) . 2) ) ) ;
15 m n ef f = ( m nrhon . m p ef f ) . / ( ( m prhop ) ((rhoprhon ) .
m p ef f ) ) ;
16 rho22 = ( ( m n m p ef f ) . /( ( m n ef f . m p ef f ) +(m n m p ef f ) +(
m p m n ef f ) ) ) . rhop ;
17 rho11 = ( ( m p m n ef f ) . /( ( m n ef f . m p ef f ) +(m n m p ef f ) +(
m p m n ef f ) ) ) . rhon ;
18 rho12 = ( ( m n ef f . ( m pm p ef f ) ) . /( ( m n ef f . m p ef f ) +(m n
m p ef f )+(m p m n ef f ) ) ) . rhop ;
19 Del ta = ( ( rho11 . / rhon ) . ( ( rho22 . / rhop ) +(m e/m p) ) ) (( rho12 .
rho22 ) . / ( rhon . rhop ) ) ;
20 Q11 = murhop . / ( ( munrhon . murhop) (munrhop . 2) ) ;
21 Q12 = munrhop . / ( ( munrhon . murhop) (munrhop . 2) ) ;
22 Q21 = Q12 ;
23 Q22 = munrhon . / ( ( munrhon . murhop) (munrhop . 2) ) ;
24 Rn = 4pi G( r ( 1 : length( rhon ) ) . 2) . ( Q11+((1+(m e/m p) ) Q21)
) ;
25 Rp = 4pi G( r ( 1 : length( rhon ) ) . 2) . ( Q12+((1+(m e/m p) ) Q22)
) ;
146
26 S11 = [ 0 ; ( (Gm r ( 2 : length( rhon ) ) ) . / ( r ( 2 : length( rhon ) ) . rhon
( 2 : end) ) ) . Q11 ( 2 : end) ] ;
27 S12 = [ 0 ; ( (Gm r ( 2 : length( rhon ) ) ) . / ( r ( 2 : length( rhon ) ) . rhon
( 2 : end) ) ) . Q12 ( 2 : end) ] ;
28 S21 = [ 0 ; ( (Gm r ( 2 : length( rhon ) ) ) . / ( r ( 2 : length( rhon ) ) . rhop
( 2 : end) ) ) . Q21 ( 2 : end) ] ;
29 S22 = [ 0 ; ( (Gm r ( 2 : length( rhon ) ) ) . / ( r ( 2 : length( rhon ) ) . rhop
( 2 : end) ) ) . Q22 ( 2 : end) ] ;
30 Ast = zeros ( length( r ) , 1) ;
31
32 l = 3;
33 sigma = 17. 32;
34
35 An = zeros ( ( ( 2 n) +(4length( r ) ) +4) , (2n) +(4length( r ) ) +4) ;
36
37 An( 1 , 1) = rhon ( 1) /rho ( 1) ;
38 An( 1 , ( n+1) ) = ( rhop ( 1) /rho ( 1) ) (1+(m e/m p) ) ;
39 An( 1 , ( ( 2 n) +1) ) = (( l rhon ( 1) ) /( ( sigma 2) c1 ( 1) rho ( 1) ) ) ;
40 An( 1 , ( ( 3 n) +1) ) = (( l rhop ( 1) ) /( ( sigma 2) c1 ( 1) rho ( 1) ) ) ;
41 An( 2 , 1) = ( ( rho11 ( 1) /rhon ( 1) ) (rho12 ( 1) /rhop ( 1) ) ) ;
42 An( 2 , ( n+1) ) = ( ( rho12 ( 1) /rhon ( 1) ) (rho22 ( 1) /rhop ( 1) ) (m e/
m p) ) ;
43 An( 2 , ( ( 2 n) +1) ) = ( l /( c1 ( 1) ( sigma 2) ) ) ;
44 An( 2 , ( ( 3 n) +1) ) = ( l /( c1 ( 1) ( sigma 2) ) ) ;
45 An( 3 , ( ( 4 n) +1) ) = l ;
46 An( 3 , ( ( 5 n) +1) ) = 1;
47
48 for i = 1 : ( n1)
49 An( ( ( 6 i ) 2) , i ) = (0. 5( 3 (( r ( i ) /rhon ( i ) ) drhondr ( i ) ) ) )
+( ( 0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
50 An( ( ( 6 i ) 2) , ( i +1) ) = (0. 5( 3 (( r ( i +1)/rhon ( i +1) )
drhondr ( i +1) ) ) ) ((0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
51 An( ( ( 6 i ) 2) , ( i +(2n) ) ) = 0. 5( ( ( 1/ Del ta ( i ) ) ( ( l ( l +1) )
/( c1 ( i ) ( sigma 2) ) ) ( ( rho22 ( i ) /rhop ( i ) ) +(m e/m p) ) )
S11 ( i ) ) ;
52 An( ( ( 6 i ) 2) , ( i +(2n) +1) ) = 0. 5( ( ( 1/ Del ta ( i +1) ) ( ( l ( l
+1) ) /( c1 ( i +1) ( sigma 2) ) ) ( ( rho22 ( i +1)/rhop ( i +1) )+(
m e/m p) ) )S11 ( i +1) ) ;
53 An( ( ( 6 i ) 2) , ( i +(3n) ) ) = 0. 5(((1/ Del ta ( i ) ) ( ( l ( l +1) )
/( c1 ( i ) ( sigma 2) ) ) ( rho12 ( i ) /rhon ( i ) ) )+S12 ( i ) ) ;
54 An( ( ( 6 i ) 2) , ( i +(3n) +1) ) = 0. 5(((1/ Del ta ( i +1) ) ( ( l ( l
+1) ) /( c1 ( i +1) ( sigma 2) ) ) ( rho12 ( i +1)/rhon ( i +1) ) )+
S12 ( i +1) ) ;
55 An( ( ( 6 i ) 2) , ( i +(4n) ) ) = 0.5( S11 ( i ) +(1+(m e/m p) ) S12
( i ) ) ;
56 An( ( ( 6 i ) 2) , ( i +(4n) +1) ) = 0.5( S11 ( i +1)+(1+(m e/m p) )
S12 ( i +1) ) ;
57 An( ( ( 6 i ) 1) , ( i+n) ) = (0. 5( 3 (( r ( i ) /rhop ( i ) ) drhopdr ( i
) ) ) ) +( ( 0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
58 An( ( ( 6 i ) 1) , ( i+n+1) ) = (0. 5( 3 (( r ( i +1)/rhop ( i +1) )
drhopdr ( i +1) ) ) ) ((0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
59 An( ( ( 6 i ) 1) , ( i +(2n) ) ) = 0. 5(((1/ Del ta ( i ) ) ( ( l ( l +1) )
/( c1 ( i ) ( sigma 2) ) ) ( rho12 ( i ) /rhop ( i ) ) )+S21 ( i ) ) ;
147
60 An( ( ( 6 i ) 1) , ( i +(2n) +1) ) = 0. 5(((1/ Del ta ( i +1) ) ( ( l ( l
+1) ) /( c1 ( i +1) ( sigma 2) ) ) ( rho12 ( i +1)/rhop ( i +1) ) )+
S21 ( i +1) ) ;
61 An( ( ( 6 i ) 1) , ( i +(3n) ) ) = 0. 5( ( ( 1/ Del ta ( i ) ) ( ( l ( l +1) )
/( c1 ( i ) ( sigma 2) ) ) ( rho11 ( i ) /rhon ( i ) ) )S22 ( i ) ) ;
62 An( ( ( 6 i ) 1) , ( i +(3n) +1) ) = 0. 5( ( ( 1/ Del ta ( i +1) ) ( ( l ( l
+1) ) /( c1 ( i +1) ( sigma 2) ) ) ( rho11 ( i +1)/rhon ( i +1) ) )
S22 ( i +1) ) ;
63 An( ( ( 6 i ) 1) , ( i +(4n) ) ) = 0. 5( S21 ( i ) +(1+(m e/m p) ) S22 (
i ) ) ;
64 An( ( ( 6 i ) 1) , ( i +(4n) +1) ) = 0. 5( S21 ( i ) +(1+(m e/m p) )
S22 ( i ) ) ;
65 An( ( 6 i ) , i ) = 0. 5 c1 ( i ) ( sigma 2) ( rho11 ( i ) /rhon ( i ) ) ;
66 An( ( 6 i ) , ( i +1) ) = 0. 5 c1 ( i +1) ( sigma 2) ( rho11 ( i +1)/rhon
( i +1) ) ;
67 An( ( 6 i ) , ( i+n) ) = 0. 5 c1 ( i ) ( sigma 2) ( rho12 ( i ) /rhon ( i ) )
;
68 An( ( 6 i ) , ( i+n+1) ) = 0. 5 c1 ( i +1) ( sigma 2) ( rho12 ( i +1)/
rhon ( i +1) ) ;
69 An( ( 6 i ) , ( i +(2n) ) ) = (0. 5(1 U( i ) ) ) +( ( 0. 5( r ( i )+r ( i +1) )
) /( r ( i +1)r ( i ) ) ) ;
70 An( ( 6 i ) , ( i +(2n) +1) ) = (0. 5(1 U( i +1) ) ) ((0. 5( r ( i )+r ( i
+1) ) ) /( r ( i +1)r ( i ) ) ) ;
71 An( ( ( 6 i ) +1) , i ) = 0. 5 c1 ( i ) ( sigma 2) ( rho12 ( i ) /rhop ( i ) )
;
72 An( ( ( 6 i ) +1) , ( i +1) ) = 0. 5 c1 ( i +1) ( sigma 2) ( rho12 ( i +1)/
rhop ( i +1) ) ;
73 An( ( ( 6 i ) +1) , ( i+n) ) = 0. 5 c1 ( i ) ( sigma 2) ( ( rho22 ( i ) /
rhop ( i ) )+(m e/m p) ) ;
74 An( ( ( 6 i ) +1) , ( i+n+1) ) = 0. 5 c1 ( i +1) ( sigma 2) ( ( rho22 ( i
+1)/rhop ( i +1) ) +(m e/m p) ) ;
75 An( ( ( 6 i ) +1) , ( i +(3n) ) ) = (0. 5(1 U( i ) ) ) +( ( 0. 5( r ( i )+r ( i
+1) ) ) /( r ( i +1)r ( i ) ) ) ;
76 An( ( ( 6 i ) +1) , ( i +(3n) +1) ) = (0. 5(1 U( i +1) ) ) ((0. 5( r ( i )
+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
77 An( ( ( 6 i ) +2) , ( i +(4n) ) ) = (0. 5(1 U( i ) ) ) +( ( 0. 5( r ( i )+r ( i
+1) ) ) /( r ( i +1)r ( i ) ) ) ;
78 An( ( ( 6 i ) +2) , ( i +(4n) +1) ) = (0. 5(1 U( i +1) ) ) ((0. 5( r ( i )
+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
79 An( ( ( 6 i ) +2) , ( i +(5n) ) ) = 0 . 5 ;
80 An( ( ( 6 i ) +2) , ( i +(5n) +1) ) = 0 . 5 ;
81 An( ( ( 6 i ) +3) , ( i +(2n) ) ) = 0. 5Rn( i ) ;
82 An( ( ( 6 i ) +3) , ( i +(2n) +1) ) = 0. 5Rn( i +1) ;
83 An( ( ( 6 i ) +3) , ( i +(3n) ) ) = 0. 5Rp( i ) ;
84 An( ( ( 6 i ) +3) , ( i +(3n) +1) ) = 0. 5Rp( i +1) ;
85 An( ( ( 6 i ) +3) , ( i +(4n) ) ) = 0. 5( ( l ( l +1) )Rn( i ) (1+(m e/
m p) ) Rp( i ) ) ;
86 An( ( ( 6 i ) +3) , ( i +(4n) +1) ) = 0. 5( ( l ( l +1) )Rn( i +1)(1+(
m e/m p) ) Rp( i +1) ) ;
87 An( ( ( 6 i ) +3) , ( i +(5n) ) ) = (0.5U( i ) ) +( ( 0. 5( r ( i )+r ( i +1)
) ) /( r ( i +1)r ( i ) ) ) ;
88 An( ( ( 6 i ) +3) , ( i +(5n) ) ) = (0.5U( i +1) ) (r ( i +1) /( r ( i +1)
r ( i ) ) ) ;
89 end
148
90
91 An( ( ( 6 n) 2) , n) = rho11 ( n) /rhon ( n) ;
92 An( ( ( 6 n) 2) , ( 2n) ) = rho12 ( n) /rhon ( n) ;
93 An( ( ( 6 n) 2) , ( ( 6 n) +1) ) = 1;
94 An( ( ( 6 n) 1) , n) = rho12 ( n) /rhop ( n) ;
95 An( ( ( 6 n) 1) , ( 2n) ) = rho22 ( n) /rhop ( n) ;
96 An( ( ( 6 n) 1) , ( ( 6 n) +1) ) = 1;
97 An( ( 6n) , ( 3n) ) = rhon ( n) /rho ( n) ;
98 An( ( 6n) , ( 4n) ) = rhop ( n) /rho ( n) ;
99 An( ( 6n) , ( 5n) ) = 1;
100 An( ( 6n) , ( ( 5 n)+length( r ) +2) ) = 1;
101 An( ( 6n) , ( ( 4 n) +(2length( r ) ) +3) ) = 1;
102 An( ( ( 6 n) +1) , ( 5n) ) = 1;
103 An( ( ( 6 n) +1) , ( ( 4 n) +(2length( r ) ) +3) ) = 1;
104 An( ( ( 6 n) +2) , ( 6n) ) = 1;
105 An( ( ( 6 n) +2) , ( ( 3 n) +(3length( r ) ) +4) ) = 1;
106
107 for i = n : ( length( r ) 1) ;
108 An( ( ( 2 n) +(4 i ) +3) , ( ( 5 n)+i +1) ) = ( 0. 5( Vg( i ) 3) )
+( ( 0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
109 An( ( ( 2 n) +(4 i ) +3) , ( ( 5 n)+i +2) ) = ( 0. 5( Vg( i +1)3) )
((0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
110 An( ( ( 2 n) +(4 i ) +3) , ( ( 4 n)+length( r )+i +2) ) = 0 . 5 ( ( ( l ( l
+1) ) /( c1 ( i ) ( sigma 2) ) )Vg( i ) ) ;
111 An( ( ( 2 n) +(4 i ) +3) , ( ( 4 n)+length( r )+i +3) ) = 0 . 5 ( ( ( l ( l
+1) ) /( c1 ( i +1) ( sigma 2) ) )Vg( i +1) ) ;
112 An( ( ( 2 n) +(4 i ) +3) , ( ( 3 n) +(2length( r ) )+i +3) ) = 0. 5Vg( i
) ;
113 An( ( ( 2 n) +(4 i ) +3) , ( ( 3 n) +(2length( r ) )+i +4) ) = 0. 5Vg( i
+1) ;
114 An( ( ( 2 n) +(4 i ) +4) , ( ( 5 n)+i +1) ) = 0. 5( ( c1 ( i ) ( sigma 2) )
+Ast ( i ) ) ;
115 An( ( ( 2 n) +(4 i ) +4) , ( ( 5 n)+i +2) ) = 0. 5( ( c1 ( i +1) ( sigma
2) )+Ast ( i +1) ) ;
116 An( ( ( 2 n) +(4 i ) +4) , ( ( 4 n)+length( r )+i +2) ) = (0. 5(1 U( i )
Ast ( i ) ) ) +( ( 0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
117 An( ( ( 2 n) +(4 i ) +4) , ( ( 4 n)+length( r )+i +3) ) = (0. 5(1 U( i
+1)Ast ( i +1) ) ) ((0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
118 An( ( ( 2 n) +(4 i ) +4) , ( ( 3 n) +(2length( r ) )+i +3) ) = 0. 5 Ast (
i ) ;
119 An( ( ( 2 n) +(4 i ) +4) , ( ( 3 n) +(2length( r ) )+i +4) ) = 0. 5 Ast (
i +1) ;
120 An( ( ( 2 n) +(4 i ) +5) , ( ( 3 n) +(2length( r ) )+i +3) ) = (0. 5(1
U( i ) ) ) +( ( 0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
121 An( ( ( 2 n) +(4 i ) +5) , ( ( 3 n) +(2length( r ) )+i +4) ) = (0. 5(1
U( i +1) ) ) ((0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
122 An( ( ( 2 n) +(4 i ) +5) , ( ( 2 n) +(3length( r ) )+i +4) ) = 0 . 5 ;
123 An( ( ( 2 n) +(4 i ) +5) , ( ( 2 n) +(3length( r ) )+i +5) ) = 0 . 5 ;
124 An( ( ( 2 n) +(4 i ) +6) , ( ( 5 n)+i +1) ) = 0. 5 Ast ( i ) ;
125 An( ( ( 2 n) +(4 i ) +6) , ( ( 5 n)+i +2) ) = 0. 5 Ast ( i +1) ;
126 An( ( ( 2 n) +(4 i ) +6) , ( ( 4 n)+length( r )+i +2) ) = 0. 5U( i ) Vg(
i ) ;
127 An( ( ( 2 n) +(4 i ) +6) , ( ( 4 n)+length( r )+i +3) ) = 0. 5U( i +1)
Vg( i +1) ;
149
128 An( ( ( 2 n) +(4 i ) +6) , ( ( 3 n) +(2length( r ) )+i +3) ) = 0. 5( ( l
( l +1) ) (Vg( i ) U( i ) ) ) ;
129 An( ( ( 2 n) +(4 i ) +6) , ( ( 3 n) +(2length( r ) )+i +4) ) = 0. 5( ( l
( l +1) ) (Vg( i +1)U( i +1) ) ) ;
130 An( ( ( 2 n) +(4 i ) +6) , ( ( 2 n) +(3length( r ) )+i +4) ) = (0.5U(
i ) ) +( ( 0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
131 An( ( ( 2 n) +(4 i ) +6) , ( ( 2 n) +(3length( r ) )+i +5) ) = (0.5U(
i +1) ) ((0. 5( r ( i )+r ( i +1) ) ) /( r ( i +1)r ( i ) ) ) ;
132 end
133
134 An( ( ( 2 n) +(4length( r ) ) +3) , ( ( 3 n) +(3length( r ) ) +3) ) = l +1;
135 An( ( ( 2 n) +(4length( r ) ) +3) , ( ( 2 n) +(4length( r ) ) +4) ) = 1;
136 An( ( ( 2 n) +(4length( r ) ) +4) , ( ( 5 n)+length( r ) +1) ) = 1;
137
138 An = sparse (An) ;
139
140 b = zeros ( ( ( 2 n) +(4length( r ) ) +4) , 1) ;
141 b(end) = 1;
142
143 Yn = Anb ;
144
145 y1n = Yn( 1 : n) ;
146 y1p = Yn( ( n+1) : ( 2 n) ) ;
147 y2n = Yn( ( ( 2 n) +1) : ( 3 n) ) ;
148 y2p = Yn( ( ( 3 n) +1) : ( 4 n) ) ;
149 y3 = Yn( ( ( 4 n) +1) : ( 5 n) ) ;
150 y4 = Yn( ( ( 5 n) +1) : ( 6 n) ) ;
151 y1 = Yn( ( ( 6 n) +1) : ( ( 5 n)+length( r ) +1) ) ;
152 y2 = Yn( ( ( 5 n)+length( r ) +2) : ( ( 4 n) +(2length( r ) ) +2) ) ;
153 y5 = Yn( ( ( 4 n) +(2length( r ) ) +3) : ( ( 3 n) +(3length( r ) ) +3) ) ;
154 y6 = Yn( ( ( 3 n) +(3length( r ) ) +4) : ( ( 2 n) +(4length( r ) ) +4) ) ;
155
156 al pha = ( ( rhon ( 1 : n) . / rho ( 1 : n) ) . y2n) +(( rhop ( 1 : n) . / rho ( 1 : n) )
. y2p) ;
157 al pha = [ al pha ; y2 ( 2 : end) ] ;
158 beta = y2ny2p ;
150

You might also like