Python Scripting for Computational Science 3e - Langtangen - Springer 2008, Programowanie
[ Pobierz całość w formacie PDF ]
Hans Petter Langtangen
Python Scripting
for Computational
Science
Third Edition
With 62 Figures
123
Hans Petter Langtangen
Simula Research Laboratory
Martin Linges vei 17, Fornebu
P. O. B o x 1 3 4
1325 Lysaker, Norway
hpl@simula.no
On leave from:
Department of Informatics
University of Oslo
P. O. B o x 1 0 8 0 B l i n d e r n
0316 Oslo, Norway
The author of this book has received financial support from the NFF – Norsk faglitterær
forfatter- og oversetterforening.
ISBN 978-3-540-73915-9
e-ISBN 978-3-540-73916-6
DOI 10.1007/978-3-540-73916-6
Texts in Computational Science and Engineering ISSN 1611-0994
Library of Congress Control Number: 2007940499
Mathematics Subject Classification (2000): 65Y99, 68N01, 68N15, 68N19, 68N30, 97U50, 97U70
© 2008, 2006, 2004 Springer-Verlag Berlin Heidelberg
This work is subject to copyright. All rights are reserved, whether the whole or part of the material is
concerned, specif ically the rights of translation, reprinting, reuse of illustrations, recitation, broad-
casting, reproduction on microf ilm or in any other way, and storage in data banks. Duplication of
this publication or parts thereof is permitted only under the provisions of the German Copyright Law
of September 9, 1965, in its current version, and permission for use must always be obtained from
Springer. Violations are liable to prosecution under the German Copyright Law.
The use of general descriptive names, registered names, trademarks, etc. in this publication does
not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
Typesetting: by the author using a Springer T
E
X macro package
Cover design: WMX Design GmbH, Heidelberg
Production: LE-T
E
X Jelonek, Schmidt & Vöckler GbR, Leipzig
Printed on acid-free paper
987654321
springer.com
Preface to the Third Edition
Numerous readers of the second edition have notified me about misprints and
possible improvements of the text and the associated computer codes. The
resulting modifications have been incorporated in this new edition and its
accompanying software.
The major change between the second and third editions, however, is
caused by the new implementation of Numerical Python, now called
numpy
.
The new
numpy
package encourages a slightly different syntax compared to
the old
Numeric
implementation, which was used in the previous editions.
Since Numerical Python functionality appears in a lot of places in the book,
there are hence a huge number of updates to the new suggested
numpy
syntax,
especially in Chapters 4, 9, and 10.
The second edition was based on Python version 2.3, while the third
edition contains updates for version 2.5. Recent Python features, such as
generator expressions (Chapter 8.9.4), Ctypes for interfacing shared libraries
in C (Chapter 5.2.2), the
with
statement (Chapter 3.1.4), and the
subprocess
module for running external processes (Chapter 3.1.3) have been exemplified
to make the reader aware of new tools. Regarding Chapter 3.1.3,
os.system
is not used in the book anymore, instead we recommend the
commands
or
subprocess
modules.
Chapter 4.4.4 is new and gives a taste of symbolic mathematics in Python.
Chapters 5 and 10 have been extended with new material. For example,
F2PY and the Instant tool are very convenient for interfacing C code, and
this topic is treated in detail in Chapters 5.2.2, 10.1.1, and 10.1.2 in the
new edition. Installation of Python itself and the many add-on modules have
become increasingly simpler over the years with
setup.py
scripts, which has
made it natural to simplify the descriptions in Appendix A.
The
py4cs
package with software tools associated with this book has un-
dergone a major revision and extension, and the package is now maintained
under the name
scitools
and distributed separately. The name
py4cs
is still
offered as a nickname for
scitools
to make old scripts work. The new
scitools
package is backward compatible with
py4cs
from the second edition.
Several people has helped me with preparing the new edition. In par-
ticular, the substantial efforts of Pearu Peterson, Ilmar Wilbers, Johannes
H. Ring, and Rolv E. Bredesen are highly appreciated.
The Springer staff has, as always, been a great pleasure to work with.
Special thanks go to Martin Peters, Thanh-Ha Le Thi, and Andrea Kohler
for their extensive help with this and other book projects.
Oslo, September 2007
Hans Petter Langtangen
Preface to the Second Edition
The second edition features new material, reorganization of text, improved
examples and software tools, updated information, and correction of errors.
This is mainly the result of numerous eager readers around the world who
have detected misprints, tested program examples, and suggested alternative
ways of doing things. I am greatful to everyone who has sent emails and
contributed with improvements. The most important changes in the second
edition are briefly listed below.
Already in the introductory examples in Chapter 2 the reader now gets a
glimpse of Numerical Python arrays, interactive computing with the IPython
shell, debugging scripts with the aid of IPython and Pdb, and turning “flat”
scripts into reusable modules (Chapters 2.2.5, 2.2.6, and 2.5.3 are added).
Several parts of Chapter 4 on numerical computing have been extended (es-
pecially Chapters 4.3.5, 4.3.6, 4.3.7, and 4.4). Many smaller changes have
been implemented in Chapter 8; the larger ones concern exemplifying Tar
archives instead of ZIP archives in Chapter 8.3.4, rewriting of the mate-
rial on generators in Chapter 8.9.4, and an example in Chapter 8.6.13 on
adding new methods to a class without touching the original source code
and without changing the class name. Revised and additional tips on opti-
mizing Python code have been included in Chapter 8.10.3, while the new
Chapter 8.10.4 contains a case study on the eciency of various implemen-
tations of a matrix-vector product. To optimize Python code, we now also
introduce the Psyco and Weave tools (see Chapters 8.10.4, 9.1, 10.1.3, and
10.4.1). To reduce complexity of the principal software example in Chapters 9
and 10, I have removed evaluation of string formulas. Instead, one can use
the revised
StringFunction
tool from Chapter 12.2.1 (the text and software
regarding this tool have been completely rewritten). Appendix B.5 has been
totally rewritten: now I introduce Subversion instead of CVS, which results
in simpler recipes and shorter text. Many new Python tools have emerged
since the first printing and comments about some of these are inserted many
places in the text.
Numerous sections or paragraphs have been expanded, condensed, or re-
moved. The sequence of chapters is hardly changed, but a couple of sections
have been moved. The numbering of the exercises is altered as a result of
both adding and removing exerises.
Finally, I want to thank Martin Peters, Thanh-Ha Le Thi, and Andrea
Kohler in the Springer system for all their help with preparing a new edition.
Oslo, October 2005
Hans Petter Langtangen
[ Pobierz całość w formacie PDF ]
-
Linki
- Home
- Rezystor, Elektronika, Programy, Dekoder Rezystancji
- Reader EULA, Programy, Foxit PDF Reader 1.2
- REGULAMIN PROGRAMU EDUKACYJNEGO MLODY OBYWATEL, PROJEKT EDUKACYJNY
- README, Programy komputerowe, Realtek AC97 MB, AC97
- README, Programy, memtest86+ 1.25 floppy+iso, floppy
- Radioodtwarzacz Stilo, Programy PC, Odzyskiwanie danych, Manuale Fiat Stilo (eZygmunt)
- ROZDZIAŁ DWUDZIESTY PIĄTY OPTYMALIACJA NASZYCH PROGRAMÓW, INFORMATYKA, „THE ART OF ASSEMBLY LANGUAGE” [PL]
- README MACON Data Licensing Terms, Programy komputerowe, Idrisi 15.0 The Andes Edition
- Resetting and Coding ALC Modules, Diagnostyka programowanie BMW
- Randall Hyde - Asembler sztuka programowania, Informatyka
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- mothmen.xlx.pl