Re: Differential eqation: command set up
- To: mathgroup at smc.vnet.net
- Subject: [mg79598] Re: Differential eqation: command set up
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Tue, 31 Jul 2007 06:01:16 -0400 (EDT)
- Organization: Uni Leipzig
- References: <f8kg2j$2i6$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi, a) your boundary/initial conditions are inconsistent and so no solution exist b) With[{A = 1}, sol = NDSolve[ { D[u[x, t], t] == A*D[u[x, t], {x, 2}], u[-1, t] == 1, u[1, t] == 1, u[x, 0] == Exp[-(Abs[x] - 1)^2/2]^64 }, u[x, t], {x, -1, 1}, {t, 0, 1}] ] Plot3D[ u[x, t] /. sol[[1]], {x, -1, 1}, {t, 0, 1}, PlotRange -> All] uses a consistent initial condition. Regards Jens Elias wrote: > I want to solve the following differential equation through Mathematica: > > du/dt=A*(d^2)u/dx^2 , A=const > > Practically, this is the diffusion equation. > > The boundary + initial conditions I have are: > > * u(t=0, -1<x<1) =0 > * u(t=0, x>=1, x<=-1) =1 > > I cant find the way to input these initial/boundary conditions in a command. > > Any ideas? > > Thanks in advance! >