09: Attempt to fix the docstrings
This commit is contained in:
@ -139,21 +139,22 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"def integrator(x, y0, f, phi):\n",
|
"def integrator(x, y0, f, phi):\n",
|
||||||
" \"\"\"\n",
|
" \"\"\"\n",
|
||||||
" Numerically solves the initial value problem given by ordinary differential equation\n",
|
" Numerically solves the initial value problem (IVP) given by ordinary differential\n",
|
||||||
" f(x, y) = y' with initial value y0 using the integration scheme provided by phi.\n",
|
" equation (ODE) f(x, y) = y' with initial value y0 using the integration scheme\n",
|
||||||
|
" provided by phi.\n",
|
||||||
"\n",
|
"\n",
|
||||||
" Args:\n",
|
" Args:\n",
|
||||||
" x: size n + 1 numerical array\n",
|
" x: size n + 1 numerical array\n",
|
||||||
" y0: an initial value to the function f\n",
|
" y0: an initial value to the function f\n",
|
||||||
" f: a callable function with signature (x, y), with x and y the current state\n",
|
" f: a callable function with signature (x, y), with x and y the current state\n",
|
||||||
" of the system\n",
|
" of the system, and f such that f(x, y) = y' in the ODE\n",
|
||||||
" phi: a callable function with signature (x, y, f, i), with x and y the current state\n",
|
" phi: a callable function with signature (x, y, f, i), with x and y the current state\n",
|
||||||
" of the system, i the step number, and f as above, representing the integration\n",
|
" of the system, i the step number, and f as above, representing the integration\n",
|
||||||
" scheme to use\n",
|
" scheme to use\n",
|
||||||
"\n",
|
"\n",
|
||||||
" Returns:\n",
|
" Returns:\n",
|
||||||
" An n + 1 numerical array representing an approximate solution to y' = f(x, y)\n",
|
" An n + 1 numerical array representing an approximate solution to y in y' = f(x, y)\n",
|
||||||
" given initial value y0 and steps from x\n",
|
" given initial value y0, steps from x, and using integration scheme phi.\n",
|
||||||
" \"\"\"\n",
|
" \"\"\"\n",
|
||||||
" \n",
|
" \n",
|
||||||
" eta = np.zeros(len(x))\n",
|
" eta = np.zeros(len(x))\n",
|
||||||
@ -187,20 +188,18 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"def phi_euler(x, y, f, i):\n",
|
"def phi_euler(x, y, f, i):\n",
|
||||||
" \"\"\"\n",
|
" \"\"\"\n",
|
||||||
" Numerically solves the initial value problem given by ordinary differential equation\n",
|
" Returns the integrator phi = f(x, y) for the Euler method to solve the ODE\n",
|
||||||
" f(x, y) = y' with initial value y0 using the Euler method.\n",
|
" y' = f(x, y).\n",
|
||||||
"\n",
|
"\n",
|
||||||
" Args:\n",
|
" Args:\n",
|
||||||
" x: a size n + 1 numerical array\n",
|
" x: current x value for f\n",
|
||||||
" y: a size n + 1 numerical array with y[0] the initial value corresponding to x[0]\n",
|
" y: current y value for f\n",
|
||||||
" f: a callable function with signature (x, y), with x and y the current state\n",
|
" f: a callable function with signature (x, y), with x and y the current state\n",
|
||||||
" of the system\n",
|
" of the system, and f such that f(x, y) = y' in the ODE\n",
|
||||||
" i: a callable function with signature (x, y, f, i), with x and y the current state\n",
|
" i: the step number of the IVP solving algorithm (not used)\n",
|
||||||
" of the system, i the step number, and f as above\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
" Returns:\n",
|
" Returns:\n",
|
||||||
" An n + 1 numerical array representing an approximate solution to y' = f(x, y)\n",
|
" The integrator phi(x, y, f, i) = f(x, y).\n",
|
||||||
" given initial value y0 and steps from x\n",
|
|
||||||
" \"\"\"\n",
|
" \"\"\"\n",
|
||||||
" \n",
|
" \n",
|
||||||
" return f(x, y)\n",
|
" return f(x, y)\n",
|
||||||
@ -260,7 +259,7 @@
|
|||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"[<matplotlib.lines.Line2D at 0x1554d71a0610>]"
|
"[<matplotlib.lines.Line2D at 0x151df36105e0>]"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 4,
|
"execution_count": 4,
|
||||||
|
|||||||
Reference in New Issue
Block a user