next up previous contents
Next: 2.3 The Gravitational -Body Up: 2. Getting Started on Previous: 2.1 Our Setting

2.2 The Gravitational $N$-Body Problem

The next day, our three friends have gathered again, ready to go.

Alice:
Hi, you're all back, so I guess you were really serious. Okay, let's write our first code for solving the gravitational $N$-body problem.

Bob:
I understand that we are dealing with something gravitational attractions between celestial bodies, but what is the problem with that?

Carol:
And why are you talking about $N$ bodies, and not $p$ bodies or anything else?

Alice:
Traditionally, in mathematics and mathematical physics, when we pose a question, we call it a problem, as in a home work problem. The gravitational 2-body problem is defined as the question: given the initial positions and velocities of two stars, together with their masses, describe their orbits.

Bob:
What if the stars collide?

Alice:
For simplicity, we treat the stars as if they are mass points, without any size. In this case they will not collide, unless they happen to hit each other head-on. Of course, we can set two point masses up such that they will hit each other, and we will have to take such possibilities into account (see volume 2). However, when we start with random initial conditions, the chance of such a collision is negligible.

Carol:
But real stars are not points?

Alice:
True. At the goal of building a laboratory for star cluster evolution is to introduce real stars with finite sizes, nuclear reactions, loss of radiation and mass, and all that good stuff. But we have to start somewhere, and a convenient starting place is to treat stars as point masses. In practice, to discriminate between the physical modeling of stars and the replacement of them with point masses, we often call those points `bodies'.

This brings me to Carol's question: why do astrophysicists talk about $N$-body simulations? This is simply a historical convention. I would prefer the term many-body simulations, but somehow somewhere someone stuck in the variable $N$ as a place-holder for how many bodies where involved, and we seem to be stuck with that notation.

Carol:
Fine. Let's pick a language and start coding! I bet you physics types insist on using fortran?

Alice:
Believe it or not, most of the code to be overhauled has been written in C++, and I suggest that we adopt the same language. It may not be exactly my favorite, but it is at least widely available, well supported, and likely to stay with us for decades.

Bob:
What is C++, and why the obscure name? Makes the notion of an $N$-body seem like clarity itself!

Carol:
Long story. I don't know whether there was ever a language A, but there certainly was a language B, which was followed alphabetically by a newer language C, which became quite popular ...

Bob:
...are you making a pun on our names?

Carol:
No, I'm not kidding. Then C was extended to a new language for object-oriented programming, something we'll talk about later. In a nerdy pun, the successor operation ``++'' from the C language was used to indicate that C++ was the successor language to C. Don't look at me, we'll have to live with it.


next up previous contents
Next: 2.3 The Gravitational -Body Up: 2. Getting Started on Previous: 2.1 Our Setting
The Art of Computational Science
2004/01/25