heat transfer by explicit finite difference

24 views (last 30 days)
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 Comment
KALYAN ACHARJYA
KALYAN ACHARJYA on 31 Aug 2018
1-D heat transfer equation? Details paprameters, varaiables, typical values?

Sign in to comment.

Accepted Answer

michio
michio on 14 Sep 2018
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.

More Answers (0)

Tags

Products


Release

R2014b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!