Planetary Motion#

Welcome to the Planetary Motion Simulation#

Have you ever wondered how planets move around a star, like Earth orbiting the Sun? This fun and interactive app lets you create your own mini solar system on your computer screen! It shows a big star in the middle, with smaller planets circling around it. The planets move because of gravity, which is like an invisible pull that keeps them from flying away.

This simulation is easy to use, even if you’ve never tried it before or don’t know much about science. You can change things like how strong the gravity is or how many planets there are, and watch what happens. It’s a great way to see how space works without needing a telescope!

Getting Started: How to Use the App#

Don’t worry if this is your first time – we’ll guide you step by step.

The Main Buttons

  • Start: Click this to make the planets begin moving. It’s like turning on the engine of your solar system!

  • Pause: This stops the movement temporarily, so you can take a closer look without everything zooming around.

  • Reset: If things get too crazy or you want to start over, click this. It clears all the planets and sets everything back to the beginning.

  • Add 100 Planets: Want more action? Click this to add a bunch of new planets to the mix. You can do this anytime, even while the simulation is running.

Things You Can Change

The app has sliders to tweak the setup:

  • Gravity Strength: This controls how hard the star pulls on the planets. A higher number means stronger pull, like turning up the magnet. It’s not the real gravity number from science books – we’ve made it simple for the simulation.

  • Planet Radius: This just changes how big the planets look on your screen. It doesn’t affect how they move, just makes them easier (or harder) to see.

What the Screen Shows You

While the simulation runs, you’ll see some numbers updating in real-time. These tell you what’s going on:

  • FPS (Frames Per Second): This shows how smoothly the app is running. Higher is better, like a video game.

  • Number of Planets: Counts how many planets are currently in your system.

  • Average Velocity: This is the average speed of all the planets. Velocity means speed with direction, but here it’s just how fast they’re going on average.

  • System Energy: This is a total score of the energy in your whole system. Energy is like the “oomph” that keeps things moving. In a perfect setup, this number should stay about the same, showing that energy doesn’t disappear.

Hint

After you click Start, keep an eye on the “System Energy.” If it doesn’t change much, that’s good! It means the simulation is following a key rule of physics: energy is conserved, or saved, in a closed system like this one.

The Science Behind It: Simple Physics Explained#

Don’t know physics? No problem! We’ll explain everything from the basics, using easy math. We’ll show every step so you can follow along. We use algebra, which is just rearranging numbers and letters – no fancy stuff.

What is Gravity?

Gravity is the force that pulls things together. On Earth, it makes apples fall from trees. In space, it keeps planets orbiting stars.

The basic rule comes from a scientist named Isaac Newton. He said the gravitational force (let’s call it \(F\)) between two things depends on their masses (how heavy they are) and how far apart they are.

The equation is:

\[F = G \times \frac{M \times m}{r^2}\]
  • \(F\) is the force (the pull).

  • \(G\) is a special number called the gravitational constant – it’s the same everywhere in the universe.

  • \(M\) is the mass of the big star.

  • \(m\) is the mass of a small planet.

  • \(r\) is the distance between the star and the planet.

  • The \(r^2\) means you square the distance (multiply it by itself). So, if things are farther apart, the force gets weaker quickly.

In our app, the star is at the center (position 0,0), and planets are at positions like (x, y). The distance \(r\) is found using the Pythagorean theorem (like for right triangles):

\[r = \sqrt{x^2 + y^2}\]

How Does Gravity Make Planets Move?

Force causes acceleration, which changes how fast something moves. Newton’s second law says:

\[F = m \times a\]
  • \(a\) is acceleration (change in speed or direction).

So, if we know the force, we can find acceleration: \(a = F / m\).

But gravity pulls towards the star, so we need to split it into directions: x (left-right) and y (up-down).

First, the full force \(F\) is towards the star. To split it:

Imagine a line from the planet to the star. The angle is called θ (theta). The parts are:

\[ \begin{align}\begin{aligned}F_x = -F \times \frac{x}{r}\\F_y = -F \times \frac{y}{r}\end{aligned}\end{align} \]

(The negatives mean it’s pulling back to the center.)

Why \(x/r\) and \(y/r\)? That’s from trigonometry: \(x/r\) is like cosine of θ, and \(y/r\) is sine of θ.

Now, plug in \(F\) from earlier:

\[ \begin{align}\begin{aligned}F_x = - \left( G \times \frac{M \times m}{r^2} \right) \times \frac{x}{r} = - G \times \frac{M \times m \times x}{r^3}\\F_y = - G \times \frac{M \times m \times y}{r^3}\end{aligned}\end{align} \]

(\(r^3\) is \(r^2\) times \(r\).)

To get acceleration (since planets move based on that), divide by the planet’s mass \(m\):

\[ \begin{align}\begin{aligned}a_x = \frac{F_x}{m} = - G \times \frac{M \times x}{r^3}\\a_y = - G \times \frac{M \times y}{r^3}\end{aligned}\end{align} \]

In the app, we combine \(G \times M\) into one number called “Gravity Strength.” You can change it with the slider!

Starting the Planets Moving

To make planets orbit nicely (like in a circle), they need the right starting speed.

For a circle, gravity provides the “centripetal force” to keep it curving:

\[F = \frac{m \times v^2}{r}\]

(Set equal to gravity force:)

\[G \times \frac{M \times m}{r^2} = \frac{m \times v^2}{r}\]

Cancel \(m\) from both sides:

\[G \times \frac{M}{r^2} = \frac{v^2}{r}\]

Multiply both sides by \(r\):

\[G \times \frac{M}{r} = v^2\]

Take square root:

\[v = \sqrt{G \times \frac{M}{r}}\]

The app sets this speed for each planet, pointing sideways (perpendicular to the line to the star), so it starts orbiting.

Energy: Why It Stays the Same

Energy is like the total “power” in the system. There are two kinds:

  • Kinetic energy (moving energy): \(K = \frac{1}{2} \times m \times v^2\) (half mass times speed squared).

  • Potential energy (stored energy from gravity): \(U = - G \times \frac{M \times m}{r}\) (negative because it’s like being in a “well”).

Total energy for one planet: \(E = K + U\).

For all planets, we add them up. In the app, this total shouldn’t change much – that’s conservation of energy!

What You Can Learn from This App#

This simulation teaches cool science ideas in a hands-on way:

  • Gravity’s Rule: See how the pull gets weaker with distance and shapes orbits.

  • Orbits: Play with gravity strength to change how fast or curvy paths are.

  • Saving Energy: Watch how energy stays constant, a big rule in physics.

  • Busy Systems: Add lots of planets to see how they bump and interact, like a real galaxy.

If Something Goes Wrong#

Note

Too many planets might slow things down. Just hit Reset to start fresh!

If the app freezes or acts weird, click Reset to clear everything and go back to defaults. That usually fixes it. Have fun exploring!