Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13135

bad PDE solution...

From Fred Bartoli < @news.free.fr>
Newsgroups comp.soft-sys.math.mathematica
Subject bad PDE solution...
Date 2013-01-14 05:01 +0000
Message-ID <kd03f3$6e0$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


Hello,

As a first simple test case of a more complicated pb I want to solve the 
plane diffusion equation.
It seems NDSolve gives a bad answer to the simple step case but I can't 
find what's happening...

(* Set up the equation: *)

eq1=D[h[t,x],x,x]- k1 D[h[t,x],t]==0

const=k1-> 10000

(*"solve" it...*)

sol = NDSolve[
    {D[h[t, x], {x, 2}] - k1 D[h[t, x], t] == 0, h[0, x] == 0,
        h[t, 1] == 0, h[t, 0] == 1 - Exp[-10^6*t]} /. const,
    h, {t, 0, 10^-3}, {x, 0, 0.01}][[1]]

Plot3D[(h[t,x])/.mag/.solCart,{x,0,10^-4},{t,0,10^-4},AxesLabel->{"x","t","h"},PlotRange->All,PlotLabel->"Bogus 
solution"]
Plot3D[Erfc[x/(2*Sqrt[t/k1])]/.const,{x,0,10^-4},{t,0,10^-4},AxesLabel->{"X","t","h"},PlotRange->All,PlotLabel->"The 
right one"]

(* Test the Erfc[x/(2Sqrt[t/k1])] solution *)
Release[Hold[D[h[t,x],x,x]- k1*D[h[t,x],t]]/. 
h[t,x]->Erfc[x/(2*Sqrt[t/k1])]]//Simplify


I hope I'm doing something wrong, but I can find what...

-- 
Thanks,
Fred.

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

bad PDE solution... Fred Bartoli < @news.free.fr> - 2013-01-14 05:01 +0000
  Re: bad PDE solution... "Nasser M. Abbasi" <nma@12000.org> - 2013-01-15 04:27 +0000

csiph-web