I am using Mathematica 10.0.2.0.
Here is the code I am working with:
w[u_] = (-u*x^2*f[t, x] + 0.5*D[f[t, x], x, x]);
wsol[u_] :=
NDSolve[{D[f[t, x], t] == w[u], f[0, x] == 1,
f[t, -50] == Exp[-1000 t], f[t, 50] == Exp[-1000 t]},
f, {t, 0, 100}, {x, -50, 50}, MaxStepSize -> 0.5,
AccuracyGoal -> 8, PrecisionGoal -> 8,
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
"MinPoints" -> 1000}}];
wl[t] = Evaluate[
Integrate[0.25*(x^2)*(f[t, x] /. wsol[0.25]), {x, -50, 50}]]
Plot[Evaluate[wl[t]], {t, 0.01, 100}, PlotRange -> All]
Perhaps, I am doing something wrong but it takes a long time to plot, or sometimes does not plot at all.
Instead of plotting, I tried putting the data in a list but that took too long as well.
Additionally, I would like to fit a function to the data as well and measure the area under the curve.
I would really appreciate some help. Thanks.
'
then the result will be the integration. $\endgroup$wsol
with the same argument. Using memoization will help dramatically reference.wolfram.com/language/tutorial/… $\endgroup$