Skip to content

Commit

Permalink
updated tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed Oct 23, 2017
1 parent f80a7bd commit ac2c176
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions notebooks/Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,36 @@
"fig"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Gegenbauer Polynomials\n",
"\n",
"Gegenbauer poylnomials $C_p^{(\\alpha)}$ are evaluated as `gegenbauer(x, p, α)` using the three term recursion formula."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"using Revise\n",
"using PolynomialBases\n",
"using LaTeXStrings, Plots; pyplot()\n",
"\n",
"α = 0.5\n",
"x = linspace(-1, 1, 10^3)\n",
"fig = plot(xguide=L\"x\")\n",
"for p in 0:5\n",
" plot!(fig, x, gegenbauer.(x, p, α), label=\"\\$ C_$p^{($α)} \\$\")\n",
"end\n",
"fig"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -148,6 +178,35 @@
"fig"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Hermite Polynomials\n",
"\n",
"Hermite poylnomials $H_p$ are evaluated as `hermite(x, p)` using the three term recursion formula."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"using Revise\n",
"using PolynomialBases\n",
"using LaTeXStrings, Plots; pyplot()\n",
"\n",
"x = linspace(-2, 2, 10^3)\n",
"fig = plot(xguide=L\"x\")\n",
"for p in 0:4\n",
" plot!(fig, x, hermite.(x, p), label=\"\\$ H_$p \\$\")\n",
"end\n",
"fig"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -266,6 +325,10 @@
"mimetype": "application/julia",
"name": "julia",
"version": "0.6.1"
},
"widgets": {
"state": {},
"version": "1.1.2"
}
},
"nbformat": 4,
Expand Down

0 comments on commit ac2c176

Please sign in to comment.