It seems that most of the second semester algebra-based physics is magic. Since you need calculus to derive many of the expressions, the students just get them magically instead.
NOT TODAY. Well, I hope not. Today I am going to use python and the Biot-Savart Law to find the magnetic field due to a wire. Here is the expression I want to show:
Where I is the current in a wire and r is the distance from the wire. I guess I should start with the magnetic field due to a moving point charge.
Yes, that’s sort of a crazy equation. The weird part is the cross product. Here are some notes:
OK, that’s enough of that. Fortunately, we don’t really need to compute cross products since it’s built into VPython (Glowscript). Let me do one more thing before calculating stuff. Suppose I have a charge q moving with a velocity v over some short length of wire, L. I can write qv as:
So, instead of dealing with qv, I can use IL. Note that L is a vector in the direction of motion for the current. Now my magnetic field looks like this:
#python #physics #programming