Now I am trying to solve the following 2D+1 type of PDE:
$\partial_t u(t,x,y)=-y\partial_{x}u+\partial_{y}\left[a y+b sin(x)u+c\partial_{y}u\right]$
with $u(0,x,y)=\frac{1}{2\pi}e^{-((x-\pi/4)^2+y^2)/2}$
and periodic boundary condition:
$u(t,-\pi,y)=u(t,\pi,y)$
In $y$-direction, it is unbounded.
Here is the code:
a = 1;
T = 1;
ωcb = -50;
ωct = 50;
ωb = -5;
ωt = 5;
A = 10;
γ = 0.1;
kT = 0.1;
ufun = NDSolveValue[{D[u[t, θ, ω], t] == -D[ω u[t, θ, ω], θ] -
D[-A Sin[θ] u[t, θ, ω] - γ kT D[u[t, θ, ω], ω], ω] + 0.1 D[ω u[t, θ, ω], ω],
u[0, θ, ω] ==
1/(2 a π)
E^(-((θ - π/4)^2/(2 a^2)) - (ω)^2/(2 a^2)),
u[t, -π, ω] == u[t, π, ω],
u[t, θ, ωcb] == u[t, θ, ωct]},
u, {t, 0,
T}, {θ, -π, π}, {ω, ωcb, ωct},
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
"MinPoints" -> 200, "MaxPoints" -> 1000}}];
plots = Table[
Plot3D[Abs[
ufun[t, θ, ω]], {θ, -π, π}, {ω, ωb, ωt}, PlotRange -> All,
ColorFunction -> "LakeColors"], {t, 0, T, .1}];
ListAnimate[plots]
The solution is a mess. I believe there are some problem on mesh?
Also there are some message
NDSolveValue::mxsst: Using maximum number of grid points 1000 allowed by the MaxPoints or MinStepSize options for independent variable $\theta$.
NDSolveValue::ibcinc: Warning: boundary and initial conditions are inconsistent.
NDSolveValue::eerr: Warning: scaled local spatial error estimate of 62.663959713694915
at t = 1.
in the direction of independent variable θ is much greater than the prescribed error tolerance. Grid spacing with 1001 points may be too large to achieve the desired accuracy or precision. A singularity may have formed or a smaller grid spacing can be specified using the MaxStepSize or MinPoints method options.
But when I try
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
"MinPoints" -> 200, "MaxPoints" -> 10000}}
It cannot manage to finish the program. What's going on ? Thanks for any suggestion!