pynucastro.eos.difference_utils module

pynucastro.eos.difference_utils module#

Some high-order finite-difference approximations for the EOS.

pynucastro.eos.difference_utils.fourth_order_diff(func, x0, delta, component=None)[source]#

Compute a 4th order accurate centered difference approximation of a function, and allow us to specify the component of the object that is returned (if applicable)

Parameters:
  • func (Callable) – the function to difference, assumed to be of the form func(x)

  • x0 (float) – the point at which to approximate the derivative

  • delta (float) – the step-size to use

  • component (str) – if func returns an object, use this component for the derivative.

Return type:

float

pynucastro.eos.difference_utils.sixth_order_diff(func, x0, delta, component=None)[source]#

Compute a 6th order accurate centered difference approximation of a function, and allow us to specify the component of the object that is returned (if applicable)

Parameters:
  • func (Callable) – the function to difference, assumed to be of the form func(x)

  • x0 (float) – the point at which to approximate the derivative

  • delta (float) – the step-size to use

  • component (str) – if func returns an object, use this component for the derivative.

Return type:

float