Differential Equations - Finite difference method

Mar 2020

I am new here and I hope to be posting my doubts in the right place!

I am taking a PhD in mechanical engineering and I have a work to do applying the finite difference method to a differential equation. The problem itself consists in a heat transfer with a moving heat source at a constant velocity. I have done the exercise applying an explicit approach on Matlab, however after some cyclics, it means after a certain value of t (time),, the value of temperature at x=0 starts to be inferior than Ta and even negative and it is not supposed.

The image in attachment shows the equations I use to create the algorithm. I also attached the algorithm itself.

Could anyone help me to understand where my mistake is?

Thank you so much!
Best regards,