A primer on scientific programming with Python:
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Berlin [u.a.]
Springer
2011
|
Ausgabe: | 2. ed. |
Schriftenreihe: | Texts in computational science and engineering
6 |
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | XXIX, 699 S. Ill., graph. Darst. |
ISBN: | 9783642183652 9783642183669 |
Internformat
MARC
LEADER | 00000nam a2200000 cb4500 | ||
---|---|---|---|
001 | BV037269770 | ||
003 | DE-604 | ||
005 | 20111021 | ||
007 | t | ||
008 | 110309s2011 gw ad|| |||| 00||| eng d | ||
015 | |a 09N230080 |2 dnb | ||
020 | |a 9783642183652 |9 978-3-642-18365-2 | ||
020 | |a 9783642183669 |c Geb. EUR 53.45 |9 978-3-642-18366-9 | ||
035 | |a (OCoLC)711849810 | ||
035 | |a (DE-599)DNB1009117793 | ||
040 | |a DE-604 |b ger |e rakwb | ||
041 | 0 | |a eng | |
044 | |a gw |c XA-DE-BE | ||
049 | |a DE-91G |a DE-384 |a DE-19 |a DE-11 |a DE-83 |a DE-Aug4 |a DE-898 |a DE-20 |a DE-29T | ||
082 | 0 | |a 518.02855133 |2 22//ger | |
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a DAT 366f |2 stub | ||
100 | 1 | |a Langtangen, Hans Petter |d 1962- |e Verfasser |0 (DE-588)1019109599 |4 aut | |
245 | 1 | 0 | |a A primer on scientific programming with Python |c Hans Petter Langtangen |
250 | |a 2. ed. | ||
264 | 1 | |a Berlin [u.a.] |b Springer |c 2011 | |
300 | |a XXIX, 699 S. |b Ill., graph. Darst. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
490 | 1 | |a Texts in computational science and engineering |v 6 | |
650 | 0 | 7 | |a Python |g Programmiersprache |0 (DE-588)4434275-5 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Wissenschaftliches Rechnen |0 (DE-588)4338507-2 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Wissenschaftliches Rechnen |0 (DE-588)4338507-2 |D s |
689 | 0 | 1 | |a Python |g Programmiersprache |0 (DE-588)4434275-5 |D s |
689 | 0 | |5 DE-604 | |
830 | 0 | |a Texts in computational science and engineering |v 6 |w (DE-604)BV016971315 |9 6 | |
856 | 4 | 2 | |m DNB Datenaustausch |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021182753&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-021182753 |
Datensatz im Suchindex
_version_ | 1804143892875968512 |
---|---|
adam_text | IMAGE 1
CONTENTS
COMPUTING WITH FORMULAS 1
1.1 THE FIRST PROGRAMMING ENCOUNTER: A FORMULA 1
1.1.1 USING A PROGRAM AS A CALCULATOR 2
1.1.2 ABOUT PROGRAMS AND PROGRAMMING 2
1.1.3 TOOLS FOR WRITING PROGRAMS 3
1.1.4 USING IDLE TO WRITE THE PROGRAM 4
1.1.5 HOW TO RUN THE PROGRAM 7
1.1.6 VERIFYING THE RESULT 8
1.1.7 USING VARIABLES 8
1.1.8 NAMES OF VARIABLES 9
1.1.9 RESERVED WORDS IN PYTHON 10
1.1.10 COMMENTS 10
1.1.11 FORMATTING TEXT AND NUMBERS 11
1.2 COMPUTER SCIENCE GLOSSARY 14
1.3 ANOTHER FORMULA: CELSIUS-FAHRENHEIT CONVERSION 19 1.3.1 POTENTIAL
ERROR: INTEGER DIVISION 19
1.3.2 OBJECTS IN PYTHON 20
1.3.3 AVOIDING INTEGER DIVISION 21
1.3.4 ARITHMETIC OPERATORS AND PRECEDENCE 22
1.4 EVALUATING STANDARD MATHEMATICAL FUNCTIONS 22
1.4.1 EXAMPLE: USING THE SQUARE ROOT FUNCTION 23 1.4.2 EXAMPLE: USING
MORE MATHEMATICAL FUNCTIONS . 25 1.4.3 A FIRST GLIMPSE OF ROUND-OFF
ERRORS 25
1.5 INTERACTIVE COMPUTING 26
1.5.1 CALCULATING WITH FORMULAS IN THE INTERACTIVE SHELL 27
1.5.2 TYPE CONVERSION 28
1.5.3 IPYTHON 29
1.6 COMPLEX NUMBERS 31
BIBLIOGRAFISCHE INFORMATIONEN HTTP://D-NB.INFO/1009117793
DIGITALISIERT DURCH
IMAGE 2
CONTENTS
1.6.1 COMPLEX ARITHMETICS IN PYTHON 32
1.6.2 COMPLEX FUNCTIONS IN PYTHON 33
1.6.3 UNIFIED TREATMENT OF COMPLEX AND REAL FUNCTIONS 33
1.7 SUMMARY 35
1.7.1 CHAPTER TOPICS 35
1.7.2 SUMMARIZING EXAMPLE: TRAJECTORY OF A BALL . . .. 38 1.7.3 ABOUT
TYPESETTING CONVENTIONS IN THIS BOOK . . 40 1.8 EXERCISES 41
L O O PS A ND LISTS 51
2.1 WHILE LOOPS 51
2.1.1 A NAIVE SOLUTION 51
2.1.2 WHILE LOOPS 52
2.1.3 BOOLEAN EXPRESSIONS 54
2.1.4 LOOP IMPLEMENTATION OF A SUM 56
2.2 LISTS 57
2.2.1 BASIC LIST OPERATIONS 58
2.2.2 FOR LOOPS 60
2.3 ALTERNATIVE IMPLEMENTATIONS WITH LISTS AND LOOPS . . .. 62 2.3.1
WHILE LOOP IMPLEMENTATION OF A FOR LOOP 62
2.3.2 THE RANGE CONSTRUCTION 62
2.3.3 FOR LOOPS WITH LIST INDICES 63
2.3.4 CHANGING LIST ELEMENTS 65
2.3.5 LIST COMPREHENSION 65
2.3.6 TRAVERSING MULTIPLE LISTS SIMULTANEOUSLY 66 2.4 NESTED LISTS 66
2.4.1 A TABLE AS A LIST OF ROWS OR COLUMNS 67
2.4.2 PRINTING OBJECTS 68
2.4.3 EXTRACTING SUBLISTS 69
2.4.4 TRAVERSING NESTED LISTS 71
2.5 TUPLES 73
2.6 SUMMARY 74
2.6.1 CHAPTER TOPICS 74
2.6.2 SUMMARIZING EXAMPLE: ANALYZING LIST DATA . .. 77 2.6.3 HOW TO FIND
MORE PYTHON INFORMATION 80
2.7 EXERCISES 81
FUNCTIONS AND BRANCHING 91
3.1 FUNCTIONS 91
3.1.1 FUNCTIONS OF ONE VARIABLE 91
3.1.2 LOCAL AND GLOBAL VARIABLES 93
3.1.3 MULTIPLE ARGUMENTS 95
3.1.4 MULTIPLE RETURN VALUES 97
3.1.5 FUNCTIONS WITH NO RETURN VALUES 99
IMAGE 3
CONTENTS
3.1.6 KEYWORD ARGUMENTS 100
3.1.7 DOC STRINGS 103
3.1.8 FUNCTION INPUT AND OUTPUT 104
3.1.9 FUNCTIONS AS ARGUMENTS TO FUNCTIONS 104
3.1.10 THE MAIN PROGRAM 106
3.1.11 LAMBDA FUNCTIONS 107
3.2 BRANCHING 108
3.2.1 IF-ELSE BLOCKS 108
3.2.2 INLINE IF TESTS 110
3.3 SUMMARY I LL
3.3.1 CHAPTER TOPICS I LL
3.3.2 SUMMARIZING EXAMPLE: NUMERICAL INTEGRATION . . 113 3.4 EXERCISES
116
INPUT D A TA AND ERROR HANDLING 129
4.1 ASKING QUESTIONS AND READING ANSWERS 130
4.1.1 READING KEYBOARD INPUT 130
4.1.2 THE MAGIC EVAL FUNCTION 131
4.1.3 THE MAGIC EXEC FUNCTION 135
4.1.4 TURNING STRING EXPRESSIONS INTO FUNCTIONS 136 4.2 READING FROM THE
COMMAND LINE 137
4.2.1 PROVIDING INPUT ON THE COMMAND LINE 137
4.2.2 A VARIABLE NUMBER OF COMMAND-LINE ARGUMENTS 138
4.2.3 MORE ON COMMAND-LINE ARGUMENTS 139
4.2.4 OPTION-VALUE PAIRS ON THE COMMAND LINE 140 4.3 HANDLING ERRORS 142
4.3.1 EXCEPTION HANDLING 143
4.3.2 RAISING EXCEPTIONS 146
4.4 A GLIMPSE OF GRAPHICAL USER INTERFACES 148
4.5 MAKING MODULES 151
4.5.1 EXAMPLE: COMPUND INTEREST FORMULAS 152
4.5.2 COLLECTING FUNCTIONS IN A MODULE FILE 153
4.5.3 USING MODULES 157
4.6 SUMMARY 159
4.6.1 CHAPTER TOPICS 159
4.6.2 SUMMARIZING EXAMPLE: BISECTION ROOT FINDING . 162 4.7 EXERCISES
170
ARRAY C O M P U T I NG AND CURVE P L O T T I NG 177
5.1 VECTORS 178
5.1.1 THE VECTOR CONCEPT 178
5.1.2 MATHEMATICAL OPERATIONS ON VECTORS 179
5.1.3 VECTOR ARITHMETICS AND VECTOR FUNCTIONS 181 5.2 ARRAYS IN PYTHON
PROGRAMS 183
IMAGE 4
CONTENTS
5.2.1 USING LISTS FOR COLLECTING FUNCTION DATA 183
5.2.2 BASICS OF NUMERICAL PYTHON ARRAYS 184
5.2.3 COMPUTING COORDINATES AND FUNCTION VALUES . .. 185 5.2.4
VECTORIZATION 186
5.3 CURVE PLOTTING 188
5.3.1 MATPLOTLIB; PYLAB 188
5.3.2 MATPLOTLIB; PYPLOT 192
5.3.3 SCITOOLS AND EASYVIZ 194
5.3.4 MAKING ANIMATIONS 199
5.3.5 CURVES IN PURE TEXT 203
5.4 PLOTTING DIFFICULTIES 204
5.4.1 PIECEWISELY DEFINED FUNCTIONS 205
5.4.2 RAPIDLY VARYING FUNCTIONS 210
5.4.3 VECTORIZING STRINGFUNCTION OBJECTS 211
5.5 MORE ON NUMERICAL PYTHON ARRAYS 212
5.5.1 COPYING ARRAYS 212
5.5.2 IN-PLACE ARITHMETICS 213
5.5.3 ALLOCATING ARRAYS 214
5.5.4 GENERALIZED INDEXING 214
5.5.5 TESTING FOR THE ARRAY TYPE 215
5.5.6 COMPACT SYNTAX FOR ARRAY GENERATION 216
5.5.7 SHAPE MANIPULATION 216
5.6 HIGHER-DIMENSIONAL ARRAYS 217
5.6.1 MATRICES AND ARRAYS 217
5.6.2 TWO-DIMENSIONAL NUMERICAL PYTHON ARRAYS . . .. 218 5.6.3 ARRAY
COMPUTING 220
5.6.4 TWO-DIMENSIONAL ARRAYS AND FUNCTIONS OF TWO VARIABLES 221
5.6.5 MATRIX OBJECTS 222
5.7 SUMMARY 223
5.7.1 CHAPTER TOPICS 223
5.7.2 SUMMARIZING EXAMPLE: ANIMATING A FUNCTION .. 224 5.8 EXERCISES 229
6 FILES, STRINGS, A ND D I C T I O N A R I ES 243
6.1 READING DATA FROM FILE 243
6.1.1 READING A FILE LINE BY LINE 244
6.1.2 READING A MIXTURE OF TEXT AND NUMBERS 247
6.1.3 WHAT IS A FILE, REALLY? 248
6.2 DICTIONARIES 252
6.2.1 MAKING DICTIONARIES 252
6.2.2 DICTIONARY OPERATIONS 253
6.2.3 EXAMPLE: POLYNOMIALS AS DICTIONARIES 254
6.2.4 EXAMPLE: FILE DATA IN DICTIONARIES 256
6.2.5 EXAMPLE: FILE DATA IN NESTED DICTIONARIES 257
IMAGE 5
CONTENTS
6.2.6 EXAMPLE: COMPARING STOCK PRICES 262
6.3 STRINGS 266
6.3.1 COMMON OPERATIONS ON STRINGS 266
6.3.2 EXAMPLE: READING PAIRS OF NUMBERS 270
6.3.3 EXAMPLE: READING COORDINATES 272
6.4 READING DATA FROM WEB PAGES 274
6.4.1 ABOUT WEB PAGES 274
6.4.2 HOW TO ACCESS WEB PAGES IN PROGRAMS 276
6.4.3 EXAMPLE: READING PURE TEXT FILES 277
6.4.4 EXAMPLE: EXTRACTING DATA FROM AN HTML PAGE 278 6.5 WRITING DATA TO
FILE 279
6.5.1 EXAMPLE: WRITING A TABLE TO FILE 280
6.5.2 STANDARD INPUT AND OUTPUT AS FILE OBJECTS . . .. 281 6.5.3 READING
AND WRITING SPREADSHEET FILES 284
6.6 SUMMARY 289
6.6.1 CHAPTER TOPICS 289
6.6.2 SUMMARIZING EXAMPLE: A FILE DATABASE 291 6.7 EXERCISES 294
INTRODUCTION TO CLASSES 305
7.1 SIMPLE FUNCTION CLASSES 306
7.1.1 PROBLEM: FUNCTIONS WITH PARAMETERS 306
7.1.2 REPRESENTING A FUNCTION AS A CLASS 308
7.1.3 ANOTHER FUNCTION CLASS EXAMPLE 314
7.1.4 ALTERNATIVE FUNCTION CLASS IMPLEMENTATIONS.... 315 7.1.5 MAKING
CLASSES WITHOUT THE CLASS CONSTRUCT. .. 317 7.2 MORE EXAMPLES ON CLASSES
320
7.2.1 BANK ACCOUNTS 320
7.2.2 PHONE BOOK 322
7.2.3 A CIRCLE 323
7.3 SPECIAL METHODS 324
7.3.1 THE CALL SPECIAL METHOD 325
7.3.2 EXAMPLE: AUTOMAGIC DIFFERENTIATION 325
7.3.3 EXAMPLE: AUTOMAGIC INTEGRATION 328
7.3.4 TURNING AN INSTANCE INTO A STRING 330
7.3.5 EXAMPLE: PHONE BOOK WITH SPECIAL METHODS . .. 331 7.3.6 ADDING
OBJECTS 333
7.3.7 EXAMPLE: CLASS FOR POLYNOMIALS 333
7.3.8 ARITHMETIC OPERATIONS AND OTHER SPECIAL METHODS 337
7.3.9 SPECIAL METHODS FOR STRING CONVERSION 338
7.4 EXAMPLE: CLASS FOR VECTORS IN THE PLANE 340
7.4.1 SOME MATHEMATICAL OPERATIONS ON VECTORS 340 7.4.2 IMPLEMENTATION
340
7.4.3 USAGE 342
IMAGE 6
CONTENTS
7.5 EXAMPLE: CLASS FOR COMPLEX NUMBERS 343
7.5.1 IMPLEMENTATION 344
7.5.2 ILLEGAL OPERATIONS 345
7.5.3 MIXING COMPLEX AND REAL NUMBERS 346
7.5.4 SPECIAL METHODS FOR RIGHT OPERANDS 348
7.5.5 INSPECTING INSTANCES 350
7.6 STATIC METHODS AND ATTRIBUTES 351
7.7 SUMMARY 352
7.7.1 CHAPTER TOPICS 352
7.7.2 SUMMARIZING EXAMPLE: INTERVAL ARITHMETICS.... 353 7.8 EXERCISES
359
8 RANDOM NUMBERS AND SIMPLE GAMES 375
8.1 DRAWING RANDOM NUMBERS 376
8.1.1 THE SEED 376
8.1.2 UNIFORMLY DISTRIBUTED RANDOM NUMBERS 377 8.1.3 VISUALIZING THE
DISTRIBUTION 378
8.1.4 VECTORIZED DRAWING OF RANDOM NUMBERS 379 8.1.5 COMPUTING THE MEAN
AND STANDARD DEVIATION . . 380 8.1.6 THE GAUSSIAN OR NORMAL DISTRIBUTION
381 8.2 DRAWING INTEGERS 382
8.2.1 RANDOM INTEGER FUNCTIONS 383
8.2.2 EXAMPLE: THROWING A DIE 384
8.2.3 DRAWING A RANDOM ELEMENT FROM A LIST 385 8.2.4 EXAMPLE: DRAWING
CARDS FROM A DECK 385 8.2.5 EXAMPLE: CLASS IMPLEMENTATION OF A DECK 387
8.3 COMPUTING PROBABILITIES 390
8.3.1 PRINCIPLES OF MONTE CARLO SIMULATION 390 8.3.2 EXAMPLE: THROWING
DICE 391
8.3.3 EXAMPLE: DRAWING BALLS FROM A HAT 393
8.3.4 EXAMPLE: POLICIES FOR LIMITING POPULATION GROWTH 395
8.4 SIMPLE GAMES 398
8.4.1 GUESSING A NUMBER 398
8.4.2 ROLLING TWO DICE 398
8.5 MONTE CARLO INTEGRATION 401
8.5.1 STANDARD MONTE CARLO INTEGRATION 401
8.5.2 AREA COMPUTING BY THROWING RANDOM POINTS. . 404 8.6 RANDOM WALK IN
ONE SPACE DIMENSION 406
8.6.1 BASIC IMPLEMENTATION 406
8.6.2 VISUALIZATION 407
8.6.3 RANDOM WALK AS A DIFFERENCE EQUATION 408 8.6.4 COMPUTING
STATISTICS OF THE PARTICLE POSITIONS .. 408 8.6.5 VECTORIZED
IMPLEMENTATION 409
8.7 RANDOM WALK IN TWO SPACE DIMENSIONS 411
IMAGE 7
CONTENTS
8.7.1 BASIC IMPLEMENTATION 411
8.7.2 VECTORIZED IMPLEMENTATION 413
8.8 SUMMARY 414
8.8.1 CHAPTER TOPICS 414
8.8.2 SUMMARIZING EXAMPLE: RANDOM GROWTH 415 8.9 EXERCISES 421
9 OBJECT-ORIENTED P R O G R A M M I NG 437
9.1 INHERITANCE AND CLASS HIERARCHIES 437
9.1.1 A CLASS FOR STRAIGHT LINES 438
9.1.2 A FIRST TRY ON A CLASS FOR PARABOLAS 439
9.1.3 A CLASS FOR PARABOLAS USING INHERITANCE 439
9.1.4 CHECKING THE CLASS TYPE 441
9.1.5 ATTRIBUTE VERSUS INHERITANCE 442
9.1.6 EXTENDING VERSUS RESTRICTING FUNCTIONALITY 443 9.1.7 SUPERCLASS
FOR DEFINING AN INTERFACE 444
9.2 CLASS HIERARCHY FOR NUMERICAL DIFFERENTIATION 446 9.2.1 CLASSES FOR
DIFFERENTIATION 447
9.2.2 A FLEXIBLE MAIN PROGRAM 450
9.2.3 EXTENSIONS 451
9.2.4 ALTERNATIVE IMPLEMENTATION VIA FUNCTIONS 454 9.2.5 ALTERNATIVE
IMPLEMENTATION VIA FUNCTIONAL PROGRAMMING 455
9.2.6 ALTERNATIVE IMPLEMENTATION VIA A SINGLE CLASS .. 456 9.3 CLASS
HIERARCHY FOR NUMERICAL INTEGRATION 458
9.3.1 NUMERICAL INTEGRATION METHODS 458
9.3.2 CLASSES FOR INTEGRATION 459
9.3.3 USING THE CLASS HIERARCHY 463
9.3.4 ABOUT OBJECT-ORIENTED PROGRAMMING 466
9.4 CLASS HIERARCHY FOR GEOMETRIC SHAPES 467
9.4.1 USING THE CLASS HIERARCHY 467
9.4.2 OVERALL DESIGN OF THE CLASS HIERARCHY 469
9.4.3 THE DRAWING TOOL 470
9.4.4 IMPLEMENTATION OF SHAPE CLASSES 472
9.4.5 SCALING, TRANSLATING, AND ROTATING A FIGURE . . .. 476 9.5 SUMMARY
480
9.5.1 CHAPTER TOPICS 480
9.5.2 SUMMARIZING EXAMPLE: INPUT DATA READER 482 9.6 EXERCISES 488
A SEQUENCES AND DIFFERENCE EQUATIONS 497
A.I MATHEMATICAL MODELS BASED ON DIFFERENCE EQUATIONS .. 498 A.I.I
INTEREST RATES 499
A.I.2 THE FACTORIAL AS A DIFFERENCE EQUATION 501 A.1.3 FIBONACCI NUMBERS
502
IMAGE 8
CONTENTS
A.1.4 GROWTH OF A POPULATION 503
A.I.5 LOGISTIC GROWTH 504
A.I.6 PAYBACK OF A LOAN 506
A.1.7 TAYLOR SERIES AS A DIFFERENCE EQUATION 507 A.1.8 MAKING A LIVING
FROM A FORTUNE 508
A.1.9 NEWTON S METHOD 509
A.1.10 THE INVERSE OF A FUNCTION 513
A.2 PROGRAMMING WITH SOUND 515
A.2.1 WRITING SOUND TO FILE 515
A.2.2 READING SOUND FROM FILE 516
A.2.3 PLAYING MANY NOTES 517
A.2.4 MUSIC OF A SEQUENCE 518
A.3 EXERCISES 521
B INTRODUCTION TO DISCRETE CALCULUS 529
B.I DISCRETE FUNCTIONS 529
B.I.I THE SINE FUNCTION 530
B.1.2 INTERPOLATION 532
B.I.3 EVALUATING THE APPROXIMATION 532
B.1.4 GENERALIZATION 533
B.2 DIFFERENTIATION BECOMES FINITE DIFFERENCES 535 B.2.1 DIFFERENTIATING
THE SINE FUNCTION 536
B.2.2 DIFFERENCES ON A MESH 536
B.2.3 GENERALIZATION 538
B.3 INTEGRATION BECOMES SUMMATION 539
B.3.1 DIVIDING INTO SUBINTERVALS 540
B.3.2 INTEGRATION ON SUBINTERVALS 541
B.3.3 ADDING THE SUBINTERVALS 542
B.3.4 GENERALIZATION 543
B.4 TAYLOR SERIES 545
B.4.1 APPROXIMATING FUNCTIONS CLOSE TO ONE POINT... 545 B.4.2
APPROXIMATING THE EXPONENTIAL FUNCTION 545 B.4.3 MORE ACCURATE
EXPANSIONS 546
B.4.4 ACCURACY OF THE APPROXIMATION 548
B.4.5 DERIVATIVES REVISITED 550
B.4.6 MORE ACCURATE DIFFERENCE APPROXIMATIONS 551 B.4.7 SECOND-ORDER
DERIVATIVES 553
B.5 EXERCISES 555
C INTRODUCTION TO DIFFERENTIAL EQUATIONS 561
C.I THE SIMPLEST CASE 562
C.2 EXPONENTIAL GROWTH 564
C.3 LOGISTIC GROWTH 569
C.4 A SIMPLE PENDULUM 570
C.5 A MODEL FOR THE SPREAD OF A DISEASE 573
IMAGE 9
CONTENTS XIX
C.6 EXERCISES 575
D A COMPLETE DIFFERENTIAL EQUATION PROJECT 577
D.I ABOUT THE PROBLEM: MOTION AND FORCES IN PHYSICS 577 D.I.I THE
PHYSICAL PROBLEM 577
D.I.2 THE COMPUTATIONAL ALGORITHM 580
D.1.3 DERIVATION OF THE MATHEMATICAL MODEL 580 D.1.4 DERIVATION OF THE
ALGORITHM 583
D.2 PROGRAM DEVELOPMENT AND TESTING 584
D.2.1 IMPLEMENTATION 584
D.2.2 CALLBACK FUNCTIONALITY 587
D.2.3 MAKING A MODULE 588
D.2.4 VERIFICATION 589
D.3 VISUALIZATION 591
D.3.1 SIMULTANEOUS COMPUTATION AND PLOTTING 591 D.3.2 SOME APPLICATIONS
594
D.3.3 REMARK ON CHOOSING AT 594
D.3.4 COMPARING SEVERAL QUANTITIES IN SUBPLOTS 595 D.3.5 COMPARING
APPROXIMATE AND EXACT SOLUTIONS .. 596 D.3.6 EVOLUTION OF THE ERROR AS
AT DECREASES 597 D.4 EXERCISES 601
E PROGRAMMING OF DIFFERENTIAL EQUATIONS 603
E.I SCALAR ORDINARY DIFFERENTIAL EQUATIONS 604
E.I.I EXAMPLES ON RIGHT-HAND-SIDE FUNCTIONS 604 E.1.2 THE FORWARD EULER
SCHEME 606
E.1.3 FUNCTION IMPLEMENTATION 607
E.1.4 VERIFYING THE IMPLEMENTATION 607
E.I.5 SWITCHING NUMERICAL METHOD 608
E.1.6 CLASS IMPLEMENTATION 609
E.I.7 EXAMPLE: LOGISTIC GROWTH 612
E.2 SYSTEMS OF ORDINARY DIFFERENTIAL EQUATIONS 613 E.2.1 MATHEMATICAL
PROBLEM 614
E.2.2 EXAMPLE OF A SYSTEM OF ODES 615
E.2.3 FROM SCALAR ODE CODE TO SYSTEMS 616
E.2.4 NUMERICAL METHODS 619
E.2.5 THE ODE SOLVER CLASS HIERARCHY 621
E.2.6 THE BACKWARD EULER METHOD 623
E.2.7 APPLICATION 1: U = U 626
E.2.8 APPLICATION 2: THE LOGISTIC EQUATION 627 E.2.9 APPLICATION 3: AN
OSCILLATING SYSTEM 629 E.2.10 APPLICATION 4: THE TRAJECTORY OF A BALL
631 E.3 EXERCISES 633
F DEBUGGING 655
F.I USING A DEBUGGER 655
IMAGE 10
CONTENTS
F.2 HOW TO DEBUG 658
F.2.1 A RECIPE FOR PROGRAM WRITING AND DEBUGGING. . 658 F.2.2
APPLICATION OF THE RECIPE 660
G TECHNICAL TOPICS 673
G.I DIFFERENT WAYS OF RUNNING PYTHON PROGRAMS 673 G.I.I EXECUTING PYTHON
PROGRAMS IN IPYTHON 673 G.I.2 EXECUTING PYTHON PROGRAMS ON UNIX 673
G.I.3 EXECUTING PYTHON PROGRAMS ON WINDOWS 675 G.I.4 EXECUTING PYTHON
PROGRAMS ON MACINTOSH 677 G.I.5 MAKING A COMPLETE STAND-ALONE EXECUTABLE
. . . 677 G.2 INTEGER AND FLOAT DIVISION 677
G.3 VISUALIZING A PROGRAM WITH LUMPY 678
G.4 DOING OPERATING SYSTEM TASKS IN PYTHON 681
G.5 VARIABLE NUMBER OF FUNCTION ARGUMENTS 683
G.5.1 VARIABLE NUMBER OF POSITIONAL ARGUMENTS 683 G.5.2 VARIABLE NUMBER
OF KEYWORD ARGUMENTS 686 G.6 EVALUATING PROGRAM EFFICIENCY 688
G.6.1 MAKING TIME MEASUREMENTS 688
G.6.2 PROFILING PYTHON PROGRAMS 690
BIBLIOGRAPHY 693
INDEX 695
|
any_adam_object | 1 |
author | Langtangen, Hans Petter 1962- |
author_GND | (DE-588)1019109599 |
author_facet | Langtangen, Hans Petter 1962- |
author_role | aut |
author_sort | Langtangen, Hans Petter 1962- |
author_variant | h p l hp hpl |
building | Verbundindex |
bvnumber | BV037269770 |
classification_rvk | ST 250 |
classification_tum | DAT 366f |
ctrlnum | (OCoLC)711849810 (DE-599)DNB1009117793 |
dewey-full | 518.02855133 |
dewey-hundreds | 500 - Natural sciences and mathematics |
dewey-ones | 518 - Numerical analysis |
dewey-raw | 518.02855133 |
dewey-search | 518.02855133 |
dewey-sort | 3518.02855133 |
dewey-tens | 510 - Mathematics |
discipline | Informatik Mathematik |
edition | 2. ed. |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01808nam a2200433 cb4500</leader><controlfield tag="001">BV037269770</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20111021 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">110309s2011 gw ad|| |||| 00||| eng d</controlfield><datafield tag="015" ind1=" " ind2=" "><subfield code="a">09N230080</subfield><subfield code="2">dnb</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9783642183652</subfield><subfield code="9">978-3-642-18365-2</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9783642183669</subfield><subfield code="c">Geb. EUR 53.45</subfield><subfield code="9">978-3-642-18366-9</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)711849810</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)DNB1009117793</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rakwb</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="044" ind1=" " ind2=" "><subfield code="a">gw</subfield><subfield code="c">XA-DE-BE</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-91G</subfield><subfield code="a">DE-384</subfield><subfield code="a">DE-19</subfield><subfield code="a">DE-11</subfield><subfield code="a">DE-83</subfield><subfield code="a">DE-Aug4</subfield><subfield code="a">DE-898</subfield><subfield code="a">DE-20</subfield><subfield code="a">DE-29T</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">518.02855133</subfield><subfield code="2">22//ger</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">DAT 366f</subfield><subfield code="2">stub</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Langtangen, Hans Petter</subfield><subfield code="d">1962-</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)1019109599</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">A primer on scientific programming with Python</subfield><subfield code="c">Hans Petter Langtangen</subfield></datafield><datafield tag="250" ind1=" " ind2=" "><subfield code="a">2. ed.</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Berlin [u.a.]</subfield><subfield code="b">Springer</subfield><subfield code="c">2011</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XXIX, 699 S.</subfield><subfield code="b">Ill., graph. Darst.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="490" ind1="1" ind2=" "><subfield code="a">Texts in computational science and engineering</subfield><subfield code="v">6</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Python</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4434275-5</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Wissenschaftliches Rechnen</subfield><subfield code="0">(DE-588)4338507-2</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Wissenschaftliches Rechnen</subfield><subfield code="0">(DE-588)4338507-2</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2="1"><subfield code="a">Python</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4434275-5</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="830" ind1=" " ind2="0"><subfield code="a">Texts in computational science and engineering</subfield><subfield code="v">6</subfield><subfield code="w">(DE-604)BV016971315</subfield><subfield code="9">6</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">DNB Datenaustausch</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021182753&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-021182753</subfield></datafield></record></collection> |
id | DE-604.BV037269770 |
illustrated | Illustrated |
indexdate | 2024-07-09T22:54:53Z |
institution | BVB |
isbn | 9783642183652 9783642183669 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-021182753 |
oclc_num | 711849810 |
open_access_boolean | |
owner | DE-91G DE-BY-TUM DE-384 DE-19 DE-BY-UBM DE-11 DE-83 DE-Aug4 DE-898 DE-BY-UBR DE-20 DE-29T |
owner_facet | DE-91G DE-BY-TUM DE-384 DE-19 DE-BY-UBM DE-11 DE-83 DE-Aug4 DE-898 DE-BY-UBR DE-20 DE-29T |
physical | XXIX, 699 S. Ill., graph. Darst. |
publishDate | 2011 |
publishDateSearch | 2011 |
publishDateSort | 2011 |
publisher | Springer |
record_format | marc |
series | Texts in computational science and engineering |
series2 | Texts in computational science and engineering |
spelling | Langtangen, Hans Petter 1962- Verfasser (DE-588)1019109599 aut A primer on scientific programming with Python Hans Petter Langtangen 2. ed. Berlin [u.a.] Springer 2011 XXIX, 699 S. Ill., graph. Darst. txt rdacontent n rdamedia nc rdacarrier Texts in computational science and engineering 6 Python Programmiersprache (DE-588)4434275-5 gnd rswk-swf Wissenschaftliches Rechnen (DE-588)4338507-2 gnd rswk-swf Wissenschaftliches Rechnen (DE-588)4338507-2 s Python Programmiersprache (DE-588)4434275-5 s DE-604 Texts in computational science and engineering 6 (DE-604)BV016971315 6 DNB Datenaustausch application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021182753&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Langtangen, Hans Petter 1962- A primer on scientific programming with Python Texts in computational science and engineering Python Programmiersprache (DE-588)4434275-5 gnd Wissenschaftliches Rechnen (DE-588)4338507-2 gnd |
subject_GND | (DE-588)4434275-5 (DE-588)4338507-2 |
title | A primer on scientific programming with Python |
title_auth | A primer on scientific programming with Python |
title_exact_search | A primer on scientific programming with Python |
title_full | A primer on scientific programming with Python Hans Petter Langtangen |
title_fullStr | A primer on scientific programming with Python Hans Petter Langtangen |
title_full_unstemmed | A primer on scientific programming with Python Hans Petter Langtangen |
title_short | A primer on scientific programming with Python |
title_sort | a primer on scientific programming with python |
topic | Python Programmiersprache (DE-588)4434275-5 gnd Wissenschaftliches Rechnen (DE-588)4338507-2 gnd |
topic_facet | Python Programmiersprache Wissenschaftliches Rechnen |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=021182753&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
volume_link | (DE-604)BV016971315 |
work_keys_str_mv | AT langtangenhanspetter aprimeronscientificprogrammingwithpython |