Skip to content

Commit 23b0c37

Browse files
committed
Fixed terms in Taylor series #307
1 parent 3b6d8b6 commit 23b0c37

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: Supporting_Notebooks/Taylor-Series.ipynb

+7-7
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
{
@@ -25,7 +25,7 @@
2525
"<IPython.core.display.HTML object>"
2626
]
2727
},
28-
"execution_count": 3,
28+
"execution_count": 1,
2929
"metadata": {},
3030
"output_type": "execute_result"
3131
}
@@ -66,21 +66,21 @@
6666
"\n",
6767
"Now we can substitute these values into the equation.\n",
6868
"\n",
69-
"$$\\sin(x) = \\frac{0}{0!}(x)^0 + \\frac{1}{1!}(x)^1 + \\frac{0}{2!}(x)^2 + \\frac{-1}{3!}(x)^3 + \\frac{0}{4!}(x)^4 + \\frac{-1}{5!}(x)^5 + ... $$\n",
69+
"$$\\sin(x) = \\frac{0}{0!}(x)^0 + \\frac{1}{1!}(x)^1 + \\frac{0}{2!}(x)^2 + \\frac{-1}{3!}(x)^3 + \\frac{0}{4!}(x)^4 + \\frac{1}{5!}(x)^5 + ... $$\n",
7070
"\n",
7171
"And let's test this with some code:"
7272
]
7373
},
7474
{
7575
"cell_type": "code",
76-
"execution_count": 4,
76+
"execution_count": 2,
7777
"metadata": {},
7878
"outputs": [
7979
{
8080
"name": "stdout",
8181
"output_type": "stream",
8282
"text": [
83-
"estimate of sin(.3) is 0.30452025\n",
83+
"estimate of sin(.3) is 0.29552025\n",
8484
"exact value of sin(.3) is 0.29552020666133955\n"
8585
]
8686
}
@@ -89,7 +89,7 @@
8989
"import numpy as np\n",
9090
"\n",
9191
"x = .3\n",
92-
"estimate = x + x**3/6 + x**5/120\n",
92+
"estimate = x - x**3/6 + x**5/120\n",
9393
"exact = np.sin(.3)\n",
9494
"\n",
9595
"print('estimate of sin(.3) is', estimate)\n",
@@ -120,7 +120,7 @@
120120
"name": "python",
121121
"nbconvert_exporter": "python",
122122
"pygments_lexer": "ipython3",
123-
"version": "3.7.1"
123+
"version": "3.7.6"
124124
}
125125
},
126126
"nbformat": 4,

0 commit comments

Comments
 (0)