pynucastro.rates.beta_limited_rate module#

Classes and method for describing effective rates that can be limited by a beta waiting point in the sequence.

class pynucastro.rates.beta_limited_rate.BetaLimitedRate(underlying_rate, beta_limiting_rates, *, limiter_nucleus, description=None)[source]#

Bases: Rate

A beta-limited rate represents a sequence that at low temperature follows the behavior of the underlying rate but at high temperature, one or more beta-decays limit the sequence, effectively capping the rate.

An example is the CNO cycle sequence: N14(p,γ)O15(β+)N15. At low temperatures, N14(p,γ)O15 is the limiting rate, but at higher temperatures, O15(β+)N15 becomes the waiting point. So we want to cap this rate at the rate for that decay. Additionally, for hot-CNO, we’ll have to wait on O14(β+)N14, so we accept a list of weak rates and compute the total waiting time from the sequence as the cap.

Note: a BetaLimitedRate does not change the products or stoichiometry. It is essentially just a wrapper around a rate that provides a cap to the reaction rate. The idea is that a BetaLimitedRate can be composed with a ModifiedRate or BranchedRate as needed to do more complex operations.

Parameters:
  • underlying_rate (Rate) – the underlying rate we are evaluating numerically to get the number of reactions / sec if there were no beta-limiting.

  • beta_limiting_rates (list(Rate))

  • description (str) – a description of the rate sequence we are approximating. This will be added as a comment to code outputs.

eval(T, *, rho=None, comp=None, screen_func=None)[source]#

Evaluate the beta-limited rate.

Parameters:
  • T (float) – the temperature to evaluate the rate at

  • rho (float) – the density to evaluate screening effects at.

  • comp (float) – the composition (of type Composition) to evaluate screening effects with.

  • screen_func (Callable) – one of the screening functions from pynucastro.screening – if provided, then the rate will include screening correction.

Return type:

float

function_string_cxx(dtype='double', specifiers='inline', leave_open=False, extra_args=None)[source]#

Return a string containing the C++ function that computes the approximate rate

Parameters:
  • dtype (str) – The C++ datatype to use for all declarations

  • specifiers (str) – C++ specifiers to add before each function declaration (i.e. “inline”)

  • leave_open (bool) – If true, then we leave the function unclosed (no “}” at the end). This can allow additional functions to add to this output.

  • extra_args (list(str)) – A list of strings representing additional arguments that should be appended to the argument list when defining the function interface.

Return type:

str

function_string_py()[source]#

Return a string containing the python function that computes the rate – in this case it is the underlying rate limited by the total waiting time of the beta rates

Return type:

str

get_child_rates()[source]#

Return a list of all of the rates that are used in this approximation.

Return type:

list(Rate)

log_eval(T, *, rho=None, comp=None, screen_func=None)[source]#

Evaluate the natural log of reaction rate for the beta-limited rate.

Parameters:
  • T (float) – the temperature to evaluate the rate at

  • rho (float) – the density to evaluate screening effects at.

  • comp (float) – the composition (of type Composition) to evaluate screening effects with.

  • screen_func (Callable) – one of the screening functions from pynucastro.screening – if provided, then the rate will include screening correction.

Return type:

float