Moving Stars Around
From Micasim
| Project | ACS |
|---|---|
| Project Lead | Piet Hut |
| Project Homepage | ACS |
This is a wiki import, and, eventually, update of Piet Hut's and Jun Makino's Moving Stars Around.
If you add or edit any pages below, at the top please include a link back to this page using the text:
[[Moving Stars Around|Table of Contents]]
0. Preface
- Gravity
- Galactic Suburbia
- Globular Clusters
- Galactic Nuclei
- Star Forming Regions
- Open Clusters
- Writing your own star cluster simulator
2. The Gravitational N-Body Problem
- Background
- Our Setting
- Fun and Profit
- What is the Problem, and why N and Bodies?
3. The Gravitational 2-Body Problem
- Absolute Coordinates
- Coordinate Systems
- A Fourth Point
- Center of Mass
- Relative Coordinates
4. A Gravitational 1-Body Problem
- Coordinates
- Equivalent coordinates
- Closing the Circle
- Newton's Equations of Motion
- An Equivalent 1-Body Problem
- Wrapping Up
- Choosing a Computer Language
- Choosing an Algorithm
- Specifying Initial Conditions
- Looping in Ruby
- Interactive Ruby: irb
- Compiled vs. Interpreted vs. Interactive
- One Step at a Time
- Printing the Result
- A Surprise
- Too Much, Too Soon
- A Circular Orbit
- Radial Acceleration
- Virial Theorem
- Circular Motion
- One Step at a Time
- One Integration Step: Verification
- A Different Surprise
- One Integration Step: Validation
- More Integration Steps
- Even More Integration Steps
- Printing Plots
8. Convergence for a Circular Orbit (Ruby)
- Better Numbers
- Even Better Numbers
- An Even Better Orbit
- Reasons for Failure
- Signs of Hope
9. Convergence for an Elliptic Orbit (Ruby)
- Adding a Counter
- Sparse Output
- Better and Better
- A Print Method
- From One Body to Two Bodies
10. The Modified Euler Algorithm (Ruby)
- A Wild Idea
- Backward and Forward
- On Shaky Ground
- Specifying the Steps
- Implementation
- Experimentation
- Simplification
- Second Order Scaling
11. Arrays (Ruby)
- The DRY Principle
- Vector Notation
- Arrays
- Declaration
- Classes
- An Array Declaration
- Three Array Methods
- The Methods each and each_index
- The map Method
- Defining a Method
- The Array#inject Method
- Shorter and Shorter
- Enough
13. Overloading the + Operator (Ruby)
- A DRY Version of Modified Euler
- Not quite DRY yet
- Array Addition
- Who is Adding What
- The plus Method
- The + Method
- A Small Matter: the Role of the Period
- Testing the + Method
- A Vector Class
14. A Vector Class with + and - (Ruby)
- Vector Subtraction
- Unary +
- Unary -
- An Unexpected Result
- Converting
- Augmenting the Array Class
- Fixing the Bug
15. A Complete Vector Class (Ruby)
- Vector Multiplication
- An Unnatural Asymmetry
- Vector Division
- The Score: Six to One
- A Solution
- Augmenting the Fixnum Class
- Augmenting the Float Class
- Vector Class Listing
- Forward Euler in Vector Form
- Slowdown by a Factor Two
- A C Version of Forward Euler
- A Simple Ruby Version
- A Ruby Array Version
- A Ruby Vector Version
- More Timing Precision
- Conclusion
17. Modified Euler in Vector Form (Ruby)
- An Easy Translation
- Variable Names
- Consistency
- A Method Returning Multiple Values
- Simplification
18. Leapfrog (Ruby)
- Interleaving Positions and Velocities
- Time Symmetry
- A Vector Implementation
- Saving Some Work
- The DRY Principle Once Again
- Long Time Behavior
- Discussing Time Symmetry
- Testing Time Symmetry
- Two Ways to Go Backward
- Testing a Lack of Time Symmetry
20. Energy Conservation (Ruby)
- Kinetic and Potential Energy
- Relative Coordinates
- Specific Energies
- Diagnostics
- Checking Energy
- Error Growth
- Pericenter Troubles
21. Scaling of Energy Errors (Ruby)
- A Matter of Time
- A New Control Structure
- Overshooting
- Knowing When To Stop
- Linear Scaling
- Picture Time
22. Error Scaling for 2nd-Order Schemes (Ruby)
- Modified Euler
- Energy Error Scaling
- Leapfrog
- Another Error Scaling Exercise
- Roundoff Kicks In
23. Error Behavior for 2nd-Order Schemes (Ruby)
- Modified Euler: Energy Error Peaks
- Almost Too Good
- Leapfrog: Peaks on Top of a Flat Valley
- Time Symmetry
- Surprisingly High Accuracy
- Squaring Off

