Suppose a ball is shot at an angle θ with an initial velocity v0. What will the motion be like in polar coordinates?
First, let me start with Newton’s 2nd Law in polar coordinates (I derived this in class).
Once the ball is in the air (and ignoring air resistance) the only force on the ball is the gravitational force. Yes, this would be -mg in the y-direction, but we don’t have a y-direction. Instead, we have polar coordinates. Maybe this picture will help.
The r and θ components of the gravitational force will change as:
If I use these forces with Newton’s law in polar coordinates, I get:
Of course the mass cancels – but now I can solve the first equation for and the second equation for .
It doesn’t matter that these second derivatives depend on the other stuff – I can still calculate them. Once I have those, I can create a numerical calculation to update the velocities and positions. Suppose I have everything know at time(1), then the stuff at time(2) would be:
Now I’m all set to do a numerical calculation. Well, I still need the initial conditions. I could use this:
But wait! There’s a problem. The calculation for has a 1/r term. If r is zero the universe will explode. I can fix this by having the initial r a little bit bigger than zero. Problem solved.
Suppose I have an electrically charged ring. The radius of this ring is R and the total charge is Q. The axis of the ring is on the x-axis. What is the value of the electric field along this x-axis?
You can’t directly find the electric field due to a charge distribution like this. Instead, you have to break the object into a bunch of tiny pieces and use the superposition principle. The super position principle says that the total electric field at some point is the vector sum of the electric field due to individual point charges.
Of course the electric field due to a single point change can be found as:
So, if I break this ring into a bunch of tiny points I can find the electric field due to each of these points and add them up. Yes, the smaller the points the better the answer. In fact, if I take the limit in which the point size goes to zero I will turn this into an integral. Calculus for the win (CFTW).
Let’s take a look at one of these pieces on the ring of charge. Here is a view of the ring from the side.
I can find the little bit of electric field from this little bit of charge at the top of the ring. This electric field would be:
Of course the direction of r and thus the electric field will change directions as you go around this ring and add up tiny electric fields. But WAIT! We can cheat. OK, it’s not cheating–it’s just being smart. What if you also consider the tiny piece of charge at the bottom of the ring? This would also make a tiny electric field at this same location. It would have the same magnitude as the electric from the top piece since it’s the same charge and distance. However, the y-components of these two electric fields would cancel and leave only an x-component of the field.
In fact, for every tiny piece on the ring there is a corresponding piece on the opposite side of the ring. The only surviving components of electric field will be in the x-direction. So that’s all we need to calculate.
Looking at the diagram above, I can find the x-component of this tiny electric field by using the angle θ (which I don’t explicitly know). However, I can still write down this new x-component of the tiny electric field.
Yes, this is no longer a vector. It’s the x-component of the electric field such that it’s just a scalar. But there’s still a problem. I want to add up (thus integrate) all these tiny electric fields due to the tiny charges. However, I have these two variables that I don’t like. There is θ and r. I need to replace those.
For the r, it’s clear that I can use R and x and the pythagorean triangle to get:
I can also replace the θ by again using the right triangle to write:
Updating the tiny x-electric field:
This simplifies to:
Now we need to get a better integration variable—we can’t integrate over dq. Or can we? Yes, we can. Take a look at the equation above. As you move around the circle, which of those variables change? The answer: none of them.
As I integrate over dq, I just get the sum of the dq’s—which would be Q. Boom. That’s it. Here is my final expression for the x-component of the electric field along the x-axis of this ring.
Now for a couple of checks on this result. I will let you make sure these are ok.
Does this expression have the correct units for electric field?
What about the limit that x>>R? Does this expression look like the field due to a point charge?
What is the electric field in the center of the ring?
One last thing to think about. What if you want to find the electric field at some location that is NOT on the x-axis? Then the above derivation wouldn’t work. Too bad.
Let’s do this again. However, this time I am going to create a numerical calculation instead of an analytical calculation. What’s the difference?
The analytical calculation takes the sum of charge pieces in the limit as the size of the pieces goes to zero.
The numerical calculation uses numerical values for a finite number of pieces to calculate the electric field.
That’s really the only difference.
OK, let’s just get into this. I’m going to give you a link to the code and then I will go over every single important part of it. Honestly, you aren’t going to understand this code until you play with it and probably break it.
I like to start with some constants and stuff. Here I am using k for the constant. I also had to pick a value for the total charge and the radius of the ring. Remember, you can’t do a numerical calculation without numbers.
This isn’t really needed for the calculation—but it allows us to make a visualization of the thingy.
“ring” is a built in object in VPython (glowscript).
The important attributes of this object are the position (pos), the axis—which is a vector in the direction of the axis of the ring. Radius and thickness and color should make sense.
For the next part, I need to break this ring into pieces. If I use N pieces, then I can find the location of each of the tiny charges by using an angle to indicate the location. I also need to find the charge on each tiny piece. Here is the important code.
The “dtheta” is the angular shift between one piece and the next. It’s like a clock. It’s a clock that only ticks N times and doesn’t really tell time. But each “tick” is another tiny charge. Maybe that’s a terrible analogy.
But how do we deal with all these tiny charges? What if N is equal to 50? I don’t want to make 50 variables for the 50 charges. I’m too lazy. So instead, I am going to make a list. Lists in python are super awesome.
I won’t go into all the details of lists (maybe I will make tutorial later), instead I will just show the code and explain it. Here’s where I make the tiny charge pieces.
First, I made an empty list called “points”.
Next I went through all the angular positions around the ring. That’s what the while loop does.
Now I create a sphere at that angular position and add it to the points list.
Update theta and repeat.
In the end I have a list of points—the first one at points.
Next part—make the observation location. This is the spot at which I will calculate the electric field.
The “E” is the base electric field, it starts at the zero vector.
Now for the physics.
for p in points:
print("E = ",E," N/C")
Here you can see the full power of a list. Once I make the list of tiny charges, it is very simple to go through the list one tiny charge at a time—using the “for loop”.
Essentially, this loop does the following:
Take a tiny charge piece.
Find the vector from this piece to the observation location
Find the tiny component of the electric field using the equation for a point charge.
Add this tiny electric field to the total electric field and then move on to the next piece.
Boom. That’s it. Print that sucker out. Maybe you should compare this electric field to the analytical solution. Oh wait. There’s a bunch of homework questions. Actually, I was going to do some of these but this post is already longer than I anticipated.
Pick a value of N = 10 and an observation location of x = 0.1 meters. How well does the analytical and numerical calculations agree? What if you change to N = 50? What about N = 100?
Create a graph that shows the magnitude of the electric field as a function of x (along the ring axis). In this graph include the analytical solution and plots for N = 10, 30, 50, 100.
Actually, I wanted to make that last graph. It would be great.
Oh wait! I forgot about the most important thing. What if I want to calculate the electric field at a location that is NOT on the x-axis? Analytically, this is pretty much impossible. But it’s pretty easy with a numerical calculation. Here’s what that would look like.
Oh, if you like videos—here is the video version of this post.
It happens all the time. It even happens to you. There is a new lab you want to try out—or maybe you are just modifying a previous physics lab. You are trying to make things better. But when the class meets—things fall apart (sometimes literally).
Yes. This is what happened to me this week. And yes—it’s OK.
But let’s look at the lab and go over the problems so that I can make it even better for the future.
Finding the electric field due to a point charge
This is a lab for the algebra-based physics course. It’s always tough because many of the first things they cover in the lecture class don’t have lab activities with things you can measure. Oh sure—there is that electrically charged clear tape lab, but it will be a while before they get to circuits.
So, my idea was to have the students use python to calculate the electric field due to a point charge. This would give them a safe and friendly introduction to python so that we could use it later to get the electric field due to other things (line a dipole or a line charge). It would be great.
You can look at that stuff, but basically I give a workshop style presentation and have the students do the following:
Review vectors. Add two vectors on paper (not with python).
Find the displacement vector – given the vector for a point, find the vector from that point to another point (the vector r).
Find the unit vector and the magnitude of a vector (using python).
Next, find the electric field due to a point charge for the simple case with a charge at the origin and the observation point on the x-axis. Do this on paper.
Now do the same calculation with python.
Find the electric field at some location due to a charge not at the origin (in python).
Use python (or whatever) to make a graph of the electric field as a function of distance for a point charge. Graph paper is fine. If they wanted to, they could do the calculations by hand (or use python).
Finally, give a quick overview of the sphere() and arrow() object in glowscript.
So, that was the plan.
Here are the problems students had during this lab.
Computer problems. Yes—whenever using computers, someone is going to have a problem. In this case, it was partly my fault. There was one computer that was broken and some other ones weren’t updated. Honestly, the best option is for students to bring their own.
I can see that there are some students that just sort of “shut down” when they see computer code. They automatically assume it’s too complicated to grok.
Students working in big groups. I hate having 4 students use one computer. That’s just lame.
Too much lecture. The first time I did this, I spent too much time going over vectors with not enough breaks for students to practice. I partially fixed this for the second section of lab.
Some students were just lost on vectors.
Yes, the unit vector is a tough concept.
I’ve learned this before—but I guess I need to relearn. The visualization (sphere and arrow) are just too much for many students. That’s why I moved it to the end in my second section.
So, that’s it. I am going to rewrite the lab stuff on trinket.io. I am also going to change my material for the dipole stuff that they are doing next week. Hopefully it goes well. Let’s just see.
Tonight’s episode (actually there are two episodes tonight) looks at the famous slinky drop problem. Let’s start with the first place I saw this—from Derek Muller (Veritasium) even though he didn’t invent this either.
That’s pretty awesome, right? Of course the first thing I want to do is to make a model of a falling slinky. Here is that first post.
Some important comments.
It’s important that the slinky itself has mass. You can’t use the normal assumption of a massless spring.
The best way to model a spring with mass is to have a bunch of smaller masses connected by massless springs.
When the slinky is dropped, the center of mass falls with a downward acceleration of -9.8 m/s^2.
However, since the slinky is contracting this makes the bottom of the slinky motionless.
Here is an animation of my python model.
Sorry—this code is older and I don’t have it on some online platform (I will try to update that soon). But here is the important plot. What if you look at the vertical position of the top, bottom and center of mass for this “slinky”? Here’s what that looks like.
The red curve is the bottom mass. Notice how it “hangs” there? Awesome.
But can you just put a mass (like a car) on the end of a spring and drop it? Yes, but it won’t look very cool. The key is the center of mass. You want the center of mass to fall such that the bottom mass stays in place. With a car and a spring, there is no top mass moving down faster than the acceleration due to gravity to make the bottom mass (the car) move up relative to the center of mass.
In the end, you need some type of mass at the top of the spring too. So, that could work. Two large masses separated by a spring. When you hang and then drop, the bottom mass will be stationary.
Here’s what that looks like in slow motion. Sorry about the vertical video, when I recorded this I didn’t think I would post it.
But wait! What if you want to make something like the slinky? In that case you can get a bunch of masses and connect them with rubber bands. It will be just like the python animation above, but in real life.
I should have recorded this in slow motion. Oh well.
Just for fun, here are some of my original notes in which I estimate what kind of spring you would need to do this drop thing with two cars.
Who is Rhett? Where is he from? What are his super powers? Why do you want to contact Rhett for your project? Let’s answer these questions.
Super Brief History
How about just the highlights? Yes.
Born in the past, not the future.
B.S. in physics from Benedictine University (although it was called I.B.C. back then).
M.S. in physics from the University of Alabama (including work at CERN).
Ph.D. in physics from NC State University.
Some other stuff here.
Associate Professor of Physics at Southeastern Louisiana University.
Stuff I Do: Blogging
Yes, I like to write. Blogging is the best (for me). It’s quick and free form. You can use a variety of tools (video, gif, graph, python). It’s just the best. THE BEST!
I should probably include some of my favorite posts—but there are just too many that I love. If you want a post on a particular topic (like video analysis)—just google “rhett allain video analysis” and that should get you what you need.
Oh, I also blog here—but I guess you already know that.
Stuff I Do: MacGyver
I am currently the technical consultant for the CBS show MacGyver. It’s a super fun and awesome job. But what do I do? Essentially, I help out with the “MacHacks” in the show. I look over the hacks and see if they are at least plausibly based on some real thing. Other times, I make suggestions for hacks. Finally, I offer suggestions for some of the science-type stuff that MacGyver says.
Oh, I also make DIY home-versions of hacks. Here is an example.
As a bonus, here is an interview I did with CBS KPIX out of San Fransisco on my work with MacGyver.
Stuff I Do: MythBusters
I’ve actually been working on MythBusters much longer than I have worked for MacGyver. I worked on about the last 4 seasons of the original MythBusters and then I did the reboot with Jon Lung and Brian Louden. Finally, I worked on MythBusters Jr.
So, what do I do? Really, there are two things. First thing is to do some background check on future myths. For some myths, I do some estimations and calculations to see if there is a chance of a myth working. You don’t want something that is either too easy or too hard, it should be just right.
The second thing I do is the science explanations. When there is a short explanation about how something works, I help with that.
Stuff I Do: Books
Writing books isn’t as much fun as blogging, but there it is. Here are the books I have authored.
I could talk about books more—but I’m just going to leave it at that.
Stuff I Do: Python and Numerical Calculations
It’s not my fault. If you want to blame someone—how about Bruce Sherwood and Ruth Chabay. It is through their textbook, Matter and Interactions (Wiley), that I was introduced to python and numerical calculations. It’s awesome.
Once you start solving problems by coding, it sort of gets addictive. I’ve been creating python programs since about 2003 (just a guess). Later I started putting more and more of it in my classes—and here we are.
I’m not an expert coder, but I am an expert at implementing this stuff in introductory courses. That’s what I do. I have even held workshops for teachers and educators. It’s fun.
If you want to look at the stuff I’ve done, here are three versions (all online).
Physics Python for Mere Mortals. This is an online type book with embedded code. Designed for intro students with zero previous programming experience and some physics. This is what I use in my lecture and lab courses.
Introductory Physics with Python. This is more like a full book. It’s incomplete, but the idea is to teach physics using python. I want to work on this some more.
But this isn’t the best system. The problem is that there are two coordinates—the angle for the top bar and the angle for the bottom bar. Sure, it’s cool—but what if you want to plot angle vs. time or something. You have to plot both angles vs. time and that’s a bummer.
OK, how about a model of bounded population growth? That’s just one dimensional, right? Actually, it doesn’t even have to be population, it’s just an equation—something like this.
In this expression, r is some parameter—it really doesn’t matter what. Let’s just model this expression for different values of r. I’ll use a starting x value of 0.1 and r values of 0.7 and 0.9. Here is the code.
Notice that when r = 0.7, the population reaches some stable value—but this is not true for r = 0.9.
Now for another way to look at a chaotic systems—the bifurcation diagram. Honestly, I didn’t really understand these things until I made one. Here’s what we are going to do.
Start with some initial value of x (just pick something—I’m going to use 0.5). Pick a value for r also. Let’s just start at 0.1.
Run the model for 200 iterations and throw out that data. This should allow us to look at the long term behavior for that particular value of r (throws out the transient behavior).
Now run the model for 100 additional iterations and save these.
Create a plot of these final x values vs. r.
Next increase the r value a little bit (I will increase it by 0.001)
Repeat until you get bored.
So if the model is stable after the initial stuff, then it will just keep plotting the same value of x after the first 200 iterations and you will just get a dot. If it’s not stable after the first stuff, then you will get a bunch of dots with different x values.
OK, let’s do it. Here is the code. Oh, I made a function to iterate the model. I probably should put more comments in there.
This is what it looks like.
Up to an r value of about 0.75, you only get one final x value. After that, you get two different values . With r over 0.9, it gets crazy.
OK, that’s enough for now. I just want to make sure future Rhett knows how to make a bifurcation diagram.
Let me be clear—something isn’t working with my program. However, I think the idea is solid. Also, by writing this I might be able to figure out my problem.
Two Forms of Angular Momentum
I’ll just just to the main point. I’m trying to make a connection between the two forms of angular momentum. The first is the point-particle definition. This says that the angular momentum of a point is defined as:
In this expression, L is the angular momentum, r is the position vector, and p is the linear momentum.
The other form of angular momentum is defined as:
Here ω is the angular velocity vector for a rigid object and I is the moment of inertia tensor.
Ok, let’s get started. I’ll begin with a simple case and move to more complicated stuff.
A free particle.
A particle has a mass m and moves with a constant velocity (no external forces). What happens to the angular momentum? Here is a python program for a free particle in which I also calculate the angular momentum. This is just a picture – you need to go here to run it.
Here is a plot of the z-component of the angular momentum in this case.
Notice that it’s constant. Oh, I assume you know about cross products—they are in vpython, so you don’t have to do it manually.
So, yes—angular momentum is conserved. No big surprise there. But what if you change the origin? Is angular momentum still conserved? Try it.
There is very little point looking at the moment of inertia. I’ll do that next.
Single object constrained to circular motion.
I want to get an object moving in a circle—but I don’t want to make some crazy constraint. This sounds like a job for THE SPRING. Yes, I will model an object moving in circular motion by using a spring attached to the object and some stationary thingy.
If you calculate the angular momentum (from the linear momentum), here is what you get.
It doesn’t look constant—but I think that’s just a rounding error. Reminder: this is the angular momentum from . What if I use the moment of inertia and the angular velocity? Do I get the same thing?
I can calculate the angular velocity as:
For objects moving about a fixed axis, the moment of inertia is a scalar value that is calculated as:
Notice that if you put these two definitions together, you get (essentially):
So it should work.
Using a stationary pivot point can cause some problems. Since the pivot point is stationary, there must be some external forces on the system. This means that calculating momentum and angular momentum can be difficult.
What happens if the center of mass of the system is not zero? In this case, I need to redo the angular momentum calculation. First, for the point model, it would be still be r cross p, but I can write it two ways:
In this case, the 1r subscript means the position relative to the center of mass and the momentum relative to the center of mass. The com subscript means center of mass.
For the moment of inertia method, I have:
But this is where I will stop. For some reason, I can’t get a constant angular momentum using the moment of inertia. Here is the plot of the component of momentum for the case when the center of mass is moving.
I feel like I am making some silly mistake. So, here are some notes and comments.
Maybe I am calculating the relative velocity incorrectly.
Maybe it has something to do with my definition of the angular velocity.
Note that the two masses can have slightly different angular velocities since this isn’t actually a rigid object—it’s just mostly rigid (stiff spring).
I feel like I have so many different programs, that I’m losing track of what works (that’s why I wrote this blog post).
What’s the next step? Well, after getting this calculation to work—I have big plans. The ultimate goal is to have a 4 mass rotator (4 masses connected by springs) and calculate the moment of inertia and the angular momentum. I would be very happy if I could show that the angular velocity vector doesn’t have to be in the same direction as the angular momentum vector. That would be cool.
So here is the deal. I had this idea. The plan was to include numerical calculations into the intro physics curriculum by writing a sort of online textbook. Or maybe just redo my Just Enough Physics ebook to include more numerical calculations. Anyway, this is what I came up with. It’s written with trinket.io – an online implementation of python that pretty much rocks.
Here is my curriculum (it’s incomplete – but totally free).
Here are some of my own thoughts on this curriculum (including using trinket.io):
It’s free and online. That’s mostly good – but I don’t know if online is the best format for physics.
There is one thing about trinket.io that makes this rock. There is python RIGHT IN THE PAGE. Readers can view and run code – no logging in, no saving, nothing. Just edit and run. No barriers.
It has the same idea as Just Enough Physics in that it goes over the basic stuff – but doesn’t overload the student with tons of different ideas (no fluid dynamics, waves, buoyancy, sound…). It’s not that those are bad topics, it’s just too much. Too much.
Homework. Students want homework questions. I sort of added those in – but students seem to want traditional homework questions.
Now for the part that needs work. Well, all of it needs work – it’s not complete. But I made an error – I figured I would finish this curriculum as I was using it to teach the summer session of physics, but the pressure was too much. In the end, I think I made it too much like the traditional format of a textbook (with the traditional order of topics). Really, I started along the best path – but went off the rails when I wanted to do a problem that involved new physics. So, I just added that new stuff in there.
I need to rethink just what I want to cover – and here is my new plan.
Kinematics in 1-D and 2-D. I like starting with kinematics because students can model motion and this works great with numerical calculations. The one problem is that you have to use acceleration instead of change in momentum – and this messes up with my momentum principle. Actually, maybe I will just do 1-D motion so that I don’t need vectors.
Forces. I don’t really want to focus on forces and equilibrium, but the students need this to do more stuff. In this, I need to do the following.
Vectors. Boom – need vectors.
Special forces: gravity, real gravity, maybe Coulomb force.
What about friction, and forces of constraint (like the normal force)? Here you can see how it gets out of hand. Friction is super crazy if you think about it – so are normal forces.
What if I just did simple forces – like pushing with your hand or rockets?
Momentum Principle. Here I need to make a connection between forces and motion. Since I used acceleration before, I need to make a connection between the momentum principle and . Honestly, I hate calling this Newton’s Second Law – it seems wrong.
But what about circular acceleration? How do you deal with that? I don’t know. Maybe just avoid it for now.
Work Energy Principle. I think this is mostly ok – except I need to introduce the spring force and spring potential energy.
Angular Momentum Principle. My initial idea was to cover “Three Big Ideas” – momentum principle, work-energy, angular momentum principle. However, there is SO MUCH baggage associated with angular momentum principle. Much of this stuff is just beyond intro-level students.
I think I have a new plan.
Start with kinematics in 1-D.
Forces – but simple stuff. No friction. No normal forces. All the examples will be in space or something.
Momentum Principle and acceleration. Again, normal stuff. No forces of constraint. Mostly space stuff because that will be fun. Projectile motion stuff too.
Work-Energy Principle. Springs, gravity, dropping objects. Orbits.
Special cases. Instead of Angular Momentum, I’m going to go over forces of constraint, friction, normal forces, circular acceleration.
The end. Oh, I need to make sure there are plenty of exercises for students. Rewrites coming.
Basically, this models the speed of a running human by assuming they are bouncing ball. When the human impacts the ground, there is some maximum impact force and an impact time. The impact time decreases with horizontal velocity such that eventually, all the force is used in the vertical direction to keep the human off the ground long enough to switch feet in the air. The end.
As I was making this model, I took some notes because I couldn’t get it to work. Here are my notes. Hopefully you can use this to see how to troubleshoot a program.