|
65 | 65 | "8. Finally, when you are done with a notebook, selection \"Close and Halt\" from the File menu." |
66 | 66 | ] |
67 | 67 | }, |
68 | | - { |
69 | | - "cell_type": "code", |
70 | | - "execution_count": 1, |
71 | | - "metadata": {}, |
72 | | - "outputs": [ |
73 | | - { |
74 | | - "name": "stdout", |
75 | | - "output_type": "stream", |
76 | | - "text": [ |
77 | | - "Hello\n" |
78 | | - ] |
79 | | - } |
80 | | - ], |
81 | | - "source": [ |
82 | | - "print('Hello')" |
83 | | - ] |
84 | | - }, |
85 | 68 | { |
86 | 69 | "cell_type": "markdown", |
87 | 70 | "metadata": {}, |
88 | 71 | "source": [ |
89 | 72 | "### Using the notebooks\n", |
90 | 73 | "\n", |
91 | | - "The notebooks for each chapter contain the code from the chapter, along with some addition examples, some explanatory text, and some exercises. I recommend you read the chapter first to understand the concepts and vocabulary, then run the notebook to review what you learned and see it in action, and then attempt the exercises.\n", |
| 74 | + "The notebooks for each chapter contain the code from the chapter along with addition examples, explanatory text, and exercises. I recommend you read the chapter first to understand the concepts and vocabulary, then run the notebook to review what you learned and see it in action, and then attempt the exercises.\n", |
92 | 75 | "\n", |
93 | 76 | "The notebooks contain some explanatory text, but it is probably not enough to make sense if you have not read the book. If you are working through a notebook and you get stuck, you might want to re-read (or read!) the corresponding section of the book.\n", |
94 | 77 | "\n", |
|
112 | 95 | }, |
113 | 96 | { |
114 | 97 | "cell_type": "code", |
115 | | - "execution_count": 2, |
| 98 | + "execution_count": 1, |
116 | 99 | "metadata": {}, |
117 | 100 | "outputs": [ |
118 | 101 | { |
|
124 | 107 | } |
125 | 108 | ], |
126 | 109 | "source": [ |
127 | | - "# If you want the figures to appear in the notebook, use\n", |
| 110 | + "# If you want the figures to appear in the notebook, \n", |
| 111 | + "# and you want to interact with them, use\n", |
128 | 112 | "# %matplotlib notebook\n", |
129 | 113 | "\n", |
| 114 | + "# If you want the figures to appear in the notebook, \n", |
| 115 | + "# and you don't want to interact with them, use\n", |
| 116 | + "# %matplotlib inline\n", |
| 117 | + "\n", |
130 | 118 | "# If you want the figures to appear in separate windows, use\n", |
131 | | - "# %matplotlib qt\n", |
| 119 | + "# %matplotlib qt5\n", |
132 | 120 | "\n", |
133 | 121 | "# To switch from one to another, you have to select Kernel->Restart\n", |
134 | 122 | "\n", |
135 | | - "%matplotlib notebook\n", |
| 123 | + "%matplotlib qt5\n", |
136 | 124 | "\n", |
137 | 125 | "from modsim import *\n", |
138 | 126 | "\n", |
|
152 | 140 | }, |
153 | 141 | { |
154 | 142 | "cell_type": "code", |
155 | | - "execution_count": 3, |
| 143 | + "execution_count": 2, |
156 | 144 | "metadata": { |
157 | 145 | "collapsed": true |
158 | 146 | }, |
|
187 | 175 | }, |
188 | 176 | { |
189 | 177 | "cell_type": "code", |
190 | | - "execution_count": 4, |
| 178 | + "execution_count": 3, |
191 | 179 | "metadata": {}, |
192 | 180 | "outputs": [ |
193 | 181 | { |
|
202 | 190 | "<Quantity(9.8, 'meter / second ** 2')>" |
203 | 191 | ] |
204 | 192 | }, |
205 | | - "execution_count": 4, |
| 193 | + "execution_count": 3, |
206 | 194 | "metadata": {}, |
207 | 195 | "output_type": "execute_result" |
208 | 196 | } |
|
223 | 211 | }, |
224 | 212 | { |
225 | 213 | "cell_type": "code", |
226 | | - "execution_count": 5, |
| 214 | + "execution_count": 4, |
227 | 215 | "metadata": {}, |
228 | 216 | "outputs": [ |
229 | 217 | { |
|
238 | 226 | "<Quantity(4, 'second')>" |
239 | 227 | ] |
240 | 228 | }, |
241 | | - "execution_count": 5, |
| 229 | + "execution_count": 4, |
242 | 230 | "metadata": {}, |
243 | 231 | "output_type": "execute_result" |
244 | 232 | } |
|
259 | 247 | }, |
260 | 248 | { |
261 | 249 | "cell_type": "code", |
262 | | - "execution_count": 6, |
| 250 | + "execution_count": 5, |
263 | 251 | "metadata": { |
264 | 252 | "collapsed": true |
265 | 253 | }, |
|
281 | 269 | }, |
282 | 270 | { |
283 | 271 | "cell_type": "code", |
284 | | - "execution_count": 7, |
| 272 | + "execution_count": 6, |
285 | 273 | "metadata": {}, |
286 | 274 | "outputs": [ |
287 | 275 | { |
|
296 | 284 | "<Quantity(8.817885349720552, 'second')>" |
297 | 285 | ] |
298 | 286 | }, |
299 | | - "execution_count": 7, |
| 287 | + "execution_count": 6, |
300 | 288 | "metadata": {}, |
301 | 289 | "output_type": "execute_result" |
302 | 290 | } |
|
318 | 306 | }, |
319 | 307 | { |
320 | 308 | "cell_type": "code", |
321 | | - "execution_count": 8, |
| 309 | + "execution_count": 7, |
322 | 310 | "metadata": {}, |
323 | 311 | "outputs": [ |
324 | 312 | { |
|
333 | 321 | "<Quantity(86.41527642726142, 'meter / second')>" |
334 | 322 | ] |
335 | 323 | }, |
336 | | - "execution_count": 8, |
| 324 | + "execution_count": 7, |
337 | 325 | "metadata": {}, |
338 | 326 | "output_type": "execute_result" |
339 | 327 | } |
|
354 | 342 | }, |
355 | 343 | { |
356 | 344 | "cell_type": "code", |
357 | | - "execution_count": 9, |
| 345 | + "execution_count": 8, |
358 | 346 | "metadata": { |
359 | 347 | "collapsed": true |
360 | 348 | }, |
|
366 | 354 | }, |
367 | 355 | { |
368 | 356 | "cell_type": "code", |
369 | | - "execution_count": 10, |
| 357 | + "execution_count": 9, |
370 | 358 | "metadata": {}, |
371 | 359 | "outputs": [ |
372 | 360 | { |
|
381 | 369 | "<Quantity(193.30546802805438, 'mile / hour')>" |
382 | 370 | ] |
383 | 371 | }, |
384 | | - "execution_count": 10, |
| 372 | + "execution_count": 9, |
385 | 373 | "metadata": {}, |
386 | 374 | "output_type": "execute_result" |
387 | 375 | } |
|
401 | 389 | }, |
402 | 390 | { |
403 | 391 | "cell_type": "code", |
404 | | - "execution_count": 11, |
| 392 | + "execution_count": 10, |
405 | 393 | "metadata": {}, |
406 | 394 | "outputs": [ |
407 | 395 | { |
|
3114 | 3102 | { |
3115 | 3103 | "cell_type": "code", |
3116 | 3104 | "execution_count": 38, |
3117 | | - "metadata": {}, |
| 3105 | + "metadata": { |
| 3106 | + "collapsed": true |
| 3107 | + }, |
3118 | 3108 | "outputs": [], |
3119 | 3109 | "source": [ |
3120 | 3110 | "if flip(0.7):\n", |
|
0 commit comments