Re: Differential eqation: command set up
- To: mathgroup at smc.vnet.net
- Subject: [mg79629] Re: Differential eqation: command set up
- From: chuck009 <dmilioto at comcast.com>
- Date: Tue, 31 Jul 2007 06:17:26 -0400 (EDT)
I made a syntax error in my earlier post in an attempt to format it better. Apparently need to specify initial condition first: a = 1; Clear[u, x, t] sol = NDSolve[{D[u[x, t], t] == a*D[u[x, t], x, x], u[x, 0] == 0, u[-1, t] == 1 - Exp[-1000*t], u[1, t] == 1 - Exp[-1000*t]}, u, {x, -1, 1}, {t, 0, 5}] Plot3D[Evaluate[u[x, t] /. First[sol]], {x, -1, 1}, {t, 0, 5}]