hkBattousai said:
Suppose that, input sample rate is 1 samples/second. I use Runge-Kutta method with a time step (h) which is very low compared to the sample rate and integer divisor of it; for example h=0.1 seconds. I receive an input sample, then apply it Runge Kutta method 10 times (10 = 1/0.1), then receive the next input and so on...
In this case, can we guaranty that the accumulating error of Runge Kutta (or any other derivation method) converges? In other words, will the error remain small, or it will grow up in time?
All numerical methods must produce a numerical solution that converges to the real solution as the step size goes towards zero. However, finding a fixed step size that balances truncation error, rounding error and stability is often difficult unless the system being integrated is very smooth. For simple integration methods, like Euler, the requirement for a stable solution may easily drive the step size so small that the solution globally suffers from severe rounding errors and requires much more computational effort than if done using methods of higher order.
In order to find the "right" step size, you would in practice normally employ so-called adaptive step size control when using Runge-Kutta and similar methods which works by estimating and monitoring the truncation error in the numerical solution. For instance, using RK4, a popular fourth-order method, the truncation error should be proportional with h
4 so from the same initial state you can calculate the next state using different h (say, h and h/2) and compare the normed difference in state to a set limit. If error is above limit you reduce h, if well below, you can increase h. Most ODE solver libraries implements something like this principle and allows you to specify the relative or absolute error the solver should strive to maintain.
As a further example, one RK variant, called embedded RK, allows you to calculate a step from the same state using two approximations with different orders but only with a minimum of additional computational effort, making adaptive step size control particular attractive for those methods. One common example of such a method is the Runge-Kutta-Feldberg 7/8 (aka RKF78) method.
There are plenty of good textbooks on the subject if you like to read more. I can personally recommend [1], although it is a bit old. There may be more appropriate reference if you are mostly interested in the state-space solution to a given control system.
[1]
Numerical Methods for Ordinary Differential Systems, Lambert, Wiley 1991.