Skip to content

Instantly share code, notes, and snippets.

/sympy.ipynb Secret

Created February 12, 2017 20:38
Show Gist options
  • Save anonymous/8293ad8ff6b6300df34be12d6dfbc478 to your computer and use it in GitHub Desktop.
Save anonymous/8293ad8ff6b6300df34be12d6dfbc478 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 46,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
"import sympy\n",
"sympy.init_printing()"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"data": {
"text/latex": [
"$$f{\\left (x_{0} \\right )} + \\left(x - x_{0}\\right) \\left. \\frac{d}{d \\xi_{1}} f{\\left (\\xi_{1} \\right )} \\right|_{\\substack{ \\xi_{1}=x_{0} }} + \\mathcal{O}\\left(\\left(x - x_{0}\\right)^{2}; x\\rightarrowx_{0}\\right)$$"
],
"text/plain": [
" ⎛ d ⎞│ ⎛ 2 ⎞\n",
"f(x₀) + (x - x₀)⋅⎜───(f(ξ₁))⎟│ + O⎝(x - x₀) ; x → x₀⎠\n",
" ⎝dξ₁ ⎠│ξ₁=x₀ "
]
},
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x, x0 = sympy.symbols('x x0')\n",
"f = sympy.Function('f')\n",
"g = sympy.series(f(x), x, x0, 2)\n",
"g"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment