# vpython

Let me start with the video. Here is a guy flying a plane in a barrel roll and pouring some tea at the same time. Talk about multitasking.
How can he pour upside down? Well, there are two ways to look at this. First, I can look at this in the frame of the plane. For this case, I can invoke the fake force - centrifugal force. Oh yes, I am going to do it. You probably remember all your physics instructors warning you to never ever do this. Well, they say that because they are afraid you will do something bad with it. Here, I will only use the centrifugal force for good.
What is the…

I have seen several videos similar to this.
Real? Fake? How many tries did this take? Let the analysis begin. Before I do any analysis, let me state that I think this is not fake. I do not know that for sure, just my first guess.
How would I tell if it is real or fake? This is tricky. I can't really get a good trajectory of the ball to make some measurements on it because of the camera angle (next time people, make sure you set the camera up perpendicular to the plane of motion and far enough away to avoid perspective problems - thanks!) Really, the best I can do is to look at the…

(alternate title: how to make pretty graphs in vpython)
I am happy. Finally, I can use the visual module in python (vPython.org) and plotting with Matplotlib. Maybe this isn't such a big deal for many of you, but for me, it never worked until now.
In the past, I blogged about plotting in vpython vs. matplotlib. My conclusion was that it was easier in vpython, but prettier in matplotlib. So, why not just use matplotlib? There are a couple of things that make vypthon very attractive.
Vectors. Vpython has a built in vector class (or function - I don't know what I am talking about). There…

In my last zombie post, I looked at a human moving in a circle to avoid a zombie (if they are stuck in a room). What if I build a zombie evading robot that always moves perpendicular to the path of the zombie? Would this work?
This shouldn't be too difficult to model. I can use my existing model for the zombie (where there is a force towards the human and a drag force). For the right-turning-robot, I will also have a drag force and a "driving" force. How do I find the direction of the driving force for the robot? Here is a diagram.
This Fdrive force will really be the frictional force…

Title: Chased by zombies
When I heard word about the ScienceBlogs Zombie Day, I knew I wanted to participate with a post - but I had no idea what to do. My first thought was to somehow talk about living off the electric grid in the case of a zombipocolypse - you know, like how big of a solar panel would you need?
But you know what? Physics is difficult - but modeling is easy. How about I model something? How about a model for the motion of a zombie horde? This will be great.
Zombie motion model
What do I want in my model? What are the constraints? What real-life situations can I use to…

So suppose you saw something that looked like this:
This is a ball shot out of a shooter device. Well, it is a vypthon animation of a ball. What would you do if you came to see this video? If I had not made it, I would say it is an unrealistic video. It does not agree with my basic model of how things move after being thrown or shot or whatever. Interestingly (but unrelated) there was a set of physics questions that showed different possible paths of a thrown ball. The path representing the motion above was a common choice.
Like I said, I made that animation. Here is another one. In…

Recently, I was talking about vectors. At that time, I had to stop and recall how I had been representing vectors. Ideally, I should stick with the same notation I used in Basics: Vectors and Vector Addition. But let me go over the different ways you could represent a vector.
Graphical
Maybe this is too obvious, but it had to be said. You can represent vectors by drawing them. In fact, this is very useful conceptually - but maybe not too useful for calculations. When a vector is represented graphically, its magnitude is represented by the length of an arrow and its direction is…

In part I of this post, I talked about the basics of projectile motion with no air resistance. Also in that post, I showed that (without air resistance) the angle to throw a ball for maximum range is 45 degrees. When throwing a football, there is some air resistance this means that 45 degree is not necessarily the angle for the greatest range. Well, can't I just do the same thing as before? It turns out that it is a significantly different problem when air resistance is added. Without air resistance, the acceleration was constant. Not so now, my friend.
The problem is that air…

Looking back at part I of this idea, I don't think I did a very good job. Let me summarize the key things I wanted to say:
Normally, there are two ways of modeling the motion of an object:
Calculating the forces on the object and using the momentum principle or Newton's second law (which are the same thing). I called this the Newtonian way. The problem with this method is forces that constrain the motion (like the normal force). These forces have a variable magnitude to make the object stay on a particular surface.
Defining some variables that describe the system as it is constrained.…

Every introductory astronomy text and most intro physics texts talk about tides. The usual explanation is something along the lines of:
The moon exerts a gravitational force on the Earth and all the stuff on the Earth.
This force decreases with distance (1/r2).
Thus the moon pulls greater on one side of the Earth than the other
This doesn't matter except for oceans which can move.
BOOM. Two tides a day due to a bulge on the side close to the moon and the opposite side.
Oh, the Earth is slowing down.
Really, that is what almost all intro texts say. Go check for yourselves.
Yes, the tides…

I am not a programmer. Just to be clear. I use python to get things done, but I am sure it could be done in more efficient ways. Anyway, I sure you know how much I like vpython - especially for teaching physics. However, sometimes I use it for blogging stuff also. The problem is that vpython doesn't make pretty graphs. Oh, they are quick and simple - but sometimes you want pretty also. Well, what if you just don't use vpython? Of course then I could use some other plotting package like pylab (which actually uses something else like matplotlib or something - I get confused). Or, I…

In part I of this post, I talked about the basics of projectile motion with no air resistance. Also in that post, I showed that (without air resistance) the angle to throw a ball for maximum range is 45 degrees. When throwing a football, there is some air resistance this means that 45 degree is not necessarily the angle for the greatest range. Well, can't I just do the same thing as before? It turns out that it is a significantly different problem when air resistance is added. Without air resistance, the acceleration was constant. Not so now, my friend.
The problem is that air…

VPython 5.0 is mostly out (in release candidate). To tell you the truth, I have been holding off on some vpython programs because I wanted to do them in the NEW vpython, not the OLD vpython. So, if you want to get the new vpython, go to http://vpython.org/index5.html. What is so great about VPython 5.0? Here a couple of things:
Runs in Mac OS X without X11. Maybe this isn't that big of a deal, but it makes me happy. If you don't use OS X, I guess this doesn't matter.
Textures. You can map textures and images onto objects. This won't really help with the calculations, but it will make…

Numerical calculations are grand. Of course, they are just another form of normal calculations - like I have said before. So, I have mostly used [VPython](http://vpython.org) for my calculations on my posts. But there is a new game in town: [Easy Java Simulations](http://www.um.es/fem/Ejs/). What is the difference between these two? Which is better for students? Which is better for me? What are their strengths? What other questions are there? What other questions are there?
**VPython**
Let me start with [VPython](httP://vpython.org) since I am more familiar with that. VPython is…

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://scienceblogs.com/dotphysics/2008/10/basics-numerical-calculation…) 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.
![…

**Pre Reqs:** [Kinematics](http://scienceblogs.com/dotphysics/2008/09/basics-kinematics.php), [Momentum Principle](http://scienceblogs.com/dotphysics/2008/10/basics-forces-and-the-moment…)
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://scienceblogs.com/dotphysics/2008/09/…

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…

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.
![linerider air 1](http://scienceblogs.com/dotphysics/wp-content/uploads/2008/09/linerider…)
(note the markers on the side. These are used to keep track of how the origin is moving).
Below is the y position of the rider as a function of time:
![linerider falling](http://scienceblogs.com/dotphysics/wp-content/uploads/2008/09/linerider…)
In this situation, the rider falls about 100 meters. A quadratic line is fit to the data…