MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

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}]


  • Prev by Date: Re: Differential eqation: command set up
  • Next by Date: Re: A cell style question
  • Previous by thread: Re: Differential eqation: command set up
  • Next by thread: Re: Differential eqation: command set up