Commit 3520fb08 by Prayush Kumar

Make derivative computation explicit in demo7

parent ca4ec884
Showing with 6 additions and 4 deletions
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -221,9 +221,11 @@ ...@@ -221,9 +221,11 @@
" conditions.\"\"\"\n", " conditions.\"\"\"\n",
"\n", "\n",
" g, Pi, Phi = u[0], u[1], u[2]\n", " g, Pi, Phi = u[0], u[1], u[2]\n",
" gDot = -Pi\n", " gDot = -Pi \n",
" PiDot = -Fourier.dudx_Fourier(Phi)\n", " # PiDot = -Fourier.dudx_Fourier(Phi)\n",
" PhiDot = -Fourier.dudx_Fourier(Pi)\n", " # PhiDot = -Fourier.dudx_Fourier(Pi)\n",
" PiDot = -info.D1 @ Phi\n",
" PhiDot = -info.D1 @ Pi\n",
"\n", "\n",
" dudt = u.copy() # create data structure of the same shape as `u`\n", " dudt = u.copy() # create data structure of the same shape as `u`\n",
" dudt[0] = gDot\n", " dudt[0] = gDot\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment