# I want to model 1-D heat transfer equation in matlab

I want to model 1-D heat transfer equation with $\ k=0.001 \$ in Matlab, at left side there is a Neumann boundary condition $\ \frac{dT}{dx}=0 \$ and at the right side, there is a Dirichlet boundary condition $\ T=0 \$ and my initial condition is $\ T(0,x)=-20 \$ degree centigrade. As I am a beginner in Matlab anybody can help in this regard. I will be very thankful to you?

• There are two separate parts to this: making pseudocode and making Matlab code. This SE is good for the former and bad for the latter. But to get help with the former, you should give some attempt, such as, at the very least, defining what algorithm you want to implement.
– Ian
Aug 20, 2018 at 23:04
• I want to solve it via finite difference method as in code I want to define grid and grid points and apply the all conditions. Aug 20, 2018 at 23:08
• I have tried my best.. but all in vain :( Aug 20, 2018 at 23:09
• @FahadPervaiz The first step is to write the numerical method such as this explicit forward finite-difference method, by taking care of the boundary conditions. The second step consists in Matlab coding, which is introduced here and here. Please show your trials. Aug 22, 2018 at 8:52