11.1.7.1. Calculus

This module provides algorithms to compute the derivative of a function sampled on an uniform grid.

PySpice.Math.Calculus.compute_exact_finite_difference_coefficients(derivative_order, grid, x0=0)[source]

This function compute the finite difference coefficients for the given derivative order and grid. The parameter x specifies where is computed the derivative on the grid. The grid is given as a list of integer offsets.

The algorithm is derived from the article: Generation of Finite Difference Formulas on Arbitrary Space Grids, Bengt Fornberg, Mathematics of computation, volume 51, number 184, october 1988

PySpice.Math.Calculus.compute_finite_difference_coefficients(derivative_order, grid)[source]
PySpice.Math.Calculus.derivative(x, values, derivative_order=1, accuracy_order=4)[source]

Compute the derivative at the given derivative order and accuracy order. The precision of the Taylor expansion is \(\mathcal{O}(dx^{accuracy})\).

PySpice.Math.Calculus.get_finite_difference_coefficients(derivative_order, accuracy_order, grid_type)[source]
PySpice.Math.Calculus.simple_derivative(x, values)[source]

Compute the derivative as a simple slope.