From charlesreid1

TempProfile.gif(480 × 360 pixels, file size: 609 KB, MIME type: image/gif, looped, 99 frames, 20 s)

Note: Due to technical limitations, thumbnails of high resolution GIF images such as this one will not be animated.

Illustration of the evolution of the temperature profile, according to the Fourier series solution found using separation of variables. The initial temperature profile consists of a sum of many different sine waves of various frequencies, with the highest-frequency fluctuations dying faster than the low-frequency fluctuations.

The animation was created using Matlab, using the following function and driver:

func.m

function T = func(X,Time)
% Given a spatial location x and a time t,
% this returns A, B, and C, where the temp
% profile is of the form
% \theta = T = A.*B(t).*C(x)

alpha = 1e-2;

A = [ 25; -4; 15; 4; 8; 1; 2; 0.5; 0.5; 1; 1; 0.5; ];

lambda = [ 1; 2; 3; 4; 5; 8; 20; 21; 25; 28; 35; 100; ];

% For each spatial location
for i=1:length(X)
    % For each term in the temperature expression, 
    % at the given spatial location
    T(i) = 0;
    for j=1:length(lambda)
        B(j) = exp(-(lambda(j)*pi*alpha).^2 * Time);
        C(j) = sin( lambda(j)*pi*X(i) );
        T(i) = T(i) + A(j)*B(j)*C(j);
    end
end

driver.m

x=linspace(0,1,100);

frame_no = 0;
for time=logspace(-1.5,3.5,100);
    frame_no = frame_no + 1
    theta = func(x,time);
    plot(x,theta)
    ylim([0 38])
    pause(0.1);
    file = sprintf('Movie_frame%d.png', 1000+frame_no);
    saveas(gcf, file) %save the current frame
    disp(file); %show the frame number we are at
end

The movie was then created using ImageMagick's convert utility, by running:

$ convert -antialias -loop 10000 -delay 20 -resize 40% Movie_frame10* TempProfile.gif

This "convert" command was pilfered from Wikipedia http://en.wikipedia.org/wiki/File:Heat_eqn.gif - except for the "resize" bit, which was specific to my wiki. It created a huge (1200 x 900) animated gif, which I had to make smaller.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current03:38, 24 October 2010Thumbnail for version as of 03:38, 24 October 2010480 × 360 (609 KB)Admin (talk | contribs)Trying with -resize 40%
03:03, 24 October 2010Thumbnail for version as of 03:03, 24 October 20101,200 × 900 (829 KB)Admin (talk | contribs)Illustration of the evolution of the temperature profile, according to the Fourier series solution found using separation of variables. The initial temperature profile consists of a sum of many different sine waves of vario

The following page uses this file: