Numerical Calculation of an Electric Field of a Half-Ring

Suppose there is a charge distribution that is half a circle with uniform charge. How do you find the electric field due to this half-ring? Here is a picture.

If you wanted to find the electric field at the origin (center of the half-ring), you could do this analytically. If you want to find the electric field somewhere else, you need to do a numerical calculation.

Here is the plan for the numerical calculation.

  • Break the ring into N pieces (where N can be whatever number makes you happy).
  • Treat each of these N pieces as though they were point charges.
  • Calculate the electric field due to each of these pieces and add them all up.
  • The end.

Maybe this updated picture will be useful.

Let’s say the total charge is 5 nC and the ring radius is 0.01 meters. We can find the electric field anywhere, but how about at < 0.03 ,0.04, 0 > meters.

I’m going to break this ring into pieces and let the angle θ determine the location of the piece. That means I will need the change in angular position from one point to the next. The total circle will go from θ = π/2 to 3π/2. The change in angle will be:

d\theta = \frac{\pi}{2N}

I know it’s wrong, but I will just put the first piece right on the y-axis and then space out the rest. Here is what that looks like for N = 7.

Here is the code.

That works. Oh, and here is the link to the code. Go ahead and try changing some stuff. See what happens if you put N = 20.

But there is a problem. If I make these charge balls, I need to also calculate the electric field due to each ball. I was going to make a list (a python list) to put all these balls in, but I don’t think I need it.

Here is my updated code.

With the output of:

I think this is working, but let me go over some of the deets.

  • Line 13: you need to know the charge of each piece—this depends on the number of pieces.
  • Line 12: We need to add up the total electric field from each piece. This means that we need to start with a zero electric field.
  • Line 15: I named the point charges so I can reference them. But here you can see that with this method, there is only one charge—it just moves.
  • Line 16: calculate r from a piece to observation location.
  • Line 17: electric field due to a point charge.


I’m stopping here. You can do the rest as homework.

  • How do you know this answer is correct? Hint: put the observation location at the origin.
  • How many pieces do you need to get a valid answer?
  • Make a plot of E vs. distance along the x-axis. This graph should show E approaching zero magnitude as you get farther away.
  • What about electric potential with respect to infinity? Oh yeah. That’s a good one.
  • Display the electric field as an arrow at different locations.

MacGyver Season 1 Episode 19 Science Notes: 19 Compass

What does “normal” mean?

Honestly, this a great physics joke. MacGyver and Jack are in a trash compactor—yes, there are some Star Wars jokes here too. In order to break the hydraulic pump, Mac wants to put a pole so that it pokes through a particular screw. Here’s the important part.

MacGyver: …if I hold the pipe perfectly normal.

Jack: Dude. Nothing about this is normal.

Jack messes up and hurts his arm. According to MacGyver: “I used a technical term that Jack didn’t understand.”

Ok, so what does “normal” mean? In short, it means perpendicular. That’s it. MacGyver needed the pipe to be perpendicular to the wall. That’s what normal means. That’s also why physicists call the force a surface pushes on an object “the normal force” —because it’s perpendicular to the surface.

Yes, we also use “normal” in geometry—but of course Jack wouldn’t get that.

What is a spectrometer?

Not a MacGyver hack, but I want to talk about spectrometers anyway.

My first idea of a spectrometer is a visible-light spectrometer. This is essentially a prism. Light goes into the prism and is then separated into different colors. By looking at the colors in the light you can identify the light source. Oh, but this kind of spectrometer wouldn’t be found in a chemistry lab—at least probably not.

There is also a mass spectrometer. This takes a gas of molecules and shoots them into an area. Using magnetic fields, the path of the molecules is bent. Based on the amount of particle deflection, you can get a value for the mass of the particles.

Also, it’s just fun to say “mass spectrometer”.

Origin of Hacking

Come on. We know that MIT didn’t really invent hacking. Humans have always been able to creatively figure out problems—which is the essence of hacking.

However, MIT might indeed have invented the word “hacking”. The history of this stuff is really interesting. Let me recommend the following book—Hackers: Heroes of the Computer Revolution (Steven Levy). I liked it.

Door Alarm

Another non-MacGyver hack. This is a hack from his friend. She creates a door alarm. You can’t really see it very well, but it would be a small battery with a buzzer. The circuit runs to a clothes pin with aluminum foil on the pinchers and a piece of paper between them. Since the paper is an insulator, there is not a closed circuit. The paper is then attached to the door (with tape) so that opening the door pulls the paper out.

It’s actually a pretty simple design. You can (and should) build one of these yourself. Here is a video showing how to do that.

Electric Whip

In order to make an improvised weapon, Mac takes an extension cord and cuts off one end. Then he strips the wires on that end and plugs it in to the wall outlet. Note: DON’T DO THIS.

When the two bare ends of the wires touch someone, they will get shocked. Oh, and it’s a whip.

So, would this work? I think it would mostly work. It wouldn’t make the lightning stuff, but that just makes it look cool. It does look cool, right?

DIY Centrifuge

This might be the best hack in MacGyver history. Basically, this is a real life MacGyver-hack. It’s a low cost and simple to build centrifuge.

What the heck is a centrifuge? It’s a super high speed spinning thingy. You can put liquids in there and the high rotation rate causes a centrifugal force (yes, I used that term correctly) to separate liquids of different densities. This can be used to process blood.

Here is a real centrifuge.

And here is the DIY version. It’s basically just string and cardboard. However, with this simple version people can process blood stuff in more rural areas. Awesome.

It’s real.

Elastic Collisions in 1D

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.

m_Av_{A1}+m_B v_{B1} = m_Av_{A2}+m_B v_{B2}

\frac{1}{2}m_A v_{A1}^2+\frac{1}{2}m_B v_{B1}^2 = \frac{1}{2}m_A v_{A2}^2+\frac{1}{2}m_B v_{B2}^2

That’s two equations and two unknowns (the two final velocities). Before solving this, I want to find the answer with a numerical calculation.

Numerical Solution

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

Here is what it looks like.

Here is the code (you should take a look). Oh, the final velocities are 0.0636 m/s for ball A and 0.2639 m/s for ball B. Also, here is a plot of the momentum so you can see momentum is conserved.

What about the kinetic energy? Here you go.

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.

Analytical Solution

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.

m_A v_{C1}=m_A v_{C2}+m_B v_{D2}

\frac{1}{2}m_A v_{C1}^2=\frac{1}{2}m_A v_{C2}^2 +\frac{1}{2}m_B v_{D2}^2

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

v_{C2} = v_{C1}-\frac{m_B}{m_A}v_{D2}

v_{D2} = \frac{2v_{C1}}{\frac{m_B}{m_A}+1}

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.

Boom. It works. Here is my calculation. Just to be clear, it looks like this:

The output looks like this:

Winning. That agrees with my numerical model.

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.

Photo - Google Photos 2018-02-18 08-55-07.png

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.

newplot (2).png

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

newplot (3).png

Double boom.

MacGyver Season 1 Episode 18 Science Notes: Flashlight

Hold on. There’s a metric butt ton of science in this episode. It’s going to be great.

Turning bullet

SPOILER ALERT. This episode has a bullet that can turn. It’s sort of the key plot element in this episode. These dudes are trying to steal the technology for these “smart bullets”. These bullets are essentially tiny guided missiles with fins so that they can turn in flight.

I’ll just leave this Wikipedia link on smart bullets and then move on (it’s not really a MacGyver hack anyway).

The physics of birthdays

Again, not a hack—but MacGyver thinks birthdays are dumb. Well, not dumb but arbitrary. I think he is right. In fact, I use the following phrase on people’s birthday’s:

Happy Solar Orbit Day.

Yes, that is the day the person completes another orbit around the Sun. I like thinking of it that way.

Fixing a generator inverter

There are lots of different types of generators. Most of them involve a gasoline engine that turns stuff. Some times this turning stuff involves a magnet to make an electric current. But what happens when the magnet get’s messed up? Yes, you have to fix it.

A permanent magnet is a ferromagnetic object (like iron) in which all the magnetic domains are aligned. If the domains are not aligned then it would just act like a dumb piece of metal. You can get the domains align by applying a strong magnetic field.

This is exactly what MacGyver does to the generator. He uses a defibrillator to generate the current and forms a loop of wire to create the strong external magnetic field. Seems like it could work.

DIY sand blaster

How do you get people out of a collapsed building? What if you could just cut through the wall? Yes, that’s the MacGyver plan.

In this case, he uses high pressure water mixed with sand—a type of sand blaster. If you have water at a high enough pressure, it can pretty much cut through anything. Of course MacGyver’s water by itself isn’t fast enough. That’s where the sand comes in. When the sand hits the concrete, the abrasive interaction is enough to eat away at the concrete.

Oh, this would take quite a while to work.

Seeing through walls with radar

Yes, this is a real thing. NASA made this device. Here is a description. Basically, this thing sends out microwaves and detects the reflected microwaves. But the magic is that it only looks for variations in reflections caused by small oscillations—these oscillations are from a human heart.

For MacGyver’s version, he starts with a radar gun (from a police car). These don’t use the same frequency as the microwave detector, but he can make a modification. With some software from Riley, that’s pretty much what he needs to get started. It’s at least plausible.

Screw jack

How do you lift super heavy stuff? You need a simple machine. All of the simple machines deal with force and distance. If you can increase the distance over which you apply a force, you can get a greater output force over a shorter distance.

In this case, MacGyver makes a screw jack. You can lift a large mass by turning the screw to get it to extend. In fact, you could do something like this yourself. Here’s how.

Ascender rig

The goal of an ascender rig is to allow some device to move UP a rope, but not down. This means you can climb up a rope one little bit at a time. Here is an example.

Oh, MacGyver made an ascender rig to climb an elevator cable and escape a collapsed building.

Modify laser

The smart bullet is aimed using a laser. Of course the bullet is only a little bit smart. It only aims towards the brightest laser. If you could make another laser that gets the attention of the bullet, you can get the bullet off course.

MacGyver takes the laser sight off a pistol. In order to increase the power output, he burns off a potentiometer. This could work on some lasers—like this.

Oh, DON’T DO THIS. You don’t want a powerful laser without knowing what it can do. These lasers can seriously damage your eyes in ways you wouldn’t be able to predict. Remember, you only have two eyes. Don’t mess them up.

So, they use this powerful laser to redirect a smart bullet. That part is plausible. It’s unlikely they could get a bullet to turn all the way around. They wouldn’t have time to move the laser dot and the bullet fins couldn’t make it turn that much.

Who cares. It was still a great episode.

MacGyver Season 3 Episode 16 Science Notes: LIDAR + Rouges + Duty

What is LIDAR?

Again, this is not a MacGyver-hack. Well, I guess it sort of is a Mac-hack since he designed the LIDAR. So, what is LIDAR? At the most basic level, LIDAR uses a laser to determine the distance to an object. By scanning this laser over some area, you can get a very detailed distance map. If you know the location of the LIDAR (in the aircraft), you get a very nice map of the terrain below.

But how do you get distance with a laser? The laser produces a beam of light (that’s what the “L” stands for in “laser”) and this light travels at a speed of about 3 \times 10^8\text{ m/s}. Yes, that is super fast. However, it’s not infinitely fast. So when this laser light travels and reflects off of something, it takes time to get back to the LIDAR. The longer it takes to return, the greater the distance. That’s the basic idea of LIDAR.

How do you start a jet engine?

I’m not an aeronautical engineer (in case you didn’t already figure that out). So here is my very simple explanation of a jet engine. The key to getting thrust is the same as a propeller driven aircraft: make the air coming in go faster as it leaves. This increase of air speed (into and out of the engine) means a change in momentum and thus a forward pushing force. For the jet engine, it increases the final speed of the outgoing air by also heating it by burning fuel.

So, how do you start a jet engine? It’s not the same as starting your car (but not completely different either). The main thing is that you need to get the jet turbines spinning first so that there is air moving through the engine. Then you can add the burning fuel to get the thing started. Here is a great video on how this works. Oh, this is why youtube is so nice—you can find a video on pretty much anything.

Pick lock with a paperclip

Oh, you missed this hack—didn’t you. When MacGyver gets into the old building, he has a paperclip in has hand. So, can you pick a lock with a paperclip? Maybe. You could use the paperclip to jiggle the lock pins, but you would need something to apply torque to the lock cylinder.

Here is a tutorial on lock picking—but don’t be a bad guy.

Break open door with a raft

MacGyver pushes open a locked door by filling a raft with water. Let’s start with the definition of pressure. Pressure is a force divided by an area.

Let’s start with the definition of pressure. Pressure is a force divided by an area.


You can solve this for the force.


So, if you have a pressure (in the raft) it will produce a force equal to the product of the pressure and the contact area. The bigger the area, the greater the force. In fact, with just a small pressure you can get a pretty big force.

OK, this is from a previous episode but I still like it. Here is a demonstration in which I use the pressure from my lungs to lift myself. Yes, small pressure with a large area means a significant e force.

What about the water? Well, the water will give the raft more mass so that it doesn’t just push itself away from the door. If you want to open the door with air pressure, you would need to have something hold the raft agains the door.

Dart gun

I love this visual effect where MacGyver is looking around for stuff to build and it shows all the things he sees. In the end, he builds a dart gun that shoots morphine needles.

Really, I just want to talk about two parts of this build—the shooting and the injecting. MacGyver uses a propane tank to shoot the dart. This is the same as your basic potato gun. Compressed gas from the tank push the dart in the tube. The longer the distance of the tube, the greater the final speed of the dart.

For the injection, you can’t just shoot a needle into someone. You need to push that plunger on the back of the needle to get the drug into a body. That’s where the steel spacers come into play. When the front of the dart hits a person, it will stop. However, the mass on the back will want to keep going until a force slows it down. This force comes from the plunger—that means the plunger gets depressed and the bad guys get drugged.

Beam splitter

How do you make one laser look like many lasers? You need a beam splitter. This is exactly what MacGyver does to fool the baddies into thinking there are bunch of other good guys in the woods.

Basically, a beam splitter is a piece of glass. We like to think of glass as being transparent so that light goes right through it—and it does. That’s why we use glass for windows to see stuff outside. But light also reflects off glass. In fact, if the light (from the laser) hits the glass at an angle then you will get both transmission AND reflection.

It doesn’t even need to be glass. Here is a quick demonstration of a beam splitter with just a piece of clear plastic.

MacGyver Season 3 Episode 15 Science Notes: K9 + Smugglers + New Recruit

Dog nose

Dog’s are pretty awesome for smelling stuff. They have noses that are much more sensitive than a human and they are smart enough to be trained. Oh, also they are dogs—so that’s an extra bonus. Dogs can detect more than guns. When trained, they can sniff out drugs or even some humans with particular medical conditions. Pretty awesome.

Here is a nice PBS article on the science of dog noses. Oh, this isn’t actually a MacGyver hack. I guess that’s clear though.

Wall climb

Again, not a MacGyver hack. Instead, there is a scene in which Desi (yes, Desi is the new recruit) runs and uses a corner of two walls to climb on top of a storage container.

So, how the heck do you run up a wall? The answer is “friction” and “momentum”. Let’s start with friction.

When two surfaces interact, there can be a frictional force. This force is parallel to the surfaces and proportional the perpendicular force that pushes the two surfaces together (we call this the normal force). If you put a book on a flat table, you can feel that frictional force as you try to slide the book. If you push DOWN on the book while trying to pull it, the frictional force will increase.

Since you have a vertical wall, it’s possible to have an upward frictional force to prevent Desi from falling down. However, there needs to be a force pushing Desi INTO the wall in order to have a significant perpendicular force. Actually, try this yourself. Take that same book you had on the table. Now put it on a vertical wall and let go. Yes. It falls. There is nothing pushing the book into the wall so there is no frictional force.

Now for momentum. Momentum (represented by “p”) is the product of an object’s (or human’s) mass and velocity where the velocity is a vector (depends on both the speed and the direction). Momentum is important in its relationship to the net force on an object. Here, we have the momentum principle:

\vec{F}_\text{net} = \frac{\Delta \vec{p}}{\Delta t}

So, what happens when Desi runs TOWARDS a wall and pushes off? The direction of her momentum changes from towards the wall to away from the wall. This change in momentum means there must be a force on her. Yes, this force comes from the wall. The faster she runs towards the wall, the greater her change in momentum and the larger the normal force.

This means a large normal force also produces a large frictional force. The frictional force is high enough to prevent Desi from falling while in contact with the wall. In fact, it’s a large enough force for her to move UP the wall. Of course, she is also now moving away from the wall. This is where the second wall comes into play. Now she just does the same this with that other corner wall. Physics.

Smoke screen

MacGyver needs a distraction. He takes some gun oil (used to trick the dog) and pours it into the engine of a forklift. When the fork lift starts, it is now running with extra oil in the fuel. This oil produces a blue-white smoke that comes out the exhaust. Yes, you have seen this with cars. It’s a bad sign that there is oil leaking into the engine cylinders.

The next thing that MacGyver does is to cut the fuel line. This pours extra diesel onto the hot engine. Theoretically, it could catch fire. Theoretically, this fire could cause an explosion. In theory.

DIY dog whistle

Yes, you can indeed make a whistle from a stick. Some sticks are easier than others—but still…

What makes a dog whistle different than a whistle? It’s really just the fundamental frequency that it blows. A normal whistle has a lower frequency that human ears are good at detecting. The dog whistle has a much higher frequency that most humans can’t hear.

Oh, what about the plastic bag? Yes, MacGyver gets a plastic bag and attaches this to the whistle. This makes an improvised bellows. The idea is that you can fill it up with air and then push the air out at a greater rate than just blowing. It makes the whistle louder than normal.

RFID detection

Cody (the dog) has an RFID chip in him. The basic idea behind a passive RFID is that you can excite it with a radio wave such that it transmits some data (like an ID). Oh, but you have to get pretty close for this to work. Here is a nice RFID tutorial.

Now for the MacGyver hack. In order to find Cody with his RFID, they need two things. First, they need a method to activate the passive RFID at a long range. To do this you need lots of power. That’s where the AM radio station comes in. If you use a nearby radio transmitter, it could activate a bunch of RFID tags. This is fairly plausible. No, you wouldn’t “hear” anything—it would just broadcast a particular frequency that the RFID uses.

The second thing—something to detect the RFID signal from a range. That’s why you need a satellite dish. The parabolic dish reflects weak radio signals into the detector. Of course this only works if you are pointing it in the right direction. So, you need to sweep this over some area until you get a signal. Once you find the dog you want, you have to use the dish to zero in on the location.

Disabling a car

What can you do to prevent a car from driving? Yes, there is the classic banana up a tail pipe trick (from Beverly Hills Cop), but how about something different?

OK, I admit this is a bit of a stretch. However, if you can make some sort of electromagnetic pulse device then it can interfere with the car’s electronic system.

That’s “essentially” what MacGyver does here. Let’s just leave it at that.

Foam fire extinguisher

How do you put out a fire? One way is to remove oxygen from the fire. Without oxygen, the fire can’t burn. This is essentially what a carbon dioxide fire extinguisher does. It shoots out carbon dioxide gas which displaces the oxygen and the fire goes out.

You can make a foam-based fire extinguisher that essentially does the same thing. The only difference is that the carbon dioxide is trapped in the foam. This means that you can cover some stuff with the foam and it should put out the fire.

Now for the fun part. You can make fire extinguishing foam with three things: vinegar, baking soda, liquid soap.

When you mix baking soda and vinegar, it produces carbon dioxide. If you add soap to the vinegar, then it also bubbles. This is not too difficult to try (but it can get messy).

MacGyver Season 1 Episode 17 Science Notes: Ruler

Propane tank flame thrower

Take a propane tank and bicycle tube. Cut the bike tire to make it a hose and connect it to the propane tank. Use a road flare to light the gas—boom. There is your flame thrower.

Oh but wait. It’s just a dream. Bozer’s dream. The flame thrower wasn’t real anyway.

Listen in on a landline phone

Who uses a landline now anyway? Oh well. They want to use a landline then it’s possible to listen in. Actually, this isn’t even that difficult. Check it out.

Here is another version.

You just need a capacitor and maybe an inductor. You could grab these from a radio or something like that.

But wait. I made a mistake. While going over this hack, I said something like this:

“Yeah, this is pretty easy. Just get the capacitor and earpiece (or radio) and then tie it into the wiring box”

Here’s what that looks like.

I just want to point out this small mistake (that you would never notice) just in case you saw it. You don’t actually “tie” the lines—that’s just a term we use in circuits to mean “connect”.

Bomb radius calculation

There’s a bomb in the truck. Where should you park it so that no one gets hurt? Yeah, this is a tough calculation. However, tough has never stopped MacGyver before and it won’t stop him now.

Here is my rough calculation and explaination.

Bombs are complicated. But usually it is the pressure produced by the explosion that will get you. We can come up with some pretty useful models to calculate their impact. First, there is the Hopkinson-Cranz Scaling Law (this is a real thing). With this law, the acceptable distance can be calculated based on the explosive weight.

\mathrm{Range} = (z)(\mathrm{weight})^(1/3)

In this expression z is a factor that depends on the type of distance with 14.8 being the distance factor for a public traffic route. That means that 2 kilograms would need 18.6 meters (60 feet).

Infrared face jammer

OK, it doesn’t actually jam your face. That would be weird. MacGyver wants to prevent the security cameras from recognizing their faces. So he takes some infrared TV removes and pulls out the IR LED lights. Normally these flash on and off so that the sensor on the TV can “see them” but humans can’t.

He mounts these IR LED lights on some sun glasses with a battery to power them. When a security camera sees the face, it just gets blinded by the IR light since many video cameras can also detect IR.

If your phone camera doesn’t have an IR filter (most now do) then you can actually see the light flashing on a TV remote by pointing it at your phone.

Oh, so this could really work. It just depends on the type of video cameras. Some people even put stuff like this on their car license plate so that police cameras can’t see them.

Car jacking

How do you open a locked car door? One way is to jam a wedge into the door. This will pull the door out just a little (by bending it) so that you can get a stick in there. The stick then can be used to push the “lock” button.

In this case, MacGyver uses something for the wedge—maybe a shoe horn or a door stop. Then a monopod is extended to click the lock button.

DIY soldering iron

You might have missed this one. But as MacGyver is building his stuff for the last mission, he needs a soldering iron. He takes the heating element out of a hair dryer and connects it to some stuff. That works.

Fake noses

Need a disguise? How about DIY latex to make a nose? Yes, this seems plausible. Here’s how to do it.

DIY keypad cracker

MacGyver makes a quick circuit board that can crack a keypad by using a brute force method that goes through all the combinations. This is from a different episode, but it’s the same idea.

If you want to play with one yourself, here is an online version of the code.

Oh, here is the code on

DIY police radio

Well, it’s just a radio. MacGyver needs a speaker and a transmitter. Really, a radio transmitter is essentially the same thing as a radio receiver—OK, not really but sort of.

Instead of going over the way MacGyver did it, how about a real actual radio you could build yourself? Here is a spark gap transmitter from simple parts (and awesome).

Here is a more detailed explanation of the spark gap transmitter from one of my WIRED posts.

MacGyver Season 1 Episode 16 Science Notes: Hook


Yes, it’s true. You don’t really sink all the way down in quicksand—that’s because the density of the stuff is greater than the density of water. Essentially, you float.

Here is a nice video on quicksand.

Pool shot.

I. Love. This. So, MacGyver is there trying to score a nice shot in pool (the game, not the pool). He starts thinking about all the physics to get the perfect shot—one with some curve. Here is what goes through his mind.

That’s pretty awesome, right? Let’s go over some of the key equations.

First, why does the ball turn? If you want to turn, you have to have a sideways force. In this case, the sideways force is a frictional force on the ball as it spins and slides on the table.

Once you know the frictional force, you can use this to find the new vector velocity after some short time. This is basically the numerical version of the definition of acceleration. Here’s that equation.

\vec{v}_3= \vec{v}_2+\frac{\vec{F}_f}{m}\Delta t

Oh, vectors. Look at the vector notation. Winning.

Next there is the changing angular speed of the ball. Since the ball is spinning with a frictional force, the ball would slow down. We describe the change in angular motion by using the angular momentum principle. This states:

\vec{\tau} = \frac{\Delta \vec{L}}{\Delta t}

Where L is the angular momentum vector. For a rigid object, the angular momentum is the product of the moment of inertia and the angular velocity (for most cases).


Where I is the moment of inertia (or as I like to call it, the rotational mass) for a sphere.

I = \frac{2}{5}MR^2

That’s pretty much all the equations you see.

Of course the amazing part is that humans can make these very complicated shots WITHOUT doing the calculations. I don’t know how that works.

Zip-tie nunchucks.

Two broken pieces of a pool stick and a towel. Boom. Nunchuck. But this is all I can think of.

Image result for napoleon dynamite nunchuck skills

Magnet phone tracker

How do you track a fleeing truck? You stick your smart phone on the bottom using a magnet. Oh, this works so well that Spider-Man used this same trick the following year in Spider-Man: Homecoming when he left his phone in the Vulture’s car.

There is a small problem with those car magnets. They are like refrigerator magnets in that they have weird magnetic domains. Actually, you should try this experiment.

  • Grab a fridge magnet.
  • Flip it around and put it on the fridge.
  • Oh, it doesn’t work!

The magnetic domains in these flat magnets are such that they stick on one side but not the other. That makes it tough to use for a magnetic phone tracker.

A better method would be to run a wire (or zip tie) through the magnet and around the phone. Like this.

Stab pepper spray with a knife

Yes, if you poke a hole in a can of pepper spray it will get pepper spray all over the place.

Circuit board knife

MacGyver uses a broken circuit board to cut through zip ties. Zip ties aren’t that strong anyway—it seems very plausible that you could sharpen a circuit board to cut through one of these things.

Control a car remotely

Is it possible to control a car with a computer? Sadly, this is real.

Moonshine spray

MacGyver sprays 155 proof moonshine and threatens to light it. Yes, 155 proof can catch on fire.

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:


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:


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 Sorry—I can’t embed the code in this wordpress blog (I wish I could).

This is where I start.


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.

cring=ring(pos=vector(0,0,0),axis=vector(1,0,0), radius=R,thickness=R/10, color=color.yellow)

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.


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.


while theta<2*pi:

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)

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.