aurel.numerical

numerical.py

This module contains numerical methods for various calculations. So far it only contains the bisection method for finding roots of a function.

aurel.numerical.dichotomy(y_wanted, function, lower_bound, upper_bound, tolerance)[source]

Find the root of a function using the bisection method.

Numerically solving for x: function(x) = y_wanted

Parameters:
  • y_wanted (float) – The value of the function to find the root for.

  • function (callable) – The function for which to find the root.

  • lower_bound (float) – The lower bound of the interval to search for the root.

  • upper_bound (float) – The upper bound of the interval to search for the root.

  • tolerance (float) – The tolerance for the convergence of the method.

Returns:

The x value for which the function is equal to y_wanted.

Return type:

float