{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["# Maxwell's equations\n", "```{index} Maxwell's equations\n", "```\n", "\n", "Maxwell's equation are some of the most important equation in physics as form the understanding behind essentially all applications of electrical or magnetic systems in the modern world. Despite being devised in the $19th$ century, they obey the laws of relativity. This notebook will introduce the 4 Maxwell equations in both their intergral and differential form."]}, {"cell_type": "markdown", "metadata": {"tags": ["module-gmod"]}, "source": ["(gauss_law)=\n", "## Gauss's law\n", "[Gravity, Magnetism, and Orbital Dynamics](module-gmod) \n", "```{index} Gauss's law\n", "```\n", "\n", "Gauss\u2019s law is the first of Maxwell\u2019s equations, and ultimately encapsulates the idea that charged particles are a source of electric field. In order to derive Gauss\u2019s law, we first have to introduce the concept of electric flux, $\\Phi_\\mathbf{E}$. This is equivalent to the magnetic flux and is defined as\n", "\n", "$$\\Phi_\\mathbf{E} = \\iint_{\\mathbf{S}}^{} \\mathbf{E} \\cdot d\\mathbf{S}$$\n", "\n", "where for a closed surface, $d\\mathbf{S}$ points outwards by convention. To better understand the electric flux from a point charge, we will introduce the concept of *Solid Angles*. The solid angle is a generalisation of the ordinary angle between two lines. Consider a surface element, i.e., a small vector area $d\\mathbf{S}$ which is distance $r$ from point $P$. The surface element is defined to subtend a solid angle $d\\Omega$ as follows:\n", "\n", "$$d\\Omega = \\frac{d\\mathbf{S} \\cdot \\mathbf{\\hat{r}}} {r^2}$$\n", "\n", "where $\\mathbf{\\hat{r}}$ is the unit vector along the direction from $P$ to the surface element. It should be noted that just as there are $2\\pi$ radians in a circle, there are $4\\pi$ steradians covering the surface of a sphere. \n", "\n", "Consider a point charge $Q$. The electric flux through a spherical surface $S_1$, radius $r_1$, is \n", "\n", "$$\\Phi_{\\mathbf{E},1} = 4\\pi r_1^2 E_{r_1} = \\frac{Q}{\\epsilon_0}$$\n", "\n", "Now we consider the flux $d\\Phi_{\\mathbf{E},1}$ through the surface element $dS_1$. This is given by\n", "\n", "$$d\\Phi_{\\mathbf{E},1} = \\mathbf{E}_{r_1} \\cdot d\\mathbf{S}_1 = \\frac {\\Phi_{\\mathbf{E},1}} {4\\pi r_1^2} dS_1$$\n", "\n", "where we have used the fact that $\\frac {d\\Phi_{\\mathbf{E},1}} {\\Phi_{\\mathbf{E},1}} = \\frac {dS_1} {4\\pi r_1^2}$ and the fact that $\\mathbf{E}$ is radial. Now, using the above definition of the solid angle, we can write\n", "\n", "$$\\frac {\\Phi_{\\mathbf{E},1}} {4\\pi r_1^2} dS_1 = \\frac {\\Phi_{\\mathbf{E},1}} {4\\pi} d\\Omega = \\frac{Q}{4\\pi \\epsilon_0} d\\Omega$$\n", "\n", "Thus, we can finally write\n", "\n", "$$d\\Phi_{\\mathbf{E},1} = \\frac{Q}{4\\pi \\epsilon_0} d\\Omega$$\n", "\n", "Now consider $S_2$, an arbitrary surface enclosing $S_1$. The corresponding element of flux $d\\Phi_{\\mathbf{E},2}$ through $dS_2$ is given by\n", "\n", "$$d\\Phi_{\\mathbf{E},2} = \\mathbf{E}_{r_2} \\cdot d\\mathbf{S}_2 = \\frac{Q}{4\\pi \\epsilon_0 r_2^2} \\mathbf{\\hat{r}} \\cdot d\\mathbf{S}_2$$\n", "\n", "and using the definition of the solid angle we can write\n", "\n", "$$d\\Phi_{\\mathbf{E},2} = \\frac{Q}{4\\pi \\epsilon_0}d\\Omega = d\\Phi_{\\mathbf{E},1}$$\n", "\n", "Thus, the flux through the two surface elements is the same, even though the orientation of $dS_2$ is arbitrary and consequently, the flux through any closed surface is always $\\frac{Q}{\\epsilon_0}$\n", "\n", "Now consider an arbitrary closed surface surrounding a collection of charges $Q_1$, $Q_2$, ..., $Q_N$. Using the supeposition principle, the electric flux through the surface is given by\n", "\n", "$$\\Phi_{\\mathbf{E}} = \\frac{Q_1}{\\epsilon_0}, \\frac{Q_2}{\\epsilon_0}, ..., \\frac{Q_N}{\\epsilon_0}$$\n", "\n", "Since $Q$ = $Q_1$ + $Q_2$ + ... + $Q_N$ we can write \n", "\n", "$$\\oint_S \\mathbf{E} \\cdot d\\mathbf{S} = \\frac{Q}{\\epsilon_0}$$\n", "\n", "This is the integral form of Gauss's law! By considering a region of space with uniform charge density instead of point charges we can write Gauss's law in a different form. Consider a volume, $V$, with total charge, $Q$, and charge density, $\\rho$. The total charge can then be written in terms of the charge density:\n", "\n", "$$Q = \\iiint_V \\rho \\,dV$$\n", "\n", "Substituting this to Gauss's law:\n", "\n", "$$\\oint_S \\mathbf{E} \\cdot d\\mathbf{S} = \\frac {1}{\\epsilon_0} \\iiint_V \\rho \\,dV$$\n", "\n", "where $V$ is the volume enclosed by the closed surface $S$.\n", "\n", "Applying the Divergence theorem we get\n", "\n", "$$\\iiint_V \\nabla \\cdot \\mathbf{E} \\,dV = \\frac {1}{\\epsilon_0} \\iiint_V \\rho \\,dV$$\n", "\n", "By applying this to an infinitesimal volume, we can remove the integrals such that\n", "\n", "$$ \\nabla \\cdot \\mathbf{E} = \\frac {\\rho}{\\epsilon_0} $$\n", "\n", "This is Gauss's law in differential form!"]}, {"cell_type": "markdown", "metadata": {}, "source": ["(gauss_magnetism)=\n", "## Gauss\u2019s law for magnetism\n", "\n", "This is essentially the same law as Gauss's law for electricity, but unlike electricity, there are no magnetic monopoles in nature, as magnetic pole always exist in pairs - dipoles. Thus, magnetic field lines are loops, with no beginning or end, unlike electric field lines. This is described mathematically by\n", "\n", "$$\\nabla \\cdot \\mathbf{B} = 0 \\, \\ \\mbox{(differential form)}$$\n", "\n", "$$\\oint_{Closed} \\mathbf{B} \\cdot d\\mathbf{S} = 0 \\, \\ \\mbox{(integral form)}$$\n", "\n", "This is Maxwell's second equation."]}, {"cell_type": "markdown", "metadata": {}, "source": ["(faraday_law)=\n", "## Faraday's law\n", "```{index} Faraday's law\n", "```\n", "\n", "We know by Faraday's law of induction that when the magnetic flux changes through a wire loop an electromotive force ($EMF$) is acquired by the wire loop given by\n", "\n", "$$EMF = - \\frac {d\\mathbf{\\Phi_B}}{dt}$$\n", "\n", "The $EMF$ and the electric field generated around the wire loop are essentially the same and thus\n", "\n", "$$EMF = \\int_{circuit} \\mathbf{E} \\cdot d\\boldsymbol{l}$$\n", "\n", "Thus, using Faraday's law\n", "\n", "$$ \\int_{circuit} \\mathbf{E} \\cdot d\\boldsymbol{l} = - \\frac {d}{dt} \\iint_{S}^{} \\mathbf{B} \\cdot d\\mathbf{S}$$\n", "\n", "This is the third Maxwell equation, in integral form. To get the differntial form we can use Stoke's Theorem such that\n", "\n", "$$\\iint_{S} \\nabla \\times \\mathbf{E} \\cdot d\\mathbf{S} = - \\frac {d}{dt} \\iint_{S}^{} \\mathbf{B} \\cdot d\\mathbf{S}$$\n", "\n", "$$\\nabla \\times \\mathbf{E} = - \\frac {d\\mathbf{B}}{dt}$$"]}, {"cell_type": "markdown", "metadata": {}, "source": ["(ampere_law)=\n", "## Ampere - Maxwell equation\n", "```{index} Ampere's law\n", "```\n", "\n", "The Biot-Savart law provides a general expression for the magnetic field from a current element:\n", "\n", "$$d\\mathbf{B} = \\frac{\\mu_0 I} {4\\pi} \\frac{d\\boldsymbol{l} \\times \\mathbf{\\hat{r}}} {r^2}$$\n", "\n", "where $d\\boldsymbol{l}$ is the line element, $d\\mathbf{B}$ is the magnetic field by the current element $Id\\boldsymbol{l}$ and $\\mathbf{\\hat{r}}$ is the unit vector from the line element to the location where we want the $\\mathbf{B}$ field. Thus the total field at this point is given by\n", "\n", "$$\\mathbf{B} = \\frac{\\mu_0} {4\\pi} \\int \\frac{I\\,d\\boldsymbol{l} \\times \\mathbf{\\hat{r}}} {r^2}$$\n", "\n", "Ampere's law is just another formulation of the Biot-Savart law. Using Biot-Savart, we can write\n", "\n", "$$\\int_L \\mathbf{B} \\cdot d\\boldsymbol{l} = \\frac{\\mu_0 I} {2\\pi r} \\int_L d\\boldsymbol{l} = \\mu_0 I$$\n", "\n", "since $ \\int_L d\\boldsymbol{l}$ is just the circumference. It should be noted that the line integral does not depend on the shape of path or the position of the wire within it. If the current in the wire is in the opposite direction, the integral has a negative sign.\n", "\n", "Rather than using a single current, we can introduce a new quantity called the *current density*, $\\mathbf{J}$, related to $I$ by\n", "\n", "$$I = \\iint_S \\mathbf{J} \\cdot d\\mathbf{S}$$\n", "\n", "Using this definition we can write\n", "\n", "$$\\int_L \\mathbf{B} \\cdot d\\boldsymbol{l} = \\mu_0 \\iint_S \\mathbf{J} \\cdot d\\mathbf{S}$$\n", "\n", "and using Stoke's Theorem we get\n", "\n", "$$\\iint_S \\nabla \\times \\mathbf{B} \\cdot d\\mathbf{S} = \\mu_0 \\iint_S \\mathbf{J} \\cdot d\\mathbf{S}$$\n", "\n", "$$\\nabla \\times \\mathbf{B} = \\mu_0\\mathbf{J}$$\n", "\n", "This is Ampere's law in differential form, but it is not quite yet a Maxwell equation, as it is not valid for a time-varying electric fields (not constant current). Another term needs to be added into the equation that takes into account the time-varying electric fields. Doing so yields the fourth Maxwell equation:\n", "\n", "$$\\int_L \\mathbf{B} \\cdot d\\boldsymbol{l} = \\mu_0 \\iint_S \\mathbf{J} \\cdot d\\mathbf{S} + \\mu_0 \\epsilon_0 \\iint_S \\frac {d\\mathbf{E}}{dt} \\cdot d\\mathbf{S} \\, \\ \\mbox{(integral form)}$$\n", "\n", "$$\\nabla \\times \\mathbf{B} = \\mu_0\\mathbf{J} + \\mu_0 \\epsilon_0 \\frac {d\\mathbf{E}}{dt} \\, \\ \\mbox{(differential form)}$$"]}], "metadata": {"celltoolbar": "Tags", "kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.8"}}, "nbformat": 4, "nbformat_minor": 2}