Hey guys,(adsbygoogle = window.adsbygoogle || []).push({});

Attempting to write an adaptive step size function into a 4th order runge kutta integrator for basic orbits.

The problems (so far) are as follows:

1.) The step size does not seem to change as one would expect if the recursive definition of the StepSize function was working properly

2.) When compared with the mathematica solution, it would seem the orbit doesn't extend as far as it should in time, ie the arc length is shorter. It would seem this is due to the coordinates remaining constant after a certain point.

Code can be found here:

http://members.iinet.net.au/~housewrk/programtest.cpp [Broken]

Apologies in advance for stupid errors and crappy coding :)

Cheers

-G

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Adaptive step size algorithm in c++ for runge kutta

Loading...

Similar Threads - Adaptive step size | Date |
---|---|

What is each step of this Matlab program doing? | Feb 21, 2018 |

Python Memorizing syntax/steps vs. looking things up | Jan 14, 2018 |

Next step C coding for electrical engineer Stuff | May 12, 2016 |

Question about CMA-ES step size sigma | May 10, 2016 |

Fortran adaptive step size problem | Oct 28, 2010 |

**Physics Forums - The Fusion of Science and Community**