Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am trying to solve a PDE for heat diffusion, but I have a problem with the boundary region. When I change the boundary region size, the estimation of temperature increases even when no other parameter is changed.

Here is my code.

Boundary region [-10, 10] in x and y

eq1 = Derivative[0, 0, 1][f][x, y, t] - 
   0.14*(Derivative[2, 0, 0][f][x, y, t] + 
      Derivative[0, 2, 0][f][x, y, t]) == Exp[-(x^2/(2^2) + y^2/(2^2))]

ic = {f[x, y, 0] == 24};
bc = {f[-10, y, t] == 24, f[10, y, t] == 24, f[x, -10, t] == 24, 
   f[x, 10, t] == 24};
sol1 = NDSolve[{eq1, ic, bc}, 
  f, {x, -10, 10}, {y, -10, 10}, {t, 0, 1200}]

Boundary region [-40,40] in x and y

Plot[Evaluate[{f[0, 0, t] /. sol1[[1]], u[0, 0, t] /. sol2[[1]]}], {t,
   0, 1200}, PlotRange -> All, Frame -> True]

Plot[Evaluate[{f[x, 0, 1] /. sol1[[1]], 
   u[x, 0, 1] /. sol2[[1]]}], {x, -10, 10}, PlotRange -> All, 
 Frame -> True]

Mathematica graphics

Time history of heat in the interior at (0,0)

Mathematica graphics

Spatial distribution of heat at t = 1 and y = 0 for x in [-10, 10]

share|improve this question
You're changing the boundary conditions. –  b.gatessucks Nov 24 '12 at 9:56
thank you for your quick replay, but this shouldn't change the results significantly, or am I wrong? i pass from 53 in the first configuration to 500 in the second. and i have problem to understand the physics behind it. For me If this would change something, it will be in the mediume around my source and not huge increase in the centre of the medium where i put the heating source. thanks for your help –  kha Nov 24 '12 at 11:12
My thermal physics is pretty rusty, but if you pump heat in at the center and force the boundary to remain at constant temperature, shouldn't you expect a big heat rise in the center? –  m_goldberg Nov 24 '12 at 15:29
Thanks for your replay. Well, i would expect the same rise in the center as far as you don't increase time or source. in this example, the heating and conditions in boundary are the same, i just change the size of my medium and this increases the temperature. Let's take an experimental example: if you take 2 plates with different size and with the same temperature than the room, and you start to increase the temperature in the center of the plate, i would expect that the temperature will slightly change in the surrounding but not in the source. Or may be i have a big confusion. –  user4775 Nov 25 '12 at 13:19
add comment

1 Answer

The problem is that NDSolve doesn't give the right answer when the boundary region is [-40,40].

Here is a code that makes it work (timing= 30 seconds on Intel I7):

eq2 = Derivative[0, 0, 1][u][x, y, t] - 0.14*(Derivative[2, 0, 0][u][x, y, t] + 
      Derivative[0, 2, 0][u][x, y, t]) == Exp[-(x^2/(2^2) + y^2/(2^2))];
ic2 = {u[x, y, 0] == 24};
bc2 = {u[-40, y, t] == 24, u[40, y, t] == 24, u[x, -40, t] == 24, u[x, 40, t] == 24};

sol2 = NDSolve[
  {eq2, ic2, bc2},u, {x, -40, 40}, {y, -40, 40}, {t, 0, 10 1200},
  AccuracyGoal -> 2,
  PrecisionGoal -> Infinity,
  Method -> {
    "TemporalVariable" -> t,
    "SpatialDiscretization" -> {"TensorProductGrid", "MinPoints" -> {120, 120}}

Here are the curves :

temperature versus time

One can see that :
- the steady-state temperature is 20°C higher in the case boundary[-40,40].
- the thermal inertia is higher.

Thermal profile on a line that cross the center (steady state) :

profile steady sate

If the plates were round, the curves would be exactly
the same, but translated.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.