|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 3, |
| 5 | + "execution_count": 1, |
6 | 6 | "metadata": {}, |
7 | 7 | "outputs": [], |
8 | 8 | "source": [ |
|
23 | 23 | }, |
24 | 24 | { |
25 | 25 | "cell_type": "code", |
26 | | - "execution_count": 5, |
| 26 | + "execution_count": 10, |
27 | 27 | "metadata": {}, |
28 | 28 | "outputs": [], |
29 | 29 | "source": [ |
|
32 | 32 | "abs_dist = sp.sqrt((var[0]-var_t[0])**2 + (var[1]-var_t[1])**2)\n", |
33 | 33 | "w = make_identity_diff_op(2)\n", |
34 | 34 | "\n", |
35 | | - "partial_1x = DerivativeIdentifier((4,0), 0)\n", |
36 | | - "partial_1y = DerivativeIdentifier((0,4), 0)\n", |
37 | | - "biharmonic_op = {partial_1x: 1, partial_1y: 1}\n", |
| 35 | + "partial_4x = DerivativeIdentifier((4,0), 0)\n", |
| 36 | + "partial_4y = DerivativeIdentifier((0,4), 0)\n", |
| 37 | + "partial_2x2y = DerivativeIdentifier((2,2), 0)\n", |
| 38 | + "biharmonic_op = {partial_4x: 1, partial_4y: 1, partial_2x2y:2}\n", |
38 | 39 | "list_pde = immutabledict(biharmonic_op)\n", |
39 | 40 | "\n", |
40 | 41 | "biharmonic_pde = LinearPDESystemOperator(2, (list_pde,))\n", |
41 | | - "g_x_y = abs_dist**2 * (sp.log(abs_dist)-1)\n", |
| 42 | + "g_x_y = abs_dist**2 * (sp.log(abs_dist))\n", |
42 | 43 | "\n", |
43 | 44 | "n_init, _, r = get_reindexed_and_center_origin_on_axis_recurrence(biharmonic_pde)\n", |
44 | 45 | "\n", |
|
55 | 56 | "s = sp.Function(\"s\")\n", |
56 | 57 | "\n", |
57 | 58 | "# pylint: disable-next=not-callable\n", |
58 | | - "subs_dict = {s(0): derivs[0], s(1): derivs[1], s(2): derivs[1], s(3): derivs[1]}\n", |
| 59 | + "subs_dict = {s(0): derivs[0], s(1): derivs[1], s(2): derivs[2], s(3): derivs[3]}\n", |
59 | 60 | "check = []\n", |
60 | 61 | "\n", |
61 | 62 | "assert n_init == 4\n", |
|
68 | 69 | }, |
69 | 70 | { |
70 | 71 | "cell_type": "code", |
71 | | - "execution_count": 7, |
| 72 | + "execution_count": 11, |
72 | 73 | "metadata": {}, |
73 | 74 | "outputs": [], |
74 | 75 | "source": [ |
|
81 | 82 | }, |
82 | 83 | { |
83 | 84 | "cell_type": "code", |
84 | | - "execution_count": 14, |
| 85 | + "execution_count": 18, |
85 | 86 | "metadata": {}, |
86 | 87 | "outputs": [ |
87 | 88 | { |
88 | 89 | "data": { |
89 | 90 | "text/latex": [ |
90 | | - "$\\displaystyle 16.9964566798618$" |
| 91 | + "$\\displaystyle -0.00388859878925869$" |
91 | 92 | ], |
92 | 93 | "text/plain": [ |
93 | | - "16.9964566798618" |
| 94 | + "-0.00388859878925869" |
94 | 95 | ] |
95 | 96 | }, |
96 | | - "execution_count": 14, |
| 97 | + "execution_count": 18, |
97 | 98 | "metadata": {}, |
98 | 99 | "output_type": "execute_result" |
99 | 100 | } |
100 | 101 | ], |
101 | 102 | "source": [ |
102 | | - "r.subs(n, 4).subs(subs_dict).subs({var[0]: 1.2, var[1]: 2.3})" |
| 103 | + "r.subs(n, 4).subs(subs_dict).subs({var[0]: 23, var[1]: 2.3})" |
103 | 104 | ] |
104 | 105 | }, |
105 | 106 | { |
106 | 107 | "cell_type": "code", |
107 | | - "execution_count": 6, |
| 108 | + "execution_count": 19, |
108 | 109 | "metadata": {}, |
109 | 110 | "outputs": [ |
110 | 111 | { |
111 | 112 | "data": { |
| 113 | + "text/latex": [ |
| 114 | + "$\\displaystyle - \\frac{\\left(- 2 x_{0}^{2} + 6 x_{1}^{2}\\right) s{\\left(3 \\right)}}{x_{0}^{3} + x_{0} x_{1}^{2}} - \\frac{\\left(- x_{0}^{4} + 6 x_{0}^{2} x_{1}^{2} + 15 x_{1}^{4}\\right) s{\\left(1 \\right)}}{x_{0}^{7} + 2 x_{0}^{5} x_{1}^{2} + x_{0}^{3} x_{1}^{4}} + \\frac{\\left(x_{0}^{4} - 6 x_{0}^{2} x_{1}^{2} - 15 x_{1}^{4}\\right) s{\\left(2 \\right)}}{x_{0}^{6} + 2 x_{0}^{4} x_{1}^{2} + x_{0}^{2} x_{1}^{4}}$" |
| 115 | + ], |
112 | 116 | "text/plain": [ |
113 | | - "{s(0): (x0**2 + x1**2)*(log(sqrt(x0**2 + x1**2)) - 1),\n", |
114 | | - " s(1): -2*x0*(log(sqrt(x0**2 + x1**2)) - 1) - x0,\n", |
115 | | - " s(2): -2*x0*(log(sqrt(x0**2 + x1**2)) - 1) - x0,\n", |
116 | | - " s(3): -2*x0*(log(sqrt(x0**2 + x1**2)) - 1) - x0,\n", |
117 | | - " s(4): 2*(-24*x0**4/(x0**2 + x1**2)**2 + 8*x0**2*(4*x0**2/(x0**2 + x1**2) - 3)/(x0**2 + x1**2) + 12*x0**2/(x0**2 + x1**2) + 3)/(x0**2 + x1**2),\n", |
118 | | - " s(5): -4*x0*(-24*x0**4/(x0**2 + x1**2)**2 + 40*x0**2/(x0**2 + x1**2) - 15)/(x0**2 + x1**2)**2,\n", |
119 | | - " s(6): 12*(-320*x0**6/(x0**2 + x1**2)**3 + 360*x0**4/(x0**2 + x1**2)**2 + 24*x0**2*(16*x0**4/(x0**2 + x1**2)**2 - 20*x0**2/(x0**2 + x1**2) + 5)/(x0**2 + x1**2) - 60*x0**2/(x0**2 + x1**2) - 5)/(x0**2 + x1**2)**2,\n", |
120 | | - " s(7): -48*x0*(-160*x0**6/(x0**2 + x1**2)**3 + 336*x0**4/(x0**2 + x1**2)**2 - 210*x0**2/(x0**2 + x1**2) + 35)/(x0**2 + x1**2)**3}" |
| 117 | + "-(-2*x0**2 + 6*x1**2)*s(3)/(x0**3 + x0*x1**2) - (-x0**4 + 6*x0**2*x1**2 + 15*x1**4)*s(1)/(x0**7 + 2*x0**5*x1**2 + x0**3*x1**4) + (x0**4 - 6*x0**2*x1**2 - 15*x1**4)*s(2)/(x0**6 + 2*x0**4*x1**2 + x0**2*x1**4)" |
121 | 118 | ] |
122 | 119 | }, |
123 | | - "execution_count": 6, |
| 120 | + "execution_count": 19, |
124 | 121 | "metadata": {}, |
125 | 122 | "output_type": "execute_result" |
126 | 123 | } |
127 | 124 | ], |
128 | 125 | "source": [ |
129 | | - "subs_dict" |
| 126 | + "r.subs(n, 4)" |
130 | 127 | ] |
131 | 128 | }, |
132 | 129 | { |
|
0 commit comments