24小时热门版块排行榜    

查看: 1918  |  回复: 0

xiaofeib

铜虫 (正式写手)

[求助] matlab 边界条件设置问题

很简单的问题,画关于Laplace方程的温度分布。我已经写好了大概,剩下边界条件设置的问题

clear
close
% Initialize square grid
[x,y] = meshgrid(0:0.01:pi,0:0.01:pi);
% Set maximum number of partial sums
nmax = 900;
% Initialize T
T = zeros(length(x),length(y));
% Calculate steady state temperature distribution
% boundary condition



for n = 2:2:nmax
T = T + (200*y/pi^2)-(400/pi.*sinh(n*y)/((n^2-1)*sinh(n*pi)).*cos(n*x));
end
% Plot temperature distribution
surface(x,y,T)
shading('interp')
colorbar
colormap jet
title('Steady-State Temperature Plot')

我的问题是如何设置边界条件呢?边界条件非常数,为: T(x,0)=0, dT/dx(在x=pi,y处)=0,dT/dx(在x=0,y处)=0,T(x,pi)=100sin(x)

非常感谢
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 xiaofeib 的主题更新
信息提示
请填处理意见