10: Add more useful comments.

This commit is contained in:
2022-03-15 10:50:55 +01:00
parent 950b0a015a
commit ab087ce976

View File

@ -215,9 +215,10 @@
" A = np.eye(m - 2)*2*(1 - λ**2) + ( np.eye(m - 2, m - 2, 1) + np.eye(m - 2, m - 2, -1) )*λ**2\n",
" \n",
" # Create empty matrix w for the result.\n",
" # The boundary values at x[0] and x[-1] are taken care of this way, too.\n",
" w = np.zeros((n, m))\n",
" \n",
" # Set initial values for w[0, i] and w[1, i].\n",
" # Set initial values for w[0, i] and w[1, i] for all i except for the boundaries.\n",
" w[0] = f(x)\n",
" w[1, 1:m - 1] = (1 - λ**2)*f(x[1:m - 1]) + λ**2/2*f(x[2:m]) + λ**2/2*f(x[0:m - 2]) + k*g(x[1:m - 1])\n",
" \n",