The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Topic: [mg6070] Is NDSolve conceptually flawed?
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List

Posts: 3
Registered: 12/7/04
[mg6070] Is NDSolve conceptually flawed?
Posted: Feb 18, 1997 10:13 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I am trying to use NDSolve to solve a simple partial differential equation,
namely the heat equation. Trying

soln =NDSolve[{D[y[x,t], t] == D[y[x,t], x, x],
y[x,0]==0, y[0,t]==1,
y[x,t], {x,0,5}, {t,0,10}]
"Warning: Boundary and initial conditions are inconsistent."

does not work because Mathematica thinks the initial condition y[x,0]==0,
is inconsistent with the boundary condition y[0,t]==1. Physically, this
problem corresponds to starting out with a block of metal say at zero degrees
and applying heat through a constant temperature at one surface. At the other
surface the block is insolated and no heat can escape. There is no physical
reason why the initial temperature of the block has to be related in any way
to the temperature at the boundary. Yet apparently Mathematica thinks so!

A simple way around this is to trick Mathematica (provided to me by Paul
Abbott) to use the same initial and boundary condition at x=t=0:
sol = NDSolve[{D[y[x, t], t] == D[y[x, t], x, x],
y[0, t] == 1, y[x, 0] == If[x > 0, 0, 1],
Derivative[1, 0][y][5, t] == 0}, y, {x, 0, 5}, {t, 0, 10}];

This seems to work!

But how does one deal with more general boundary conditions? For example,
apply radiation boundary conditions at the face x=0:

sol = NDSolve[{D[y[x,t], t] == D[y[x,t], x, x],
y[x, 0] == 1,
y[x,t], {x,0,5}, {t,0,10}]

But now the temperature at the boundary is varying with time and Mathematica
complains! I may be missing something here and would be happy to admit my
ignorance if someone could help me out!
Thanks, ...Peter
Peter C. Lichtner <>
Southwest Research Institute
Center for Nuclear Waste Regulatory Analyses (CNWRA)
6220 Culebra Road
San Antonio, Texas 78238-5166
Telephone: Work: (210) 522-6084 <<NeXTMail Welcome!!!>>
Fax: (210) 522-6081
Home: (210) 490-8258

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.