Initial Condition Problems with Heat Equation in Mathematica

Click For Summary

Discussion Overview

The discussion revolves around the challenges of solving the heat equation as presented in a Sous Vide cooking primer using Mathematica. Participants explore issues related to initial conditions, derivatives, and singularities in the context of partial differential equations (PDEs).

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes their attempt to implement a modified heat equation in Mathematica, noting that one of the initial conditions evaluates to "True".
  • Another participant suggests using "Derivative[1, 0][u][0,t] == 0" instead of "D[u[0, t], r] == 0" to avoid the issue of evaluating the derivative at a fixed point.
  • Several participants explain that the expression "D[u[0, t], r]" results in "True" because it evaluates the partial derivative of a function with respect to a variable that has been set to a constant, leading to a trivial equality (0=0).
  • A participant mentions encountering difficulties with NDSolve in Mathematica due to a singularity at r=0, which complicates solving the PDE.
  • There is a discussion about the role of the Beta parameter in the heat equation and its implications for handling 3D shapes.

Areas of Agreement / Disagreement

Participants generally agree on the nature of the issue with the derivative evaluation leading to "True", but there is no consensus on how to effectively handle the singularity in NDSolve or the implications of the Beta parameter.

Contextual Notes

The discussion highlights limitations related to the evaluation of derivatives at specific points and the behavior of the PDE near singularities, which may affect the applicability of numerical methods like NDSolve.

mhmounty
Messages
10
Reaction score
0
I've been trying to work through the heat equation given in this Sous Vide cooking primer:

http://amath.colorado.edu/~baldwind/sous-vide.html

It gives a modified version of the heat equation with a shape parameter for simplification. The equations are shown below:

[PLAIN]http://amath.colorado.edu/~baldwind/heatEq3.png

When I try to put this into Mathematica, one of the initial conditions gives me the value "True". I can't figure it out for the life of me. My Mathematica input is here:

pde = {D[u[r, t],
t] == \[Alpha] (D[u[r, t], r, r] + \[Beta] D[u[r, t], r]/r),
u[r, 0] == Temp0, D[u[0, t], r] == 0,
D[u[R, t], r] == (h/k) (TempW - u[R, t])}

And this is what it spits out:

{Derivative[0, 1][r, t] ==
9.95*^-8*(Derivative[1, 0][r, t]/r +
Derivative[2, 0][r, t]), u[r, 0] == 25, True,
0 == 1250.*(60 - u[R, t])}

I've got some dummy variables in there for the alpha, beta, h, k, ... constants. I'm just not sure why this gives me "True". I know I'm completely missing something simple here. But it's been a while since I've tried to solve anything like this without finite elements.
 
Last edited by a moderator:
Physics news on Phys.org
Try "Derivative[1, 0][0,t] == 0" instead of "D[u[0, t], r] == 0". I think the latter evaluates, and the former represents (and will evaluate if it makes certain sense) but I'm not sure.
 
You're plugging in a value for r in your original equation for u and then differentiating with respect to r. Since there will be no terms with r in it (since you plugged 0 in for r), the resulting partial derivative will be 0. Since 0=0 is a true statement, you are getting back "true" as a result.

Try defining the derivative of u as a function and then plugging r in the derivative. However, this could also give a similar 0=0 result.

Hope this helps.
 
The reason it's giving your "True" is that the expression D[u[0,t],r] means "take the partial derivative of u[0,t] with respect to r". Since u[0,t] is not a function of r, its partial derivative with respect to r is 0, so this equation reduces to 0==0, which reduces to "True". As Leperous said, you can type , "Derivative[1, 0][0,t] == 0", or what is perhaps more clear: "(D[u[r, t], r] /. r -> 0) == 0", which means "take the partial derivative of u[r,t] with respect to r, and then set r=0", which is what you really want.
 
I am also trying to put the PDE from Douglas Baldwin's Sous Vide cooking primer into Mathematica. With the comments before (on correct notation) I was able to add the equations to Mathematica. However NDSolve is trapped by the singularity for r=0 in (1). The second term in the usual 1D heat equation is added (as far as I understand) to be able to compensate with the Beta parameter for 3D shapes such as bricks and cylinders using approriate correction factors between 0 and 2 for Beta. The condition (2) makes the singularity "better behaving" but I found no simple way to convince NDSolve not being trapped by the 1/r term in (1).

(1) D[u[r, t], t] == \[Alpha] (D[u[r, t], r, r] + \[Beta] D[u[r, t], r]/r)
(2) D[u[r, t], r] /. r -> 0) == 0

Any ideas?
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 0 ·
Replies
0
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 23 ·
Replies
23
Views
7K
  • · Replies 6 ·
Replies
6
Views
3K