Skip to content

Commit 3bfa91e

Browse files
committed
Adding non-solution notebooks
1 parent bb2c369 commit 3bfa91e

24 files changed

Lines changed: 10318 additions & 11414 deletions

code/chap01.ipynb

Lines changed: 125 additions & 4433 deletions
Large diffs are not rendered by default.

code/chap01soln.ipynb

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -65,30 +65,13 @@
6565
"8. Finally, when you are done with a notebook, selection \"Close and Halt\" from the File menu."
6666
]
6767
},
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-
},
8568
{
8669
"cell_type": "markdown",
8770
"metadata": {},
8871
"source": [
8972
"### Using the notebooks\n",
9073
"\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",
9275
"\n",
9376
"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",
9477
"\n",
@@ -112,7 +95,7 @@
11295
},
11396
{
11497
"cell_type": "code",
115-
"execution_count": 2,
98+
"execution_count": 1,
11699
"metadata": {},
117100
"outputs": [
118101
{
@@ -124,15 +107,20 @@
124107
}
125108
],
126109
"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",
128112
"# %matplotlib notebook\n",
129113
"\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",
130118
"# If you want the figures to appear in separate windows, use\n",
131-
"# %matplotlib qt\n",
119+
"# %matplotlib qt5\n",
132120
"\n",
133121
"# To switch from one to another, you have to select Kernel->Restart\n",
134122
"\n",
135-
"%matplotlib notebook\n",
123+
"%matplotlib qt5\n",
136124
"\n",
137125
"from modsim import *\n",
138126
"\n",
@@ -152,7 +140,7 @@
152140
},
153141
{
154142
"cell_type": "code",
155-
"execution_count": 3,
143+
"execution_count": 2,
156144
"metadata": {
157145
"collapsed": true
158146
},
@@ -187,7 +175,7 @@
187175
},
188176
{
189177
"cell_type": "code",
190-
"execution_count": 4,
178+
"execution_count": 3,
191179
"metadata": {},
192180
"outputs": [
193181
{
@@ -202,7 +190,7 @@
202190
"<Quantity(9.8, 'meter / second ** 2')>"
203191
]
204192
},
205-
"execution_count": 4,
193+
"execution_count": 3,
206194
"metadata": {},
207195
"output_type": "execute_result"
208196
}
@@ -223,7 +211,7 @@
223211
},
224212
{
225213
"cell_type": "code",
226-
"execution_count": 5,
214+
"execution_count": 4,
227215
"metadata": {},
228216
"outputs": [
229217
{
@@ -238,7 +226,7 @@
238226
"<Quantity(4, 'second')>"
239227
]
240228
},
241-
"execution_count": 5,
229+
"execution_count": 4,
242230
"metadata": {},
243231
"output_type": "execute_result"
244232
}
@@ -259,7 +247,7 @@
259247
},
260248
{
261249
"cell_type": "code",
262-
"execution_count": 6,
250+
"execution_count": 5,
263251
"metadata": {
264252
"collapsed": true
265253
},
@@ -281,7 +269,7 @@
281269
},
282270
{
283271
"cell_type": "code",
284-
"execution_count": 7,
272+
"execution_count": 6,
285273
"metadata": {},
286274
"outputs": [
287275
{
@@ -296,7 +284,7 @@
296284
"<Quantity(8.817885349720552, 'second')>"
297285
]
298286
},
299-
"execution_count": 7,
287+
"execution_count": 6,
300288
"metadata": {},
301289
"output_type": "execute_result"
302290
}
@@ -318,7 +306,7 @@
318306
},
319307
{
320308
"cell_type": "code",
321-
"execution_count": 8,
309+
"execution_count": 7,
322310
"metadata": {},
323311
"outputs": [
324312
{
@@ -333,7 +321,7 @@
333321
"<Quantity(86.41527642726142, 'meter / second')>"
334322
]
335323
},
336-
"execution_count": 8,
324+
"execution_count": 7,
337325
"metadata": {},
338326
"output_type": "execute_result"
339327
}
@@ -354,7 +342,7 @@
354342
},
355343
{
356344
"cell_type": "code",
357-
"execution_count": 9,
345+
"execution_count": 8,
358346
"metadata": {
359347
"collapsed": true
360348
},
@@ -366,7 +354,7 @@
366354
},
367355
{
368356
"cell_type": "code",
369-
"execution_count": 10,
357+
"execution_count": 9,
370358
"metadata": {},
371359
"outputs": [
372360
{
@@ -381,7 +369,7 @@
381369
"<Quantity(193.30546802805438, 'mile / hour')>"
382370
]
383371
},
384-
"execution_count": 10,
372+
"execution_count": 9,
385373
"metadata": {},
386374
"output_type": "execute_result"
387375
}
@@ -401,7 +389,7 @@
401389
},
402390
{
403391
"cell_type": "code",
404-
"execution_count": 11,
392+
"execution_count": 10,
405393
"metadata": {},
406394
"outputs": [
407395
{
@@ -3114,7 +3102,9 @@
31143102
{
31153103
"cell_type": "code",
31163104
"execution_count": 38,
3117-
"metadata": {},
3105+
"metadata": {
3106+
"collapsed": true
3107+
},
31183108
"outputs": [],
31193109
"source": [
31203110
"if flip(0.7):\n",

0 commit comments

Comments
 (0)