jesterTOV.eos.metamodel.MetaModel_with_CSE_EOS_model#

class MetaModel_with_CSE_EOS_model(
nsat=0.16,
nmin_MM_nsat=0.75,
nmax_nsat=12,
max_nbreak_nsat=None,
ndat_metamodel=100,
ndat_CSE=100,
nb_CSE=8,
**metamodel_kwargs,
)[source]#

Bases: Interpolate_EOS_model

Meta-model EOS combined with piecewise speed-of-sound extensions (CSE).

This class extends the meta-model approach by allowing for piecewise-constant speed-of-sound extensions at high densities. This is useful for modeling phase transitions or exotic matter components in neutron star cores that may not be captured by the meta-model polynomial expansions.

The EOS is constructed in two regions:

  1. Low-to-intermediate density: Meta-model approach (crust + core)

  2. High density: Speed-of-sound extension scheme

The CSE grid is specified via individual parameters (n_CSE_i_u, cs2_CSE_i) that are converted internally to density and sound speed arrays.

__init__(
nsat=0.16,
nmin_MM_nsat=0.75,
nmax_nsat=12,
max_nbreak_nsat=None,
ndat_metamodel=100,
ndat_CSE=100,
nb_CSE=8,
**metamodel_kwargs,
)[source]#

Initialize the MetaModel with CSE EOS combining meta-model and constant speed-of-sound extensions.

This constructor sets up a hybrid EOS that uses the meta-model approach for low-to-intermediate densities and allows for user-defined constant speed-of-sound extensions at high densities. The transition occurs at a break density specified in the NEP dictionary during EOS construction.

Parameters:
  • nsat (Float, optional) – Nuclear saturation density \(n_0\) [\(\mathrm{fm}^{-3}\)]. Reference density for the meta-model construction. Defaults to 0.16.

  • nmin_MM_nsat (Float, optional) – Starting density for meta-model region as fraction of \(n_0\). Must be above crust-core transition. Defaults to 0.75 (= 0.12/0.16).

  • nmax_nsat (Float, optional) – Maximum density for EOS construction in units of \(n_0\). Defines the high-density reach including CSE region. Defaults to 12.

  • max_nbreak_nsat (Float | None, optional) – Maximum value of nbreak prior in units of \(n_0\). Used to set the upper limit for the meta-model region to avoid unnecessary computation. If None, defaults to nmax_nsat. Should be set to the maximum value from the nbreak prior distribution. Defaults to None.

  • ndat_metamodel (Int, optional) – Number of density points for meta-model region discretization. Higher values give smoother meta-model interpolation. Defaults to 100.

  • ndat_CSE (Int, optional) – Number of density points for constant speed-of-sound extension region. Controls resolution of high-density exotic matter modeling. Defaults to 100.

  • nb_CSE (Int, optional) – Number of CSE grid points. This determines how many individual parameters are expected: n_CSE_0_u, cs2_CSE_0, …, n_CSE_{nb_CSE-1}_u, cs2_CSE_{nb_CSE-1}, plus cs2_CSE_{nb_CSE} (final value at nmax). Defaults to 8.

  • **metamodel_kwargs – Additional keyword arguments passed to the underlying MetaModel_EOS_model. Includes parameters like kappas, v_nq, b_sat, b_sym, crust_name, etc. See MetaModel_EOS_model.__init__ for complete parameter descriptions.

See also

MetaModel_EOS_model.__init__ : Base meta-model parameters construct_eos : Method that defines CSE parameters and break density

Note

The metamodel is created once in __init__ with max_nbreak_nsat as the maximum density to avoid re-instantiating the metamodel class on each construct_eos call. During construct_eos, the metamodel output is interpolated to the actual nbreak value (which varies with each sample) while maintaining fixed array sizes for JAX.

Methods

__init__([nsat, nmin_MM_nsat, nmax_nsat, ...])

Initialize the MetaModel with CSE EOS combining meta-model and constant speed-of-sound extensions.

construct_eos(params)

Construct the EOS by combining metamodel and CSE regions.

get_required_parameters()

Return list of parameters required by MetaModel with CSE.

interpolate_eos(n, p, e)

Convert physical EOS quantities to geometric units and compute auxiliary quantities.

construct_eos(params)[source]#

Construct the EOS by combining metamodel and CSE regions.

This method constructs the full EOS by: 1. Extracting and processing CSE grid point parameters 2. Building the metamodel EOS up to the full nmax range 3. Interpolating the metamodel to a fixed-size grid up to nbreak 4. Stitching the CSE extension on top from nbreak to nmax

Parameters:

params (dict[str, float]) – Dictionary containing: - NEP parameters: E_sat, K_sat, Q_sat, Z_sat, E_sym, L_sym, K_sym, Q_sym, Z_sym - Break density: nbreak - CSE grid points: n_CSE_0_u, cs2_CSE_0, …, n_CSE_{nb_CSE-1}_u, cs2_CSE_{nb_CSE-1} - Final cs2 value: cs2_CSE_{nb_CSE}

Return type:

EOSData

Returns:

EOSData – Complete EOS with all required arrays in geometric units

Note

The metamodel instance is reused from __init__ (not re-instantiated) and its output is interpolated to the actual nbreak value to maintain JAX compatibility with fixed array sizes.

CSE parameters are converted from individual normalized positions (n_CSE_i_u ∈ [0,1]) to physical density arrays (ngrids) via: n_CSE_i = nbreak + n_CSE_i_u * (nmax - nbreak)

get_required_parameters()[source]#

Return list of parameters required by MetaModel with CSE.

Return type:

list[str]

Returns:

list[str]

NEP parameters + nbreak + individual CSE grid point parameters
[“E_sat”, “K_sat”, “Q_sat”, “Z_sat”, “E_sym”, “L_sym”, “K_sym”, “Q_sym”, “Z_sym”,

”nbreak”, “n_CSE_0_u”, “cs2_CSE_0”, …, “n_CSE_{nb_CSE-1}_u”, “cs2_CSE_{nb_CSE-1}”, “cs2_CSE_{nb_CSE}”]

Note

The individual grid point parameters (n_CSE_i_u, cs2_CSE_i) are converted internally by construct_eos() to arrays (ngrids, cs2grids).