pysdic.numeric.assemble_forward_finite_difference_matrix#

assemble_forward_finite_difference_matrix(order, n_times, *, n_dim=1, spacing=1.0, accuracy=1, boundary='one_sided', sparse=True, return_indices=False)[source]#

Assemble the forward finite difference operator of a derivative on a uniform sampling.

The row \(i\) uses the samples \(i, \dots, i + n + p - 1\) (see compute_forward_finite_difference_coefficients()). At the end of the sampling, the window is shifted backward (boundary="one_sided") or the row is removed (boundary="valid"). See assemble_finite_difference_matrix() for the ordering of the components and the outputs.

Parameters:

Examples

assemble_forward_finite_difference_matrix(1, 4, sparse=False)
# [[-1,  1,  0,  0],
#  [ 0, -1,  1,  0],
#  [ 0,  0, -1,  1],
#  [ 0,  0, -1,  1]]  (last row: shifted window)