Derivatives

ed_lgt.tools.derivatives.first_derivative(x, f, dx)[source]

Compute the first derivative of a function f(x).

Parameters:
  • x (array-like) – The array of x values.

  • f (array-like) – The array of function values.

  • dx (real scalar) – The step size for differentiation.

Returns:

Tuple containing the updated x values and the first derivative of the function.

Return type:

tuple

ed_lgt.tools.derivatives.second_derivative(x, f, dx)[source]

Compute the second derivative of a function f(x).

Parameters:
  • x (array-like) – The array of x values.

  • f (array-like) – The array of function values.

  • dx (real scalar) – The step size for differentiation.

Returns:

Tuple containing the updated x values and the second derivative of the function.

Return type:

tuple