📄 e934.m
字号:
%-------------------------------------------------------------------
% Example 9.3.4: Heat Flow in a Rod
%-------------------------------------------------------------------
% Initialize
clc
clear
global a
m = 50; % t precision
n = 39; % x precision
c = [0 0]; % boundary condition type
a = 1; % maximum x
T = 6.0e3; % maximum t
beta = 1.0e-5; % thermal diffusivity
% Find gamma
fprintf ('Example 9.3.4: Heat Flow in a Rod\n');
dt = T/m;
dx = a/(n+1);
gamma = beta*dt/(dx*dx);
show ('gamma',gamma)
% Solve heat equation
disp ('Solving heat equation ...')
[t,x,U] = heat1 (T,a,m,n,beta,c,'funf934','fung934');
plotxyz (t,x,U,'Heat Flow in a Rod','t','x','u')
%-------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -