ConceptPythonAdvanced
Compact finite differences: four points per wavelength instead of 26
- "three-point": Diff(0, h, acc=2, periodic=True),
- "five-point": Diff(0, h, acc=4, periodic=True),
- "seven-point": Diff(0, h, acc=6, periodic=True),
- "compact": Diff(0, h, compact=3, acc=6, periodic=True),
- d = Diff(0, 1.0, acc=acc, compact=compact_, periodic=True)
- err = np.abs(Diff(0, xe[1] - xe[0], compact=3, acc=6)(np.sin(ke * xe)) - ke * np.cos(ke * xe)) / ke
and 1 more line in this tutorial