Here I provide two Python classes to simulate many-body systems. The many-body systems are two dimensional and following the rules in classic physics. The bodies interact with each other purely via gravity.
I have shown some examples of two-body systems and three-body systems. You can feel free to change the parameters and find out the differences.
Trajectories of a stable two-body system.
Trajectories of an unstable three-body system.
All the codes are in the Jupyter notebook