Planet Simulation In Python - Tutorial

preview_player
Показать описание
Welcome back to another tutorial video! In this video I am going to be showing you how to make a planet simulation using Python! The goal of this tutorial is to simulate the orbits of different planets around the sun using real astronomical values! We're also going to apply the force of gravity on each of the planets so we get an accurate elliptical orbit! I hope you enjoy!

📄 Resources 📄

⭐️ Timestamps ⭐️
00:00 | Planet Simulation
01:15 | Sponsor
02:12 | Setup & Installation
03:46 | Pygame Window Setup
09:28 | Creating Planets
18:50 | Initializing Planets (Using Real Values)
27:33 | Moving Planets Explanation (Math & Physics)
36:45 | Implementing Movement Physics
51:58 | Drawing Orbits
55:38 | Drawing Distance To Sun
59:18 | Conclusion

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️

⭐️ Tags ⭐️
-Tech With Tim
-Planet Simulation
-Planet Simluation In Python
-How to Simulate Planets
-Python Simulation Tutorial

⭐️ Hashtags ⭐️
#TechWithTim #Python #PlanetSimulation
Рекомендации по теме
Комментарии
Автор

Hey guys! Glad so many of you are enjoying this topic. Just wanted to note that I made a bunch of small physics/math errors in this video and I am by no means a physicist. Some people have politely pointed out the flaws in the simulation and that it is indeed a very rough approximation. Regardless, I think there is still a ton of value here and you can tweak/fix some parts to make it more accurate 👍

TechWithTim
Автор

It's not the first time so pretty sure it's not just a coincidence. I was thinking about this project and here you go 3 days later posting the exact thing I want. You really seem to know what your audience needs, thanks Tim!

lissankoirala
Автор

f = ma .. NOT f = m/a .. force equals mass multiplied by acceleration

renegadezed
Автор

amazing tutorial 👍

just a correction at 45:00
F = m times a (not m/a)

vishsinghania
Автор

You’re about to hit a million subs. Congrats man. Your videos are great and as someone that’s new to python <2 months they really help me understand things in a practical sense.

kevinbacon
Автор

Physics modeling is so interesting, look forward to see more like this !

matheotrouille
Автор

That was awesome! I love and appreciate how you explained the logic behind each line of code and the concepts behind the physics of the orbits :D

hyphenbruh
Автор

Thank Tim. I really enjoyed this project. I remember studying these planetary equations when I was in my undergraduate mechanical engineering program back in 1985 and I remember coding the orbit of a planet in Turbo Pascal. Crazy.

danadasachan
Автор

there's a great guy, explains the science behind planets in simplest way, claims we're confused
like NO PROBLEM.

NishantCosmos
Автор

Nice tutorial! The x and y variables are shadowing each other at you suspected at the end. The reason that it doesn't break the program is because x and y ended up being the last values in the orbit array, which happens to be the same.

amaarquadri
Автор

Thanks, Tim. It is a very nice tutorial and introduction to astronomy, physics and Python, despite some minor flaws. I've made it, add the name of planet/sun to it and re-factored it in classes PlanetSimulation and Planet (which goes beyond your tutorial). It gave me a nice step up to go further in astronomy and astrophysics (when I was as young as you, I studied astronomy, years ago). kind regards, Peter.

flashypepo
Автор

I can finally get into data simulation now that you made the perfect introduction for me.

googldeed
Автор

This is so awesome that made me understand more about Space Engine, the best Universe Simulator that I've ever seen. Thank you so much

universodacomputacao
Автор

Coming from a physicist your explanation is by no means perfect but it's good enough for what you want to accomplish and that's more than enough keep up the good work

Greatbob-quip
Автор

Five Star! Excellent. Thank you for providing detailed explanations as you are introducing the code. Simulations like this offer a good way to learn and provide a platform upon which to build more interesting simulations.

bobmorone
Автор

While watching your lecture, I immediately entered the code and tried it out on my computer.
It is perfect and beautiful.
You have been a great inspiration to me.
I will also try Earth's satellite, the Moon, the asteroid belt and other large outer planets.
It was a really fun weekend. Thank you!!!!

philosopherPsy
Автор

Great! A fascinating simulation. I would love to see some more physics simulations using forces.

devbites
Автор

I think it's important to mention that what you're doing is just an approximate solution. When using the acceleration from the force and multiplying it with the timestep, you're taking a shortcut and calculating the average speed over a timestep. Since it's a many body problem, you can't get an "exact" solution.

DevilisshDan
Автор

Thank you for the wonderful tutorial. You do an excellent job of showing and explaining each of the steps, what you're using in Python, and what each part of the program does. I just completed the CS50 Intro to Python course and was looking for a project to practice the skills taught. I have an avid interest in space so coming across this tutorial was excellent.

annajuliagiza
Автор

You are awesome, bro. Every time producing different ideas.. Keep going Tim

emirhanu