Re: discretizing once again but with a lot more progress...
- To: mathgroup at smc.vnet.net
- Subject: [mg40346] Re: [mg40329] discretizing once again but with a lot more progress...
- From: john boy <johnboyincali at yahoo.com>
- Date: Wed, 2 Apr 2003 04:36:14 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
there is a mistake in my last post. the actual
discretizaed equation should read as follows
eq2 = Table[
D[y[i][t], t] == (y[i + 1][t] - 2y[i][t] + y[i-
1][t])/(dx^2),{i, 1, nbins}];
but not,
eq2 = Table[
D[y[i][t], t] == (y[i + 1][t] - 2y[i][t] + y[i-
1][t])/(dx^2) +
c y[i][t]^2 - c y[i][t], {i, 1, nbins}];
so to reiterate the actual input for the discretized
equation is as below.
Apologies for any confusion to those who considered
commenting.
In[13]:=
eq1 = D[u, t] == D[u, x, x];
xmin = -3; xmax = 3; nbins = 2; npoints = nbins + 1;
dx =
Abs[(xmax - xmin)/(nbins)];
eq2 = Table[
D[y[i][t], t] == (y[i + 1][t] - 2y[i][t] + y[i -
1][t])/(dx^2), {i, 1,
nbins}];
ic = Table[
y[i][0] == N[E^(-x^2) /. {x -> xmin + (i -
1)(xmax - xmin)/nbins}], {i,
1, nbins}];
vbls = Table[y[i][t], {i, 1, nbins}];
list = Join[eq2, ic];
NDSolve[list, vbls, {t, 0, 20}]
NDSolve::"ndnum": "Encountered non-numerical value for
a derivative at t == (8.761068570442811`*^199"
Out[19]=
{{y[1][t] -> InterpolatingFunction[{{0., 0.}},
"<>"][t],
y[2][t] -> InterpolatingFunction[{{0., 0.}},
"<>"][t]}}
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://platinum.yahoo.com