Assume sufficient decay and differentiability to justify integration by parts and exchange of integrals; Schwartz functions are one convenient class. With the stated Fourier transform convention, integrate first in :
The boundary contribution vanishes under the decay assumption. The Fourier transform of a derivative consequently turns constant-coefficient spatial differential operators into multipliers. Repeating it gives , so the heat equation becomes an independent temporal ordinary differential equation at each wavevector.
Apply the Fourier transform of a derivative twice in each spatial coordinate, and commute the time derivative with the spatial Fourier transform. For the Laplacian,
Thus
The minus sign is essential: positive thermal diffusivity damps short spatial scales rather than amplifying them. The zero Fourier mode is unchanged in the absence of a source.
Let be the Fourier transform of the initial temperature. Solving the scalar linear ordinary differential equation gives
Recover using the Fourier inversion theorem, with inverse factor for this two-dimensional convention. Equivalently, take the convolution of the initial data with the two-dimensional heat kernel. On a periodic square, the same exponential applies to each discrete Fourier mode, with and .
For consistency with the supplied wavenumbers, use an FFT grid on a periodic interval: , , and similarly for . In MATLAB, replace the endpoint-inclusive coordinate definitions by x = (0:nx-1)*Lx/nx; and y = (0:ny-1)*Ly/ny;. The supplied linspace arrays instead have spacing while the Fourier multipliers assume . Including both copies of the periodic endpoint creates a grid inconsistency, separate from high-frequency aliasing.
The line references below use the original listing's line numbers.
For this linear homogeneous problem, the exponential update is exact for the retained modes, apart from roundoff error. It is not a forward Euler method step and does not require the explicit finite-difference diffusion stability restriction. Sampling, periodic modelling and spatial resolution still matter.
Diffusion smooths and broadens the hot spot while conserving its integral. For an isolated two-dimensional initial profile , the Gaussian hot spot under diffusion is
Here and , giving a width parameter of and a peak of in the initial temperature units. The periodic-grid calculation agrees to displayed precision because the periodic copies are far away. Running the endpoint-inclusive listing as written instead gives a sampled initial peak near and final peak near ; the difference is consistent with the coordinate-grid issue, rather than a different diffusion law.
Increasing positive thermal diffusivity at fixed time produces a wider, lower peak. Each nonconstant Fourier mode decays faster, while the spatial mean of a periodic heat equation remains fixed. The profiles approach a uniform mean at long times under these periodic boundary conditions.
Figure 1.
Diffusion of a Gaussian hot spot, with and without a spatially uniform decaying heat source
. Original calculations on an endpoint-excluded periodic grid. The cross-sections use a common temperature scale; the source contribution is a uniform offset. The dashed initial profile and the two final profiles are calculated rather than copied from the supplied examination figure. Details.
Aliasing occurs because a sampled grid cannot distinguish certain different continuous Fourier modes. With spacing , modes and agree at every sample point. Frequencies above the Nyquist frequency can therefore be misidentified as lower frequencies, changing the resolved spectrum and its subsequent diffusion rate.
For the corrected grid, and the maximum resolved angular wavenumber is approximately . The initial Gaussian function has spectral envelope proportional to . At that one-coordinate cutoff the factor is about , so the omitted high-frequency tail is tiny. Its continuation mismatch at the distant edges is also tiny. Significant aliasing is not expected for this resolved, smooth initial condition.
The linear constant-coefficient heat equation only damps existing modes; it does not generate higher frequencies through nonlinear products. An unresolved narrow peak, a sharp edge or a nonlinear source would require a separate resolution assessment. The duplicated-endpoint grid issue described above should not be diagnosed as high-frequency folding.
A spatially uniform source changes only the zero Fourier mode. Its exact integrated increment over a time step beginning at is
The unnormalised two-dimensional discrete Fourier transform stores a constant field as in element (1,1).[ref] Keep the existing homogeneous exponential multiplication and add this source increment to that element:
for i = 1:nt
    t = (i-1)*dt;
    u_hat = u_hat .* exp(-alpha*K2*dt);
    dq = exp(-t/10) - exp(-(t+dt)/10);
    u_hat(1,1) = u_hat(1,1) + nx*ny*dq;
end
This replacement uses the original variable names and MATLAB indexing. The uniform forcing of a periodic heat equation is integrated exactly in time here. No source multiplier is applied to the other modes, and the zero-mode homogeneous multiplier equals one. Adding only dq to the unnormalised coefficient would underestimate the physical temperature increment by the factor .
The uniform source adds a background without changing the spatial gradients relative to the unforced solution:
At the offset is . On the corrected grid the central peak is therefore about , and regions far from the hot spot are near . The hot spot's broadening is unchanged; the source is spatially uniform. The spatial mean of a periodic heat equation rises by the same amount, tending to a total increment of one temperature unit as .

Articles by others on the same topic (0)

There are currently no matching articles.