When modeling a system with a step h1 using the simple Euler method, the error a1 was obtained, and the 4th order Runge-Kutta method obtained the error b1. How can i determine the values of errors a2 and b2 that will be obtained by modeling this system with a step of h2.
I tried formulas a2 = a1(h1 / h2), b2 = b1(h1 / h2)⁴ But I'm not sure if these formulas are correct. I have
h1 = 10^-5
a1 = 3.0 * 10^-3
b1 = 0.2 * 10^-12
h2 = 5 * 10^-3
You are not calculating the error, but estimating from one error to the next. Or calculating an estimate for the error.
Mainly, your formulas need to be the other way around,
h2/h1. You are using the modelThe flow of information is: from
a1andh1determine guess forC_a, and with that compute the guess fora2. ThusThe error as function of the step size usually has a V shape in a loglog plot, falling like
1/hfor small step sizes, then rising linearly as per the order, then becoming wavy then chaotic for step sizes near the stability boundary. See for exampleSo to get a correct estimate one needs that
h1andh2are both in the second or middle segment where the error behaves as per the error order of the method.