Skip to content

Commit 0614ff1

Browse files
committed
Need to debug taylor_recur start order
1 parent 237ab95 commit 0614ff1

3 files changed

Lines changed: 138 additions & 120 deletions

File tree

test/biharmonic.ipynb

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 3,
5+
"execution_count": 1,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -23,7 +23,7 @@
2323
},
2424
{
2525
"cell_type": "code",
26-
"execution_count": 5,
26+
"execution_count": 10,
2727
"metadata": {},
2828
"outputs": [],
2929
"source": [
@@ -32,13 +32,14 @@
3232
"abs_dist = sp.sqrt((var[0]-var_t[0])**2 + (var[1]-var_t[1])**2)\n",
3333
"w = make_identity_diff_op(2)\n",
3434
"\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",
3839
"list_pde = immutabledict(biharmonic_op)\n",
3940
"\n",
4041
"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",
4243
"\n",
4344
"n_init, _, r = get_reindexed_and_center_origin_on_axis_recurrence(biharmonic_pde)\n",
4445
"\n",
@@ -55,7 +56,7 @@
5556
"s = sp.Function(\"s\")\n",
5657
"\n",
5758
"# 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",
5960
"check = []\n",
6061
"\n",
6162
"assert n_init == 4\n",
@@ -68,7 +69,7 @@
6869
},
6970
{
7071
"cell_type": "code",
71-
"execution_count": 7,
72+
"execution_count": 11,
7273
"metadata": {},
7374
"outputs": [],
7475
"source": [
@@ -81,52 +82,48 @@
8182
},
8283
{
8384
"cell_type": "code",
84-
"execution_count": 14,
85+
"execution_count": 18,
8586
"metadata": {},
8687
"outputs": [
8788
{
8889
"data": {
8990
"text/latex": [
90-
"$\\displaystyle 16.9964566798618$"
91+
"$\\displaystyle -0.00388859878925869$"
9192
],
9293
"text/plain": [
93-
"16.9964566798618"
94+
"-0.00388859878925869"
9495
]
9596
},
96-
"execution_count": 14,
97+
"execution_count": 18,
9798
"metadata": {},
9899
"output_type": "execute_result"
99100
}
100101
],
101102
"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})"
103104
]
104105
},
105106
{
106107
"cell_type": "code",
107-
"execution_count": 6,
108+
"execution_count": 19,
108109
"metadata": {},
109110
"outputs": [
110111
{
111112
"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+
],
112116
"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)"
121118
]
122119
},
123-
"execution_count": 6,
120+
"execution_count": 19,
124121
"metadata": {},
125122
"output_type": "execute_result"
126123
}
127124
],
128125
"source": [
129-
"subs_dict"
126+
"r.subs(n, 4)"
130127
]
131128
},
132129
{

0 commit comments

Comments
 (0)