Ficheiro:Heat_eqn.gif
From Wikipedia, the free encyclopedia
Heat_eqn.gif (200 × 136 píxeles; tamaño do ficheiro: 500 kB; tipo MIME: image/gif, en bucle, 181 fotogramas, 6,0 s)
![]() | Este ficheiro procede de Wikimedia Commons. A continuación móstrase a información da súa páxina de descrición. Commons é un repositorio libre de ficheiros multimedia. Pode contribuír alí cargando as súas imaxes. |
Resumo
DescriciónHeat eqn.gif |
English: Illustration of the Heat equation. Русский: Решение уравнения теплопроводности. |
Data | (UTC) |
Orixe | Obra propia |
Autoría | Oleg Alexandrov |
Outras versións |
![]() |
Licenza
Public domainPublic domainfalsefalse |
![]() |
Eu, como posuidor dos dereitos de autor desta obra, libéroa para que pertenza ao dominio público. Isto é válido en todo o mundo. Nalgúns países, isto pode non ser legalmente posible; entón: Concedo a calquera o dereito de empregar esta obra para o propósito que considere oportuno, sen condicións, agás aquelas que sexan requiridas pola lei. |
MATLAB source code
% illustration of the heat equation
% Solve the heat equation using finite differences and Forward Euler
function main()
% the number of data points. More points means prettier picture.
N = 400;
L = 2.5; % the box size is [-L, L] x [-L, L]
XX = linspace(-L, L, N);
YY = linspace(-L, L, N);
[X, Y] = meshgrid(XX, YY);
scale = 2;
Z = get_step_function (N, scale, X, Y);
CFL = 0.125; % CourantFriedrichsLewy
dx = XX(2)-XX(1); dy = dx; % space grid
dt = CFL*dx^2;
plot_dt = 0.004; % plot every plot_dt iterations
cmap = rv_matrix_rows(autumn); % colormap
% Solve the heat equation with zero boundary conditions
T = 0:dt:1;
iter = 0;
frame_no = 0;
for t=T
% plot the current temperature distribution
if floor(t/plot_dt) + 1 > frame_no
frame_no = frame_no + 1
% plot the surface
figure(2); clf;
surf(X, Y, Z);
% make the surface beautiful
shading interp; colormap(cmap);
% add in a source of light
camlight (-50, 54);
lighting phong;
% viewing angle
view(-40, 38);
axis equal; axis off;
axis([-L, L, -L, L, 0, scale])
hold on; plot3(0, 0, 3.4, 'g*'); % a marker to help with cropping
pause(0.1);
%return
file = sprintf('Movie_frame%d.png', 1000+frame_no);
%saveas(gcf, file) %save the current frame
print(gcf, '-dpng', '-r400', file) %save the current frame
disp(file); %show the frame number we are at
% cut at max_fr_no frames
max_fr_no = 15;
if frame_no >= max_fr_no
break
end
end
% advance in time
W = 0*Z;
for i=2:(N-1)
for j=2:(N-1)
W(i, j) = Z(i, j) + dt * ( Z(i+1, j) + Z(i-1, j) + Z(i, j-1) + Z(i, j+1) - 4*Z(i, j))/dx^2;
end
end
Z = W;
end
% The gif image was creating with the command
% convert -antialias -loop 10000 -delay 20 -compress LZW Movie_frame10* Heat_eqn.gif
% get a function which is 1 on a set, and 0 outside of it
function Z = get_step_function(N, scale, X, Y)
c = 2;
d=-1;
e=1;
f=0.5;
k=1.2;
shift=10;
Z = (c^2-(X/e-d).^2-(Y/f).^2).^2 + k*(c+d-X/e).^3-shift;
Z = 1-max(sign(Z), 0);
Z = scale*Z;
function X = rv_matrix_rows(X)
[m, n] = size(XL);
for i = 1:m
j = m + 1 - i;
if i < j
tmp = X(i, :); X(i, :) = X(j, :); X(j, :) = tmp;
end
end
Pés de foto
Engada unha explicación dunha liña do representa este ficheiro
Animación de la ecuación del calor.
Elementos retratados neste ficheiro
representa a
Um valor sem um elemento no repositório Wikidata
23 novembro 2007
image/gif
Historial do ficheiro
Prema nunha data/hora para ver o ficheiro tal e como estaba nese momento.
Data/Hora | Miniatura | Dimensións | Usuario | Comentario | |
---|---|---|---|---|---|
actual | 2 de febreiro de 2024 ás 18:01 | ![]() | 200 × 136 (500 kB) | Jahobr | more frames (by user Emil Dalalyan) |
12 de abril de 2019 ás 01:25 | ![]() | 200 × 136 (172 kB) | Jorge Stolfi | Duplicated some framed at beginning so that readers can see the initial state. Added a couple blank frames at end to make it clear that the simulation ended. Slowed down the movie a bit. | |
24 de abril de 2011 ás 19:58 | ![]() | 200 × 136 (116 kB) | Oleg Alexandrov | Reverse the colormap (red is high). | |
23 de novembro de 2007 ás 06:11 | ![]() | 199 × 140 (126 kB) | Oleg Alexandrov | Tweak, same license | |
23 de novembro de 2007 ás 05:51 | ![]() | 200 × 129 (112 kB) | Oleg Alexandrov | {{Information |Description=Illustration of the en:Heat equation |Source=self-made with Matlab |Date=~~~~~ |Author= Oleg Alexandrov |Permission=PD-self, see below |other_versions= }} {{PD-self}} ==MATLAB source code== <pre> |
Uso do ficheiro
As seguintes 2 páxinas usan este ficheiro:
Uso global do ficheiro
Os seguintes wikis empregan esta imaxe:
- Uso en ar.wikipedia.org
- Uso en ast.wikipedia.org
- Uso en bn.wikipedia.org
- Uso en ca.wikipedia.org
- Uso en cs.wikipedia.org
- Uso en de.wikipedia.org
- Uso en el.wikipedia.org
- Uso en en.wikipedia.org
- Uso en eo.wikipedia.org
- Uso en es.wikipedia.org
- Uso en et.wikipedia.org
- Uso en fr.wikipedia.org
- Uso en hy.wikipedia.org
- Uso en ja.wikipedia.org
- Uso en ko.wikipedia.org
- Uso en ms.wikipedia.org
- Uso en nl.wikipedia.org
- Uso en pl.wikipedia.org
- Uso en pt.wikipedia.org
- Uso en ro.wikipedia.org
- Uso en ru.wikipedia.org
- Uso en sco.wikipedia.org
- Uso en ta.wikipedia.org
- Uso en th.wikipedia.org
- Uso en tl.wikipedia.org
- Uso en www.wikidata.org
- Uso en zh-yue.wikipedia.org
- Uso en zh.wikipedia.org
Traído desde «https://gl.wikipedia.org/wiki/Ficheiro:Heat_eqn.gif»