endless recursive calculation

Augustijn Pool shared this question 6 months ago
Answered

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?

Comments (9)

photo
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

photo
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?

photo
1

Yes

photo
1

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

photo
1

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

photo
photo
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)

photo
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.

photo
photo
1

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

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

Details to build it are here.

https://www.geogebra.org/m/hgwgsukv

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

A 3D version is here too:

https://www.geogebra.org/m/mss4fkxy

All these animation run endlessly. :)

photo
1

Very nicely made! Thanks.

photo
© 2021 International GeoGebra Institute