Our fourth class explored numerical simulation, a common computational tool for solving complex, many-body problems. In its most basic classical form, numerical computation is the process of solving for the position (x) and velocity (v) of every object of mass m in a system with a given force law (F) using Newton’s Laws of Motion, following a two-step iterative process:

with the initial starting points for position and velocity. These equations are just the definitions of acceleration (with **a** = **F**/m) and velocity for a finite timestep Δt. Letting Δt go to 0 yields the differential forms for instantaneous acceleration and velocity.

If you have a simple force law and a system of one or two objects, these equations can generally be solved analytically. Real systems, however, have many (e.g., 6×10^{23} in a mole) interacting objects governed by complex force laws that may themselves be dependent on the objects’ changing positions and velocities, necessitating the use of high-speed supercomputers and special techniques to reduce the computational load. However, some insight into the interactions of a simple N-body system can be done with an even more advanced computing system – our brains and our bodies.

## Pre-class assignments

To prompt the students into thinking about the use of numerical simulation, they were asked to view a couple of examples of numerical simulation in action:

- Fluid flow: http://vimeo.com/31489254
- Galaxy collisions: http://apod.nasa.gov/apod/ap130514.html

I also asked them to read about the beautiful experiments conducted by Erik Holmberg in 1941 to simulate galaxy collisions, using light as a proxy for gravity

- Summary by Andrew Jaffe: http://www.andrewjaffe.net/blog/2010/10/light-and-gravi.html
- Holmberg’s 1941 paper: http://adsabs.harvard.edu/abs/1941ApJ….94..385H

Finally, anticipating some of the students may be rusty on vector addition, they were pointed to a basic tutorial on vector addition: http://www.physicsclassroom.com/class/vectors/Lesson-1/Vector-Addition

## Pre-assessment

Numerical simulation ultimately comes down to careful accounting and vector algebra. So for the pre-assessement, I asked the students to state the differences between motion quantities:

**Position vs. Displacement**: Most of the students identified displacement as a “directional distance”; i.e., a vector quantity. Responses on position were insightful; most identified it as an “absolute location”; only one made the point that it was “relative to a frame”.**Speed vs. Velocity**: All students identified the vector nature of velocity as the main difference; about half related speed to change in position or distance with time.**Acceleration vs. Force**: All of the students compared these terms by defining acceleration first through Newton’s 2^{nd}Law. Remarkably, no one commented on the fundamentally different nature of these quantities: acceleration as a measure of movement, force as a measure of interaction, with mass the “transducer” between these quantities.

The second question probed knowledge of vector addition, using increasing number of vectors. This was surprisingly challenging for the students, all of whom had taken a vector math course at UCSD. Only one successfully applied the “head to tail” method to determine the net vector in all three cases. This was critical for the experiment, so we spent some time discussing vector addition after the pre-assessment.

## Class

We started off with a mini-lecture on kinematics, probing students’ ideas of kinematic quantities. We then did a series of 1D walks directed entirely by acceleration, first with simple directions (accelerate forward/backward), then pointing the direction of acceleration for free motion. The challenge was pointing not in the direction of motion (velocity) but in the direction of change of motion (acceleration).

We then expanded this task to 2D by following three sets of paths at constant speed: a straight line, a wavy line and a circle. One pass was a simple walk through. Next, the students walked and pointed in the direction of velocity, in the direction of acceleration, and then both; this is a challenge on a wavy path! After playing with this for a while, we discussed what was challenging and what techniques they used to separate velocity and acceleration in their heads as they moved. A few students learned to point “into the curve” for acceleration, but always keep velocity pointed in their direction of motion. This was summarized by one student’s comment: “velocity is the direction we move, acceleration yanks us around”.

To introduce the simulation part of the exercise, we went back to the board to discuss how position, velocity and acceleration are related to each other through the kinematic equations for velocity and acceleration. We then linked acceleration to forces, talked about different force laws, and discussed how Newton’s 3^{rd} Law codifies the “interaction” nature of forces. Finally we were ready for the “rules of the simulation game”:

## The Rules:

To start:

- Everyone in a group chooses their own mass (in “person masses”, discrete numbers close to unity), starting position, and starting velocity (in units of “feet per time step”, with a specified direction). Mark your location on the ground and the lay out your initial velocity vector with colored masking tape.
- Each group decides on a force law for their system. To keep things simple, we chose two simple attractive forces laws, F ~ 1/r (“gravity-esque”) and F ~ r (spring force), with the scaling constants chosen to be equal to unity for ease of calculation (i.e., force was measured in person masses – feet per timestep
^{2}). With practice, more complex force laws are possible.

Then, at each time step:

- Each pair of players in a group measure the distance between them, and compute the magnitude of force acting between them using their force law. Students in the class did this using their portable whiteboards.
- Divide by your mass to compute your acceleration (feet per timestep
^{2}). Since the time step is equal to 1 in our simulation, the change in velocity vector Δv = a x [1 timestep] in units of feet per timestep. - Each player in a pair lay down this change of velocity vector from their current position to the other student (assuming these are attractive forces). Both players should do this.
- Repeat steps 1-3 for each pair of players in the group
- Add all of your velocity vectors for a given player – initial and Δv’s – are added together by simply moving the tape pieces to lie head to tail. This is the net velocity at this timestep.
- The change in position Δx = v x [1 timestep] (now in feet), so the end of the net velocity vector specifies the next position. Mark this position.
- Move the net velocity vector so that it starts at this new position (but still points in the same direction); this is the initial velocity vector for the next step.
- Start again at step 1.

After a demonstration of this process with myself and one other student, the student groups started their simulations. The instructions above are not trivial, so the start up was a little slow. Common errors included:

- Forgetting to divide by mass,
- Adding the change of velocity vectors incorrectly (which matched issues seen in the pre-assessment),
- Neglecting to include the initial velocity vector in the net velocity, and
- Forgetting to carry the final velocity from the previous step through as the initial velocity of the next step.

However, in about 30 minutes, both groups had finished 5 or 6 steps of their simulation, enough to showcase some interesting phenomena, including scattering from near encounters, boundedness in the spring force law, and the role of mass.

## Post-Assessment

Despite the early struggles and few steps completed in the simulation, the students commented how “fun” vector addition was in this embodied format. While they may learn (partly – see pre-assessment) the operation of vector addition, they rarely use it in its geometric form. Most were also surprised by how much “action” occurred in their simulations even in a few steps, and how different the two simulations turned out. They also commented how great it was to have a finished product (and took plenty of pictures).

“I have never done numerical simulation before. It would be fun to program this.”

“I’d like to know more about numerical simulation algorithms”

“Visualizing vector addition on a larger scale is hard! This was surprising!”

“I was surprised by how far I ended up going, probably due to my low mass.”

“It was new and exciting to understand an application of vectors.”

“It surprised me how much fun I was having with physics/math.”

## Documents on Google Drive:

[Pre-assessment] [Facilitation Guide] [Rules for Simulation]

## Leave a Reply