# Projectile in Polar Coordinates

Why?  There is no why.

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).

$F_r = m(\ddot{r}-r\dot{\theta}^2)$
$F_\theta = m(r\ddot{\theta}+2\dot{r}\dot{\theta})$

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:

$F_r = -mg\sin\theta$
$F_\theta = -mg\cos\theta$

If I use these forces with Newton’s law in polar coordinates, I get:

$F_r = -mg\sin\theta=m(\ddot{r}-r\dot{\theta}^2)$
$F_\theta = -mg\cos\theta = m(r\ddot{\theta}+2\dot{r}\dot{\theta})$

Of course the mass cancels – but now I can solve the first equation for $\ddot{r}$ and the second equation for $\ddot{\theta}$.

$\ddot{r} = r\dot{\theta}^2-g\sin\theta$
$\ddot{\theta} = \frac{-2\dot{r}\dot{\theta}}{r} - \frac{g\cos\theta}{r}$

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:

$\dot{r}_2 = \dot{r}_1 +\ddot{r}\Delta t$
$\dot{\theta}_2 = \dot{\theta}_1 +\ddot{\theta}\Delta t$
$r_2 = r_1+\dot{r}\Delta t$
$\theta_2 = \theta_1 +\dot{\theta}\Delta t$
$t_2 = t_1 +\Delta t$

Now I’m all set to do a numerical calculation. Well, I still need the initial conditions. I could use this:

$\dot{r}_0 = v_0$
$r_0 =0$
$\dot{\theta}_0 = 0$
$\theta_0 = \theta_0$

But wait! There’s a problem. The calculation for $\ddot{\theta}$ 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.

Here is the program in Glowscript.

For the first run, I am going to calculate the x- and y-coordinates in each step and plot x vs y.  I know this should look like a parabola.

Boom.  That works.  Now for a plot of both r and theta as a function of time for a high launch angle.

Double boom.

# Electric Field due to a Uniformly Charged Ring

Hold on to your pants. Let’s do this.

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?

Analytical Calculation

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:

$\vec{E}=\frac{1}{4\pi \epsilon_0} \frac{q\hat{r}}{r^2}$

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:

$d\vec{E}=\frac{1}{4\pi\epsilon_0}\frac{dq\hat{r}}{r^2}$

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.

$dE_x = \frac{1}{4 \pi \epsilon_0} \frac{dq}{r^2}\cos\theta$

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:

$r^2=R^2+x^2$

I can also replace the θ by again using the right triangle to write:

$\cos \theta = \frac{x}{\sqrt{R^2+x^2}}$

Updating the tiny x-electric field:

$dE_x = \frac{1}{4 \pi \epsilon_0}\frac{dq}{R^2+x^2}\frac{x}{\sqrt{R^2+x^2}}$

This simplifies to:

$dE_x = \frac{1}{4 \pi \epsilon_0}\frac{xdq}{(R^2+x^2)^{3/2}}$

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.

$E_x = \frac{1}{4 \pi \epsilon_0}\frac{xQ}{(R^2+x^2)^{3/2}}$

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.

Numerical Calculation

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.

Here is the code on trinket.io. Sorry—I can’t embed the code in this wordpress blog (I wish I could).

This is where I start.

k=9e9
Q=10e-9
R=0.01


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.

Now let’s make the ring.

Some notes.

• 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.

N=20
theta=0
dtheta=2*pi/N
dq=Q/N


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.

points=[]

while theta<2*pi:
theta=theta+dtheta


Some notes.

• 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[0].

Next part—make the observation location. This is the spot at which I will calculate the electric field.

obs=sphere(pos=vector(.03,0.03,0), radius=R/10)
E=vector(0,0,0)


The “E” is the base electric field, it starts at the zero vector.

Now for the physics.

for p in points:
r=obs.pos-p.pos
dE=k*dq*norm(r)/mag(r)**2
E=E+dE

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.

Homework

• 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.

# Analysis of a borked lab

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.

Here is the basic structure of the lab (based on this trinket.io stuff that I wrote – https://rhettallain_gmail_com.trinket.io/intro-to-electric-and-magnetic-fields#/introduction/vector-review

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.

Lab problems

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.

# MythBusters Jr. Slinky Drop Stuff

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.

• 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.

But wait! You can try this yourself. Get two masses and connect them with rubber bands (even though rubber bands aren’t ideal springs). Hold one mass and let the other hang below. Now drop.

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.

Pretty awesome.

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.

# All About Rhett: A Resume

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.

Here is my WIRED blog stuff.

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.
• Numerical Calculations in Physics. I wrote these as tutorials for students in the calculus based physics course. It uses more vectors and stuff than the over stuff.

Again, I could list a BUNCH more stuff on python but I won’t.

Stuff I Do: Talks

I’ve done quite a few talks. Instead of listing all my talks (or my favorite talks), I’m going to list my favorite topics:

• The physics of superheroes.
• The physics of Star Wars and science fiction.
• Video Analysis (real vs. fake videos).
• The best physics models (python and stuff) and estimations.
• Science communication (blogging, MythBusters, MacGyver).
• The physics of video games.
• Learning about physics learning (education stuff).
• Physics demos.
• Physics and python.

Other Videos

I’m not a huge video guy, but I do make videos. Here is one that turned out better than I expected. It’s a video made at WIRED.

Here is one more. I like to make videos that show physics solutions.

Wait. One more. This one is a more advanced video.

The End.

Contact me if you want to work on something. I’m always looking for extra jobs.

# Intro to Chaos in Mechanics

This is really just for me so that I won’t forget.  I mean, I will forget—but then I can look back at this post and remember stuff.  Here’s to you Future Rhett.

What is a chaotic system?  Really, that’s the question—isn’t it?  There is the classic example of the double pendulumHere is some code for a double pendulum. And this is what it looks like.

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.

$x_{n+1} = 4rx_n(1-x_n)$

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.

Bifurcation Diagram

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.

# Angular Momentum and the Moment of Inertia

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:

$\vec{L} = \vec{r} \times \vec{p}$

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:

$\vec{L} = I\vec{\omega}$

Here &omega; 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.

Here is the code.  Here is what it looks like.

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 $\vec{L} = \vec{r} \times \vec{p}$.  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:

$\vec{omega} = \frac{\vec{r} \times \vec{v}}{r^2}$

For objects moving about a fixed axis, the moment of inertia is a scalar value that is calculated as:

$I = \sum_i m_i r_i^2$

Notice that if you put these two definitions together, you get (essentially):

$I\vec{\omega} = \vec{r}\times \vec{p}$

So it should work.

Two masses.

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.

Here is the program.  Here is what it looks like.

Yes, these are two unequal masses but the center of mass is stationary.  Also, I will skip the graph, but angular momentum (the z-component) is constant.

Here is a different (but similar) version of the program in which I also calculate the moment of inertia version of the angular momentum.  Everything seems to work—until it doesn’t.

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:

$\vec{L} = \vec{r}_1 \times \vec{p}_1 = \vec{r}_{com} \times \vec{p}_{com} + \vec{r}_{1r} \times \vec{p}_{1r} +\vec{r}_{2r} \times \vec{p}_{2r}$

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:

$\vec{L} = \vec{r}_{com} \times \vec{p}_{com} + I\vec{\omega}$

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.

# Update on Python Physics Curriculum

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).

Introductory Physics with Python

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 $\vec{F}_\text{net} = m\vec{a}$.  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.

• 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.

# Numerical Calculation Collection

The following are some of my best posts about numerical calculations.

# Working notes for my bouncing ball running model

I’ll be honest.  I had some problems getting my bouncing ball running model working.  Oh, here is the model.

https://www.wired.com/story/how-is-a-runner-like-a-bouncing-ball/

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.

Running model notes

I think I mostly have it working:

http://www.glowscript.org/#/user/rhettallain/folder/blog_posts/program/runningbouncemodel/edit

Here is basically how it works.  Two big ideas:

• Humans can push off the ground with some maximum force.  This force does two things – gets them off the ground and in the air so legs can move and pushes them forward
• The contact time with the ground is small and gets smaller as horizontal speed increases
• This means as the human speeds up, the ground force eventually gets to where it can only push up and not forward

Here is what it looks like so far

Here is a graph of speed vs. time

• This model reaches a max speed of about 3.5 m/s in just a couple of strides – that doesn’t seem right
• I think my Fv calc is wrong – it gives back the same speed not the needed vertical speed to get the stride time
• Need to recalcualte Fv based on pfinal
• If you want to be in the air for ts seconds, then your initial vertical velocity must be -g=dv/dt.  dv=g*dt dv = 2vstart. start=(½)gdt
• Now to calculate the force. I know tc (contact time) so F = dp/dt = m*(vy2-vy1)/tc – this is the total force = Fv-mg so Fv = that stuff +mg

Something isn’t right.  Here is a plot of position vs. time

It’s getting higher and higher (and going lower – weird)

• I’m getting stride (in air) times of 0.09 to 0.13 – that’s wrong

Ok – I think I know the problem.  I need to set the force push time loop and forget about while human.pos.y<R – I think that’s my problem

1. Once human hits the ground – calculate Fv, Fx, and tc set tcount = 0
2. While tcount < tc – set human.pos.y = ground. And set the forces
3. When tcount = tc, turn off the forces and stop holding the person

It appears there is something wrong with my Fx.

• Fx is some value for the first push – but after that it goes to zero and the Fv is maxed out.
• Werid
• There is a problem with both Fv and Fx

The problem is the time of impact – it gets too small such that the required force is HUGE

• How about a min time – and it can’t go lower?

Fmax = m*2v/t

t=m*2*v/Fmax

I think the problem is that during the contact time, the horizontal force is too much so that the human ends up going faster than the theoretical speed.

I can use the time and force and velocity to estimate the average velocity and then recalculate the time

This is the paper

https://www.physiology.org/doi/pdf/10.1152/japplphysiol.00947.2009

It has this plot.

This shows a decrease in contact time with speed

Here is what I get for a fit

This gives a contact time function of

Although this “blows up” at v= 0.  Maybe I should say tc = 0.3612 for v < 2 and this expression for v>=2

End of notes – it finally worked.