This is a set of codes for private project.
Team member: Yukei, Tom, Savannah
Updated: 11/21/2018
Physics 77 project team 2018. All rights reserved.
- N-body simulation of galaxy development(2D?)
- Animation of simulated data
-
Take initial condition of N-particles (coordinate and velocity)
-
Run gravitational simulation to calculate next position and velocity
-
Loop above
-
After creating data table (coordinate axis and time axis), show animation
- almost uniform distribution of particles with small random fluctuation of density
- having tangential velocity against single center point (origin)
# starlist: Table of star information at given time.
# Contains (1) coordinate and (2) velocity
# for each particle (=star).
# gal_hist: History of the Galaxy.
# Table of starlist with time axis.note: function names are represented by bold letters
-
data_read():
- Take in initial 'starlist'
-
Prepare an array as gal_hist
-
time_development(): for time t_next,
- Prepare 'starlist_next'
- Starloop(): for star[i],
- net_force():
- calculate force between i-j
- dist(): calculate distance
- force_ij(): calculate force value
- components(): break force in component form
- add all force in component form
- get (return) net force on star[i]
- calculate force between i-j
- accel():
- get (return) acceleration of star[i]
- pos():
- get (return) next coordinate from r & v & a
- vel():
- get (return) next velocity from v & a
- append star[i]'s data to 'starlist_next'
- net_force():
- vStack 'starlist_next' to 'gal_hist'
-
animate():
- show animation of position of stars over time