Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • $\begingroup$ Maybe method is not stable for large step size. $\endgroup$ Commented Oct 10, 2023 at 23:15
  • 1
    $\begingroup$ Thank you for the comments. I'm not sure I understand what I should look at in the documentation of "FixedStep". I see the following sentence "..."ExplicitEuler" method has no adaptive step size control. Therefore, the integration is already carried out using fixed step sizes so the specification of "FixedStep" is unnecessary..." The example it gives is NDSolve[system, StartingStepSize -> 1/10, Method -> "ExplicitEuler"]; which is what I was trying to follow. $\endgroup$ Commented Oct 11, 2023 at 1:47
  • $\begingroup$ @ can be used to notify a user that you replied. For example @xzczd . $\endgroup$ Commented Oct 11, 2023 at 2:19
  • $\begingroup$ Oh… so I didn't remember it right, sorry for that. (Close vote retracted. ) $\endgroup$ Commented Oct 11, 2023 at 4:57
  • $\begingroup$ I also use the following code to plot the first-order interpolation (rather than the default 3rd order): 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$ Commented Oct 11, 2023 at 16:02