src.spyice.utils.error_norms#

class src.spyice.utils.error_norms.ErrorNorms[source]#

Bases: object

Defines functions for calculating error norms between numerical and analytical values.

Parameters:
  • numerical_values (list) – A list of numerical values.

  • analytical_values (list) – A list of analytical values.

Variables:
  • numerical_values (list) – A list of numerical values.

  • analytical_values (list) – A list of analytical values.

  • iteration_count (int) – The count of iterations.

__init__(numerical_values, analytical_values)[source]#
Parameters:
  • numerical_values (list) – A list of numerical values.

  • analytical_values (list) – A list of analytical values.

Variables:
  • numerical_values (list) – A list of numerical values.

  • analytical_values (list) – A list of analytical values.

  • iteration_count (int) – The count of iterations.

Return type:

None

infinity_norm(numerical_analytical_diff)[source]#

Calculates the infinity norm of the given numerical-analytical difference.

Parameters:

numerical_analytical_diff (array-like) – The numerical-analytical difference.

Returns:

The infinity norm of the difference. If the analytical values are 1-dimensional, a single float value is returned. Otherwise, a numpy array containing the infinity norm for each iteration is returned.

Return type:

float or numpy.ndarray

numerical_analytical_diff()[source]#

Calculates the absolute difference between the analytical values and the numerical values.

Parameters:

None

Returns:

The array containing the absolute differences between the analytical values and the numerical values.

Return type:

numpy.ndarray

one_norm(numerical_analytical_diff)[source]#

Calculates the one norm of the numerical-analytical difference.

Parameters:

numerical_analytical_diff (ndarray) – The numerical-analytical difference.

Returns:

The one norm of the numerical-analytical difference. If the analytical values are 1D, a float is returned. Otherwise, an ndarray is returned with the one norm for each iteration.

Return type:

ndarray or float

Raises:

None

two_norm(numerical_analytical_diff)[source]#

Calculates the two-norm error of the numerical-analytical difference.

Parameters:

numerical_analytical_diff (ndarray) – The numerical-analytical difference.

Returns:

The two-norm error. If the analytical values are 1D, a float is returned. If the analytical values are 2D, an ndarray is returned with the two-norm error for each iteration.

Return type:

ndarray or float