{ "cells": [ { "cell_type": "markdown", "id": "9e8afe14-79cd-4ef9-8024-45638010e642", "metadata": {}, "source": [ "# Cosmology " ] }, { "cell_type": "markdown", "id": "f92b3c07-80bb-472e-be8c-cfcff2d305b2", "metadata": {}, "source": [ "## Section 1: Setup the metric " ] }, { "cell_type": "code", "execution_count": 23, "id": "27ba461d-dd62-4539-bc64-e0610d03a55c", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\t\t\t\t\t\t\t\t\t\t\t\t
\"Output\"
\"Output\"
" ], "text/plain": [ "\n", "\n", "\n", "\n", "\n", "1 0 0 0\n", "\n", " 2\n", " R[t]\n", " -(------------)\n", " D 2\n", " 1 + - - k r\n", "0 r 0 0\n", "\n", "\n", "\n", "\n", "\n", " 2 2\n", "0 0 -(r R[t] ) 0\n", "\n", "\n", "\n", "\n", "\n", " 2 2 2\n", "0 0 0 -(r R[t] Sin[θ] )\n", "/mnt/d/coding/coscom" ] }, "execution_count": 23, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "(* Defining coordinate system *)\n", "coord = {t, r, θ, ϕ};\n", "(* Set these variable for coordinate, hopefully mathematica will be \\\n", "smarter when we Simplify *)\n", "(* Noted that e is an expansions parameter *)\n", "$Assumptions = t ∈ Reals && r ∈ Reals && θ ∈ Reals && ϕ ∈ Reals && e ∈ Reals;\n", "(* Defining the metric*)\n", "metric = DiagonalMatrix[{1, -(R[t]^2/(1 - k r^2 + D/r)), -R[t]^2 r^2, -R[t]^2 (r*Sin[θ])^2}];\n", "metricsign = -1;\n", "metric // MatrixForm\n", "(* Load the package from the folder which you put diffgeo.m *)\n", "SetDirectory[\"/mnt/d/coding/coscom\"]\n", "<< diffgeo.m" ] }, { "cell_type": "markdown", "id": "ed97ca99-c706-4900-a6d5-b802f5218c10", "metadata": {}, "source": [ "## Section 2 : The equation of motion, typical Einstein equation + cosmological constant\n", "(* axion can be straightforwardly added *)" ] }, { "cell_type": "code", "execution_count": 27, "id": "b9be4a37-b272-4cde-8eba-5b993a2d72ac", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ "Einstein tensor, with both indices down.\n", "Einstein := (Unprotect[Einstein]; \n", "\n", " \n", "> Einstein = Simplify[RicciTensor - RicciScalar*(metric/2)]; Protect[Einstein];\\\n", " \n", "> Einstein)\n", " \n", "\n", "\n", "Attributes[Einstein]={Protected}" ] }, "execution_count": 27, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "?Einstein" ] }, { "cell_type": "code", "execution_count": 28, "id": "d33b78b0-2f41-45a1-86ab-a14255a959e2", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " 3 3 2\n", " D - k r - r R'[t]\n", " --------------------\n", "{ϕ, θ, θ, ϕ} r\n", "\n", " 3 3 2\n", " -D + k r + r R'[t]\n", " ---------------------\n", "{θ, ϕ, θ, ϕ} r\n", "\n", " 2 3 3 2\n", " Sin[θ] (-D + k r + r R'[t] )\n", " -(-------------------------------)\n", "{θ, ϕ, ϕ, θ} r\n", "\n", " 2 3 3 2\n", " Sin[θ] (-D + k r + r R'[t] )\n", " -------------------------------\n", "{ϕ, θ, ϕ, θ} r\n", "\n", " 3 3 2\n", " 1 D + 2 k r + 2 r R'[t]\n", " -(-) ------------------------\n", "{r, θ, θ, r} 2 r\n", "\n", " 3 3 2\n", " D + 2 k r + 2 r R'[t]\n", " ------------------------\n", "{θ, r, θ, r} 2 r\n", "\n", " 3 3 2\n", " 1 D + 2 k r + 2 r R'[t]\n", " -(-) ------------------------\n", "{θ, r, r, θ} 2 2 3\n", "{ϕ, r, r, ϕ} r (D + r - k r )\n", "\n", " 3 3 2\n", " D + 2 k r + 2 r R'[t]\n", " ------------------------\n", "{r, θ, r, θ} 2 3\n", "{r, ϕ, r, ϕ} 2 r (D + r - k r )\n", "\n", " 2 3 3 2\n", " 1 Sin[θ] (D + 2 k r + 2 r R'[t] )\n", " -(-) ----------------------------------\n", "{r, ϕ, ϕ, r} 2 r\n", "\n", " 2 3 3 2\n", " Sin[θ] (D + 2 k r + 2 r R'[t] )\n", " ----------------------------------\n", "{ϕ, r, ϕ, r} 2 r\n", "\n", "{t, r, t, r} R''[t]\n", "{t, θ, t, θ} -(------)\n", "{t, ϕ, t, ϕ} R[t]\n", "\n", "{r, t, t, r} R''[t]\n", "{θ, t, t, θ} ------\n", "{ϕ, t, t, ϕ} R[t]\n", "\n", " 2\n", "{t, θ, θ, t} -(r R[t] R''[t])\n", "\n", " 2\n", "{θ, t, θ, t} r R[t] R''[t]\n", "\n", " r R[t] R''[t]\n", " -(-------------)\n", " 3\n", "{t, r, r, t} D + r - k r\n", "\n", " r R[t] R''[t]\n", " -------------\n", " 3\n", "{r, t, r, t} D + r - k r\n", "\n", " 2 2\n", "{t, ϕ, ϕ, t} -(r R[t] Sin[θ] R''[t])\n", "\n", " 2 2\n", "{ϕ, t, ϕ, t} r R[t] Sin[θ] R''[t]" ] }, "execution_count": 28, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "display[Riemann]" ] }, { "cell_type": "code", "execution_count": 29, "id": "cf6289cc-0c75-4d34-b54d-bfdb34740275", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " 2\n", "-6 (k + R'[t] + R[t] R''[t])\n", "-----------------------------\n", " 2\n", " R[t]" ] }, "execution_count": 29, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "RicciScalar" ] }, { "cell_type": "code", "execution_count": 30, "id": "bee1958b-8294-4f07-9ba8-06df58b0798e", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " 2\n", " 3 (k + R'[t] )\n", " --------------\n", " 2\n", "{t, t} R[t]\n", "\n", " 3 3 2 3\n", " -D + k r + r R'[t] + 2 r R[t] R''[t]\n", " -(----------------------------------------)\n", " 2 3\n", "{r, r} r (D + r - k r )\n", "\n", " 3 3 2 3\n", " 1 D + 2 k r + 2 r R'[t] + 4 r R[t] R''[t]\n", " -(-) -------------------------------------------\n", "{θ, θ} 2 r\n", "\n", " 2 3 3 2 3\n", " 1 Sin[θ] (D + 2 k r + 2 r R'[t] + 4 r R[t] R''[t])\n", " -(-) -----------------------------------------------------\n", "{ϕ, ϕ} 2 r" ] }, "execution_count": 30, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "display[Einstein]" ] }, { "cell_type": "code", "execution_count": 31, "id": "e310ce84-735b-47f8-9b32-859cf0e68120", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " -3 R''[t]\n", " ---------\n", "{t, t} R[t]\n", "\n", " 1 D 2 2 2 2\n", " -(-) - + 2 k r + 2 r R'[t] + r R[t] R''[t]\n", "{θ, θ} 2 r\n", "\n", " 3 3 2 3\n", " D + 2 k r + 2 r R'[t] + r R[t] R''[t]\n", " -----------------------------------------\n", " 2 3\n", "{r, r} r (D + r - k r )\n", "\n", " 2 3 3 2 3\n", " Sin[θ] (-D + 4 k r + 4 r R'[t] + 2 r R[t] R''[t])\n", " ------------------------------------------------------\n", "{ϕ, ϕ} 2 r" ] }, "execution_count": 31, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "display[RicciTensor]" ] }, { "cell_type": "code", "execution_count": 32, "id": "df17587c-7c66-49e7-af0e-ebe594f29ef8", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ "lower[ tensor, {index1,index2,...} (optional) ] lowers index1, index2, etc. using the\\\n", " \n", "> metric; if the list of indices is omitted then all indices are lowered (so they\\\n", " \n", "> should all be up in the original tensor).\n", "lower[(tensor_)?ArrayQ] := lower[tensor, Range[ArrayDepth[tensor]]]\n", " \n", "lower[(tensor_)?ArrayQ, indic_List] := \n", "\n", " \n", "> Simplify[Fold[Transpose[Inner[Times, #1, metric, Plus, #2], \n", "\n", " \n", "> Join[Range[#2 - 1], Range[#2 + 1, ArrayDepth[tensor]], {#2}]] & , tensor,\\\n", " \n", "> indic]]\n", " \n", "\n", "\n", "Attributes[lower]={Protected}" ] }, "execution_count": 32, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "?lower" ] }, { "cell_type": "code", "execution_count": 34, "id": "552288bb-387f-41d5-a089-2972e22e12cf", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " 2\n", " r u1 R[t] 2 2 2 2 2\n", "{u0, -(------------), -(r u2 R[t] ), -(r u3 R[t] Sin[θ] )}\n", " 3\n", " D + r - k r" ] }, "execution_count": 34, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "u = {u0, u1, u2, u3};\n", "ul = lower[u] // FullSimplify\n", "(*{ud0,ud1,ud2,ud3}=ul;*)" ] }, { "cell_type": "markdown", "id": "a31d545c-6b37-4051-8e97-e1ae4a6c78e1", "metadata": {}, "source": [ "# $T_{\\mu\\nu} = (\\rho+P)u_{\\mu}u_{\\nu}-g_{\\mu\\nu}P$" ] }, { "cell_type": "code", "execution_count": 38, "id": "9b14009f-743d-4976-ba00-8a67dc6db874", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " 2 2\n", "{θ, θ} r P[t] R[t]\n", "\n", " 2\n", " P[t] R[t]\n", " ------------\n", " D 2\n", " 1 + - - k r\n", "{r, r} r\n", "\n", " 2 2 2\n", "{ϕ, ϕ} r P[t] R[t] Sin[θ]\n", "\n", "{t, t} ρ[t]" ] }, "execution_count": 38, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "usub = {u0 -> 1, u1 -> 0, u2 -> 0, u3 -> 0};(*Comoving observer*) \n", "Tmunu = (ρ[t] + P[t]) TensorProduct[ul, ul] - (P[t])*metric /. usub;\n", "display[Tmunu] " ] }, { "cell_type": "markdown", "id": "aaaa69ac-1aca-46d4-83c7-22ca53285b3c", "metadata": {}, "source": [ "# $G_{\\mu\\nu} = 8\\pi T_{\\mu\\nu}$" ] }, { "cell_type": "code", "execution_count": 39, "id": "93c887e2-175b-4f08-83f2-b9ef9200c1b6", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\t\t\t\t\t\t\t\t\t\t\t\t
\"Output\"
\"Output\"
" ], "text/plain": [ " 2\n", "3 (k + R'[t] )\n", "-------------- == 8 Pi ρ[t]\n", " 2\n", " R[t]\n", " 2 2\n", " k 8 Pi P[t] R[t] R'[t] 2 R[t] R''[t]\n", "--------- + --------------- + --------- + ------------- == 0\n", " 2 2 2 2\n", "-1 + k r -1 + k r -1 + k r -1 + k r" ] }, "execution_count": 39, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "Einstein[[1, 1]] == 8 π Tmunu[[1, 1]] \n", "(Einstein[[2, 2]] == 8 π Tmunu[[2, 2]] /. D -> 0) // Simplify // Expand" ] }, { "cell_type": "code", "execution_count": 41, "id": "7d10c79e-f220-424c-9012-66c0a574c258", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " 2\n", " k R'[t]\n", "---- + 8 Pi P[t] R[t] + ------ + 2 R''[t] == 0\n", "R[t] R[t]" ] }, "execution_count": 41, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "(-1 + k r^2)/R[t]^2 (k/(-1 + k r^2) + (8 π P[t] R[t]^2)/(-1 + k r^2) + Derivative[1][R][t]^2/(-1 + k r^2) + (2 R[t] (R'')[t])/(-1 + k r^2)) == 0 // Simplify // Expand" ] }, { "cell_type": "code", "execution_count": 43, "id": "df69b930-9475-43f7-a363-ca9978983f9a", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ "{r, r}\n", "{θ, θ}\n", "{ϕ, ϕ} -P[t]\n", "\n", "{t, t} ρ[t]" ] }, "execution_count": 43, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "Tdu1 = raise[Tmunu, {2}];\n", "display[Tdu1]" ] }, { "cell_type": "markdown", "id": "6b67bd23-14ac-40cf-915a-aace7840df6f", "metadata": {}, "source": [ "# $EOM = R_{\\mu\\nu} - 8\\pi (T_{\\mu\\nu} - g_{\\mu\\nu}T)$" ] }, { "cell_type": "code", "execution_count": 44, "id": "bbde89f2-109c-471b-ba3e-6bb951bdaa5d", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " 3 R''[t]\n", "{{-12 Pi P[t] - 4 Pi ρ[t] - --------, 0, 0, 0}, \n", " R[t]\n", " \n", "> {0, \n", " \n", " 3 3 2 3 2 3 2 3\n", " D + 2 k r + 4 Pi r P[t] R[t] - 4 Pi r R[t] ρ[t] + 2 r R'[t] + r R[t] R''[t]\n", "> -----------------------------------------------------------------------------------\n", " 2 3\n", " r (D + r - k r )\n", " \n", " 1 D 2 2 2 2 2\n", "> , 0, 0}, {0, 0, -(-) - + 2 k r + 4 Pi r P[t] R[t] - 4 Pi r R[t] ρ[t] + \n", " 2 r\n", " \n", " 2 2 2\n", "> 2 r R'[t] + r R[t] R''[t], 0}, \n", " \n", " 2 3 3 2 3 2\n", "> {0, 0, 0, (Sin[θ] (-D + 4 k r + 8 Pi r P[t] R[t] - 8 Pi r R[t] ρ[t] + \n", " \n", " 3 2 3\n", "> 4 r R'[t] + 2 r R[t] R''[t])) / (2 r)}}" ] }, "execution_count": 44, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "EOM = RicciTensor - 8 π (Tmunu - metric (Tdu1[[1, 1]] + Tdu1[[2, 2]] + Tdu1[[3, 3]] + Tdu1[[4, 4]])/2) // Simplify" ] }, { "cell_type": "code", "execution_count": 45, "id": "adab908b-59dd-4877-ab16-ab410d9331a2", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ "\n", "\n", "{t, t} 3 R''[t]\n", " -12 Pi P[t] - 4 Pi ρ[t] - --------\n", " R[t]\n", "\n", "\n", "\n", "{θ, θ} 1 D 2 2 2 2 2 2 2\n", " -(-) - + 2 k r + 4 Pi r P[t] R[t] - 4 Pi r R[t] ρ[t] + 2 r R'[t] + \n", " 2 r\n", " \n", " 2\n", " > r R[t] R''[t]\n", "\n", " 3 3 2 3 2 3 2\n", "{r, r} (D + 2 k r + 4 Pi r P[t] R[t] - 4 Pi r R[t] ρ[t] + 2 r R'[t] + \n", " \n", " 3 2 3\n", "> r R[t] R''[t]) / (r (D + r - k r ))\n", "\n", "\n", "{ϕ, ϕ} 2 3 3 2 3 2 3 2\n", " (Sin[θ] (-D + 4 k r + 8 Pi r P[t] R[t] - 8 Pi r R[t] ρ[t] + 4 r R'[t] + \n", " \n", " 3\n", " > 2 r R[t] R''[t])) / (2 r)" ] }, "execution_count": 45, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "display[EOM]" ] }, { "cell_type": "code", "execution_count": 46, "id": "1c976b72-c7a0-4c2b-ad8e-ecf1c9eac10a", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " 3 D 2 2\n", "3 k - ---- - 8 Pi R[t] ρ[t] + 3 R'[t]\n", " 3\n", " 4 r" ] }, "execution_count": 46, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "(EOM[[3, 3]] /. {R''[t] -> -((4*π)/3) R[t] *(ρ[t] + 3 P[t])}) 3/(2 r^2) // Simplify" ] }, { "cell_type": "code", "execution_count": 48, "id": "4c8417a6-1501-410d-b311-ce9f363d8376", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " 2\n", " D 8 Pi R[t] ρ[t] 2\n", "---- + --------------- == k + R'[t]\n", " 3 3\n", "4 r" ] }, "execution_count": 48, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "(*Only way [[1,1]] consistent with [[3,3]] is D=0*)\n", "D/(4 r^3) + 8/3 π R[t]^2 ρ[t] == (k + Derivative[1][R][t]^2)" ] }, { "cell_type": "code", "execution_count": 50, "id": "ce7fdc84-e8c8-4436-b95d-a4e14592fd93", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ " 2\n", "8 Pi R[t] ρ[t] 2\n", "--------------- == k + R'[t]\n", " 3" ] }, "execution_count": 50, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "(*ALSO Friedmann Eqn for D=0*)\n", "8/3 π R[t]^2 ρ[t] == (k + Derivative[1][R][t]^2)" ] }, { "cell_type": "code", "execution_count": 51, "id": "609a707d-a00f-4df0-b944-c85b2fafe93d", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ "covariant[ tensor, indexpositions (optional) ]: covariant derivative of a tensor; the\\\n", " \n", "> derivative index is the first index of the resulting tensor; the indexpositions\\\n", " \n", "> argument is a list of the form {up,down,down}; if it is omitted, then all indices\\\n", " \n", "> are assumed to be down. (The index position none is also allowed, indicating that\\\n", " \n", "> the corresponding index should be ignored, i.e. no connection should be used.)\n", "covariant[(scalar_)?scalarQ] := partial[scalar]\n", " \n", "covariant[(tensor_)?FullTensorQ] := covariant[tensor, ConstantArray[down, rank[tensor]]]\n", " \n", "covariant[tensor_, indexp:{(up | down | none)...}] := \n", "\n", " \n", "> Simplify[With[{trank = Length[indexp], Christoffelt = Transpose[Christoffel, \n", "\n", " \n", "> {3, 2, 1}]}, partial[tensor] + Sum[Which[indexp[[index]] === down, \n", "\n", " \n", "> -Transpose[Inner[Times, tensor, Christoffel, Plus, index], \n", "\n", " \n", "> Join[Range[2, index], Range[index + 2, trank + 1], {1, index + 1}]], \n", "\n", " \n", "> indexp[[index]] === up, Transpose[Inner[Times, tensor, Christoffelt, Plus,\\\n", " \n", "> index], \n", " Join[Range[2, index], Range[index + 2, trank + 1], {1, index +\\\n", " \n", "> 1}]], \n", " indexp[[index]] === none, 0], {index, trank}]]]\n", " \n", "\n", "\n", "Attributes[covariant]={Protected}" ] }, "execution_count": 51, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "?covariant" ] }, { "cell_type": "code", "execution_count": 52, "id": "82b9e120-a6ec-475c-bd40-b543ae89440a", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ "contract[ tensor, {index1,index2}, {index3,index4}, . . . (optional) ]: contraction of\\\n", " \n", "> index1 with index2, index3 with index4, etc., using the inverse metric (i.e. all\\\n", " \n", "> indices to be contracted are assumed to be down). If no index pair is given, it\\\n", " \n", "> returns the contraction of the first two indices.\n", "contract[(tensor_)?ArrayQ] := tr[inverse . tensor]\n", " \n", "contract[(tensor_)?ArrayQ, indic:{_, _}..] := Nest[tr[inverse . #1] & , \n", "\n", " \n", "> transpose[tensor, Join[indic]], Length[{indic}]]\n", " \n", "\n", "\n", "Attributes[contract]={Protected}" ] }, "execution_count": 52, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "?contract" ] }, { "cell_type": "code", "execution_count": 53, "id": "f76b4b5d-bedf-4aca-8324-9734e1ff8182", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\t\t\t\t\t\t\t\t\t\t\t\t
\"Output\"
\"Output\"
" ], "text/plain": [ " 3 (P[t] + ρ[t]) R'[t]\n", "{--------------------- + ρ'[t], 0, 0, 0}\n", " R[t]\n", " 3 (P[t] + ρ[t]) R'[t]\n", "{--------------------- + ρ'[t], 0, 0, 0}\n", " R[t]" ] }, "execution_count": 53, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "contract[covariant[Tmunu], {1, 2}]\n", "contract[covariant[Tmunu], {1, 3}]" ] }, { "cell_type": "code", "execution_count": 55, "id": "549f90a7-6786-44a9-9072-090204f5f554", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ "-3 P[t] + ρ[t]" ] }, "execution_count": 55, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "contract[Tmunu]" ] }, { "cell_type": "code", "execution_count": 57, "id": "76f6b7a9-baa4-46bf-bdd5-5346e67e4c0c", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "data": { "text/html": [ "
\"Output\"
" ], "text/plain": [ "3 (P[t] + ρ[t]) R'[t]\n", "--------------------- + ρ'[t]\n", " R[t]" ] }, "execution_count": 57, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "CON = contract[covariant[Tmunu], {1, 2}];\n", "CON[[1]]" ] }, { "cell_type": "code", "execution_count": 58, "id": "16558604-0b96-47f4-8b06-17e35b30b7ef", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [ { "ename": "DSolve::ifun", "evalue": "Inverse functions are being used by DSolve, so some solutions may not be found.", "output_type": "error", "traceback": [ "\u001b[0;31mDSolve::ifun: Inverse functions are being used by DSolve, so some solutions may not be found.\u001b[0m" ] }, { "data": { "text/html": [ "\n", "\n", "\t\t\t\t\t\t\t\t\t\t\t\t
\"Output\"
\"Output\"
" ], "text/plain": [ " R0 3 (1 + w) 2\n", "8 Pi ρ0 (----) R[t]\n", " R[t] 2\n", "----------------------------- == k + R'[t]\n", " 3\n", " (3 (1 + w))/2 2/(3 (1 + w))\n", " ((1 + w) (2 Sqrt[6 Pi] R0 t Sqrt[ρ0] + 3 C[1]))\n", "{{R[t] -> -------------------------------------------------------------------------}, \n", " 1/(3 + 3 w)\n", " 4\n", " \n", "> {R[t] -> \n", " \n", " (3 (1 + w))/2 2/(3 (1 + w))\n", " (-((1 + w) (2 Sqrt[6 Pi] R0 t Sqrt[ρ0] - 3 C[1])))\n", "> ----------------------------------------------------------------------------}}\n", " 1/(3 + 3 w)\n", " 4" ] }, "execution_count": 58, "metadata": { "text/html": [], "text/plain": [] }, "output_type": "execute_result" } ], "source": [ "(8/3 π R[t]^2 ρ[t] == (k + Derivative[1][R][t]^2) /. {P[t] -> w ρ[t]} /. {ρ[t] -> ρ0 (R0/R[t])^(3 (1 + w))})\n", "DSolve[8/3 π ρ0 (R0)^(3 (1 + w)) R[t]^(-1 - 3 w) == Derivative[1][R][t]^2, R[t], t] // Simplify " ] }, { "cell_type": "code", "execution_count": null, "id": "49b4c094-1d09-49b4-a270-8be59e0ce626", "metadata": { "vscode": { "languageId": "python" } }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Wolfram Language 14.1", "language": "Wolfram Language", "name": "wolframlanguage14.1" }, "language_info": { "codemirror_mode": "mathematica", "file_extension": ".m", "mimetype": "application/vnd.wolfram.m", "name": "Wolfram Language", "pygments_lexer": "mathematica", "version": "12.0" } }, "nbformat": 4, "nbformat_minor": 5 }