Greetings,
I so love SymPy! I had the idea of creating a simple physics engine using symbolic math rather than numerical methods. Using SymPy, I got it working. It is 2D with circles, infinite walls, and elastic collisions.
On the downside, after too many events, the expressions can get too long, so it's not really practical.
On the upside, I was able to see if, for example, a billiards break is really deterministic (no!) and reversible (not really).
I'm writing up my experience in a series of free Towards Data Science articles:
- Part 1: High-level engine applied to tennis ball and basketball drop
https://towardsdatascience.com/perfect-infinite-precision-game-physics-in-python-part-2-360cc445a197
- Part 2: What a billiards break tells us about philosophy
https://towardsdatascience.com/perfect-infinite-precision-game-physics-in-python-part-2-360cc445a197
- Part 3: Creating the low-level engine using SymPy, including setting up the physics equations (some are tricky) and getting SymPy to do the rest of the work.
https://medium.com/towards-data-science/perfect-infinite-precision-game-physics-in-python-part-3-9ea9043e3969
- Part 4, how to speed up the engine a bit (but not enough) and limitations (not yet published).
All the code is on GitHub
https://github.com/CarlKCarlK/perfect-physics
If you have ideas for simulations that you'd like me to run, please send them to me. They may become the basis of a part 5.
Thank you SymPy for making this possible.
- Carl
https://medium.com/@carlmkadie
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsympy%2Fsympy%2Fwiki%2FGSoC-Ideas&data=05%7C01%7C%7C56dc2d41e49c4b11e65908dad15015ce%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638052439135314859%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8jLPne%2Fz1pAq%2F5VSf6zcrjvf4%2FEB%2B7TR1zaCiKD5jn0%3D&reserved=0
Oscar
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
sympy+un...@googlegroups.com.
To view this discussion on the web visit
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fsympy%2FCAHVvXxRys96dNdHce8hjq36QfDyfoTGRnFzW%252ByG%253Dtx%253DVvquJFA%2540mail.gmail.com&data=05%7C01%7C%7C56dc2d41e49c4b11e65908dad15015ce%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638052439135314859%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=WCKKgq6nAPVIqzODDqy6lkynF3%2BLFPLBGg8omuMo7Mo%3D&reserved=0.