Heat Equation with Mathematica Neumann / Dirichlet Conditions

This is the question I am trying to solve After fours hours of research and 61 attempts (just today) on how to do this, I'm asking for help. I've been in hospital and am now trying to catch up on lectures and unfortunately, although the Maths makes sense, the Mathematica does not.

This is the latest attempt and I really cannot find where I am going wrong.

NDSolve[{D[T[x, t], t] == 2.5*D[T[x, t], {x, 2}] + 10*Exp[-x^2],T[-2, t] == 22, (D[T[x, t], x] /. x -> 2) == 0}, T[x, t], {x, -2, 2}, {t, 0, 20}]

I am literally in tears typing this because I don't know what do anymore.

This is what it appears as in Mathematica I assumed because I am given the flux, this is Neumann boundary conditions but the error is coming up about Dirichlet boundary conditions. What am I doing wrong and how do I go about fixing it?

Thank you in advance for your help.

• If I add the initial condition then it works for me. I don't know what the second error message is complaining about, but I think the solution looks correct once I do that. – KraZug Jan 11 at 11:39
• Yeah, I made the same observation. The error messages are really misleading. – Henrik Schumacher Jan 11 at 11:44
• @KraZug Thank you! – Gracious Jan 11 at 11:57
• @HenrikSchumacher Thank you! – Gracious Jan 11 at 11:57
• why does the problem says the heat is open to flow through the right boundary then it says the flux is zero? flux zero means it is insulated on the right. If something is insulated, does this not mean heat does not flow? which book/page number did you get this problem from? – Nasser Jan 11 at 14:41