diff --git a/exercises/classicalMechanics/Projectile with Air Resistance.ipynb b/exercises/classicalMechanics/Projectile with Air Resistance.ipynb
index 11fa28d..ac738c1 100644
--- a/exercises/classicalMechanics/Projectile with Air Resistance.ipynb
+++ b/exercises/classicalMechanics/Projectile with Air Resistance.ipynb
@@ -6,8 +6,71 @@
"source": [
"# Projectile with Air Resistance\n",
"\n",
- "- **PROGRAM**: Projectile with air resistance\n",
- "- **CREATED**: 4/9/2018"
+ " \n",
+ "\n",
+ "The equations for velocity $v$ as a function of position $y$ come from solving the differential equations\n",
+ "\n",
+ "
\n",
+ "\n",
+ "$Question$\n",
+ "\n",
+ "A projectile of mass $m$ is launched vertically in gravity at speed $v_0$. Gravitational acceleration is $g$. If the air resistance is $kmv^{2}$, directed opposite the velocity vector, what is the speed of the projectile just before it hits the ground?\n",
+ "\n",
+ "$Goal$\n",
+ "\n",
+ "Solve for the particle's speed just before it hits the ground. \n",
+ "\n",
+ "Plot the particle's _velocity_ as a function of _height_ along its entire journey up and back down.\n",
+ "\n",
+ "$Equation$\n",
+ "\n",
+ "Say the particle is moving in the $y$ direction. The velocity of the particle at any height $y$ is \n",
+ "\n",
+ "> $1)$ $v = \\sqrt{\\frac{1}{k}[e^{-2ky}(g + kv_{0}^{2}) - g]}$ on the way up, and\n",
+ "\n",
+ "> $2)$ $v = -\\sqrt{\\frac{1}{k}g(1 - e^{2k(y-h)})}$ on the way down, where $h = \\frac{1}{2k}ln(\\frac{kv_{0}^{2}}{g} + 1)$ is the maximum height of the particle.\n",
+ "\n",
+ " Why?
\n",
+ "\n",
+ "\n",
+ "
\n",
+ "\n",
+ "\n",
+ "
\n",
+ "\n",
+ "
\n",
+ "Image source: $\\href{http://www.moblerhome.com/brushed-aluminum-drum-table-or-pedestal}{link}$\n",
+ "\n",
+ "$Question$\n",
+ "\n",
+ "A fat wire of radius $a$ carries a constant current $I$ uniformly distributed over its cross-section. A narrow gap in the wire of width $w << a$ forms a sort of parallel plate capacitor. Assume the wire acts like infinite plates, so that the electric field lines in the gap are parallel.\n",
+ "\n",
+ "(a) Find the electric and magnetic fields in the gap as a function of the distance $s$ from the axis and the time $t$. (Assume the charge is zero at $t = 0$).\n",
+ "\n",
+ "(b) Find the Poynting vector $\\vec{S}$ in the gap. Pay attention to the direction of $\\vec{S}$.\n",
+ "\n",
+ "$Goal$\n",
+ "\n",
+ "Plot the electric field $\\vec{E}$ as a function of radius $s$ from the wire's central axis.\n",
+ "\n",
+ "Plot the magnetic field $\\vec{B}$ as a function of radius $s$ from the wire's central axis.\n",
+ "\n",
+ "Plot the Poynting vector $\\vec{S}$ as a function of radius $s$ from the wire's central axis.\n",
+ "\n",
+ "$Equation$\n",
+ "\n",
+ "The equation for the electric field in this narrow gap is \n",
+ "\n",
+ "\n", + "$E = \\frac{I t}{\\pi a^2 \\epsilon_{0}} \\hat{z}$. \n", + "\n", + "\n", + "Notice that $\\vec{E} = \\vec{E}(t)$ is independent of radius $s$ from the central axis of the wire.\n", + "\n", + "The equation for the magnetic field in this narrow gap is \n", + "\n", + "
\n", + "$B = \\frac{\\mu_{0} I s}{2 \\pi a^{2}} \\hat{\\phi}$. \n", + "\n", + "\n", + "Notice that $\\vec{B} = \\vec{B}(s)$ is independent of time $t$.\n", + "\n", + "The equation for the Poynting vector is \n", + "\n", + "
\n", + "$\\vec{S} = -\\frac{\\mu_{0} I^2 c^2 t s}{2 \\pi^2 a^4} \\hat{s}$.\n", + "\n", + "\n", + "\n", + "
\n", + "\n", + "The equation for the electric field $\\vec{E}$ comes from the expression for the electric field between two parallel plates with charge density $\\sigma$, \n", + "\n", + "
\n", + "$E = \\frac{\\sigma}{\\epsilon_0}$.\n", + "\n", + "\n", + "Assuming the current starts at time $t = 0$, the charge on the plates is $Q(t) = I \\cdot t$. The charge density is \n", + "\n", + "\n", + "$\\sigma(t) = \\frac{charge}{area} = \\frac{I t}{\\pi a^2}$.\n", + "\n", + "\n", + "Then\n", + "\n", + "\n", + "$E = \\frac{\\sigma(t)}{\\epsilon_0} = \\frac{I t}{\\pi a^2 \\epsilon_{0}}$\n", + "\n", + "\n", + "is the expression for the electric field in the gap.\n", + "\n", + "\n", + "For the magnetic field $B$, use Maxwell's equation\n", + "\n", + "$\\vec{\\nabla} \\times \\vec{B} = \\mu_0 \\vec{J} + \\mu_0 \\epsilon_0 \\frac{\\partial \\vec{E}}{\\partial t}$\n", + "\n", + "and state that $\\vec{J} = 0$ inside the gap to get that\n", + "\n", + "$\\vec{\\nabla} \\times \\vec{B} = 0 + \\mu_0 \\epsilon_0 (\\frac{I}{\\pi a^2 \\epsilon_0}) = \\frac{\\mu_0 I}{\\pi a^2}$.\n", + "\n", + "\n", + "Use Stokes' theorem:\n", + "\n", + "\n", + "so\n", + "$\\int{(\\vec{\\nabla} \\times \\vec{B})} \\cdot d\\vec{a} = \\oint{\\vec{B} \\cdot} d\\vec{l}$\n", + "$\\frac{\\mu_0 I}{\\pi a^2} (\\pi s^2) = |\\vec{B}| (2 \\pi s)$,\n", + "\n", + "$B = \\frac{\\mu_0 I s}{2 \\pi a^2}$.\n", + "\n", + "\n", + "\n", + "Finally, find the Poynting vector $\\vec{S}$ using the equation\n", + "\n", + "$S = \\frac{1}{\\mu_0} \\vec{E} \\times \\vec{B}$.\n", + "\n", + "\n", + "\n", + "\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Import packages." ] }, { @@ -18,7 +122,19 @@ }, "outputs": [], "source": [ - "import numpy as np" + "# Import numpy.\n", + "import numpy as np\n", + "# Import 3-dimensional plotting package.\n", + "from mpl_toolkits.mplot3d import axes3d" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Define constants.\n", + "- Define constants important to the problem: current $I$, permittivity of free space $\\epsilon_{0}$, permeability of free space $\\mu_{0}$, and the wire radius $a$.\n", + "- For constants $I$ and $a$ that are not given, estimate a reasonable value. Anything \"reasonable\" will do, so long as the specified relationships ($w << a$) can arguably apply." ] }, { @@ -29,23 +145,35 @@ }, "outputs": [], "source": [ - "#Define constants - current, permittivity of free space, permeability of free space, wire radius a.\n", "I = 4\n", "e_0 = 8.85 * 10**(-12)\n", "u_0 = 1.26 * 10**(-6)\n", "a = 0.005" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Electric and Magnetic Field" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Define functions for electric and magnetic field.\n", + "- Define a function for the magnitude of the electric field and magnetic field as a function of time and position. Here the electric field does not depend on position, and the magnetic field does not depend on time." + ] + }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ - "#Define a function for the magnitude of the electric field and magnetic field as a function of time and position.\n", - "#Here the electric field does not depend on position, and the magnetic field does not depend on time.\n", "def E(t):\n", " return (I * t) / (np.pi * a**2 * e_0)\n", "def B(s):\n", @@ -53,15 +181,13 @@ ] }, { - "cell_type": "code", - "execution_count": 5, + "cell_type": "markdown", "metadata": { "collapsed": true }, - "outputs": [], "source": [ - "#Import 3-dimensional plotting package.\n", - "from mpl_toolkits.mplot3d import axes3d" + "### Plot the electric and magnetic fields together.\n", + "- Plot the values for $E(t)$ and $B(s)$ within a circular region of radius $a$ (to represent the wire)." ] }, { @@ -136,6 +262,13 @@ "plt.show()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Plot only the electric field." + ] + }, { "cell_type": "code", "execution_count": 13, @@ -202,6 +335,13 @@ "plt.show()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Plot only the magnetic field." + ] + }, { "cell_type": "code", "execution_count": 12, @@ -268,6 +408,34 @@ "plt.show()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Define a function for the Poynting vector." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#Define the Poynting vector as a function of time and position.\n", + "c = 2.99792 * 10**8\n", + "def Poynting(t, s):\n", + " return - (u_0 * I**2 * c**2 * t * s) / (2 * np.pi**2 * a**4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Plot the Poynting vector." + ] + }, { "cell_type": "code", "execution_count": 34, @@ -305,11 +473,6 @@ "#Choose a time (in seconds) to plot the electric and magnetic fields, since the electric field is changing with time.\n", "t = 0.5\n", "\n", - "#Define the Poynting vector as a function of time and position.\n", - "c = 2.99792 * 10**8\n", - "def Poynting(t, s):\n", - " return - (u_0 * I**2 * c**2 * t * s) / (2 * np.pi**2 * a**4)\n", - "\n", "X = S * np.cos(PHI)\n", "Y = S * np.sin(PHI)\n", "Z = Z\n",