diff --git a/lessons/12_Step_9.ipynb b/lessons/12_Step_9.ipynb index 8855c39b..c752687c 100644 --- a/lessons/12_Step_9.ipynb +++ b/lessons/12_Step_9.ipynb @@ -126,9 +126,7 @@ { "cell_type": "code", "execution_count": 1, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "import numpy\n", @@ -140,9 +138,7 @@ { "cell_type": "code", "execution_count": 2, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "def plot2D(x, y, p):\n", @@ -162,7 +158,13 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The function `plot2D` takes three arguments, an x-vector, a y-vector and our p matrix. Given these three values, it produces a 3D projection plot, sets the plot limits and gives us a nice viewing angle. " + "The function `plot2D` takes three arguments:\n", + "\n", + "* `x`: 1D array with point locations along an horizontal gridline,\n", + "* `y`: 1D array with point locations along a vertical gridline,\n", + "* `p`: 2D array containing the numerical solution in the domain.\n", + "\n", + "Given these three values, it produces a 3D projection plot, sets the plot limits and gives us a nice viewing angle. " ] }, { @@ -175,9 +177,7 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "def laplace2d(p, y, dx, dy, l1norm_target):\n", @@ -204,7 +204,13 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "`laplace2d` takes five arguments, the `p` matrix, the `y`-vector, `dx`, `dy` and the value `l1norm_target`. This last value defines how close the `p` matrix should be in two consecutive iterations before the loop breaks and returns the calculated `p` value. \n", + "`laplace2d` takes five arguments:\n", + "\n", + "* `p`: 2D array containing the initial solution in the domain,\n", + "* `y`: 1D array with point locations along a vertical gridline,\n", + "* `dx`: $x$-distance between two gridlines,\n", + "* `dy`: $y$-distance between two gridlines,\n", + "* `l1norm_target`: value to define convergence; we stop the iterative process (i.e., exit the `while` loop) when the relative difference between two consecutive solutions (in the $L_1$-norm) is lower or equal than `l1norm_target`.\n", "\n", "Note that when executing the cells above in your own notebook, there will be no output. You have *defined* the function but you have not yet *called* the function. It is now available for you to use, the same as `numpy.linspace` or any other function in our namespace. " ] @@ -212,9 +218,7 @@ { "cell_type": "code", "execution_count": 4, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "##variable declarations\n", @@ -250,9 +254,7 @@ { "cell_type": "code", "execution_count": 5, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -281,9 +283,7 @@ { "cell_type": "code", "execution_count": 6, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "p = laplace2d(p, y, dx, dy, 1e-4)" @@ -299,9 +299,7 @@ { "cell_type": "code", "execution_count": 7, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -342,9 +340,7 @@ { "cell_type": "code", "execution_count": 8, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -384,9 +380,7 @@ { "cell_type": "code", "execution_count": 9, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -419,9 +413,7 @@ { "cell_type": "code", "execution_count": 10, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -551,9 +543,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.2" + "version": "3.6.10" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 1 }