heat transfer by explicit finite difference
20 次查看(过去 30 天)
显示 更早的评论
I want to solve the 1-D heat transfer equation in MATLAB. with an insulator (heat flux=dT/dx @(0,t)=zero)at left boundary condition and Temperature at the right boundary T(L,t) is zero and Initial Temperature=-20 degree centigrade and Length of the rod is 0.2m and Thermal diffusivity =Alpha=0.001 by explicit finite difference method can anybody help me in this regard?
1 个评论
KALYAN ACHARJYA
2018-8-31
1-D heat transfer equation? Details paprameters, varaiables, typical values?
采纳的回答
michio
2018-9-14
I think pdepe function will work for your problem. Please see the first example of the documentation page. https://jp.mathworks.com/help/matlab/ref/pdepe.html
It uses finite difference for spacial derivative and ode15s for time integration.
If you want to explicitly code the finite difference part by yourself, the following File Exchange entry might be of use.
The above code solves 2D case with the Neumann boundary conditions. You need to drop one dimension and modify the boundary condition of one end where you need Dirichlet boundary condition. And of course, please modify the initial condition too.
getRHS.m has the following line of code that implements Neumann boundary condition.
ubig(end,:) = ubig(end-1,:);
The idea is that the finite difference derivative at the boundary should be zero. In order to use the Dirichlet boundary condition, you can change the above to
ubig(end,:) = 2*BC - ubig(end-1,:);
where BC is the boundary value that you want to specify. The idea here is to fix ubig(end,:) value so that the interpolated value at the boundary to be BC.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Boundary Conditions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!