{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 2.27 (A Numeric Connection Solution)\n", "Determining connection coefficients with parameter initial conditions. \n", "*Requirements: [ore_algebra package](https://github.com/mkauers/ore_algebra/)*" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Define the rings of differential and shift operators\n", "from ore_algebra import *\n", "Ind. = PolynomialRing(QQ); Shift. = OreAlgebra(Ind)\n", "Pols. = PolynomialRing(QQ); Diff. = OreAlgebra(Pols)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Start with the differential equation\n", "diff = 5*z^2*(2*z-1)*(z-3)*Dz^4 + 2*z*(59*z^2-139*z+36)*Dz^3 + 6*(61*z^2-80*z+6)*Dz^2 + 12*(25*z-11)*Dz + 36" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(15*n^2 + 57*n + 36)*Sn^2 + (-35*n^2 - 103*n - 66)*Sn + 10*n^2 + 28*n + 18" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Get recurrence on coefficients\n", "rec = diff.to_S(Shift).primitive_part()\n", "rec" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[(2)^{n}n^{-1}\\Bigl(1 - n^{-1} + n^{-2} + O(n^{-3})\\Bigr), (1/3)^{n}\\Bigl(1 + O(n^{-3})\\Bigr)\\right]\n", "\\end{math}" ], "text/plain": [ "[2^n*n^(-1)*(1 - n^(-1) + n^(-2) + O(n^(-3))), (1/3)^n*(1 + O(n^(-3)))]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# The following gives asymptotic expansions for a basis of solutions to the recurrence\n", "show(rec.generalized_series_solutions(n=3))" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[z^(-1), 1 - 1/2*z^2, z + 11/6*z^2, z^(6/5) + 11/6*z^(11/5) + 187/63*z^(16/5) + 1705/351*z^(21/5)]\n" ] } ], "source": [ "# There is a basis with the following series expansions near the origin\n", "print(diff.local_basis_expansions(0, order = 4))" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, f0, f1, 0]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# A power series solution starting f0 + f1*z + ... is expressed in this basis with coordinates\n", "var('f0 f1')\n", "ini = [0,f0,f1,0]\n", "ini" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(10) * (z - 3) * (z - 1/2) * z^2" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# This generating function potentially has singularities at z = 1/2 and z = 3\n", "diff.leading_coefficient().factor()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\verb|log(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)| - 2\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)*log(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)| + 4\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)^2*log(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)| - 8\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)^3*log(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)|\n", "\\end{math}" ], "text/plain": [ "log(z - 1/2) - 2*(z - 1/2)*log(z - 1/2) + 4*(z - 1/2)^2*log(z - 1/2) - 8*(z - 1/2)^3*log(z - 1/2)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}1 + \\frac{8}{25}\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)^3|\n", "\\end{math}" ], "text/plain": [ "1 + 8/25*(z - 1/2)^3" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)| + \\frac{4}{25}\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)^3|\n", "\\end{math}" ], "text/plain": [ "(z - 1/2) + 4/25*(z - 1/2)^3" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)^2| - 2\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|1/2)^3|\n", "\\end{math}" ], "text/plain": [ "(z - 1/2)^2 - 2*(z - 1/2)^3" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Expansions of a basis near z=1/2\n", "for k in diff.local_basis_expansions(1/2, order = 4):\n", " show(k)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n", "\\verb|[+/-|\\phantom{\\verb!x!}\\verb|2.28e-5]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|2.12e-6]*I| & \\verb|[0.50|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|8e-7]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|9.22e-8]*I| & \\verb|[-1.5|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|4e-6]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|2.65e-7]*I| & \\verb|[-1.4|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0212]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|2.42e-7]*I| \\\\\n", "\\verb|[2.0|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|1.77e-4]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|7.92e-5]*I| & \\verb|[2.1|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0466]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[-1.6|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0293]*I| & \\verb|[-2.8|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0398]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[4.7|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0124]*I| & \\verb|[-2.7|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0324]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[4.3|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0323]*I| \\\\\n", "\\verb|[-4.0|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|1.34e-4]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|1.44e-4]*I| & \\verb|[0.027|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|1.49e-4]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[3.1|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0416]*I| & \\verb|[1.4|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0406]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[-9.4|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0248]*I| & \\verb|[1.1|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0486]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[-8.7|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0363]*I| \\\\\n", "\\verb|[8.0|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|1.0e-4]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|2.78e-4]*I| & \\verb|[1.7|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0258]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[-6.3|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0169]*I| & \\verb|[-4.4|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0469]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[1.9e+1|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.151]*I| & \\verb|[-4.1|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0113]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[1.7e+1|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.330]*I|\n", "\\end{array}\\right)\n", "\\end{math}" ], "text/plain": [ "[ [+/- 2.28e-5] + [+/- 2.12e-6]*I [0.50 +/- 8e-7] + [+/- 9.22e-8]*I [-1.5 +/- 4e-6] + [+/- 2.65e-7]*I [-1.4 +/- 0.0212] + [+/- 2.42e-7]*I]\n", "[ [2.0 +/- 1.77e-4] + [+/- 7.92e-5]*I [2.1 +/- 0.0466] + [-1.6 +/- 0.0293]*I [-2.8 +/- 0.0398] + [4.7 +/- 0.0124]*I [-2.7 +/- 0.0324] + [4.3 +/- 0.0323]*I]\n", "[ [-4.0 +/- 1.34e-4] + [+/- 1.44e-4]*I [0.027 +/- 1.49e-4] + [3.1 +/- 0.0416]*I [1.4 +/- 0.0406] + [-9.4 +/- 0.0248]*I [1.1 +/- 0.0486] + [-8.7 +/- 0.0363]*I]\n", "[ [8.0 +/- 1.0e-4] + [+/- 2.78e-4]*I [1.7 +/- 0.0258] + [-6.3 +/- 0.0169]*I [-4.4 +/- 0.0469] + [1.9e+1 +/- 0.151]*I [-4.1 +/- 0.0113] + [1.7e+1 +/- 0.330]*I]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# We can compute the change of basis matrix between the basis with series at the origin and the basis with series at 1/2\n", "# We take a low numeric accuracy here to fit on screen\n", "show(diff.numerical_transition_matrix([0,1/2],1e-1))" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\verb|[0.50000000000|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|8e-16]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|3.86e-17]*I|\\right) \\, f_{0} + \\left(\\verb|[-1.5000000000|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|4e-15]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|1.10e-16]*I|\\right) \\, f_{1}\n", "\\end{math}" ], "text/plain": [ "([0.50000000000 +/- 8e-16] + [+/- 3.86e-17]*I)*f0 + ([-1.5000000000 +/- 4e-15] + [+/- 1.10e-16]*I)*f1" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# The coefficient of the dominant singular term is f0/2 - 3f1/2\n", "bas = diff.numerical_transition_matrix([0,1/2],1e-10) * vector(ini)\n", "show(bas[0])" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|3)^(-1)|\n", "\\end{math}" ], "text/plain": [ "(z - 3)^(-1)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}1 - \\frac{1}{150}\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|3)^3|\n", "\\end{math}" ], "text/plain": [ "1 - 1/150*(z - 3)^3" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|3)| - \\frac{32}{225}\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|3)^3|\n", "\\end{math}" ], "text/plain": [ "(z - 3) - 32/225*(z - 3)^3" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|3)^2| - \\frac{7}{10}\\verb|(z|\\phantom{\\verb!x!}\\verb|-|\\phantom{\\verb!x!}\\verb|3)^3|\n", "\\end{math}" ], "text/plain": [ "(z - 3)^2 - 7/10*(z - 3)^3" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Expansions of a basis near z=3\n", "for k in diff.local_basis_expansions(3, order = 5):\n", " show(k)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\begin{array}{rrrr}\n", "\\verb|[+/-|\\phantom{\\verb!x!}\\verb|2.65]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|2.65]*I| & \\verb|[-4.5|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0159]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.0159]*I| & \\verb|[4.5|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0307]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.0307]*I| & \\verb|[5e+0|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.350]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.283]*I| \\\\\n", "\\verb|[+/-|\\phantom{\\verb!x!}\\verb|3.48]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|3.15]*I| & \\verb|[0.1|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0527]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[-0.3|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0568]*I| & \\verb|[-0.4|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0386]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[0.8|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0508]*I| & \\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.584]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|1.06]*I| \\\\\n", "\\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.865]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.754]*I| & \\verb|[-0.01|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|5.79e-3]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[0.09|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|7.15e-3]*I| & \\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.0428]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[-0.3|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|0.0469]*I| & \\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.0974]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.322]*I| \\\\\n", "\\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.296]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.259]*I| & \\verb|[+/-|\\phantom{\\verb!x!}\\verb|4.39e-3]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[-0.03|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|2.42e-3]*I| & \\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.0116]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[0.09|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|5.69e-3]*I| & \\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.0381]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|0.108]*I|\n", "\\end{array}\\right)\n", "\\end{math}" ], "text/plain": [ "[ [+/- 2.65] + [+/- 2.65]*I [-4.5 +/- 0.0159] + [+/- 0.0159]*I [4.5 +/- 0.0307] + [+/- 0.0307]*I [5e+0 +/- 0.350] + [+/- 0.283]*I]\n", "[ [+/- 3.48] + [+/- 3.15]*I [0.1 +/- 0.0527] + [-0.3 +/- 0.0568]*I [-0.4 +/- 0.0386] + [0.8 +/- 0.0508]*I [+/- 0.584] + [+/- 1.06]*I]\n", "[ [+/- 0.865] + [+/- 0.754]*I [-0.01 +/- 5.79e-3] + [0.09 +/- 7.15e-3]*I [+/- 0.0428] + [-0.3 +/- 0.0469]*I [+/- 0.0974] + [+/- 0.322]*I]\n", "[ [+/- 0.296] + [+/- 0.259]*I [+/- 4.39e-3] + [-0.03 +/- 2.42e-3]*I [+/- 0.0116] + [0.09 +/- 5.69e-3]*I [+/- 0.0381] + [+/- 0.108]*I]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# We can compute the change of basis matrix between the basis with series at the origin and the basis with series at 3\n", "# We take a low numeric accuracy here to fit on screen\n", "# Note -- the path for continuation must move off the real line to *avoid* the singularity at z=1/2\n", "show(diff.numerical_transition_matrix([0,I,3],1e-1))" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/latex": [ "\\begin{math}\n", "\\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left(\\verb|[-4.5000000000|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|9.00e-11]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|9.00e-11]*I|\\right) \\, f_{0} + \\left(\\verb|[4.500000000|\\phantom{\\verb!x!}\\verb|+/-|\\phantom{\\verb!x!}\\verb|9.90e-11]|\\phantom{\\verb!x!}\\verb|+|\\phantom{\\verb!x!}\\verb|[+/-|\\phantom{\\verb!x!}\\verb|9.90e-11]*I|\\right) \\, f_{1}\n", "\\end{math}" ], "text/plain": [ "([-4.5000000000 +/- 9.00e-11] + [+/- 9.00e-11]*I)*f0 + ([4.500000000 +/- 9.90e-11] + [+/- 9.90e-11]*I)*f1" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# The coefficient of the singular term is (9/2)(f1-f0)\n", "bas2 = diff.numerical_transition_matrix([0,I,3],1e-10) * vector(ini)\n", "show(bas2[0])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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 }