creating a 2-d model of the solar system using physics-based geometries in java. brian tubergen

18
Creating a 2-D Model of the Solar System using Physics- Based Geometries in Java. Brian Tubergen

Upload: emily-reed

Post on 08-Jan-2018

219 views

Category:

Documents


0 download

DESCRIPTION

Scope of Study Program “action at a distance” gravitation force: F = G*m*M/r^2 Acquire real world position/velocity planetary data or find an equation that can give it to me and compare it with simulation Allow for future implementation of non-coplanar orbits (ie: program a z component of position, velocity, etc.) for 3-D purposes

TRANSCRIPT

Page 1: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Creating a 2-D Model of the Solar System using Physics-Based

Geometries in Java.

Brian Tubergen

Page 2: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Purpose/Subject/Goals Create a working simulation of the Solar System Implement Keplerian/Newtonian models to control

planetary motion Allow for development of user interaction with

simulation: ability to add customizable solar bodies

(comets, planets, etc.) at a given location and see

what reaction of Solar System is Transition 2-D simulation into 3-D

Page 3: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Scope of Study Program “action at a distance” gravitation force:

F = G*m*M/r^2 Acquire real world position/velocity planetary data

or find an equation that can give it to me and

compare it with simulation Allow for future implementation of non-coplanar

orbits (ie: program a z component of position,

velocity, etc.) for 3-D purposes

Page 4: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Similar Projects

The basic Solar System part of the project is a visual recreation of the Keplerian model of planetary motion

Other Solar System simulations exist, but none

that I’ve seen allow user interaction to the extent

I’d like to with user addition of solar bodies My program could be modified in future to do this

Page 5: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Theory/Design Program written in Java (for now, for 2-D) Create a class that essentially handles the creation

and management of the panel itself (Display class) Create a class that can represent a planet and

contains data on that planet’s position, velocity,

etc. (Sprite class)

Page 6: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Theory/Design cont.

Update the positions of the planets one at a time and iteratively, where at each step the planet’s acceleration is updated based on the position of each other body

a = G*m/r^2 Every solar body’s acceleration is calculated based on

every other body, if that makes sense

Page 7: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Testing

Acquire real world (or equation based) position and velocity data after one year has passed for each planet and compare to my simulation’s output

Verify that my simulation runs more or less

correctly (matches real world position data)

Page 8: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Testing Cont.

Page 9: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Problems I ran into Issues with iterative calculation of forces

Solved, although Mercury’s orbit seems to be incorrect Issues handling how to let each planet know about

the other planets/bodies in the system Necessary to calculate accelerations correctly Solved, although I had to send/receive a lot of data and

this probably caused rounding errors

Page 10: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Problems cont.

Determining the most intelligent and easiest way

to compare position data from my program to

position data from NASA Decided to simply output data and do basic analysis in

spreadsheet program

Page 11: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Timeline 1st quarter:

Get iterative force/acceleration calculations working for multiple bodies interacting

2nd quarter: Fix bugs with said calculations and resulting motion

3rd quarter: Verify that the equations actually work based on solar

system data 4th quarter:

Wrap up/conclude project; Implement user interaction with simulation if I have time

Page 12: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Results

Page 13: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Results cont. Solar bodies appear to move elliptically,

hyperbolically, parabolically, etc. as they should Real initial position/velocity values have been

assigned Planetary orbits are mostly circular (as they should

be), although Mercury’s appears slightly incorrect

Page 14: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Position Data (my simulation and NASA)

Page 15: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Percent Error

Page 16: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Results cont.

Predicted data from my simulation compares favorably to actual data from NASA

Inner planets are worse; their movement is a rougher estimate because they move more/faster than outer planets

Good predictor for outer planets, however

Page 17: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Causes of error Why are planets closer to the sun “worse” than

planets farther from the sun?

They move more in a given time interval than planets farther from the sun

Ultimately means that their accelerations are adjusted less per distance traveled than other planets This is an issue since acceleration depends on location

(distance) This means their accelerations are more incorrect more

often, which entails more error

Page 18: Creating a 2-D Model of the Solar System using Physics-Based Geometries in Java. Brian Tubergen

Conclusion Valuable tool for basic visualization of planetary

motion

Fair predictor of planetary positions for small increments of time

Better for outer planets

Possibility for modification User interaction with simulation Intrusive body testing – What would solar system’s

reaction be to a massive asteroid passing through it, for instance?