# Newton 2 on a spreadsheet

#### Prerequisites

Once we view Newton's second law as a pair of stepping rules to move from position and velocity $x_1$ and $v_1$ at a time $t$ to position and velocity $x_2$ and $v_2$ at a time $t+dt$,

$$v_2 = v_1 + \frac{F^{net}(x_1,v_1)}{m} dt$$

$$x_2 = x_1 + v_2 dt$$

it's really easy to set it up on a spreadsheet.  This allows you to use N2 to predict the future motion of an object if you know the starting position and velocity and what forces it will encounter as it moves. Here's how to do it.

1. Set up a column for the times, the positions, the velocities, and the forces.
2. Set up cells that will contain the mass, m, the time interval, $dt$, and any parameters that the forces depend on.*
3. Put starting values for the time, position, and velocity in the first row below the variable names.
4. In the next row put equations to update the variables.
5. Copy these down to as many rows as you want to calculate.

Here's a specific example.  Suppose the force is "$-kx$".  That is, it is proportional to the position and pushes back by an amount proportional to $x$.  (This is like a spring.) Set up cells that contain the parameters $dt$ (time interval), $m$ (mass), and $k$ (spring constant).  If you have

• time in column A
• position in column B
• velocity in column C
• force in column D
• acceleration in column E

then here is what your second row would look like.  The cell label is shown in parentheses first. This is not to be included; it's just to show you where this equation goes. We assume your first data is in row 2 since labels are in row 1. Note that if you name the cells with parameters in them, you can use the names — $dt$, $k$, $m$ — in your equations.*  If you don't, you have to use the cell label but with dollar signs to keep it from changing the cell ID when you copy down.  (Like this:  if "$dt$" is in cell H3, you have to write it as $H$3.)

 (A3) =  A2 + dt (B3) = B2 + C2*dt (C3) = C2 + E2*dt (D3) = -k*A2 (E3) = D3/m

This is how these are read conceptually:

 New time = old time + dt New position = old position + current velocity * dt New velocity = old velocity + old acceleration * dt Force = function of old position New acceleration = force/m

For this to work, the time step has to be small enough that the force doesn't change a lot over the step.  We are basically assuming that the force is a constant over the time step and if the time step is too big that may not work.  To check if your time step is good enough, take a smaller step— say half the size of your original step — and do twice as many steps.  If your original time step was small enough this should give you the same answer at the same final time.

* In Excel, it's easy to actually give the cells containing parameters names so you can refer to them by name in your equations.  Decide which cell you want to put the information in.  (I always put the name of the parameter with an = in the cell to the left so I remember what's what.) Put your number in that cell. For example, in the function line in the clip from a spreadsheet shown below, the function box shows that the value in the selected cell is 0.1 and the name box (at the top left) shows that the cell is cell labeled "H3".

If you go into the name box at the upper left where it says H3, select it and now type in "dt", it will give that name to the value in the cell.  You can then use that name in your formulas.  Once you've done that, it looks like this.

Joe Redish 9/17/11

Article 363