-
Notifications
You must be signed in to change notification settings - Fork 196
/
Copy pathindex.html
441 lines (338 loc) · 17.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
<!--
Automatically generated HTML file from DocOnce source
(https://github.com/hplgit/doconce/)
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
<meta name="description" content="Resources for A Primer on Scientific Programming with Python">
<title>Resources for A Primer on Scientific Programming with Python</title>
<style type="text/css">
/* bloodish style */
body {
font-family: Helvetica, Verdana, Arial, Sans-serif;
color: #404040;
background: #ffffff;
}
h1 { font-size: 1.8em; color: #8A0808; }
h2 { font-size: 1.6em; color: #8A0808; }
h3 { font-size: 1.4em; color: #8A0808; }
h4 { color: #8A0808; }
a { color: #8A0808; text-decoration:none; }
tt { font-family: "Courier New", Courier; }
/* pre style removed because it will interfer with pygments */
p { text-indent: 0px; }
hr { border: 0; width: 80%; border-bottom: 1px solid #aaa}
p.caption { width: 80%; font-style: normal; text-align: left; }
hr.figure { border: 0; width: 80%; border-bottom: 1px solid #aaa}
div { text-align: justify; text-justify: inter-word; }
</style>
</head>
<!-- tocinfo
{'highest level': 1,
'sections': [('The 5th edition', 1, None, '___sec0'),
('All programs from the book', 2, None, '___sec1'),
('Erratalist', 2, None, '___sec2'),
('More resources and information for the latest edition',
1,
None,
'___sec3'),
('Software installation', 2, None, '___sec4'),
('Software installation on Ubuntu', 2, None, '___sec5'),
('Slides', 2, None, '___sec6'),
('The 4th edition', 1, None, '___sec7'),
('All programs from the book', 2, None, '___sec8'),
('Erratalist', 2, None, '___sec9'),
('Slides', 2, None, '___sec10'),
('The 3rd edition', 1, None, '___sec11'),
('All programs from the book', 2, None, '___sec12'),
('Software installation', 2, None, '___sec13'),
('Software installation on Ubuntu', 2, None, '___sec14'),
('Erratalist', 2, None, '___sec15'),
('Slides', 2, None, '___sec16'),
('The 1st and 2nd edition', 1, None, '___sec17')]}
end of tocinfo -->
<body>
<!-- ------------------- main content ---------------------- -->
<center><h1>Resources for A Primer on Scientific Programming with Python</h1></center> <!-- document title -->
<p>
<!-- author(s): Hans Petter Langtangen -->
<center>
<b>Hans Petter Langtangen</b> (<tt>hpl at simula.no</tt>)
</center>
<p>
<!-- institution(s) -->
<br>
<h1 id="___sec0">The 5th edition </h1>
<p>
<a href="http://www.springer.com/gp/book/9783662498866"><img border="0" width="130" src="figs/Primer5th_pic.jpg"></a>
<p>
<b>Changes from the fourth to the fifth edition.</b>
Substantial changes were introduced in the fourth edition, and the
fifth edition is primarily a consolidation of those changes. Many
typos have been corrected and many explanations and exercises have
been improved. The emphasis on unit tests and test functions,
especially in exercises, is stronger than in the previous edition.
Symbolic computation with the aid of SymPy is used to a larger extent
and integrated with numerical computing throughout the book. All
classes are now new-style (instead of old-style/classic as in previous
editions). Examples on Matplotlib do not use the <code>pylab</code> module
anymore, but <code>pyplot</code> and MATLAB-like syntax is still favored to ease
the transition between Python and MATLAB. The concept of closures is
more explicit than in earlier editions (see the new Section 7.1.7)
since this is a handy and popular construction much used in the
scientific Python community. We also discuss the difference between
Python 2 and 3 and demonstrate how to use the <code>future</code> module to write
code that runs under both versions.
The most substantial new material in the fifth edition appears toward
the end of Chapter 5 and regards high-performance computing, linear
algebra, and visualization of scalar and vector fields.
The numbering of sections and in particular exercises differs from
previous editions.
<h2 id="___sec1">All programs from the book </h2>
<p>
On Unix/Linux or Mac, download
the tarfile <a href="book-examples-5th.tar.gz" target="_self"><tt>book-examples-5th.tar.gz</tt></a>
for the 5th edition and pack it out by
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>tar xvzf book-examples-5th.tar.gz
</pre></div>
<p>
On Windows, download <a href="book-examples-5th.zip" target="_self"><tt>book-examples-5th.zip</tt></a>
for the 4th edition and pack it out by
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>unzip book-examples-5th.zip
</pre></div>
<p>
or double click on the file icon.
<p>
The result is a folder (directory)
tree <code>src</code> with subfolders containing
the program examples for different chapters in the book
(<code>formulas</code>, <code>looplist</code>, etc., as explained in the introduction to
each chapter).
<p>
An important change from the 4th edition is that the directory <code>files</code>
in the 4th edition is named <code>dictstring</code> in the 5th edition.
<p>
You can also directly access the latest version of the example
files at <a href="https://github.com/hplgit/scipro-primer" target="_self">GitHub</a>, see
the <a href="https://github.com/hplgit/scipro-primer/tree/master/src" target="_self">src</a>
directory (to download a file, click the <em>Raw</em> button on the right first
to get the pure text file in the browser and then right-click to download).
To copy the whole repository to your computer, run
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>git clone https://github.com/hplgit/scipro-primer.git
</pre></div>
<h2 id="___sec2">Erratalist </h2>
<p>
Here is a <a href="erratalist5th.pdf" target="_self">PDF file</a> or an <a href="erratalist5th.html" target="_self">HTML file</a> with an errata list for the
5th edition of the book. If you find any typo or error, please
report it to <a href="mailto:hpl@simula.no" target="_self">the author</a>.
<h1 id="___sec3">More resources and information for the latest edition </h1>
<h2 id="___sec4">Software installation </h2>
<p>
There are several ways to access Python, either on your computer or
in the cloud. <a href="http://hplgit.github.io/edu/accesspy/accesspy_primer4.html" target="_self">Appendix H.1</a> in the book gives an overview of
recommended technologies and how to use them to get the software you need
for working with the book. Our primary recommendation is to install Anaconda - it suffices for the book. However, if you intend to do more advanced
scientific computing in the future, we strongly recommend to use a virtual
Ubuntu machine for all that work.
<p>
<b>SciTools.</b>
The package SciTools is freqently referred to and used in the book.
You may want to install SciTools directly from its Git version control
repository. This makes it easy to upgrade the package at any time.
SciTools is hosted at <a href="https://github.com/hplgit/scitools/" target="_self">GitHub</a>
(note that the old repository at Googlecode only contains old versions - stay
away from those!).
Make sure you have the Git version control system
on your computer (if not, googling for installation of Git brings you
to simple procedures, depending on the platform you are on).
Get the SciTools source code and install it by
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>git clone https://github.com/hplgit/scitools.git
cd scitools
sudo python setup.py install
</pre></div>
<p>
Whenever you want to upgrade the package, just go to the <code>scitools</code>
folder and run the commands
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>git pull origin master
sudo python setup.py install
</pre></div>
<p>
A simpler installation procedure applies <code>pip</code>:
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>pip install -e git+https://github.com/hplgit/scitools.git#egg=scitools --upgrade
</pre></div>
<p>
Note that you have to rerun this command to install new versions of SciTools
in the future.
<h2 id="___sec5">Software installation on Ubuntu </h2>
<p>
If you have an Ubuntu installation, Python is already there. The minimum
extra packages are installed by this command:
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>sudo apt-get install python-matplotlib python-scipy python-gnuplot gnuplot gnuplot-x11 python-scitools
</pre></div>
<p>
The Gnuplot packages are optional (you can exclusively used Matplotlib instead).
<p>
A comprehensive installation with lots of useful packages can be
performed by a <a href="https://raw.github.com/hplgit/vagrantbox/master/doc/src/vagrant/src-vagrant/install_rich.sh" target="_self">Bash script</a>. Download this file (<code>install_rich.sh</code>) and run it by <code>bash install_rich.sh</code>.
<h2 id="___sec6">Slides </h2>
<p>
There is a <a href="slides/index.html" target="_self">slide collection</a>
from lectures based on the latest edition of the book.
<p>
<hr>
<h1 id="___sec7">The 4th edition </h1>
<p>
<a href="http://www.amazon.com/Scientific-Programming-Computational-Science-Engineering/dp/3642549586/ref=sr_1_2?s=books&ie=UTF8&qid=1407225588&sr=1-2&keywords=langtangen"><img border="0" width="130" src="figs/Primer4th_pic.jpg"></a>
<h2 id="___sec8">All programs from the book </h2>
<p>
On Unix/Linux or Mac, download
the tarfile <a href="book-examples-4th.tar.gz" target="_self"><tt>book-examples-4th.tar.gz</tt></a>
for the 4th edition and pack it out by
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>tar xvzf book-examples-4th.tar.gz
</pre></div>
<p>
On Windows, download <a href="book-examples-4th.zip" target="_self"><tt>book-examples-4th.zip</tt></a>
for the 4th edition and pack it out by
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>unzip book-examples-4th.zip
</pre></div>
<p>
or double click on the file icon.
<p>
The result is a folder (directory)
tree <code>src</code> with subfolders containing
the program examples for different chapters in the book
(<code>formulas</code>, <code>looplist</code>, etc., as explained in the introduction to
each chapter).
<p>
You can also directly access the latest version of the example
files at <a href="https://github.com/hplgit/scipro-primer" target="_self">GitHub</a>, see
the <a href="https://github.com/hplgit/scipro-primer/tree/master/src-4th" target="_self">src-4th</a>
directory (to download a file, click the <em>Raw</em> button on the right first
to get the pure text file in the browser and then right-click to download).
To copy the whole repository to your computer, run
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>git clone https://github.com/hplgit/scipro-primer.git
</pre></div>
<h2 id="___sec9">Erratalist </h2>
<p>
Here is a <a href="erratalist4th.pdf" target="_self">PDF file</a> or an <a href="erratalist4th.html" target="_self">HTML file</a> with an errata list for the
4th edition of the book. If you find any typo or error, please
report it to <a href="mailto:hpl@simula.no" target="_self">the author</a>.
<h2 id="___sec10">Slides </h2>
<p>
There is a <a href="slides/index.html" target="_self">slide collection</a>
from lectures based on the latest edition of the book.
<p>
<hr>
<h1 id="___sec11">The 3rd edition </h1>
<p>
<a href="http://www.amazon.com/Scientific-Programming-Computational-Science-Engineering/dp/3642302920/ref=sr_1_4?ie=UTF8&qid=1344338912&sr=8-4&keywords=langtangen+primer"><img border="0" width="130" src="figs/Primer_pic.jpg"></a>
<h2 id="___sec12">All programs from the book </h2>
<p>
On Unix/Linux or Mac, download
the tarfile <a href="book-examples-3rd.tar.gz" target="_self"><tt>book-examples-3rd.tar.gz</tt></a>
for the 3rd edition and pack it out by
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>tar xvzf book-examples-3rd.tar.gz
</pre></div>
<p>
On Windows, download <a href="book-examples-3rd.zip" target="_self"><tt>book-examples-3rd.zip</tt></a>
for the 3rd edition and pack it out by
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>unzip book-examples-3rd.zip
</pre></div>
<p>
or double click on the file icon.
<p>
The result is a folder (directory)
tree <code>src</code> with subfolders containing
the program examples for different chapters in the book
(<code>formulas</code>, <code>looplist</code>, etc., as explained in the introduction to
each chapter).
<p>
You can also directly access the latest version of the example
files at <a href="https://github.com/hplgit/scipro-primer" target="_self">GitHub</a>, see
the <a href="https://github.com/hplgit/scipro-primer/tree/master/src-3rd" target="_self">src-3rd</a>
directory (to download a file, click the <em>Raw</em> button on the right first
to get the pure text file in the browser and then right-click to download).
To copy the whole repository to your computer, run
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>git clone https://github.com/hplgit/scipro-primer.git
</pre></div>
<h2 id="___sec13">Software installation </h2>
<p>
The <a href="install.html" target="_self">old software description</a> is now outdated, so we
refer to the <a href="http://hplgit.github.io/edu/accesspy/accesspy_primer4.html" target="_self">new one</a> that appears in the 4th edition.
<p>
You may want to install SciTools directly from its Mercurial version control
repository. This makes it easy to upgrade the package at any time.
SciTools is hosted at <a href="https://github.com/hplgit/scitools/" target="_self">Googlecode</a>.
Make sure you have the Mercurial (<tt>hg</tt>) version control system
on your computer (if not, do <code>sudo pip install mercurial</code> on Linux or Mac,
and <code>pip install mercurial</code> in a Windows Command Prompt or Power Shell window).
Get the SciTools source code and install it by
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>hg clone https://langtangen@code.google.com/p/scitools/
cd scitools
sudo python setup.py install
</pre></div>
<p>
Whenever you want to upgrade the package, just go to the <code>scitools</code>
folder and run the commands
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>hg pull
hg update
sudo python setup.py install
</pre></div>
<h2 id="___sec14">Software installation on Ubuntu </h2>
<p>
If you have an Ubuntu installation, Python is already there. The minimum
extra packages are installed by this command:
<p>
<!-- code=text (!bc sys) typeset with pygments style "default" -->
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>sudo apt-get install python-matplotlib python-scipy python-gnuplot gnuplot gnuplot-x11 python-scitools
</pre></div>
<p>
A comprehensive installation with lots of useful packages can be
performed by a <a href="https://raw.github.com/hplgit/vagrantbox/master/doc/src/vagrant/src-vagrant/install_rich.sh" target="_self">Bash script</a>. Download this file (<code>install_rich.sh</code>) and run it by <code>bash install_rich.sh</code>.
<h2 id="___sec15">Erratalist </h2>
<p>
There is a <a href="erratalist3rd.pdf" target="_self">PDF file</a> with an errata list for the
3rd edition of the book.
<h2 id="___sec16">Slides </h2>
<p>
There is a <a href="http://www.ifi.uio.no/~inf1100/slides" target="_self">slide collection</a>
from lectures based on the <em>latest edition</em> edition of the book.
<h1 id="___sec17">The 1st and 2nd edition </h1>
<p>
The resource page for the first two editions is located
<a href="http://vefur.simula.no/intro-programming" target="_self">elsewhere</a>.
<!-- ------------------- end of main content --------------- -->
</body>
</html>