Re: Differential eqation: command set up
- To: mathgroup at smc.vnet.net
- Subject: [mg79628] Re: Differential eqation: command set up
- From: chuck009 <dmilioto at comcast.com>
- Date: Tue, 31 Jul 2007 06:16:55 -0400 (EDT)
Looks like you have inconsistent boundary and initial data. But you know that already right. Your problem looks like:
DE: u_t=a u_{xx} ; -1<=x<=1; t>=0
BC: u(-1,t)=1; u(1,t)=1
IC: u(x,0)=0
Just let a be 1 for now. One way to code such inconsistent data is to specify boundary conditions that jump quickly to 1 smoothly. Like this:
a = 1;
sol = NDSolve[{D[u[x, t], t] == a*D[u[x, t], x, x],
u[-1, t] == 1 - Exp[-1000*t],
u[1, t] == 1 - Exp[-1000*t]},
u[x, 0] == 0,
u,
{x, -1, 1}, {t, 0, 5}]
Plot3D[Evaluate[u[x, t] /. First[sol]], {x, -1, 1},
{t, 0, 5}]