Skip to content

Commit ac2c176

Browse files
committed
updated tutorial
1 parent f80a7bd commit ac2c176

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

notebooks/Tutorial.ipynb

+63
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,36 @@
117117
"fig"
118118
]
119119
},
120+
{
121+
"cell_type": "markdown",
122+
"metadata": {},
123+
"source": [
124+
"## Gegenbauer Polynomials\n",
125+
"\n",
126+
"Gegenbauer poylnomials $C_p^{(\\alpha)}$ are evaluated as `gegenbauer(x, p, α)` using the three term recursion formula."
127+
]
128+
},
129+
{
130+
"cell_type": "code",
131+
"execution_count": null,
132+
"metadata": {
133+
"collapsed": false
134+
},
135+
"outputs": [],
136+
"source": [
137+
"using Revise\n",
138+
"using PolynomialBases\n",
139+
"using LaTeXStrings, Plots; pyplot()\n",
140+
"\n",
141+
"α = 0.5\n",
142+
"x = linspace(-1, 1, 10^3)\n",
143+
"fig = plot(xguide=L\"x\")\n",
144+
"for p in 0:5\n",
145+
" plot!(fig, x, gegenbauer.(x, p, α), label=\"\\$ C_$p^{($α)} \\$\")\n",
146+
"end\n",
147+
"fig"
148+
]
149+
},
120150
{
121151
"cell_type": "markdown",
122152
"metadata": {},
@@ -148,6 +178,35 @@
148178
"fig"
149179
]
150180
},
181+
{
182+
"cell_type": "markdown",
183+
"metadata": {},
184+
"source": [
185+
"## Hermite Polynomials\n",
186+
"\n",
187+
"Hermite poylnomials $H_p$ are evaluated as `hermite(x, p)` using the three term recursion formula."
188+
]
189+
},
190+
{
191+
"cell_type": "code",
192+
"execution_count": null,
193+
"metadata": {
194+
"collapsed": false
195+
},
196+
"outputs": [],
197+
"source": [
198+
"using Revise\n",
199+
"using PolynomialBases\n",
200+
"using LaTeXStrings, Plots; pyplot()\n",
201+
"\n",
202+
"x = linspace(-2, 2, 10^3)\n",
203+
"fig = plot(xguide=L\"x\")\n",
204+
"for p in 0:4\n",
205+
" plot!(fig, x, hermite.(x, p), label=\"\\$ H_$p \\$\")\n",
206+
"end\n",
207+
"fig"
208+
]
209+
},
151210
{
152211
"cell_type": "markdown",
153212
"metadata": {},
@@ -266,6 +325,10 @@
266325
"mimetype": "application/julia",
267326
"name": "julia",
268327
"version": "0.6.1"
328+
},
329+
"widgets": {
330+
"state": {},
331+
"version": "1.1.2"
269332
}
270333
},
271334
"nbformat": 4,

0 commit comments

Comments
 (0)