-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: rewrite double pendulum example using vectors
- Loading branch information
1 parent
4f12990
commit 787a6e5
Showing
10 changed files
with
109 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,72 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Solution( t = 1.1176 seconds )\n" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/latex": [ | ||
"$\\displaystyle \\frac{1397}{1250} \\hspace{1.25em} \\text{s}$" | ||
], | ||
"text/plain": [ | ||
"1.1176 seconds" | ||
] | ||
}, | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"from mathpad import *\n", | ||
"\n", | ||
"t = \"t\" * seconds # \"t seconds\"\n", | ||
"\n", | ||
"velocity = 5 * miles / hour # \"5 miles/hour\"\n", | ||
"\n", | ||
"deceleration = 2 * meters / second ** 2 # \"10 meters/second**2\"\n", | ||
"\n", | ||
"solution = solve(t == velocity / deceleration, t) # \"Solution(t = 1.1176 seconds)\"\n", | ||
"print(solution)\n", | ||
"\n", | ||
"solution[t]" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"interpreter": { | ||
"hash": "bec35ff8d3ceac10428ff23ff3d495acaf5c2f0370f6a03008458d4f010ac403" | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3.9.1 64-bit ('mathpad-tPciuzSw-py3.9': poetry)", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.1" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Solution( t = 1.1176 seconds )\n" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/latex": [ | ||
"$\\displaystyle \\frac{1397}{1250} \\hspace{1.25em} \\text{s}$" | ||
], | ||
"text/plain": [ | ||
"1.1176 seconds" | ||
] | ||
}, | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"from mathpad import *\n", | ||
"\n", | ||
"t = \"t\" * seconds # \"t seconds\"\n", | ||
"\n", | ||
"velocity = 5 * miles / hour # \"5 miles/hour\"\n", | ||
"\n", | ||
"deceleration = 2 * meters / second ** 2 # \"10 meters/second**2\"\n", | ||
"\n", | ||
"solution = solve(t == velocity / deceleration, t) # \"Solution(t = 1.1176 seconds)\"\n", | ||
"print(solution)\n", | ||
"\n", | ||
"solution[t]" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3.8.10 ('mathpad-IMbbmyaw-py3.8')", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.10" | ||
}, | ||
"orig_nbformat": 4, | ||
"vscode": { | ||
"interpreter": { | ||
"hash": "c68f6f75b9b5074b455bff57bf843aee0a1a4f29736bbb117f262860b9efa145" | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
787a6e5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see this. The reference frame thing is cute as well.