When solving an equation of the following form:

$$ \begin{aligned} \frac {\partial A}{\partial t} &= EB - A \\ \frac {\partial B}{\partial t} &= EA - B \\ \frac {\partial E}{\partial t} &= u \\ \frac {\partial u}{\partial t} &= u + \frac{1}{10^4}\frac {\partial E}{\partial z} - \frac{1}{10^8}\frac {\partial^2 E}{\partial z^2} - \frac {\partial^2 B}{\partial t^2} - \frac {\partial B}{\partial t} \end{aligned} $$

I am able to produce the desired output that matches figures in this text when applying a Cash-Karp method and approximating the spatial derivatives by central differences. (Backward difference approximations of order 5 for the spatial derivatives appear to work, too). The domain I am considering in the above case is from $t = [0,1000] \times z = [0,1000]$ and my step-size in the $z$-direction is $\Delta z \sim $ 1m. Once again, this code seems to work correctly.

To my understanding, explicit methods like the ones I've implemented and finite difference approximations are more accurate when using smaller step-sizes. Of course there should be a precision limit based on floating point error, but I can re-scale my variables to avoid this problem.

Now I am using the exact same initial/boundary conditions as for the above, but wanting to simply consider the domain $t = [0,1000]$ and $z = [0,10^{-4}]$. It should correspond to my solution above but simply on a reduced domain, right? Well when I run the code now, $\Delta z \sim 10^{-7}$ and it appears there are very fast and large oscillations in only the $z$-component for $A, B,$ and $E$ (larger than any oscillations than on the original larger domain). I have an adaptive step based on the Cash-Karp method and the steps seem to work perfectly fine on this domain. But it appears my solutions on $t = [0,1000] \times z = [0,10^{-4}]$ and $t = [0,1000] \times z = [0,1000]$ do not correspond. When reducing the domain of $t$, the oscillations are still present, but just not as large. To my knowledge, it's arising because of the spatial derivative approximations where a small $\Delta z$ results in a large $\frac {\partial E}{\partial z}$. But is this to be expected when using such precise values with finite difference approximations? Are these large oscillations I am observing characteristics of the true solution or simply numerical errors?

  • 1
    $\begingroup$ One way to interrogate whether an error arises from, e.g., the finite difference truncation error vs. precision error is by performing computations at two precisions (e.g. Double precision and quad precision). If differences remain the same between the two precisions, then the errors are due to (using the same example) truncation error. If the errors decrease along with the change in precision, then the errors are due to precision. $\endgroup$ – Charles Nov 12 '16 at 22:38
  • $\begingroup$ @Charlie The problem appears when $\Delta z < 10^{-7}$. When varying the precision of $\Delta z$, it doesn't appear to matter. If I use smaller $\Delta z$, the problem seems to persist. Even if I stop the code very quickly after beginning, it appears using such a small step size yields the code unstable and has large oscillations. But If I use larger $\Delta z$, these large oscillations are not present. $\endgroup$ – Mathews24 Nov 13 '16 at 22:07
  • $\begingroup$ @Charlie At the moment, I am wondering if these oscillations are truly characteristics of the exact solution or not since maybe a smaller step size is necessary to realize the true variation of the solution (akin to the Courant condition for the equations). But perhaps there is a stability limit when using explicit methods and using finite difference approximations for discretized derivatives. Perhaps making $\Delta z$ arbitrarily small when computing $\frac {\Delta E}{\Delta z} $ is numerically problematic. $\endgroup$ – Mathews24 Nov 13 '16 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.