# endless recursive calculation

Augustijn Pool shared this question 2 years ago

I made this app of the three body problem https://www.geogebra.org/m/esakyjxb

I store the different vector-values in a spreadsheet and calculate the next values out of the previous ones. These values are then stored in a new row. etc.

This method works, but I would rather make these calculations on the fly and thus creating a somewhat endless animation. Is this possible in Geogebra? 1

You can use a trick like this (use a formula for the slider speed to solve the ODE)

https://www.geogebra.org/m/mc2EbNa6 1

Thank you for your suggestion. I don't know if this will work for me. This is a repetitive motion, but the three body problem isn't. So can I use a formula here? 1

Yes 1

Maybe https://wiki.geogebra.org/e... is interesting too 1

Thank you, Michael, this NSolveODE code is very interesting! I will inverstigate it further.  1

a simple solution with script in t (timer)

I don't know if the formulas in the row 2 in the spredsheet are correct (at least unchanged) 1

This looks like a promising solution. Thank you! I don't know scripting that well, so I'll look into it. The animation doesn't match mine because I calculated row 3 out of row 2. This has to do with the speed of the body. In row 1 speed is still 0. But I think I can work that out myself.  1

Maybe it can be donw without the NSolveODE command, just by numerical calculation: here is an example of an attracttor without considereing mass

Details to build it are here.

You just need to figure out how to add the mass.

A 3D version is here too:

All these animation run endlessly. :) 1 