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