When applying NDSolve to a 1-D transient heat equation, the following code appears to set MaxStepSize for the temporal variable t.
t0 = 0;
t1 = 10;
x0 = 0;
x1 = 1;
nx = 100;
dx = (x1-x0)/nx;
eqs1 = {D[u[x,t],x,x] - D[u[x,t],t] == NeumannValue[1, x==x0 || x == x1], DirichletCondition[u[x,t]==0, t== t0]};
sol1 = NDSolve[eqs1, u, {x, x0, x1}, {t, t0, t1}, Method-> {"MethodOfLines", "TemporalVariable" -> t}, MaxStepSize -> dx]
f = u /. First[sol1];
Dimensions[f["Grid"]]
I would like to apply MaxStepSize to the spatial variable x, rather than to the temporal variable t.
I've tried without success variations involving SpatialDiscretization, such as
NDSolve[eqs1, u, {x, x0, x1}, {t, t0, t1}, Method-> {"MethodOfLines", "TemporalVariable" -> t, "SpatialDiscretization"-> {"TensorProductGrid","MaxStepSize" -> dx}}]
which yields the following error:
NDSolve::moptx: Method option MaxStepSize in {NDSolve`FiniteElement,MaxStepSize->1/100} is not one of {ConstraintMethod,BoundaryTolerance,InterpolationOrder,IntegrationOrder,LinearSolveMethod,MeshOptions,PrecomputeGeometryData}. >>
What is the correct approach?