ToolPythonAdvanced
numpy.fft.rfft2
Python. Called in 2 tutorials; each line below leads to its place in the tutorial.
ToolPythonIntermediate
Cahn-Hilliard with a semi-implicit spectral step: how fast domains grow
- lap = irfft2(-k2 * rfft2(f), s=f.shape)
- print(f"R = {domain_size(rfft2(f)):.2f}, L/sqrt(34) = {L / np.sqrt(34):.2f}")
- ch = rfft2(c)
- c = irfft2(ch - dt * (k2 * rfft2(c**3 - c) + KAPPA * k2**2 * ch), s=c.shape)
- nonlinear = rfft2(c**3 - c)
- ch = rfft2(c0) if keep is None else keep * rfft2(c0)
and 1 more line in this tutorial