very experimental example breaking
This commit is contained in:
1 parent
26a74b4f94
commit
22f3d9c762
2 files changed
+24
-15
No files matched your search
+16
-15
@@ -36,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 1,
|
"execution_count": 13,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 2,
|
"execution_count": 14,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 3,
|
"execution_count": 15,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
"x**3 - x - 2"
|
"x**3 - x - 2"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 3,
|
"execution_count": 15,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"output_type": "execute_result"
|
"output_type": "execute_result"
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 4,
|
"execution_count": 16,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
"(1 + sqrt(3))/2"
|
"(1 + sqrt(3))/2"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 4,
|
"execution_count": 16,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"output_type": "execute_result"
|
"output_type": "execute_result"
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 5,
|
"execution_count": 17,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
@@ -192,7 +192,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 6,
|
"execution_count": 18,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 7,
|
"execution_count": 19,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
@@ -217,7 +217,7 @@
|
|||||||
"np.float64(1.5213797068045676)"
|
"np.float64(1.5213797068045676)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 7,
|
"execution_count": 19,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"output_type": "execute_result"
|
"output_type": "execute_result"
|
||||||
}
|
}
|
||||||
@@ -258,7 +258,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 8,
|
"execution_count": 20,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@@ -286,9 +286,9 @@
|
|||||||
" return (low, 0)\n",
|
" return (low, 0)\n",
|
||||||
" elif ldaprx(0, fh):\n",
|
" elif ldaprx(0, fh):\n",
|
||||||
" return (high, 0)\n",
|
" return (high, 0)\n",
|
||||||
"\n",
|
" else:\n",
|
||||||
" while (steps := steps + 1) and (max_loop := max_loop - 1) + 1:\n",
|
|
||||||
" mid = (low + high) / 2\n",
|
" mid = (low + high) / 2\n",
|
||||||
|
" while (steps := steps + 1) and (max_loop := max_loop - 1) + 1 > 0:\n",
|
||||||
" match f(mid):\n",
|
" match f(mid):\n",
|
||||||
" case x if ldaprx(0, x):\n",
|
" case x if ldaprx(0, x):\n",
|
||||||
" return (mid, steps)\n",
|
" return (mid, steps)\n",
|
||||||
@@ -296,12 +296,13 @@
|
|||||||
" low = mid\n",
|
" low = mid\n",
|
||||||
" case x if x > 0:\n",
|
" case x if x > 0:\n",
|
||||||
" high = mid\n",
|
" high = mid\n",
|
||||||
|
" mid = (low + high) / 2\n",
|
||||||
" return (mid, steps)"
|
" return (mid, steps)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 9,
|
"execution_count": 21,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
@@ -310,7 +311,7 @@
|
|||||||
"(1.5213797068045676, 52)"
|
"(1.5213797068045676, 52)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 9,
|
"execution_count": 21,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"output_type": "execute_result"
|
"output_type": "execute_result"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,3 +3,11 @@
|
|||||||
## what the hell
|
## what the hell
|
||||||
|
|
||||||
its a systems solver
|
its a systems solver
|
||||||
|
|
||||||
|
## so uh
|
||||||
|
|
||||||
|
iterative method is
|
||||||
|
|
||||||
|
$$
|
||||||
|
x_{i+1} = x_i - \frac{f{x_i}}{f'(x_i)}
|
||||||
|
$$
|
||||||
Reference in new issue
Block a user