partial_density_central_difference

despasito.equations_of_state.eos_toolbox.partial_density_central_difference

partial_density_central_difference(xi, rho, T, func, step_size=0.01, log_method=False)[source]

Take the derivative of a dependent variable calculated with a given function using the central difference method.

Parameters:
  • xi (list[float]) – Mole fraction of each component

  • rho (float) – Molar density of system [\(mol/m^3\)]

  • T (float) – Temperature of the system [K]

  • func (function) – Function used in job to calculate dependent factor. This function should have a single output. Inputs arguments should be (rho, T, xi)

  • step_size (float, Optional, default=1E-2) – Step size used in central difference method

  • log_method (bool, Optional, default=False) – Choose to use a log transform in central difference method. This allows easier calculations for very small numbers.

Returns:

dydxi – Array of derivative of y with respect to xi

Return type:

numpy.ndarray