
[mg6070] Is NDSolve conceptually flawed?
Posted:
Feb 18, 1997 10:13 PM


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, Derivative[1,0][y][5,t]==0}, y[x,t], {x,0,5}, {t,0,10}] NDSolve::"ibcinc": "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], Derivative[1,0][y][0,t]==y[0,t]^4, y[x, 0] == 1, Derivative[1,0][y][5,t]==0}, 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 <lichtner@swri.edu> Southwest Research Institute http://www.swri.edu/ Center for Nuclear Waste Regulatory Analyses (CNWRA) 6220 Culebra Road San Antonio, Texas 782385166 Telephone: Work: (210) 5226084 <<NeXTMail Welcome!!!>> Fax: (210) 5226081 Home: (210) 4908258 __________________________________________________________________

