# Spring Motion and Numerical Calculations

Maybe you know I like numerical calculations, well I do. I think they are swell. [VPython](http://vpython.org) is my tool of choice. In the post [Basics: Numerical Calculations](http://blog.dotphys.net/2008/10/basics-numerical-calculations/) I used vpython and excel to do something simple. I will do that again today (in that this problem could also be solved analytically). However, there is one big difference. This problem has a non-constant forces. Suppose I have a mass that is connected by a spring to a wall. This mass-spring is sitting on a table with no friction.

There is a very interesting property of springs. The more you stretch them, the greater the force they exert (in the usual model of springs). This model works very well.

This is known as Hooke’s law. I have written it as a scalar for simplicity. The “k” is called the spring constant. It is a measure of how “stiff” the spring is. The value “s” is the amount the spring is stretched. Typically, there is a minus sign in front of the ks to indicate that the force is in the opposite direction that the spring is stretched. Really, in a scalar equation this is rather silly to include (but everyone does anyway).

**Question: What will the motion of the mass be like if I pull it back and then let go?**

Although this can be determined analytically, I am going to first calculate this with vpython. I will try to show all the details so that you can reproduce this also. If you have not already installed [vpython](http://vpython.org), do that now (don’t cost nothing).

# Basics: Numerical Calculations

**Pre Reqs:** [Kinematics](http://blog.dotphys.net/2008/09/basics-kinematics/), [Momentum Principle](http://blog.dotphys.net/2008/10/basics-forces-and-the-momentum-principle/)

What are “numerical calculations”? Why are they in the “basics”? I will give you really brief answer and then a more detailed answer. Numerical calculations (also called many other things – like computational physics) takes a problem and breaks into a WHOLE bunch of smaller easier problems. This is great for computers ([or a whole bunch of 8th graders](http://blog.dotphys.net/2008/09/computational-physics-and-a-group-of-1000-8th-graders/)) because computers don’t mind doing lots of little problems. Why are they “basic”? Well, most text would say they are not basic. I disagree. I think this is a legitimate method for solving problems. In particular, this is a great way of solving problems that can not be solved analytically (meaning solving one hard problem).

**Numerical Calculations are Theoretical Calculations**

Let me just get this out of the way. Numerical calculations and analytical calculations are really in the same “class”. Often people will lump numerical in with “computational experiment” but that is a really bad thing to do. Some others will claim that there are three different “paths” to discover stuff in science: theory, experiment, and simulations. Simulations are the same thing as numerical calculations which are the same as theory. ([I wrote a letter about this in the American Journal of Physics](http://scitation.aip.org/getabs/servlet/GetabsServlet?prog=normal&id=AJPIAS000076000009000797000001&idtype=cvips&gifs=yes))

**Example Problem**

Let me start with a problem that can be solved analytically. Suppose I have a ball of mass 0.5 kg and I throw this straight up with a speed of 10 m/s. How high will it go?

# Gravity, Weightlessness, and Apparent Weight

In my classes, I like to bring up the question:

*Why do astronauts float around in space?*

The most common response to this question is that they float around because there is no gravity in space. Some people take this a small step further and say that there is no gravity in space because there is no air in space. This is why they claim there is no gravity on the moon (even though there is – more on this later).

I like to start off with the concept of gravity. Gravity is an attractive force between any two objects with mass. Your pencil and your dog both have mass so there is a force pulling your dog and your pencil (that is if you have a pencil) together. This force turns out to be extremely small. So small that you would never notice it. However, if one of the masses is very large, it is noticeable. An expression for the gravitational force was first determined by Newton. He came up with the following (turning off vector notation for simplicity).

Where G is the universal gravitational constant, m1 and m2 are the two masses in the interaction and r is the distance between their centers. This force (as are all forces) is really a vector that points from one mass to the other.

# Physics of Linerider III: Air Resistance

There is no air resistance in line rider. Sorry to spoil the suspense.

To test for the presence of an air resistance force, a track was created that let the rider fall.