Skip to content

Commit

Permalink
docs: update Walkthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
CallumJHays committed Jul 2, 2023
1 parent e35509e commit 8ff844d
Showing 1 changed file with 10 additions and 305 deletions.
315 changes: 10 additions & 305 deletions examples/Walkthrough.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
"\n",
"With `mathpad`, engineers can effortlessly solve complex equations, perform symbolic calculations, handle units and dimensions, and access a growing library of equations and constants. It leverages the power of symbolic computation while providing a user-friendly interface, enabling users to explore and validate mathematical concepts with ease.\n",
"\n",
"Whether you need to verify your work, gain a deeper understanding of mathematical models, or tackle intricate calculations, MathPad simplifies the process with its user-friendly interface and comprehensive features.\n",
"\n",
"Start using MathPad today and experience the power of solving mathematical problems with simplicity and ease using Python."
"Whether you need to verify your work, gain a deeper understanding of mathematical models, or tackle intricate calculations, MathPad simplifies the process with its user-friendly interface and comprehensive features."
]
},
{
Expand Down Expand Up @@ -86,325 +84,32 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"data": {
"text/latex": [
"$$ \\int\\limits_{0}^{10} a\\, dt \\hspace{1.25em} \\frac{\\text{m}}{\\text{s}} $$"
],
"text/plain": [
"Integral(a(t), (t, 0, 10)) meters/second"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# calculus\n",
"integral(a, wrt=t, between=(0, 10))"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [
{
"data": {
"text/latex": [
"$$ 5 t \\hspace{1.25em} \\text{m} $$"
],
"text/plain": [
"5*t meters"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"integral(v)"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"data": {
"text/latex": [
"$$ \\int a\\, dt = 5 \\hspace{1.25em} \\frac{\\text{m}}{\\text{s}} $$"
],
"text/plain": [
"Integral(a(t), t) = 5 meter/second"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"eqn = integral(a) == v\n",
"eqn"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Features\n",
"\n",
"MathPad offers the following features:\n",
"\n",
"- **Easy to pick up**: MathPad is designed to be accessible and user-friendly, allowing you to quickly grasp its functionality and start using it for your mathematical computations without a steep learning curve.\n",
"\n",
" <table>\n",
" <tr>\n",
" <td> Code </td> <td> Latex Display </td>\n",
" </tr>\n",
" <tr>\n",
" <td>\n",
"\n",
" ```python\n",
" from mathpad import *\n",
"\n",
" # constants\n",
" v = 5 * m / s\n",
" ```\n",
"\n",
" </td>\n",
" <td>\n",
"\n",
" $$ 5 \\hspace{1.25em} \\frac{\\text{m}}{\\text{s}} $$\n",
"\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td>\n",
"\n",
" ```python\n",
" # symbols\n",
" t = \"t\" * seconds\n",
" ```\n",
"\n",
" </td>\n",
" <td>\n",
"\n",
" $$ t \\hspace{1.25em} \\text{s} $$\n",
"\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td>\n",
"\n",
" ```python\n",
" # expressions\n",
" dist = v * t\n",
" ```\n",
"\n",
" </td>\n",
" <td>\n",
"\n",
" $$ 5 t \\hspace{1.25em} \\text{m} $$\n",
"\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td>\n",
"\n",
" ```python\n",
" # symbolic functions\n",
" a = \"a(t)\" * m / s ** 2\n",
" ```\n",
"\n",
" </td>\n",
" <td>\n",
"\n",
" $$ a{\\left(t \\right)} \\hspace{1.25em} \\frac{\\text{m}}{\\text{s}^{2}} $$\n",
"\n",
" </td>\n",
" </tr>\n",
" </tr>\n",
" <tr>\n",
" <td>\n",
"\n",
" ```python\n",
" # equations & calculus\n",
" eqn = a == diff(v)\n",
" ```\n",
"\n",
" </td>\n",
" <td>\n",
"\n",
" $$ a = 0 \\hspace{1.25em} \\frac{\\text{m}}{\\text{s}^{2}} $$\n",
"\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td>\n",
"\n",
" ```python\n",
" # solving\n",
" sln, = solve([eqn], solve_for=[a])\n",
" sln[a]\n",
" ```\n",
"\n",
" </td>\n",
" <td>\n",
" \n",
" $$ 0 \\hspace{1.25em} \\frac{\\text{m}}{\\text{s}^{2}} $$\n",
"\n",
" </td>\n",
" </tr>\n",
"\n",
"\n",
"\n",
" </table>\n",
"\n",
"<br />\n",
"\n",
"- **Growing Library**: `mathpad` provides a continuously expanding library of equations and constants that you can leverage in your calculations."
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"$$ mph = \\frac{15625}{1397} \\hspace{1.25em} \\frac{\\text{mile}}{\\text{hour}} $$\n"
]
}
],
"source": [
"print(eqn._repr_latex_())"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'$$ 3 x^{2} \\\\hspace{1.25em} \\\\text{m}^{2} $$'"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\n",
"x = \"x\" * m\n",
"diff(x**3, wrt=x, order=1)._repr_latex_()"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"$$ 0 \\hspace{1.25em} \\frac{\\text{m}}{\\text{s}^{3}} $$\n"
]
}
],
"source": [
"print(diff(v, order=2)._repr_latex_())"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
"\n",
"\n",
" ```python\n",
" ```\n",
"\n",
" Fully Type Hinted: MathPad is fully type hinted, providing clear and precise information about function parameters and return types for seamless integration with your development environment.\n",
"\n",
"```python\n",
"\n",
"import mathpad\n",
"\n",
"# Type hinting in action\n",
"mp: mathpad.MathPad = mathpad.MathPad()\n",
"\n",
"# Perform basic arithmetic operations\n",
"result: float = mp.evaluate(\"2 + 3 * 4\")\n",
"print(result) # Output: 14\n",
"```\n",
"\n",
"- **Growing Library**: MathPad provides a continuously expanding library of equations and constants that you can leverage in your calculations.\n",
"\n",
"```python\n",
"\n",
"# Access constants from the MathPad library\n",
"speed_of_light: float = mp.constants.speed_of_light\n",
"print(speed_of_light) # Output: 299792458\n",
"\n",
"# Utilize equations from the MathPad library\n",
"acceleration_due_to_gravity: float = mp.equations.acceleration_due_to_gravity\n",
"print(acceleration_due_to_gravity) # Output: 9.8 m/s^\n",
"```"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Welcome to MathPad\n",
"\n",
"MathPad is a Computer Algebra System (CAS) library designed to simplify the process of solving engineering, science, and math problems. Whether you are an engineering student or an academic, MathPad provides a powerful tool for verifying your work and gaining a deeper understanding of the mathematical models and equations you are dealing with.\n",
"\n",
"MathPad is ideal for engineering students and academics seeking to easily check their work or better understand the mathematical models and equations they are working with.\n",
"MathPad is a Computer Algebra System (CAS) library designed to simplify the process of solving engineering, science, and math problems. Whether you are an engineering student or an academic, MathPad provides a powerful tool for bootstrapping and verifying your work and gaining a deeper understanding of your mathematical models.\n",
"\n",
"Features:\n",
"- Easy to learn to \n",
"- Define variables and equations with an easy-to-learn syntax\n",
"- Automatically solve equations with the `solve(...)` function\n",
"- Use systems of equations to:\n",
" - model\n",
" - visualize, and\n",
" - simulate your system\n",
"- Beautifully displayed latex output for all core math objects\n",
"- Growing library of equations and constants to utilize\n",
"- Define systems of equations \n",
"- Easy-to-use construction of systems of equations - goodbye hand calculations!\n",
"- Beautifully displayed latex output for every mathematical object\n",
"- Automatic dimensionality validity checking\n",
"- Automatic dimensionality validity checking for operations\n",
"- Automatic unit conversion\n",
"- Growing library of equations and constants to utilize\n",
"\n",
"This notebook will serve as a tour of the major features of `mathpad`.\n",
"\n",
"For more complex, problem-driven examples, please check out the other `.ipynb` files in this directory by accessing the menu to the left."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"attachments": {},
"cell_type": "markdown",
Expand Down

0 comments on commit 8ff844d

Please sign in to comment.