Artificial intelligent assistant

Procedure for adaptive step size for Runge Kutta 4? I am writing a Runga Kutta 4 algorithm in MATLAB. I would like to add adaptive step sizing to this algorithm. From what I've read it seems you calculate the value of the function for two step sizes on each iteration and then from the size of the error terms you deduce which one to use as $y_{i+1}$. But I can't see any advantage in efficiency if you are calculating two potential $y_{i+1}$'s on each iteration. Obviously I am missing/misinterpreted something as I have read that adaptive step sizing can lead to huge performance increases. So how does adaptive step sizing work for RK methods and can someone tell me the steps I need to implement?

I think for adaptive size, typically what is called a embedded method is used. Basically one set of coefficients gives the next step, and another set gives the error estimate. Look for Fehlberg method <

The advantage comes from the fact that the overall number of steps may be less, even though there are more evaluations for each step. Obviously this is not always the case and a fixed step RK is the best bet for many types of problems.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy fd079b20372b29e4242fc55ec09291fb