Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
shenvitor committed Apr 10, 2024
1 parent 8497c1b commit 5993484
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 826 deletions.
145 changes: 137 additions & 8 deletions playground.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
{
"cell_type": "markdown",
"id": "3",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"## [Introductory](https://docs.sympy.org/latest/tutorials/intro-tutorial/intro.html) (What is Symbolic Computation?)"
]
Expand Down Expand Up @@ -734,6 +736,7 @@
"id": "53",
"metadata": {
"editable": true,
"jp-MarkdownHeadingCollapsed": true,
"slideshow": {
"slide_type": ""
},
Expand Down Expand Up @@ -1214,10 +1217,18 @@
"## [Lambdify](https://docs.sympy.org/latest/modules/utilities/lambdify.html) (Lambdification to numerical functions)"
]
},
{
"cell_type": "markdown",
"id": "101",
"metadata": {},
"source": [
"forwards"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "101",
"id": "102",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1231,7 +1242,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "102",
"id": "103",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1242,7 +1253,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "103",
"id": "104",
"metadata": {
"editable": true,
"slideshow": {
Expand All @@ -1261,17 +1272,135 @@
"f(0.1)"
]
},
{
"cell_type": "markdown",
"id": "105",
"metadata": {},
"source": [
"This module provides convenient functions to transform SymPy expressions to lambda functions which can be used to calculate numerical values very fast."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "104",
"id": "106",
"metadata": {},
"outputs": [],
"source": [
"from sympy.abc import x\n",
"from sympy.utilities.lambdify import implemented_function\n",
"from sympy import lambdify\n",
"f = implemented_function('f', lambda x: x+1)\n",
"lam_f = lambdify(x, f(x))\n",
"lam_f(4)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "107",
"metadata": {},
"outputs": [],
"source": [
"from sympy.abc import x, y, z\n",
"from sympy.utilities.lambdify import lambdastr\n",
"lambdastr(x, x**2)\n",
"lambdastr((x,y,z), [z,y,x])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "108",
"metadata": {},
"outputs": [],
"source": [
"lambdastr((x, (y, z)), x + y)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "109",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "110",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "111",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "112",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "113",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "114",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "115",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "116",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "117",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "118",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "105",
"id": "119",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
Expand All @@ -1282,7 +1411,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "106",
"id": "120",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1292,7 +1421,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "107",
"id": "121",
"metadata": {},
"outputs": [],
"source": []
Expand Down
Loading

0 comments on commit 5993484

Please sign in to comment.