SERiF 0.0.1a
3+1D Stellar Structure and Evolution
Loading...
Searching...
No Matches
serif::polytrope::laneEmden Namespace Reference

Namespace for Lane-Emden equation related utility functions. More...

Functions

double a (const int k, const double n)
 Computes the coefficient $a_k$ for the Lane-Emden series expansion.
 
double c (const int m, const double n)
 Computes the auxiliary coefficient $c_{m,n}$ used in determining $a_k$.
 
double thetaSeriesExpansion (const double xi, const double n, const int order)
 

Detailed Description

Namespace for Lane-Emden equation related utility functions.

Provides functions to compute coefficients and evaluate the series expansion solution to the Lane-Emden equation, which describes the structure of a spherically symmetric polytropic star. The Lane-Emden equation is given by:

\[\frac{1}{\xi^2} \frac{d}{d\xi} \left( \xi^2 \frac{d\theta}{d\xi} \right) = -\theta^n
\]

where $\xi$ is a dimensionless radius and $\theta$ is related to the density, and $n$ is the polytropic index.

Function Documentation

◆ a()

double serif::polytrope::laneEmden::a ( const int k,
const double n )

Computes the coefficient $a_k$ for the Lane-Emden series expansion.

The series solution for $\theta(\xi)$ is given by $\theta(\xi) = \sum_{k=0}^{\infty} a_k \xi^k$. The coefficients $a_k$ are determined by substituting the series into the Lane-Emden equation. Specifically, $a_0 = 1$, $a_1 = 0$, and for $k \ge 2$, $a_k = -\frac{c_{k-2,n}}{k(k+1)}$.

Parameters
kThe index of the coefficient.
nThe polytropic index.
Returns
The value of the coefficient $a_k$.
See also
c(const int m, const double n)
Examples
/Users/tboudreaux/Programming/SERiF/src/polytrope/solver/public/polySolver.h.

Definition at line 47 of file polySolver.cpp.

◆ c()

double serif::polytrope::laneEmden::c ( const int m,
const double n )

Computes the auxiliary coefficient $c_{m,n}$ used in determining $a_k$.

The term $\theta^n$ in the Lane-Emden equation can also be expanded as a series $\theta^n(\xi) = \sum_{m=0}^{\infty} c_{m,n} \xi^m$. The coefficients $c_{m,n}$ are related to $a_k$ by: $c_{0,n} = a_0^n$ $c_{m,n} = \frac{1}{m a_0} \sum_{j=1}^{m} (j n - m + j) a_j c_{m-j,n}$ for $m > 0$.

Parameters
mThe index of the coefficient.
nThe polytropic index.
Returns
The value of the coefficient $c_{m,n}$.
See also
a(const int k, const double n)
Examples
/Users/tboudreaux/Programming/SERiF/src/polytrope/solver/public/polySolver.h.

Definition at line 54 of file polySolver.cpp.

◆ thetaSeriesExpansion()

double serif::polytrope::laneEmden::thetaSeriesExpansion ( const double xi,
const double n,
const int order )