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:
RateA 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
BetaLimitedRatedoes 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 aBetaLimitedRatecan be composed with aModifiedRateorBranchedRateas needed to do more complex operations.- Parameters:
- 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:
- 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:
- 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:
- 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: