File:Heat_eqn.gif
維基百科,自由的 encyclopedia
Heat_eqn.gif (200 × 136 像素,檔案大小:500 KB,MIME 類型:image/gif、循環、181 畫格、6.0秒)
摘要
描述Heat eqn.gif |
English: Illustration of the Heat equation. Русский: Решение уравнения теплопроводности. |
日期 | (UTC) |
來源 | 自己的作品 |
作者 | Oleg Alexandrov |
其他版本 |
![]() |
授權條款
Public domainPublic domainfalsefalse |
![]() |
我,此作品的版權所有人,釋出此作品至公共領域。此授權條款在全世界均適用。 這可能在某些國家不合法,如果是的話: 我授予任何人有權利使用此作品於任何用途,除受法律約束外,不受任何限制。 |
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
說明
添加單行說明來描述出檔案所代表的內容
Animación de la ecuación del calor.
在此檔案描寫的項目
描繪內容
創作作者 Chinese (Hong Kong) (已轉換拼寫)
沒有維基數據項目的某些值
著作權狀態 繁體中文 (已轉換拼寫)
保有知識產權並由其所有者公開於公有領域 繁體中文 (已轉換拼寫)
著作權持有者釋出至公有領域 繁體中文 (已轉換拼寫)
23 11 2007
多媒體型式 繁體中文 (已轉換拼寫)
image/gif
檔案歷史
點選日期/時間以檢視該時間的檔案版本。
日期/時間 | 縮圖 | 尺寸 | 用戶 | 備註 | |
---|---|---|---|---|---|
目前 | 2024年2月2日 (五) 18:01 | ![]() | 200 × 136(500 KB) | Jahobr | more frames (by user Emil Dalalyan) |
2019年4月12日 (五) 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. | |
2011年4月24日 (日) 19:58 | ![]() | 200 × 136(116 KB) | Oleg Alexandrov | Reverse the colormap (red is high). | |
2007年11月23日 (五) 06:11 | ![]() | 199 × 140(126 KB) | Oleg Alexandrov | Tweak, same license | |
2007年11月23日 (五) 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> |
檔案用途
下列頁面有用到此檔案:
全域檔案使用狀況
以下其他 wiki 使用了這個檔案:
- ar.wikipedia.org 的使用狀況
- ast.wikipedia.org 的使用狀況
- bn.wikipedia.org 的使用狀況
- ca.wikipedia.org 的使用狀況
- cs.wikipedia.org 的使用狀況
- de.wikipedia.org 的使用狀況
- el.wikipedia.org 的使用狀況
- en.wikipedia.org 的使用狀況
- eo.wikipedia.org 的使用狀況
- es.wikipedia.org 的使用狀況
- et.wikipedia.org 的使用狀況
- fr.wikipedia.org 的使用狀況
- gl.wikipedia.org 的使用狀況
- hy.wikipedia.org 的使用狀況
- ja.wikipedia.org 的使用狀況
- ko.wikipedia.org 的使用狀況
- ms.wikipedia.org 的使用狀況
- nl.wikipedia.org 的使用狀況
- pl.wikipedia.org 的使用狀況
- pt.wikipedia.org 的使用狀況
- ro.wikipedia.org 的使用狀況
- ru.wikipedia.org 的使用狀況
- sco.wikipedia.org 的使用狀況
- ta.wikipedia.org 的使用狀況
- th.wikipedia.org 的使用狀況
- tl.wikipedia.org 的使用狀況
- www.wikidata.org 的使用狀況
- zh-yue.wikipedia.org 的使用狀況