usol = NDSolveValue[{4 Derivative[2, 0][u][x, t] ==
Derivative[0, 2][u][x, t], u[x, 0] == Cos[x/2], u[0, t] == Cos[t],
2 Derivative[1, 0][u][6 Pi, t] == -Derivative[0, 1][u][6 Pi, t],
Derivative[0, 1][u][x, 0] == Sin[x/2]}, u, {x, 0, 6 Pi}, {t, 0, 40}]
Animate[Plot[{usol[x, t], Cos[x/2 - t]}, {x, 0, 6 Pi},
PlotRange -> {-1.2, 1.2}], {t, 0, 40}]
NDSolveValue spits out a ibcinc warning and the numerical solution droops towards the end. What should I do to make these results more accurate?
Adding
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid", "MinPoints" -> 20}}
does not solve the problem
Method -> {"MethodOfLines", "SpatialDiscretization" -> {"TensorProductGrid", "MaxPoints" -> 50, "MinPoints" -> 50, "DifferenceOrder" -> 4}}toNDSolveValueto resolve the issue. – xzczd Nov 29 '16 at 12:39