New answers tagged

1

In 2D you don't have a wavelength anymore. In 1D you have a wavenumber $k$ and this is the spatial frequency and it is related to the wavelength by $$k = \frac{2 \pi}{\lambda}\, ,$$ or without the $2\pi$, that depends on the definition. On the other hand, in 2D you have a wavevector $$\mathbf{k} = (k_x, k_y)\, .$$ I guess that you could could use the ...


2

Indeed the problem was that you were trying to calculate your nonlinear term incorrectly and you forgot that: $$\mathcal{F}[(f(x))^{2}] \neq (\mathcal{F}[f(x)])^{2}$$ I changed your code to this: import numpy as np import matplotlib.pyplot as plt from matplotlib.pyplot import cm nu = 1 L = 100 nx = 1024 t0 = 0 tN = 200 dt = 0.05 nt = int((tN - t0) / 0....


Top 50 recent answers are included