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"). Seeassemble_finite_difference_matrix()for the ordering of the components and the outputs.- Parameters:
order (Integral) – The order \(n \geq 1\) of the derivative.
n_times (Integral) – The number of samples \(N_t\).
n_dim (Integral) – See
assemble_finite_difference_matrix().boundary (str) – See
assemble_finite_difference_matrix().sparse (bool) – See
assemble_finite_difference_matrix().return_indices (bool) – See
assemble_finite_difference_matrix().spacing (Real, optional (default:
1.0)) – The sampling step \(h > 0\).accuracy (Integral, optional (default:
1)) – The order \(p \geq 1\) of the error.
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)