One way to guarantee accuracy in the solution of an I.V.P. is to solve the problem twice using step sizes h and h/2 and compare answers at the mesh points corresponding to the larger step size. But this requires a significant amount of computation for the smaller step size and must be repeated if it is determined that the agreement is not good enough. The Fehlberg method is one way to try to resolve this problem. It has a procedure to determine if the proper step size h is being used. At each step, two different approximations for the solution are made and compared. If the two answers are in close agreement, the approximation is accepted. If the two answers do not agree to a specified accuracy, the step size is reduced. If the answers agree to more significant digits than required, the step size is increased.
Meysam Mahooti (2021). Runge-Kutta-Fehlberg (RKF78) (https://www.mathworks.com/matlabcentral/fileexchange/61130-runge-kutta-fehlberg-rkf78), MATLAB Central File Exchange. Retrieved .
I hope call-back rules of your code could be definitely consistent with defalut fuctions, such as ode45
I think a h is missed in the error estimated formulation in Runge_Kutta.m, and why it is so slow on the running of the test code?
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!