Skip to content

Commit

Permalink
small corrections (np.imshow -> plt.imshow, etc.)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiitozer committed Oct 4, 2023
1 parent a8ae66e commit 14b86e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PCP_06_complex.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,8 @@
"<ul>\n",
" <li>Model the Mandelbrot set as a binary indicator function $\\chi:\\mathbb{C}\\in\\{0,1\\}$, where $\\chi(c)=1$ if $c$ belongs to the Mandelbrot set and $\\chi(c)=0$ otherwise. </li>\n",
" <li>Only consider complex numbers $c=a+ib$ on a discrete grid on a bounded range. It suffices to consider the range $a\\in[-2,1]$ and $b\\in[-1.2,1.2]$. Furthermore, for efficiency reasons, use a grid spacing that is not too fine. First, try out $\\Delta a = \\Delta b = 0.01$. To create the grid, you may use the function <code>np.meshgrid</code>.</li>\n",
" <li>Test for each $c=a+ib$ on that grid, if $(v_c(k))_{k\\in\\mathbb{N}}$ remains bounded or not. Computationally, this cannot be tested easily. However, usually, the sequence $(v_c(k))$ increases in an exponential fashion in the case that it is not bounded. Therefore, a pragmatic (yet not always correct) test is to fix a maximum number of iterations (e.g., $K = 50$) and a threshold (e.g., $L = 100$). In case that $v_c(K)<L$, assume that the sequence is bounded and set $\\chi(c)=1$, otherwise $\\chi(c)=0$.</li>\n",
" <li>Plot $\\chi$ using the function <code>np.imshow</code>, use the colormap <code>'gray_r'</code>. Furthermore, use the parameter <code>extent</code> to adjust ranges of the horizontal axis $[-2,1]$ (real part) and vertical axis $[-1.2,1.2]$ (imaginary part).</li> \n",
" <li>Test for each $c=a+ib$ on that grid, if $(v_c(k))_{k\\in\\mathbb{N}}$ remains bounded or not. Computationally, this cannot be tested easily. However, usually, the sequence $(v_c(k))$ increases in an exponential fashion in the case that it is not bounded. Therefore, a pragmatic (yet not always correct) test is to fix a maximum number of iterations (e.g., $K = 50$) and a threshold (e.g., $L = 100$).</li>\n",
" <li>Plot $\\chi$ using the function <code>plt.imshow</code>, use the colormap <code>'gray_r'</code>. Furthermore, use the parameter <code>extent</code> to adjust ranges of the horizontal axis $[-2,1]$ (real part) and vertical axis $[-1.2,1.2]$ (imaginary part).</li> \n",
"</ul> \n",
"</div>"
]
Expand Down Expand Up @@ -593,7 +593,7 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -607,7 +607,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.17"
"version": "3.9.18"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 14b86e2

Please sign in to comment.