Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Other Sciences
Programming and Computer Science
Building a Solar System simulation with python
Reply to thread
Message
[QUOTE="TheJP78, post: 6651873, member: 702787"] Hey'all. First of all, I'm not fluent in English, so forgive me for the spelling mistakes. So, I'm trying to make a simulation of a solar system using python 3.9. It's not complicated, but my teacher wants me to do it using the Basic Verlet method, and that's what is bugging me. He told me do do divide the code in three steps: Sun-Earth, Earth-Moon, and then the rest of the planets. He also told me the basics to initialize the code: 1. creat a function called acceleration(r, v) that contains the position r(x0, y0, x1, y1, ...) and the velocity v(x0, y0, x1, y1, ...); 2. use the acc(r, v) funtion and the verlet method to calculate the position of the Earth relatively to the sun (the sun will be located in r=v=0); 3. the same case as the above, but now for the earth-moon and the other planets. He wrote a short instruction for me (linked bellow). My problem is to define the acceleration function. I found a similar code on stack overflow ([URL]https://stackoverflow.com/questions/37800349/verlet-integration-in-python-resulting-in-particles-running-away[/URL]) and tried to modify it, but didn't work. If anyone could help me I will be forever grateful. [ATTACH type="full"]304147[/ATTACH] [/QUOTE]
Insert quotes…
Post reply
Forums
Other Sciences
Programming and Computer Science
Building a Solar System simulation with python
Back
Top