diff --git a/PruebasDeformaciones.ipynb b/PruebasDeformaciones.ipynb index 367aa66..36e108c 100644 --- a/PruebasDeformaciones.ipynb +++ b/PruebasDeformaciones.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 36, + "execution_count": 1, "id": "b0a70dc1-6537-456b-8243-43ab8eb49923", "metadata": {}, "outputs": [], @@ -18,7 +18,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 2, "id": "cad50def-ecb8-403f-b50c-ce026fbd216d", "metadata": {}, "outputs": [], @@ -28,7 +28,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 5, "id": "5ec9dd77-8118-4439-b8cb-4c475a2a645e", "metadata": {}, "outputs": [ @@ -38,7 +38,7 @@ "((0, 0, 0, 0, 0, 0, 1), (0, 0, 4, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 3))" ] }, - "execution_count": 38, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -53,7 +53,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 6, "id": "c5104650-44eb-4c9c-b016-c34994f72f38", "metadata": {}, "outputs": [], @@ -63,7 +63,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 7, "id": "8dccac88-2fa3-4365-990a-2571f643b9dc", "metadata": {}, "outputs": [], @@ -73,7 +73,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 8, "id": "097214a4-61e4-4939-bad0-4e5b3c8ac716", "metadata": {}, "outputs": [ @@ -84,7 +84,7 @@ " {1: 1, 2: 1, 6: 1, 4: 1, 3: 1, 12: 1, 8: 1, 7: 1, 24: 1, 21: 1})" ] }, - "execution_count": 41, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -95,7 +95,364 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 12, + "id": "3f56c2cb-e3b4-4c71-b6c8-903bf1736aef", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{0: (x^2*z + z^3 + x^4, (2, 1, 1), 1),\n", + " 1: (z^3 + x^4*z + x^8, (3, 1, 1), 0),\n", + " 2: (z^3 + x^6*z + x^12, (4, 1, 1), 0),\n", + " 3: (z^3 + x^7*z + x^12, (5, 1, 1), 1),\n", + " 4: (z^3 + x^14*z + x^24, (9, 1, 1), -1),\n", + " 5: (z^3 + x^15*z + x^24, (10, 1, 1), 0),\n", + " 6: (z^3 + x^16*z + x^24, (11, 1, 1), -2),\n", + " (0, 1): (z^3 + x^2*y^4*z + x^4*y^8, (2, 3, 1), 1),\n", + " (1, 2): (z^3 + x^4*y^6*z + x^8*y^12, (3, 4, 1), 1),\n", + " (2, 4): (z^3 + x^6*y^14*z + x^12*y^24, (4, 9, 1), 1),\n", + " (3, 4): (z^3 + x^7*y^14*z + x^12*y^24, (5, 9, 1), 1),\n", + " (4, 5): (z^3 + x^14*y^15*z + x^24*y^24, (9, 10, 1), 1),\n", + " (5, 6): (z^3 + x^15*y^16*z + x^24*y^24, (10, 11, 1), 1),\n", + " (6, 'd'): (z^3 + x^8*z^2 + x^24*y, (11, 1, 1), 3)}" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pols" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "558ef7c7-39cf-47bf-b224-479f1ff365d4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(-\\frac{1}{2}\\right) \\cdot (s + 1)^{-2} \\cdot (s - 1)\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(-\\frac{1}{2}\\right) \\cdot (s + 1)^{-2} \\cdot (s - 1)$" + ], + "text/plain": [ + "(-1/2) * (s + 1)^-2 * (s - 1)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1: -1, 3: -1}\n", + "=======================\n", + "1\n", + "0\n", + "{}\n", + "=======================\n", + "2\n", + "0\n", + "{}\n", + "=======================\n", + "3\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(\\frac{2}{105}\\right) \\cdot (s + \\frac{17}{21})^{-1} \\cdot (s + 1)^{-1} \\cdot (s + \\frac{17}{2})\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(\\frac{2}{105}\\right) \\cdot (s + \\frac{17}{21})^{-1} \\cdot (s + 1)^{-1} \\cdot (s + \\frac{17}{2})$" + ], + "text/plain": [ + "(2/105) * (s + 17/21)^-1 * (s + 1)^-1 * (s + 17/2)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{7: -1, 21: -1}\n", + "=======================\n", + "4\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(\\frac{11}{189}\\right) \\cdot (s + \\frac{16}{21})^{-1} \\cdot (s + 1)^{-1} \\cdot (s - \\frac{16}{11})\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(\\frac{11}{189}\\right) \\cdot (s + \\frac{16}{21})^{-1} \\cdot (s + 1)^{-1} \\cdot (s - \\frac{16}{11})$" + ], + "text/plain": [ + "(11/189) * (s + 16/21)^-1 * (s + 1)^-1 * (s - 16/11)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1: 1, 3: 1, 7: 2, 21: 2}\n", + "=======================\n", + "5\n", + "0\n", + "{}\n", + "=======================\n", + "6\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(\\frac{7}{66}\\right) \\cdot (s + \\frac{19}{24})^{-1} \\cdot (s + 1)^{-1} \\cdot (s - \\frac{19}{14})\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(\\frac{7}{66}\\right) \\cdot (s + \\frac{19}{24})^{-1} \\cdot (s + 1)^{-1} \\cdot (s - \\frac{19}{14})$" + ], + "text/plain": [ + "(7/66) * (s + 19/24)^-1 * (s + 1)^-1 * (s - 19/14)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1: 2, 2: 4, 3: 2, 6: 4, 4: 4, 12: 4, 8: 4, 24: 4}\n", + "=======================\n", + "(0, 1)\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(\\frac{1}{18}\\right) \\cdot (s + 1)^{-2} \\cdot (s + \\frac{5}{6})^{-1} \\cdot (s^{2} + \\frac{1}{2} s + \\frac{5}{2})\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(\\frac{1}{18}\\right) \\cdot (s + 1)^{-2} \\cdot (s + \\frac{5}{6})^{-1} \\cdot (s^{2} + \\frac{1}{2} s + \\frac{5}{2})$" + ], + "text/plain": [ + "(1/18) * (s + 1)^-2 * (s + 5/6)^-1 * (s^2 + 1/2*s + 5/2)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1: 1, 3: 1}\n", + "=======================\n", + "(1, 2)\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(\\frac{1}{36}\\right) \\cdot (s + \\frac{7}{9})^{-1} \\cdot (s + \\frac{5}{6})^{-1} \\cdot (s + 1)^{-1} \\cdot (s^{2} + \\frac{17}{18} s + \\frac{35}{18})\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(\\frac{1}{36}\\right) \\cdot (s + \\frac{7}{9})^{-1} \\cdot (s + \\frac{5}{6})^{-1} \\cdot (s + 1)^{-1} \\cdot (s^{2} + \\frac{17}{18} s + \\frac{35}{18})$" + ], + "text/plain": [ + "(1/36) * (s + 7/9)^-1 * (s + 5/6)^-1 * (s + 1)^-1 * (s^2 + 17/18*s + 35/18)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1: 1, 3: 1}\n", + "=======================\n", + "(2, 4)\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(\\frac{1}{108}\\right) \\cdot (s + \\frac{16}{21})^{-1} \\cdot (s + \\frac{7}{9})^{-1} \\cdot (s + 1)^{-1} \\cdot (s^{2} + \\frac{67}{63} s + \\frac{16}{9})\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(\\frac{1}{108}\\right) \\cdot (s + \\frac{16}{21})^{-1} \\cdot (s + \\frac{7}{9})^{-1} \\cdot (s + 1)^{-1} \\cdot (s^{2} + \\frac{67}{63} s + \\frac{16}{9})$" + ], + "text/plain": [ + "(1/108) * (s + 16/21)^-1 * (s + 7/9)^-1 * (s + 1)^-1 * (s^2 + 67/63*s + 16/9)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1: 1, 3: 1}\n", + "=======================\n", + "(3, 4)\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(\\frac{1}{135}\\right) \\cdot (s + \\frac{16}{21})^{-1} \\cdot (s + \\frac{17}{21})^{-1} \\cdot (s + 1)^{-1} \\cdot (s^{2} + \\frac{284}{147} s + \\frac{272}{147})\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(\\frac{1}{135}\\right) \\cdot (s + \\frac{16}{21})^{-1} \\cdot (s + \\frac{17}{21})^{-1} \\cdot (s + 1)^{-1} \\cdot (s^{2} + \\frac{284}{147} s + \\frac{272}{147})$" + ], + "text/plain": [ + "(1/135) * (s + 16/21)^-1 * (s + 17/21)^-1 * (s + 1)^-1 * (s^2 + 284/147*s + 272/147)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1: 1, 3: 1}\n", + "=======================\n", + "(4, 5)\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(\\frac{1}{270}\\right) \\cdot (s + \\frac{16}{21})^{-1} \\cdot (s + \\frac{7}{9})^{-1} \\cdot (s + 1)^{-1} \\cdot (s^{2} + \\frac{121}{63} s + \\frac{16}{9})\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(\\frac{1}{270}\\right) \\cdot (s + \\frac{16}{21})^{-1} \\cdot (s + \\frac{7}{9})^{-1} \\cdot (s + 1)^{-1} \\cdot (s^{2} + \\frac{121}{63} s + \\frac{16}{9})$" + ], + "text/plain": [ + "(1/270) * (s + 16/21)^-1 * (s + 7/9)^-1 * (s + 1)^-1 * (s^2 + 121/63*s + 16/9)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1: 1, 3: 1}\n", + "=======================\n", + "(5, 6)\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(\\frac{1}{330}\\right) \\cdot (s + \\frac{7}{9})^{-1} \\cdot (s + \\frac{19}{24})^{-1} \\cdot (s + 1)^{-1} \\cdot (s^{2} + \\frac{139}{72} s + \\frac{133}{72})\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(\\frac{1}{330}\\right) \\cdot (s + \\frac{7}{9})^{-1} \\cdot (s + \\frac{19}{24})^{-1} \\cdot (s + 1)^{-1} \\cdot (s^{2} + \\frac{139}{72} s + \\frac{133}{72})$" + ], + "text/plain": [ + "(1/330) * (s + 7/9)^-1 * (s + 19/24)^-1 * (s + 1)^-1 * (s^2 + 139/72*s + 133/72)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1: 1, 3: 1}\n", + "=======================\n", + "(6, 'd')\n" + ] + }, + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(-\\frac{3}{88}\\right) \\cdot (s + \\frac{19}{24})^{-1} \\cdot (s + 1)^{-1} \\cdot (s - \\frac{19}{3})\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(-\\frac{3}{88}\\right) \\cdot (s + \\frac{19}{24})^{-1} \\cdot (s + 1)^{-1} \\cdot (s - \\frac{19}{3})$" + ], + "text/plain": [ + "(-3/88) * (s + 19/24)^-1 * (s + 1)^-1 * (s - 19/3)" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{2: -3, 6: -3, 4: -3, 12: -3, 8: -3, 24: -3}\n", + "=======================\n" + ] + } + ], + "source": [ + "for j in pols:\n", + " pol, pesos, euler = pols[j]\n", + " print(j)\n", + " zt, zm, dc = estrato(pol, pesos, euler, info=True)\n", + " if zt != 0:\n", + " show(zt.factor())\n", + " else:\n", + " print(zt)\n", + " print(dc)\n", + " print(\"=======================\")" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "8f5e2324-c385-4a99-a4a4-96cc9aa35c12", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(z^3 + x^8*z^2 + x^24*y, (11, 1, 1), 3)" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pols[6, 'd']" + ] + }, + { + "cell_type": "code", + "execution_count": 27, "id": "38806472-5640-42de-86b7-b50e64817c6a", "metadata": {}, "outputs": [], @@ -105,7 +462,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 29, "id": "a46b91f9-b42a-48c8-8208-16e2095a221f", "metadata": {}, "outputs": [ @@ -115,7 +472,7 @@ "((0, 0, 0, 0, 0, 1, 0, 0), (0, 0, 0, 1, 0, 0, 1, 0), (0, 0, 0, 0, 1, 0, 0, 1))" ] }, - "execution_count": 43, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -128,7 +485,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 30, "id": "a23267a1-ad55-4b88-871e-097b6e1b624f", "metadata": {}, "outputs": [], @@ -138,7 +495,29 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 33, + "id": "1091d954-9b65-4496-974c-aa6c6276c5ec", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(6, 12, 18, 21, 42, 45, 45, 90)\n", + "(6, 12, 18, 22, 42, 44, 46, 90)\n", + "(6, 12, 18, 21, 42, 44, 45, 90)\n" + ] + } + ], + "source": [ + "print(3 * Nf1)\n", + "print(2 * Ng1)\n", + "print(Nd1)" + ] + }, + { + "cell_type": "code", + "execution_count": 34, "id": "bbc67c59-33f2-4607-a364-c8dc58e305a8", "metadata": {}, "outputs": [], @@ -148,7 +527,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 35, "id": "67179a40-ad7d-400b-b6dd-c2282dae00ce", "metadata": {}, "outputs": [ @@ -159,7 +538,7 @@ " (-5/21) * (s + 16/21)^-1 * (s + 1)^-1 * (s - 16/5))" ] }, - "execution_count": 46, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -170,7 +549,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 36, "id": "9fc6382a-02e9-43e7-b06c-2e5477fbf24b", "metadata": {}, "outputs": [ @@ -181,7 +560,7 @@ " {1: 1, 3: 1, 7: 2, 21: 2})" ] }, - "execution_count": 47, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -192,7 +571,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 37, "id": "e9645f64-855b-4b4f-9e51-5d242ec6de8b", "metadata": {}, "outputs": [ @@ -202,7 +581,7 @@ "((0, 0, 0, 0, 1, 0, 0, 0), (0, 0, 0, 1, 1, 0, 0, 0), (0, 0, 0, 0, 1, 0, 0, 1))" ] }, - "execution_count": 48, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -215,7 +594,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 38, "id": "e3236935-72bd-4eae-b2a5-204a11451707", "metadata": {}, "outputs": [], @@ -225,7 +604,29 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 39, + "id": "daee0c17-b39d-45d6-a950-9856a2d3af2d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(6, 12, 18, 21, 42, 42, 42, 84)\n", + "(6, 12, 18, 22, 42, 42, 42, 84)\n", + "(6, 12, 18, 21, 42, 44, 45, 90)\n" + ] + } + ], + "source": [ + "print(3 * Nf2)\n", + "print(2 * Ng2)\n", + "print(Nd2)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, "id": "1bf9e48e-d38f-4818-8ec0-7b7079cb1415", "metadata": {}, "outputs": [], @@ -235,7 +636,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 41, "id": "5bbbdfd7-c71b-4727-a57e-3adfb09baddb", "metadata": {}, "outputs": [ @@ -246,7 +647,7 @@ " (-41/168) * (s + 16/21)^-1 * (s + 19/24)^-1 * (s + 1)^-1 * (s^2 - 283/123*s - 304/123))" ] }, - "execution_count": 51, + "execution_count": 41, "metadata": {}, "output_type": "execute_result" } @@ -279,11 +680,113 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 43, + "id": "50a35ef7-a01a-41df-8e74-444ab2840729", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\\(\\displaystyle \\left(\\begin{array}{rrrrr}\n", + "-2 & 1 & 0 & 0 & 0 \\\\\n", + "1 & -2 & 1 & 0 & 0 \\\\\n", + "0 & 1 & -3 & 0 & 1 \\\\\n", + "0 & 0 & 0 & -2 & 1 \\\\\n", + "0 & 0 & 1 & 1 & -1\n", + "\\end{array}\\right)\\)" + ], + "text/latex": [ + "$\\displaystyle \\left(\\begin{array}{rrrrr}\n", + "-2 & 1 & 0 & 0 & 0 \\\\\n", + "1 & -2 & 1 & 0 & 0 \\\\\n", + "0 & 1 & -3 & 0 & 1 \\\\\n", + "0 & 0 & 0 & -2 & 1 \\\\\n", + "0 & 0 & 1 & 1 & -1\n", + "\\end{array}\\right)$" + ], + "text/plain": [ + "[-2 1 0 0 0]\n", + "[ 1 -2 1 0 0]\n", + "[ 0 1 -3 0 1]\n", + "[ 0 0 0 -2 1]\n", + "[ 0 0 1 1 -1]" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "A1 = A.matrix_from_rows_and_columns([0 .. 4], [0 .. 4])\n", + "A1[-1, -1] = -1\n", + "show(A1)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "d0872a37-ac30-4821-8c59-0a0b849f8dda", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "((0, 0, 0, 0, 1), (0, 0, 0, 1, 1), (0, 0, 0, 0, 3))" + ] + }, + "execution_count": 44, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Vf, Vg, Vd = [vector(QQ, 5) for i in (1, 2, 3)]\n", + "Vf[4] = Vg[3] = Vg[4] = 1\n", + "Vd[4]= 3\n", + "Vf, Vg, Vd" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "id": "cbf95cd1-1b54-4356-9a7e-3993b2a96ba9", + "metadata": {}, + "outputs": [], + "source": [ + "n3, Nf3, Ng3, Nd3, Nhs3, Nks3, euler3, nus3, pols3 = trinomiales_general(A1, Vf, Vg, (), (), Vd, total=False)" + ] + }, + { + "cell_type": "code", + "execution_count": 47, "id": "469f980a-50a9-44d1-b596-96a46d33fdd4", "metadata": {}, "outputs": [], - "source": [] + "source": [ + "zetatop3, zetamon3, dic3 = zetas(n3, pols3, info=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "id": "0870be50-c79c-48c9-80b7-24bfd6914737", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "((-41/168) * (s + 16/21)^-1 * (s + 19/24)^-1 * (s + 1)^-1 * (s^2 - 283/123*s - 304/123),\n", + " (-5/21) * (s + 16/21)^-1 * (s + 1)^-1 * (s - 16/5))" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "zetatop.factor(), zetatop3.factor()" + ] }, { "cell_type": "code", @@ -360,7 +863,7 @@ "kernelspec": { "display_name": "SageMath 10.4.beta9", "language": "sage", - "name": "sagemath-310" + "name": "sagemath-devel" }, "language_info": { "codemirror_mode": {