I am an educator trying to teach Euler's method to numerically approximate ODEs. I want to use Mathematica to generate somewhat small examples, i.e. a large step size. When I run
f = NDSolveValue[{y'[x] == y[x]^2, y[0] == 1}, y, {x, 0, 2}, StartingStepSize -> .5, Method -> {"ExplicitEuler"}, StepMonitor :> Print[{x, y[x]}]] I get the output
{0.2,1.2} {0.4,1.488} {0.6,1.93083} {0.8,2.67645} {1.,4.10912} {1.2,7.48611} {1.4,18.6945} {1.6,88.591} {1.8,1658.26} {2.,551627.} In other words, Mathematica appears to override my intentional choice of step size 0.5 with its own step size of 0.2. Is there any way to force Mathematica to use my desired step size?
By the way, when I make the step size smaller than 0.2, it works as expected:
f = NDSolveValue[{y'[x] == y[x]^2, y[0] == 1}, y, {x, 0, 2}, StartingStepSize -> .1, Method -> {"ExplicitEuler"}, StepMonitor :> Print[{x, y[x]}]] Gives
{0.1,1.1} {0.2,1.221} {0.3,1.37008} {0.4,1.5578} {0.5,1.80047} {0.6,2.12464} {0.7,2.57605} {0.8,3.23965} {0.9,4.28919} {1.,6.1289} {1.1,9.88524} {1.2,19.657} {1.3,58.2969} {1.4,398.15} {1.5,16250.5} {1.6,2.64241*10^7} {1.7,6.98233*10^13} {1.8,4.87529*10^26} {1.9,2.37685*10^52} {2.,5.64941*10^103} 
NDSolve[system, StartingStepSize -> 1/10, Method -> "ExplicitEuler"];which is what I was trying to follow. $\endgroup$f = NDSolveValue[{y'[x] == y[x]*Cos[x], y[0] == 1}, y, {x, 0, 2}, StartingStepSize -> .5, MaxStepFraction -> 1, Method -> {"ExplicitEuler"}]; data = Table[{x, f[x]}, {x, f["Coordinates"][[1]]}]; F = Interpolation[data, InterpolationOrder -> 1]; G = DSolveValue[{y'[x] == y[x]*Cos[x], y[0] == 1}, y, x]; Show[ VectorPlot[{1, y*Cos[x]}, {x, 0, 2}, {y, 0, 3}, VectorColorFunction -> None, VectorStyle -> {Black, Arrowheads[0]} ], Plot[{G[x], F[x]}, {x, 0, 2}] ]$\endgroup$