3
$\begingroup$

If I take the step too large I will get error, while if I take the step too small I also get an error. In my case, instead of seeing the function decreasing, i have it increasing if I take the step too small.

$\endgroup$

closed as unclear what you're asking by nicoguaro, Wolfgang Bangerth, Kirill, LKlevin, BrunoLevy Oct 15 '16 at 9:11

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    $\begingroup$ It is very difficult to answer with such few details. Please consider improving your post by at least writing the PDE you are dealing with as well as the numerical scheme. $\endgroup$ – Coriolis Oct 14 '16 at 11:06
8
$\begingroup$

Using too small of a timestep can lead to accuracy issues due to finite precision. Since you can use derivative approximations to derive time integration schemes, it is fair to look at how derivative approximations fare as you change stepsize.

enter image description here

As you can see above, where I used a second order central difference approximation, the error for derivative step sizes between $1$ and $10^{-5}$ produce the expected second order convergence rate. However, past that span of step sizes, the error starts to grow.

This is a problem with finite precision and so it's feasible that too small a step size in your integration schemes could result in a similar issue.

$\endgroup$
  • $\begingroup$ It's a little curious that the approximation starts to fail around $10^{-5}$, are you using single precision? It is also worth noting that some derivative approximations are more sensitive to mesh spacing when it is sufficiently small. Spectral methods are a good example of this, where the condition number of the derivative operator grows as $10^{2p}$ where $p$ is the order of the derivative. $\endgroup$ – Spencer Bryngelson Oct 14 '16 at 23:59
  • $\begingroup$ @SpencerBryngelson You are correct about different schemes being more or less sensitive than others. In terms of the approximation starting to fail kind of soon, I agree as it seemed odd when I first saw it too. I wrote a quick code in Matlab to generate the above plot, so I will paste the code later so others can try as well. $\endgroup$ – spektr Oct 15 '16 at 0:08
  • $\begingroup$ At the very least your result is qualitatively correct, which I suppose is the point anyhow. $\endgroup$ – Spencer Bryngelson Oct 15 '16 at 0:10
  • $\begingroup$ I agree, the point is certainly conveyed. I think it's also worth adding that the sudden increase in error will shift as the precision is increased from single to double, quadruple etc. $\endgroup$ – Charles Oct 15 '16 at 3:25
  • 2
    $\begingroup$ @SpencerBryngelson $h^2+\epsilon h^{-1}$ is minimized at $h\sim \epsilon^{1/3}$, so a minimized error at $h\approx 10^{-5}$ makes sense for double-precision arithmetic with $\epsilon\approx 10^{-16}$. $\endgroup$ – Kirill Oct 15 '16 at 17:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.