NOC: Midterm Project – Jingyi Zhu

Link: sketch, full-screen

Date: 04.03.2019

Idea and Concepts

My project idea is to simulate a planetary system and the slingshot effect of space probes by using forces in p5. I am inspired by the interesting trajectories of successfully launched space probes such as Voyager and I am interested in learning and implementing the physics behind.

I simulated the planetary system with simplified and idealized models, not considering friction on the planets. The physics concepts that I use are gravitational attraction, circular motion, centripetal force, Roche Limit, escape velocity and the third cosmic velocity. The sketches below are related formulas and computations.

Project Description

My project allows users to change the mass of the star, create different planets and launch space probes from selected planets. 

1> Planets

The velocity of the planets are calculated according to their distances to the star from where they are created. In this way, all the planets will orbit around the sun in perfect circles. The planets also rotate with a randomly assigned angular velocity, which is used later in calculating the velocity of the space probes. According to the definition of planets, they should not have “cleared [their] neighbouring region of planetesimals” (Wikipedia). Therefore, a warning will appear when the users try to create planets too close to other planets’ orbits.

Users can change planet features such as mass and color each time they create a new planet. When the mass of the star is changed after the planets are created, the planets will move off their orbits. Roche Limit is also calculated to check whether two planets or a planet and the star move too close to each other. If a planet’s Roche Limit in relation to another planet or star is reached, the planet will be destroyed.

2> Space Probes

Users can select one or more planets to launch spaces probes from. When a planet is selected, it will turn red and a little transparent, and a pointer will also appear to indicate the initial vertical velocity and the launching direction of the space probe. The initial velocity of a space probe is the combination of the space probe’s initial velocity, the linear velocity of the planet rotation and the linear velocity of the orbiting of the planet.

After launching, the space probes travel with the gravitational attraction of all the celestial bodies. The space probes might collide with each other, or be attracted to a celestial body and crash. Only when they reach the third cosmic velocity with the gravitational assist of planets can they fly out of the planetary system. By creating different planetary systems and trying different directions for launching, users can see how the acceleration and the change of direction work.

Users can also set a maximum number of planets that they want to create so as not to accidentally create unwanted planets while launching the space probes.

Process and Challenges

I first did some research on slingshot effect, the solar system and physics formulas. There was much sketching and calculation to do on paper before I start coding the physics.

For coding, I created three objects – Star, Planet and Voyager in order to implement forces more easily. To check Roche Limit and the distance to neighboring planets, I wrote object functions that check and return boolean values. I also learnt to embed the debug mode as an interactive interface.

One challenge I had was to pass the linear velocity and position of a planet to space probes. I calculated the linear velocity with the angular velocity given to the planets. Then, I added a variable to store the parent planet in Voyager object, which remembers which planet is the space probe launched from. Thus, I can use the velocity and position from the parent planet in object functions of Voyager to calculate the initial velocity and the direction.

Another challenge I had was scaling. Since the actual stars and planets are huge in mass and size, and the distances between the celestial bodies are enormous, I need to scale the values so that they can fit in a small screen. While testing my sketches, forces and velocities sometimes became too big. I wasn’t able to figure out all the calculations, so I had to manually adjust each parameter until they work well together.

Further Improvements

1> Scaling

Now, the scales of sizes and distances in my project are not accurate enough. I need to compute a set of accurate scales to fit the enormous planetary system into a small screen and create a more realistic simulation.

2> User Experience

One problem with user experience is that the planet are selected for launching space probes by default when they are created. I need to polish the algorithm so that the planets are unselected when created and users can see what the planets actually look like.

3> Space Probe Trajectories

I would like to figure out a way to draw trajectories of space probes because I think it is more interesting to see the complete route of space probes, especially the route of each flyby.

4> Visible Planet Rotation

As is suggested in the class, because of the simplistic visual of the planets, the planet rotation is not visible. I might try coloring the planets with gradient to show the rotation.

5> A Non-realistic Environment

My project tries to simulate a realistic planetary system with all the established rules and concepts. But as is suggested in the class, I might also try to ignore or change some of the rules to create a special environment to see what would happen.

References

https://en.wikipedia.org/wiki/Gravity_assist

https://en.wikipedia.org/wiki/Roche_limit

https://en.wikipedia.org/wiki/Solar_System

https://en.wikipedia.org/wiki/Centripetal_force

https://en.wikipedia.org/wiki/Escape_velocity

https://en.wikipedia.org/wiki/Planet

Leave a Reply