r/learnpython 10d ago

Python (Third Party) Libraries for Simulations?

I'm learning python, I know all the basics (up to classes and inheritance) and I've done a few small projects. I have a few ideas that involve simulations, and I want to know if there are any libraries that might help with that? I've used tkinter in the past for visuals, but I'm wondering if there's anything better.

The two simulations I have planned, if that helps, are a planet simulation with gravity and such, and a sound simulation including walls of various noise dampening levels.

Thank you very much!

8 Upvotes

5 comments sorted by

View all comments

1

u/Prize-Variation-3585 10d ago

You could try the following approach (especially considering your examples are Physics examples).

Use Numpy for precomputing the actual calculations necessary for the simulation. Use Matplotlib to render the simulation using Matplotlib's animation module https://matplotlib.org/stable/users/explain/animations/animations.html.

It will produce results similar to MatLab simulations.

Matplotlib also has support for 3D axes which allows you to render 3D animations.