diff --git a/lessons/05_Step_4.ipynb b/lessons/05_Step_4.ipynb index ec8e076f..038cdb65 100644 --- a/lessons/05_Step_4.ipynb +++ b/lessons/05_Step_4.ipynb @@ -86,7 +86,7 @@ "\n", "$$u(0) = u(2\\pi)$$\n", "\n", - "This is called a *periodic* boundary condition. Pay attention! This will cause you a bit of headache if you don't tread carefully." + "This is called a *periodic* boundary condition. Pay attention! This will cause you a bit of headache if you don't read carefully." ] }, { diff --git a/lessons/08_Step_6.ipynb b/lessons/08_Step_6.ipynb index 59559a8b..aaa9e055 100644 --- a/lessons/08_Step_6.ipynb +++ b/lessons/08_Step_6.ipynb @@ -69,9 +69,9 @@ "source": [ "Rearranging both equations, we solve for $u_{i,j}^{n+1}$ and $v_{i,j}^{n+1}$, respectively. Note that these equations are also coupled. \n", "\n", - "$$u_{i,j}^{n+1} = u_{i,j}^n - u_{i,j} \\frac{\\Delta t}{\\Delta x} (u_{i,j}^n-u_{i-1,j}^n) - v_{i,j}^n \\frac{\\Delta t}{\\Delta y} (u_{i,j}^n-u_{i,j-1}^n)$$\n", + "$$u_{i,j}^{n+1} = u_{i,j}^n - u_{i,j}^n \\frac{\\Delta t}{\\Delta x} (u_{i,j}^n-u_{i-1,j}^n) - v_{i,j}^n \\frac{\\Delta t}{\\Delta y} (u_{i,j}^n-u_{i,j-1}^n)$$\n", "\n", - "$$v_{i,j}^{n+1} = v_{i,j}^n - u_{i,j} \\frac{\\Delta t}{\\Delta x} (v_{i,j}^n-v_{i-1,j}^n) - v_{i,j}^n \\frac{\\Delta t}{\\Delta y} (v_{i,j}^n-v_{i,j-1}^n)$$" + "$$v_{i,j}^{n+1} = v_{i,j}^n - u_{i,j}^n \\frac{\\Delta t}{\\Delta x} (v_{i,j}^n-v_{i-1,j}^n) - v_{i,j}^n \\frac{\\Delta t}{\\Delta y} (v_{i,j}^n-v_{i,j-1}^n)$$" ] }, { @@ -160,9 +160,7 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -188,20 +186,18 @@ { "cell_type": "code", "execution_count": 4, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "for n in range(nt + 1): ##loop across number of time steps\n", " un = u.copy()\n", " vn = v.copy()\n", " u[1:, 1:] = (un[1:, 1:] - \n", - " (un[1:, 1:] * c * dt / dx * (un[1:, 1:] - un[1:, :-1])) -\n", - " vn[1:, 1:] * c * dt / dy * (un[1:, 1:] - un[:-1, 1:]))\n", + " (un[1:, 1:] * dt / dx * (un[1:, 1:] - un[1:, :-1])) -\n", + " vn[1:, 1:] * dt / dy * (un[1:, 1:] - un[:-1, 1:]))\n", " v[1:, 1:] = (vn[1:, 1:] -\n", - " (un[1:, 1:] * c * dt / dx * (vn[1:, 1:] - vn[1:, :-1])) -\n", - " vn[1:, 1:] * c * dt / dy * (vn[1:, 1:] - vn[:-1, 1:]))\n", + " (un[1:, 1:] * dt / dx * (vn[1:, 1:] - vn[1:, :-1])) -\n", + " vn[1:, 1:] * dt / dy * (vn[1:, 1:] - vn[:-1, 1:]))\n", " \n", " u[0, :] = 1\n", " u[-1, :] = 1\n", @@ -217,9 +213,7 @@ { "cell_type": "code", "execution_count": 5, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -245,9 +239,7 @@ { "cell_type": "code", "execution_count": 6, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -286,9 +278,7 @@ { "cell_type": "code", "execution_count": 7, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -321,9 +311,7 @@ { "cell_type": "code", "execution_count": 8, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -453,9 +441,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.2" + "version": "3.6.4" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 1 }