{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# SageMath para físicos\n", "***\n", "Rogério T. C." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Aula IV.1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Sagemanifolds, Minkowski e Maxwell\n", "Baseado [neste exemplo](https://nbviewer.jupyter.org/github/ernestyalumni/Gravite/blob/master/EMsage.ipynb)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "reset()\n", "%display latex" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Espaço de Minkoski e dualidade" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "M. = manifolds.Minkowski()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "print(M)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Coordinate frame (M, (d/dt,d/dx,d/dy,d/dz))]\n" ] }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(M, \\left(\\frac{\\partial}{\\partial t },\\frac{\\partial}{\\partial x },\\frac{\\partial}{\\partial y },\\frac{\\partial}{\\partial z }\\right)\\right)\\right]\n", "\\end{math}" ], "text/plain": [ "[Coordinate frame (M, (d/dt,d/dx,d/dy,d/dz))]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(M.frames())\n", "M.frames()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[Coordinate coframe (M, (dt,dx,dy,dz))]\n" ] }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\left(M, \\left(\\mathrm{d} t,\\mathrm{d} x,\\mathrm{d} y,\\mathrm{d} z\\right)\\right)\\right]\n", "\\end{math}" ], "text/plain": [ "[Coordinate coframe (M, (dt,dx,dy,dz))]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(M.coframes())\n", "M.coframes()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Calculando\n", "$$dt\\left(\\frac{\\partial}{\\partial x}\\right)$$" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{llcl} \\mathrm{d} x \\left( \\frac{\\partial}{\\partial x } \\right) : & M & \\longrightarrow & \\mathbb{R} \\\\ & \\left(t, x, y, z\\right) & \\longmapsto & 1 \\end{array}\n", "\\end{math}" ], "text/plain": [ "dx(d/dx): M --> R\n", " (t, x, y, z) |--> 1" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.coframes()[0][1](M.frames()[0][1]).display()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{llcl} \\mathrm{d} t \\left( \\frac{\\partial}{\\partial t } \\right) : & M & \\longrightarrow & \\mathbb{R} \\\\ & \\left(t, x, y, z\\right) & \\longmapsto & 1 \\end{array}\n", "\\end{math}" ], "text/plain": [ "dt(d/dt): M --> R\n", " (t, x, y, z) |--> 1" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{llcl} \\mathrm{d} t \\left( \\frac{\\partial}{\\partial x } \\right) : & M & \\longrightarrow & \\mathbb{R} \\\\ & \\left(t, x, y, z\\right) & \\longmapsto & 0 \\end{array}\n", "\\end{math}" ], "text/plain": [ "dt(d/dx): M --> R\n", " (t, x, y, z) |--> 0" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{llcl} \\mathrm{d} x \\left( \\frac{\\partial}{\\partial t } \\right) : & M & \\longrightarrow & \\mathbb{R} \\\\ & \\left(t, x, y, z\\right) & \\longmapsto & 0 \\end{array}\n", "\\end{math}" ], "text/plain": [ "dx(d/dt): M --> R\n", " (t, x, y, z) |--> 0" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{llcl} \\mathrm{d} x \\left( \\frac{\\partial}{\\partial x } \\right) : & M & \\longrightarrow & \\mathbb{R} \\\\ & \\left(t, x, y, z\\right) & \\longmapsto & 1 \\end{array}\n", "\\end{math}" ], "text/plain": [ "dx(d/dx): M --> R\n", " (t, x, y, z) |--> 1" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "for i in range(2):\n", " for j in range(2):\n", " show(M.coframes()[0][i](M.frames()[0][j]).display())" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "eta = M.metric()\n", "eta.set_name('eta', latex_name=r'\\eta')" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\eta = -\\mathrm{d} t\\otimes \\mathrm{d} t+\\mathrm{d} x\\otimes \\mathrm{d} x+\\mathrm{d} y\\otimes \\mathrm{d} y+\\mathrm{d} z\\otimes \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "eta = -dt*dt + dx*dx + dy*dy + dz*dz" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eta.display()" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n", "-1 & 0 & 0 & 0 \\\\\n", "0 & 1 & 0 & 0 \\\\\n", "0 & 0 & 1 & 0 \\\\\n", "0 & 0 & 0 & 1\n", "\\end{array}\\right)\n", "\\end{math}" ], "text/plain": [ "[-1 0 0 0]\n", "[ 0 1 0 0]\n", "[ 0 0 1 0]\n", "[ 0 0 0 1]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eta[:]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$dx^i\\left(\\frac{\\partial}{\\partial x^j}\\right) = \\eta\\left(\\frac{\\partial}{\\partial x^i},\\frac{\\partial}{\\partial x^j}\\right)$$" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{True}\n", "\\end{math}" ], "text/plain": [ "True" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.coframes()[0][1](M.frames()[0][1])==eta(M.frames()[0][1],M.frames()[0][1])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$dt\\left(\\frac{\\partial}{\\partial t}\\right) \\neq \\eta\\left(\\frac{\\partial}{\\partial t},\\frac{\\partial}{\\partial t}\\right)$$" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}-\\mathrm{d} t\n", "\\end{math}" ], "text/plain": [ "-dt" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.frames()[0][0].down(eta).display()" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{False}\n", "\\end{math}" ], "text/plain": [ "False" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "M.coframes()[0][0](M.frames()[0][0])==eta(M.frames()[0][0],M.frames()[0][0])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Formas diferencias e equações de Maxwell" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### $E$, $B$ estáticos" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[E_{x}\\left(x, y, z\\right), E_{y}\\left(x, y, z\\right), E_{z}\\left(x, y, z\\right)\\right]\n", "\\end{math}" ], "text/plain": [ "[E_x(x, y, z), E_y(x, y, z), E_z(x, y, z)]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vE0 = [function('E_'+i)(x,y,z) for i in ['x','y','z']];vE0" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}E = E_{x}\\left(x, y, z\\right) \\mathrm{d} x + E_{y}\\left(x, y, z\\right) \\mathrm{d} y + E_{z}\\left(x, y, z\\right) \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "E = E_x(x, y, z) dx + E_y(x, y, z) dy + E_z(x, y, z) dz" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "E0 = M.one_form([0]+vE0, name='E');E0.display()" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{d}E = \\left( -\\frac{\\partial\\,E_{x}}{\\partial y} + \\frac{\\partial\\,E_{y}}{\\partial x} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y + \\left( -\\frac{\\partial\\,E_{x}}{\\partial z} + \\frac{\\partial\\,E_{z}}{\\partial x} \\right) \\mathrm{d} x\\wedge \\mathrm{d} z + \\left( -\\frac{\\partial\\,E_{y}}{\\partial z} + \\frac{\\partial\\,E_{z}}{\\partial y} \\right) \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "dE = (-d(E_x)/dy + d(E_y)/dx) dx/\\dy + (-d(E_x)/dz + d(E_z)/dx) dx/\\dz + (-d(E_y)/dz + d(E_z)/dy) dy/\\dz" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dE0 = E0.exterior_derivative();dE0.display()" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[B_{z}\\left(x, y, z\\right), -B_{y}\\left(x, y, z\\right), B_{x}\\left(x, y, z\\right)\\right]\n", "\\end{math}" ], "text/plain": [ "[B_z(x, y, z), -B_y(x, y, z), B_x(x, y, z)]" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vB0 = [function('B_z')(x,y,z), -function('B_y')(x,y,z), function('B_x')(x,y,z)];vB0" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "B0 = M.diff_form(2,name='B')\n", "B0[1,2],B0[1,3],B0[2,3] = vB0" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}B = B_{z}\\left(x, y, z\\right) \\mathrm{d} x\\wedge \\mathrm{d} y -B_{y}\\left(x, y, z\\right) \\mathrm{d} x\\wedge \\mathrm{d} z + B_{x}\\left(x, y, z\\right) \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "B = B_z(x, y, z) dx/\\dy - B_y(x, y, z) dx/\\dz + B_x(x, y, z) dy/\\dz" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "B0.display() " ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{d}B = \\left( \\frac{\\partial\\,B_{x}}{\\partial x} + \\frac{\\partial\\,B_{y}}{\\partial y} + \\frac{\\partial\\,B_{z}}{\\partial z} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "dB = (d(B_x)/dx + d(B_y)/dy + d(B_z)/dz) dx/\\dy/\\dz" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dB0 = B0.exterior_derivative();dB0.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Equaões de Maxwell no Vácuo (caso estático)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "| **Lei** | **Equação diferencial** |\n", "| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n", "| Lei de Gauss | ${\\displaystyle \\nabla \\cdot \\mathbf{E} =0 }$ |\n", "| Lei de Gauss para o magnetismo | ${\\displaystyle \\nabla \\cdot \\mathbf{B} =0}$ |\n", "| Lei de Faraday | ${\\displaystyle \\nabla \\times \\mathbf{E} = 0}$ |\n", "| Lei circular de Ampère | ${\\displaystyle \\nabla \\times \\mathbf{B} =0}$ |" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Lei de Faraday:\n", "$\\quad d\\mathbf{E} = 0$" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{d}E = \\left( -\\frac{\\partial\\,E_{x}}{\\partial y} + \\frac{\\partial\\,E_{y}}{\\partial x} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y + \\left( -\\frac{\\partial\\,E_{x}}{\\partial z} + \\frac{\\partial\\,E_{z}}{\\partial x} \\right) \\mathrm{d} x\\wedge \\mathrm{d} z + \\left( -\\frac{\\partial\\,E_{y}}{\\partial z} + \\frac{\\partial\\,E_{z}}{\\partial y} \\right) \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "dE = (-d(E_x)/dy + d(E_y)/dx) dx/\\dy + (-d(E_x)/dz + d(E_z)/dx) dx/\\dz + (-d(E_y)/dz + d(E_z)/dy) dy/\\dz" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dE0.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Lei de Gauss: $\\quad d\\mathbf{B} = 0$" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{d}B = \\left( \\frac{\\partial\\,B_{x}}{\\partial x} + \\frac{\\partial\\,B_{y}}{\\partial y} + \\frac{\\partial\\,B_{z}}{\\partial z} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "dB = (d(B_x)/dx + d(B_y)/dy + d(B_z)/dz) dx/\\dy/\\dz" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dB0.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Caso dinâmico" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [], "source": [ "vE = [function('E_'+i)(t,x,y,z) for i in ['x','y','z']]" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[B_{z}\\left(x, y, z\\right), -B_{y}\\left(x, y, z\\right), B_{x}\\left(x, y, z\\right)\\right]\n", "\\end{math}" ], "text/plain": [ "[B_z(x, y, z), -B_y(x, y, z), B_x(x, y, z)]" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vB = [function('B_z')(t,x,y,z), -function('B_y')(t,x,y,z), function('B_x')(t,x,y,z)];vB0" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}E = E_{x}\\left(t, x, y, z\\right) \\mathrm{d} x + E_{y}\\left(t, x, y, z\\right) \\mathrm{d} y + E_{z}\\left(t, x, y, z\\right) \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "E = E_x(t, x, y, z) dx + E_y(t, x, y, z) dy + E_z(t, x, y, z) dz" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "E = M.one_form([0]+vE, name='E');E.display()" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}B = B_{z}\\left(t, x, y, z\\right) \\mathrm{d} x\\wedge \\mathrm{d} y -B_{y}\\left(t, x, y, z\\right) \\mathrm{d} x\\wedge \\mathrm{d} z + B_{x}\\left(t, x, y, z\\right) \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "B = B_z(t, x, y, z) dx/\\dy - B_y(t, x, y, z) dx/\\dz + B_x(t, x, y, z) dy/\\dz" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "B = M.diff_form(2,name='B')\n", "B[1,2],B[1,3],B[2,3] = vB;B.display()" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{d} t\n", "\\end{math}" ], "text/plain": [ "1-form dt on the 4-dimensional Lorentzian manifold M" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dt = M.coframes()[0][0];dt" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}E\\wedge \\mathrm{d} t + B = -E_{x}\\left(t, x, y, z\\right) \\mathrm{d} t\\wedge \\mathrm{d} x -E_{y}\\left(t, x, y, z\\right) \\mathrm{d} t\\wedge \\mathrm{d} y -E_{z}\\left(t, x, y, z\\right) \\mathrm{d} t\\wedge \\mathrm{d} z + B_{z}\\left(t, x, y, z\\right) \\mathrm{d} x\\wedge \\mathrm{d} y -B_{y}\\left(t, x, y, z\\right) \\mathrm{d} x\\wedge \\mathrm{d} z + B_{x}\\left(t, x, y, z\\right) \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "E/\\dt+B = -E_x(t, x, y, z) dt/\\dx - E_y(t, x, y, z) dt/\\dy - E_z(t, x, y, z) dt/\\dz + B_z(t, x, y, z) dx/\\dy - B_y(t, x, y, z) dx/\\dz + B_x(t, x, y, z) dy/\\dz" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F = E.wedge(dt) + B;F.display()" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n", "0 & -E_{x}\\left(t, x, y, z\\right) & -E_{y}\\left(t, x, y, z\\right) & -E_{z}\\left(t, x, y, z\\right) \\\\\n", "E_{x}\\left(t, x, y, z\\right) & 0 & B_{z}\\left(t, x, y, z\\right) & -B_{y}\\left(t, x, y, z\\right) \\\\\n", "E_{y}\\left(t, x, y, z\\right) & -B_{z}\\left(t, x, y, z\\right) & 0 & B_{x}\\left(t, x, y, z\\right) \\\\\n", "E_{z}\\left(t, x, y, z\\right) & B_{y}\\left(t, x, y, z\\right) & -B_{x}\\left(t, x, y, z\\right) & 0\n", "\\end{array}\\right)\n", "\\end{math}" ], "text/plain": [ "[ 0 -E_x(t, x, y, z) -E_y(t, x, y, z) -E_z(t, x, y, z)]\n", "[ E_x(t, x, y, z) 0 B_z(t, x, y, z) -B_y(t, x, y, z)]\n", "[ E_y(t, x, y, z) -B_z(t, x, y, z) 0 B_x(t, x, y, z)]\n", "[ E_z(t, x, y, z) B_y(t, x, y, z) -B_x(t, x, y, z) 0]" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F[:]" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{d} \\left( E\\wedge \\mathrm{d} t + B \\right) = \\left( \\frac{\\partial\\,B_{z}}{\\partial t} - \\frac{\\partial\\,E_{x}}{\\partial y} + \\frac{\\partial\\,E_{y}}{\\partial x} \\right) \\mathrm{d} t\\wedge \\mathrm{d} x\\wedge \\mathrm{d} y + \\left( -\\frac{\\partial\\,B_{y}}{\\partial t} - \\frac{\\partial\\,E_{x}}{\\partial z} + \\frac{\\partial\\,E_{z}}{\\partial x} \\right) \\mathrm{d} t\\wedge \\mathrm{d} x\\wedge \\mathrm{d} z + \\left( \\frac{\\partial\\,B_{x}}{\\partial t} - \\frac{\\partial\\,E_{y}}{\\partial z} + \\frac{\\partial\\,E_{z}}{\\partial y} \\right) \\mathrm{d} t\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z + \\left( \\frac{\\partial\\,B_{x}}{\\partial x} + \\frac{\\partial\\,B_{y}}{\\partial y} + \\frac{\\partial\\,B_{z}}{\\partial z} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "d(E/\\dt+B) = (d(B_z)/dt - d(E_x)/dy + d(E_y)/dx) dt/\\dx/\\dy + (-d(B_y)/dt - d(E_x)/dz + d(E_z)/dx) dt/\\dx/\\dz + (d(B_x)/dt - d(E_y)/dz + d(E_z)/dy) dt/\\dy/\\dz + (d(B_x)/dx + d(B_y)/dy + d(B_z)/dz) dx/\\dy/\\dz" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dF = F.exterior_derivative();dF.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "| **Lei** | **Equação diferencial** |\n", "| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n", "| Lei de Gauss para o magnetismo | ${\\displaystyle \\nabla \\cdot \\mathbf{B} =0}$ |\n", "| Lei de Faraday | ${\\displaystyle \\nabla \\times \\mathbf{E} =-{\\frac {\\partial \\mathbf {B} }{\\partial t}}} $ |" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Lei de Gauss para $\\mathbf{B}$ e Lei de Faraday: $\\quad dF =0$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "***" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Dual de Hodge\n", "$$\\star: \\Omega^p(M) \\to \\Omega^{n-p}$$\n", "tal que\n", "$$\\omega \\wedge \\star \\mu = g(\\omega,\\mu) \\text{vol}$$" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [], "source": [ "star_F = F.hodge_dual(eta)" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\star \\left( E\\wedge \\mathrm{d} t + B \\right) = B_{x}\\left(t, x, y, z\\right) \\mathrm{d} t\\wedge \\mathrm{d} x + B_{y}\\left(t, x, y, z\\right) \\mathrm{d} t\\wedge \\mathrm{d} y + B_{z}\\left(t, x, y, z\\right) \\mathrm{d} t\\wedge \\mathrm{d} z + E_{z}\\left(t, x, y, z\\right) \\mathrm{d} x\\wedge \\mathrm{d} y -E_{y}\\left(t, x, y, z\\right) \\mathrm{d} x\\wedge \\mathrm{d} z + E_{x}\\left(t, x, y, z\\right) \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "*(E/\\dt+B) = B_x(t, x, y, z) dt/\\dx + B_y(t, x, y, z) dt/\\dy + B_z(t, x, y, z) dt/\\dz + E_z(t, x, y, z) dx/\\dy - E_y(t, x, y, z) dx/\\dz + E_x(t, x, y, z) dy/\\dz" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "star_F.display()" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [], "source": [ "dstar_F = star_F.exterior_derivative().hodge_dual(eta)" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\star \\mathrm{d} \\star \\left( E\\wedge \\mathrm{d} t + B \\right) = \\left( -\\frac{\\partial\\,E_{x}}{\\partial x} - \\frac{\\partial\\,E_{y}}{\\partial y} - \\frac{\\partial\\,E_{z}}{\\partial z} \\right) \\mathrm{d} t + \\left( -\\frac{\\partial\\,B_{y}}{\\partial z} + \\frac{\\partial\\,B_{z}}{\\partial y} - \\frac{\\partial\\,E_{x}}{\\partial t} \\right) \\mathrm{d} x + \\left( \\frac{\\partial\\,B_{x}}{\\partial z} - \\frac{\\partial\\,B_{z}}{\\partial x} - \\frac{\\partial\\,E_{y}}{\\partial t} \\right) \\mathrm{d} y + \\left( -\\frac{\\partial\\,B_{x}}{\\partial y} + \\frac{\\partial\\,B_{y}}{\\partial x} - \\frac{\\partial\\,E_{z}}{\\partial t} \\right) \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "*d*(E/\\dt+B) = (-d(E_x)/dx - d(E_y)/dy - d(E_z)/dz) dt + (-d(B_y)/dz + d(B_z)/dy - d(E_x)/dt) dx + (d(B_x)/dz - d(B_z)/dx - d(E_y)/dt) dy + (-d(B_x)/dy + d(B_y)/dx - d(E_z)/dt) dz" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dstar_F.display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Fonte" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [], "source": [ "ep0 = var('epsilon_0')\n", "mu0 = var('mu_0')" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mu_{0}\n", "\\end{math}" ], "text/plain": [ "mu_0" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mu0" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [], "source": [ "rho = function('rho', latex_name=r'\\rho')(t,x,y,z)\n", "fJ = [rho]+[function('J_'+str(i))(t,x,y,z) for i in range(1,4)]" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [], "source": [ "J = M.one_form(fJ, name='J')" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}J = \\rho\\left(t, x, y, z\\right) \\mathrm{d} t + J_{1}\\left(t, x, y, z\\right) \\mathrm{d} x + J_{2}\\left(t, x, y, z\\right) \\mathrm{d} y + J_{3}\\left(t, x, y, z\\right) \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "J = rho(t, x, y, z) dt + J_1(t, x, y, z) dx + J_2(t, x, y, z) dy + J_3(t, x, y, z) dz" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "J.display()" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\star \\mathrm{d} \\star \\left( E\\wedge \\mathrm{d} t + B \\right) + J = \\left( \\rho\\left(t, x, y, z\\right) - \\frac{\\partial\\,E_{x}}{\\partial x} - \\frac{\\partial\\,E_{y}}{\\partial y} - \\frac{\\partial\\,E_{z}}{\\partial z} \\right) \\mathrm{d} t + \\left( J_{1}\\left(t, x, y, z\\right) - \\frac{\\partial\\,B_{y}}{\\partial z} + \\frac{\\partial\\,B_{z}}{\\partial y} - \\frac{\\partial\\,E_{x}}{\\partial t} \\right) \\mathrm{d} x + \\left( J_{2}\\left(t, x, y, z\\right) + \\frac{\\partial\\,B_{x}}{\\partial z} - \\frac{\\partial\\,B_{z}}{\\partial x} - \\frac{\\partial\\,E_{y}}{\\partial t} \\right) \\mathrm{d} y + \\left( J_{3}\\left(t, x, y, z\\right) - \\frac{\\partial\\,B_{x}}{\\partial y} + \\frac{\\partial\\,B_{y}}{\\partial x} - \\frac{\\partial\\,E_{z}}{\\partial t} \\right) \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "*d*(E/\\dt+B)+J = (rho(t, x, y, z) - d(E_x)/dx - d(E_y)/dy - d(E_z)/dz) dt + (J_1(t, x, y, z) - d(B_y)/dz + d(B_z)/dy - d(E_x)/dt) dx + (J_2(t, x, y, z) + d(B_x)/dz - d(B_z)/dx - d(E_y)/dt) dy + (J_3(t, x, y, z) - d(B_x)/dy + d(B_y)/dx - d(E_z)/dt) dz" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(dstar_F+J).display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "| **Lei** | **Equação diferencial** |\n", "| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n", "| Lei de Gauss | ${\\displaystyle \\nabla \\cdot \\mathbf{E} ={\\rho }} $ |\n", "| Lei de Gauss para o magnetismo | ${\\displaystyle \\nabla \\cdot \\mathbf{B} =0}$ |\n", "| Lei de Faraday | ${\\displaystyle \\nabla \\times \\mathbf{E} =-{\\frac {\\partial \\mathbf {B} }{\\partial t}}} $ |\n", "| Lei circular de Ampère | ${\\displaystyle \\nabla \\times \\mathbf{B} =\\mathbf {J} +{\\frac {\\partial \\mathbf {E} }{\\partial t}}}$ |" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Lei de Gauss e Lei de Ampère\n", "$$\\star d \\star dF = \\mathbf{J}$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "***" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Lei de conservação" ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{d}\\star J = \\left( \\frac{\\partial\\,J_{1}}{\\partial x} + \\frac{\\partial\\,J_{2}}{\\partial y} + \\frac{\\partial\\,J_{3}}{\\partial z} - \\frac{\\partial\\,\\rho}{\\partial t} \\right) \\mathrm{d} t\\wedge \\mathrm{d} x\\wedge \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "d*J = (d(J_1)/dx + d(J_2)/dy + d(J_3)/dz - d(rho)/dt) dt/\\dx/\\dy/\\dz" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "J.hodge_dual(eta).exterior_derivative().display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Potencial" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [], "source": [ "Phi = function('Phi', latex_name=r'\\Phi')(t,x,y,z)" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [], "source": [ "fA = [-Phi]+[function('A_'+str(i))(t,x,y,z) for i in range(1,4)]" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[-\\Phi\\left(t, x, y, z\\right), A_{1}\\left(t, x, y, z\\right), A_{2}\\left(t, x, y, z\\right), A_{3}\\left(t, x, y, z\\right)\\right]\n", "\\end{math}" ], "text/plain": [ "[-Phi(t, x, y, z), A_1(t, x, y, z), A_2(t, x, y, z), A_3(t, x, y, z)]" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fA" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [], "source": [ "A = M.one_form(fA, name='A')" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}A = -\\Phi\\left(t, x, y, z\\right) \\mathrm{d} t + A_{1}\\left(t, x, y, z\\right) \\mathrm{d} x + A_{2}\\left(t, x, y, z\\right) \\mathrm{d} y + A_{3}\\left(t, x, y, z\\right) \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "A = -Phi(t, x, y, z) dt + A_1(t, x, y, z) dx + A_2(t, x, y, z) dy + A_3(t, x, y, z) dz" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "A.display()" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1-form A on the 4-dimensional Lorentzian manifold M\n" ] }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\Omega^{1}\\left(M\\right)\n", "\\end{math}" ], "text/plain": [ "Free module Omega^1(M) of 1-forms on the 4-dimensional Lorentzian manifold M" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(A)\n", "A.parent()" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [], "source": [ "F_A = A.exterior_derivative()" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{d}A = \\left( \\frac{\\partial\\,A_{1}}{\\partial t} + \\frac{\\partial\\,\\Phi}{\\partial x} \\right) \\mathrm{d} t\\wedge \\mathrm{d} x + \\left( \\frac{\\partial\\,A_{2}}{\\partial t} + \\frac{\\partial\\,\\Phi}{\\partial y} \\right) \\mathrm{d} t\\wedge \\mathrm{d} y + \\left( \\frac{\\partial\\,A_{3}}{\\partial t} + \\frac{\\partial\\,\\Phi}{\\partial z} \\right) \\mathrm{d} t\\wedge \\mathrm{d} z + \\left( -\\frac{\\partial\\,A_{1}}{\\partial y} + \\frac{\\partial\\,A_{2}}{\\partial x} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y + \\left( -\\frac{\\partial\\,A_{1}}{\\partial z} + \\frac{\\partial\\,A_{3}}{\\partial x} \\right) \\mathrm{d} x\\wedge \\mathrm{d} z + \\left( -\\frac{\\partial\\,A_{2}}{\\partial z} + \\frac{\\partial\\,A_{3}}{\\partial y} \\right) \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "dA = (d(A_1)/dt + d(Phi)/dx) dt/\\dx + (d(A_2)/dt + d(Phi)/dy) dt/\\dy + (d(A_3)/dt + d(Phi)/dz) dt/\\dz + (-d(A_1)/dy + d(A_2)/dx) dx/\\dy + (-d(A_1)/dz + d(A_3)/dx) dx/\\dz + (-d(A_2)/dz + d(A_3)/dy) dy/\\dz" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F_A.display()" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\frac{\\partial\\,A_{1}}{\\partial t} + \\frac{\\partial\\,\\Phi}{\\partial x}\n", "\\end{math}" ], "text/plain": [ "d(A_1)/dt + d(Phi)/dx" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F_A[0,1]" ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n", "0 & \\frac{\\partial\\,A_{1}}{\\partial t} + \\frac{\\partial\\,\\Phi}{\\partial x} & \\frac{\\partial\\,A_{2}}{\\partial t} + \\frac{\\partial\\,\\Phi}{\\partial y} & \\frac{\\partial\\,A_{3}}{\\partial t} + \\frac{\\partial\\,\\Phi}{\\partial z} \\\\\n", "-\\frac{\\partial\\,A_{1}}{\\partial t} - \\frac{\\partial\\,\\Phi}{\\partial x} & 0 & -\\frac{\\partial\\,A_{1}}{\\partial y} + \\frac{\\partial\\,A_{2}}{\\partial x} & -\\frac{\\partial\\,A_{1}}{\\partial z} + \\frac{\\partial\\,A_{3}}{\\partial x} \\\\\n", "-\\frac{\\partial\\,A_{2}}{\\partial t} - \\frac{\\partial\\,\\Phi}{\\partial y} & \\frac{\\partial\\,A_{1}}{\\partial y} - \\frac{\\partial\\,A_{2}}{\\partial x} & 0 & -\\frac{\\partial\\,A_{2}}{\\partial z} + \\frac{\\partial\\,A_{3}}{\\partial y} \\\\\n", "-\\frac{\\partial\\,A_{3}}{\\partial t} - \\frac{\\partial\\,\\Phi}{\\partial z} & \\frac{\\partial\\,A_{1}}{\\partial z} - \\frac{\\partial\\,A_{3}}{\\partial x} & \\frac{\\partial\\,A_{2}}{\\partial z} - \\frac{\\partial\\,A_{3}}{\\partial y} & 0\n", "\\end{array}\\right)\n", "\\end{math}" ], "text/plain": [ "[ 0 d(A_1)/dt + d(Phi)/dx d(A_2)/dt + d(Phi)/dy d(A_3)/dt + d(Phi)/dz]\n", "[-d(A_1)/dt - d(Phi)/dx 0 -d(A_1)/dy + d(A_2)/dx -d(A_1)/dz + d(A_3)/dx]\n", "[-d(A_2)/dt - d(Phi)/dy d(A_1)/dy - d(A_2)/dx 0 -d(A_2)/dz + d(A_3)/dy]\n", "[-d(A_3)/dt - d(Phi)/dz d(A_1)/dz - d(A_3)/dx d(A_2)/dz - d(A_3)/dy 0]" ] }, "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F_A[:]" ] }, { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2-form dA on the 4-dimensional Lorentzian manifold M\n" ] }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\Omega^{2}\\left(M\\right)\n", "\\end{math}" ], "text/plain": [ "Free module Omega^2(M) of 2-forms on the 4-dimensional Lorentzian manifold M" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "print(F_A)\n", "F_A.parent()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Campos de Gauge" ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [], "source": [ "G = M.scalar_field(function('G')(t,x,y,z))" ] }, { "cell_type": "code", "execution_count": 54, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{llcl} & M & \\longrightarrow & \\mathbb{R} \\\\ & \\left(t, x, y, z\\right) & \\longmapsto & G\\left(t, x, y, z\\right) \\end{array}\n", "\\end{math}" ], "text/plain": [ "M --> R\n", "(t, x, y, z) |--> G(t, x, y, z)" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "G.display()" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}0\n", "\\end{math}" ], "text/plain": [ "0" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "G.exterior_derivative().exterior_derivative().display()" ] }, { "cell_type": "code", "execution_count": 56, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left( -\\Phi\\left(t, x, y, z\\right) + \\frac{\\partial\\,G}{\\partial t} \\right) \\mathrm{d} t + \\left( A_{1}\\left(t, x, y, z\\right) + \\frac{\\partial\\,G}{\\partial x} \\right) \\mathrm{d} x + \\left( A_{2}\\left(t, x, y, z\\right) + \\frac{\\partial\\,G}{\\partial y} \\right) \\mathrm{d} y + \\left( A_{3}\\left(t, x, y, z\\right) + \\frac{\\partial\\,G}{\\partial z} \\right) \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "(-Phi(t, x, y, z) + d(G)/dt) dt + (A_1(t, x, y, z) + d(G)/dx) dx + (A_2(t, x, y, z) + d(G)/dy) dy + (A_3(t, x, y, z) + d(G)/dz) dz" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "A2 = A+ G.exterior_derivative()\n", "A2.display()" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left( \\frac{\\partial\\,A_{1}}{\\partial t} + \\frac{\\partial\\,\\Phi}{\\partial x} \\right) \\mathrm{d} t\\wedge \\mathrm{d} x + \\left( \\frac{\\partial\\,A_{2}}{\\partial t} + \\frac{\\partial\\,\\Phi}{\\partial y} \\right) \\mathrm{d} t\\wedge \\mathrm{d} y + \\left( \\frac{\\partial\\,A_{3}}{\\partial t} + \\frac{\\partial\\,\\Phi}{\\partial z} \\right) \\mathrm{d} t\\wedge \\mathrm{d} z + \\left( -\\frac{\\partial\\,A_{1}}{\\partial y} + \\frac{\\partial\\,A_{2}}{\\partial x} \\right) \\mathrm{d} x\\wedge \\mathrm{d} y + \\left( -\\frac{\\partial\\,A_{1}}{\\partial z} + \\frac{\\partial\\,A_{3}}{\\partial x} \\right) \\mathrm{d} x\\wedge \\mathrm{d} z + \\left( -\\frac{\\partial\\,A_{2}}{\\partial z} + \\frac{\\partial\\,A_{3}}{\\partial y} \\right) \\mathrm{d} y\\wedge \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "(d(A_1)/dt + d(Phi)/dx) dt/\\dx + (d(A_2)/dt + d(Phi)/dy) dt/\\dy + (d(A_3)/dt + d(Phi)/dz) dt/\\dz + (-d(A_1)/dy + d(A_2)/dx) dx/\\dy + (-d(A_1)/dz + d(A_3)/dx) dx/\\dz + (-d(A_2)/dz + d(A_3)/dy) dy/\\dz" ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "A2.exterior_derivative().display()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Comparando com a derivada covariante" ] }, { "cell_type": "code", "execution_count": 58, "metadata": {}, "outputs": [], "source": [ "star_dE_star = -(E.hodge_dual(eta).exterior_derivative().hodge_dual(eta))" ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Scalar field -*d*E on the 4-dimensional Lorentzian manifold M\n" ] } ], "source": [ "print(star_dE_star)" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{llcl} -\\star \\mathrm{d}\\star E:& M & \\longrightarrow & \\mathbb{R} \\\\ & \\left(t, x, y, z\\right) & \\longmapsto & \\frac{\\partial\\,E_{x}}{\\partial x} + \\frac{\\partial\\,E_{y}}{\\partial y} + \\frac{\\partial\\,E_{z}}{\\partial z} \\end{array}\n", "\\end{math}" ], "text/plain": [ "-*d*E: M --> R\n", " (t, x, y, z) |--> d(E_x)/dx + d(E_y)/dy + d(E_z)/dz" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "star_dE_star.display()" ] }, { "cell_type": "code", "execution_count": 61, "metadata": {}, "outputs": [], "source": [ "nabla = eta.connection()" ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\nabla_{\\eta} E = \\frac{\\partial\\,E_{x}}{\\partial t} \\mathrm{d} x\\otimes \\mathrm{d} t + \\frac{\\partial\\,E_{x}}{\\partial x} \\mathrm{d} x\\otimes \\mathrm{d} x + \\frac{\\partial\\,E_{x}}{\\partial y} \\mathrm{d} x\\otimes \\mathrm{d} y + \\frac{\\partial\\,E_{x}}{\\partial z} \\mathrm{d} x\\otimes \\mathrm{d} z + \\frac{\\partial\\,E_{y}}{\\partial t} \\mathrm{d} y\\otimes \\mathrm{d} t + \\frac{\\partial\\,E_{y}}{\\partial x} \\mathrm{d} y\\otimes \\mathrm{d} x + \\frac{\\partial\\,E_{y}}{\\partial y} \\mathrm{d} y\\otimes \\mathrm{d} y + \\frac{\\partial\\,E_{y}}{\\partial z} \\mathrm{d} y\\otimes \\mathrm{d} z + \\frac{\\partial\\,E_{z}}{\\partial t} \\mathrm{d} z\\otimes \\mathrm{d} t + \\frac{\\partial\\,E_{z}}{\\partial x} \\mathrm{d} z\\otimes \\mathrm{d} x + \\frac{\\partial\\,E_{z}}{\\partial y} \\mathrm{d} z\\otimes \\mathrm{d} y + \\frac{\\partial\\,E_{z}}{\\partial z} \\mathrm{d} z\\otimes \\mathrm{d} z\n", "\\end{math}" ], "text/plain": [ "nabla_eta(E) = d(E_x)/dt dx*dt + d(E_x)/dx dx*dx + d(E_x)/dy dx*dy + d(E_x)/dz dx*dz + d(E_y)/dt dy*dt + d(E_y)/dx dy*dx + d(E_y)/dy dy*dy + d(E_y)/dz dy*dz + d(E_z)/dt dz*dt + d(E_z)/dx dz*dx + d(E_z)/dy dz*dy + d(E_z)/dz dz*dz" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nabla(E).display()" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [], "source": [ "div_E = nabla(E).up(eta,0).trace()" ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\begin{array}{llcl} & M & \\longrightarrow & \\mathbb{R} \\\\ & \\left(t, x, y, z\\right) & \\longmapsto & \\frac{\\partial\\,E_{x}}{\\partial x} + \\frac{\\partial\\,E_{y}}{\\partial y} + \\frac{\\partial\\,E_{z}}{\\partial z} \\end{array}\n", "\\end{math}" ], "text/plain": [ "M --> R\n", "(t, x, y, z) |--> d(E_x)/dx + d(E_y)/dy + d(E_z)/dz" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "div_E.display()" ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\mathrm{True}\n", "\\end{math}" ], "text/plain": [ "True" ] }, "execution_count": 65, "metadata": {}, "output_type": "execute_result" } ], "source": [ "star_dE_star == div_E" ] } ], "metadata": { "kernelspec": { "display_name": "SageMath 9.2", "language": "sage", "name": "sagemath" }, "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.5" } }, "nbformat": 4, "nbformat_minor": 4 }