I need a nice model to predict the final velocity when two balls collide elastically. Don’t worry why I need this—just trust me.
After working on this for a short bit and making an error, I realized what I need to do. I need to blog about it. A blog is the perfect place to work things out.
So, here is the situation. A ball of mass 10 kg (ball A) is moving with a speed of 0.1 m/s in the positive x-direction. This collides with a 1 kg ball (ball B) moving at 0.1 m/s in the negative x-direction. What is the final velocity of the two balls if the collision is perfectly elastic.
For a perfectly elastic collision, the following two things are true:
Momentum is conserved. The total momentum before the collision is equal to the total momentum after the collision.
Kinetic energy is conserved. The total kinetic energy is the same before and after the collision.
In one dimension, I can write this as the following two equations. I’m going to drop the “x” notation since you already know it’s in the x-direction. Also, I am going to use A1 for the velocity of A before the collision and A2 for after. Same for ball B.
That’s two equations and two unknowns (the two final velocities). Before solving this, I want to find the answer with a numerical calculation.
Here’s the basic plan (I’m not going over all the deets).
Model the two masses as points with springs on them (not really going to show the springs).
When the two masses “overlap” there is a spring force pushing them apart. The strength of this force depends on the amount they overlap.
Calculate the position and force on each ball (the force would be the zero-vector in cases where they aren’t “touching”).
Update the momentum of the balls.
Update the position of the balls.
Repeat until you get bored.
Oh, make sure you set your fake spring constant high enough. If it’s too low, the two masses can just pass through each other (which would still be an elastic collision).
Actually, notice that KE is NOT conserved. During the collision there is a decrease in the total KE because of the elastic potential energy. I just thought that was cool.
Now let’s get to solving this sucker. I’m going to start with a trick—a trick that I’m pretty sure will work (but not positive). Instead of having the two balls moving towards each other at a speed of 0.1 m/s each, I am going to use the reference frame that has ball B with an initial speed of 0 m/s and ball A with a speed of 0.2 m/s.
Since I am switching reference frames, I am going to rename the velocities. I am going to call ball A velocity C1 and C2 and then ball B will be D1 and D2 (for final and initial). Technically, I should use prime notation – but I think it will just get messy.
So, here is how it looks in the new reference frame.
In general, the initial C velocity would be:
Now I get the following for the momentum and kinetic energy conservation equations.
Now we have two equations two unknowns. I’m going to cheat. I worked this out on paper and I’m just going to take a picture of it.
Here is the final solution (in case you can’t read it).
So, you can get a value for vD2 and then plug that into vC2. After that, you can convert them back to the stationary reference frame to get vA2 and vB2.
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.
But how do you make a model of a falling slinky? Remember, you don’t fully understand something until you model it.
Also, with a model you can quickly test different situations. What happens if you put a car on one end of the slinky (or massive spring). What kind of spring constant do you need? What if the two masses are different?
All of these questions can be investigated with a model.
Let’s get to it. Of course, I am building my model with python—because I like python (and so should you). Here is my code. This is what most of it looks like (sorry, I can’t embed here).
Here is a gif of the output.
The balls wait a short time before dropping—just to make it dramatic.
I have calculated the position of the bottom mass so that it starts in equilibrium. If you don’t do that, the bottom mass will just oscillate up and down and ruin the whole thing.
I added two objects—a stick on the side and a free falling ball. That way you can see how the spring thingy falls.
Oh, you should absolutely try changing things up and running the model.
Here is how the model works.
There are two masses (the ball1 and ball2)—just ignore the other objects, they don’t matter.
Once the top mass is let go, there are two forces on the two balls. The downward gravitational force and then the spring force. Whatever the spring force on the bottom ball is, the top ball has the opposite.
The gravitational force is easy to calculate.
For the spring force, you need to know the natural length of the spring and the distance between the masses. The spring force depends on the difference between the distance and the natural length—then just multiply by the spring constant. Yes, I often mess up the sign on this force so that the two objects get pushed away in a weird motion.
After that, you are pretty much done. Use this force to update the momentum and then use the momentum to update the position.
Here are some things for you to try.
What if the top mass is 0.1 times the bottom mass? Does this still work?
What if the bottom mass is 0.1 times the top mass?
See if you can calculate and plot the vertical motion of the center of mass of the two ball system.
What if the spring also has mass? There is a way to model this, but I’m going to make you think about it first.
Suppose I want to do this with a 2000 kg car. What spring constant would I need? What natural length of a spring should I use?
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.
In order to keep my blogging certification up to date, I am required to post some type of year end review.
OK, here it is. These are my “best” or “favorite” posts from 2018. Maybe these didn’t get the most traffic, but they are ones that I like the best. It’s all about me.
You might think this list is long, but I just counted. I had 106 blog posts for the year of 2018. So, these all “made the cut”. Also, I normally just list the posts but this time I will give a brief description.
Really, this post is all about a TV show – The 100. In one episode, a boy is floating around in a space ship during the re-entry process. This leads to a discussion about how gravity works and what happens during re-entry.
This really isn’t a blog post—at least not like a normal post. This is really just a holder for my WIRED video on how airplanes fly. This short explanation covers flying using the momentum principle instead of Bernoulli’s Principle.
The gravitational constant is needed to find the gravitational force between two objects with mass. The problem with finding this value is that it’s very small and we (humans) didn’t initially know the mass of the Earth.
Here is a method to find the gravitational constant by estimating the mass of a mountain and detecting the change in gravitational field with a pendulum. It’s just so crazy it might work.
Oh, the real tricking part is find the direction of “up” and “down”.
Everyone knows (or should know) how much I love numerical calculations with python. Here is a demo to show the angle of reflection is equal to the angle of incidence using Fermat’s Principle. This says that light takes the path of shortest distance.
First, there is a random walk. Second there is a random self-avoiding walk (SAW). A self avoiding walk doesn’t cross its own path. So, a SAW is like a long protein—which is important for life.
3D works the best for proteins (and not 4D). In 4D, there is no big difference in length vs. step number for SAW and normal walks. In 3D, it’s more likely a walk will cross itself—which is important for protein folding.
Yes, there is lots of python code here. Note: random walks in 4D are tricky since you can’t just use the position of the walk as a built in 3D vector class.
This is one of my blog posts that goes along with an episode of MacGyver (since I’m the technical consultant for the show). The idea was that MacGyver would use some stuff from a car to find out how to get to a base from his location in the desert.
The cool part is that navigation is really just using a compass to measure angles and clock to measure time.
Note: for this particular episode, I did a bunch of calculations to get the exact angle and time measurements they would use in the show. I don’t think they made it in the episode, but I did it. Also, I had to cheat since everything happened at night and MacGyver couldn’t find the time of local noon.
Yes, a Star Wars post. SPOILER ALERT – there is a space battle in Star Wars The Last Jedi. They show this First Order ship firing on the Resistance. In order to make it look like a WWII sea battle, the turbo lasers have an arc to them—that looks cool, but it wouldn’t happen.
So, what do I do? Other than enjoy the movie (which I do), I first do a video analysis to determine the vertical acceleration. Then I make a python model to recreate the arc. Fun.
In Star Wars A New Hope, there is a scene that shows the escape pod leaving the blockade runner (near the beginning of the movie). It turns out that this shot was created by dropping a model and viewing it from above.
Here is my video analysis (with angular size) to show that the model is indeed accelerating as it moves away.
Bonus: one of the guys that made this special effect sent me an email after I posted this. Winning.
I started off writing a book review (How to Invent Everything: A Survival Guide for the Stranded Time Traveler – Ryan North). In the book, he suggests that if you were starting from scratch it would be easier to build a radio transmitter than it would be to build a clock. Of course (from a previous post), a clock is important for navigation. If you had a radio transmitter, you could just broadcast the time.
OK, but how difficult is it to build a transmitter? Not too hard. I did it. Here is my spark gap transmitter.
Why are you still here? Oh, you are waiting for just one more post? Or maybe you think this was too many? No, it’s 16 out of 106. That’s just 15 percent of my posts.
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.
I like to solve physics problems. Here is one for you (I just made it up).
A 4 meter ladder leans against a frictionless wall at a 30 degree angle. The mass of the ladder is 10 kg. A human stands 1 meter up the ladder and has a mass of 70 kg. What is the minimum coefficient of static friction between the floor and the ladder so that the ladder doesn’t slip?
Here is the solution—in video form.
But wait! There’s more. Let’s do another problem.
Suppose you have the same ladder and the same human. However, in this case the coefficient of static friction between the ladder and the ground is 0.55. How far up can the human move before the ladder slips?
I like this question because I don’t know how the answer will turn out. That makes it fun. So, let’s do it.
But what kind of problem is this? I’ll make this a multiple choice question. Here are your options.
A friction problem.
An equilibrium problem.
A ladder problem.
A work-energy problem.
Your answer? Go ahead and answer. It’s important to think about things like this if you want to become an expert problem solver.
Did you pick? OK, I’ll tell you that there will be quite a few students that will say this is a friction problem because it has a coefficient of friction. That’s not untrue—but it’s not a good way to classify the problem. You could also say this is a “ladder problem”—again, not untrue but not helpful.
This is an equilibrium problem. We are trying to find the point at which the ladder slips—the point it leaves equilibrium, but it’s still sort of in equilibrium.
For an object in equilibrium, there are two main ideas—especially for a rigid object. First, it must have zero net force. Second, it must have zero net torque about any point. In two dimensions, I can write these two conditions as the following three equations.
Let’s talk about the torque stuff. I don’t want to get into a whole thing about torque, so let me just say that torque is like a “rotational force” and it can be calculated as:
In this expression, F is the applied force, r is the distance from the point at which you are calculating torque, and is the angle between r and F. This equation is equivalent to F-perpendicular times r or F times r-perpendicular.
Oh, torques that would make an object rotate clockwise are negative.
One last thing about torques—especially the sum of the torques. If an object is in rotational equilibrium about some point (point “o”) then it is also in rotational equilibrium about any other point. When you set up the torque equation, you can pick whatever point you like to sum the torques—it’s your choice (but choose wisely).
Now we can start setting up some equations for equilibrium. I’ll start with a force diagram for the ladder.
I know that’s a little busy—but it will have to do. Here are some comments.
There are two normal forces. One from the wall (labeled 1) and one from the floor.
There are two gravitational forces—and this is a cheat. There is a gravitational force on the ladder and it is as though it is one force acting at the center of mass for the ladder. If the ladder has a uniform density, the center of mass is the center of the ladder.
The other gravitational force is fake. This force is there to represent the weight of the human. But that gravitational force acts on the human, not the ladder. The ladder pushes UP on the human the same as the weight. Since forces come in pairs, an upward pushing force from the ladder means there is a downward pushing force from the human on the ladder. It’s equal to mg, but not mg.
The friction force is parallel to the floor. The maximum magnitude of this friction force would be: where is the coefficient of static friction.
Now for some equations. First, this is the sum of the forces in the y-direction.
Just a quick reminder. These are not vectors. These are components of vectors in the y-direction. That’s why the two gravitational forces have a negative sign. I guess I can simplify this a little bit.
Next is the sum of forces in the x-direction.
Since we are at the point of maximum friction, I can include the expression for the frictional force in terms of the coefficient.
Notice that I know the value of since it only depends on the mass of stuff—but I don’t know . I’m going to need another equation. That’s where the sum of the torques comes in.
In order to write down the sum of the torques, I need to pick a point about which I calculate the torque. I’m going to go with the bottom of the ladder. At this point, there are two forces applied. Since they are applied at the point about which the torque is calculated, they contribute zero torque and they won’t appear in the equation. Winning.
Here is the sum of the torques about point O (at the bottom of the ladder).
What do I want to solve for here? I want the distance the human goes up the ladder. This is the value “s” in the expression above. Really, I have all the values I need in that expression to solve for s. I just need to set to the maximum frictional force. But that would be boring.
Instead, let me make a plot of the frictional force as a function of human distance up the ladder. That will be more fun, right?
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.