Hello everybody!
First, thank you for reading this post.
I am a Ph.D. student in plasma physics, and I am struggling with numerically solving a set of equations. After some thoughts, I basically detected that the problem in my solution arises from my inability to choose good NDSolve methods to solve an inherently unstable equation of the type:
dy/dt = - d^2y/dx^2,
With initial condition y(x,0) = sin(x), and boundary conditions y(0,t) = 0, y(Pi,t) = 0.
The analytical solution is y(x,t) = Exp(t)Sin(x), but I failed to compute it numerically. An example:
solpru = NDSolve[{D[y[x, t], t] == - D[D[y[x, t], x], x],
y[0, t] == Sin[0], y[Pi, t] == Sin[Pi], y[x, 0] == Sin[x]},
y, {x, 0, Pi}, {t, 0, 1}, Method -> {
"PDEDiscretization" -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid"}}}];
ys[x_,t_] := Evaluate[y[x,t] /. solpru];
Plot[{ys[x, 0], ys[x, 1]}, {x, 0, Pi}, PlotRange -> All]
I have tried with different Mehtods ("TimeIntegration", "PDEDiscretization"), but none of them gave me a proper result, all of them induced numerical instabilities.
Please can someone shed some light on this problem? Which would the best Method options be for this type of "exploding" equation?
Thank you very much