A primer on scientific programming with Python:
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Berlin [u.a.]
Springer
2014
|
Ausgabe: | 4. ed. |
Schriftenreihe: | Texts in computational science and engineering
6 |
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | XXXI, 865 S. Ill., graph. Darst. |
ISBN: | 9783642549588 9783642549595 |
Internformat
MARC
LEADER | 00000nam a2200000 cb4500 | ||
---|---|---|---|
001 | BV042029869 | ||
003 | DE-604 | ||
005 | 20140912 | ||
007 | t | ||
008 | 140819s2014 gw ad|| |||| 00||| eng d | ||
020 | |a 9783642549588 |c Print |9 978-3-642-54958-8 | ||
020 | |a 9783642549595 |c EBook |9 978-3-642-54959-5 | ||
035 | |a (OCoLC)889984436 | ||
035 | |a (DE-599)BVBBV042029869 | ||
040 | |a DE-604 |b ger |e rakwb | ||
041 | 0 | |a eng | |
044 | |a gw |c XA-DE-BE | ||
049 | |a DE-11 |a DE-91G |a DE-188 |a DE-862 |a DE-29T |a DE-83 |a DE-92 | ||
082 | 0 | |a 518.02855133 |2 22//ger | |
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
084 | |a 68N15 |2 msc | ||
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 4. ed. | ||
264 | 1 | |a Berlin [u.a.] |b Springer |c 2014 | |
300 | |a XXXI, 865 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 Wissenschaftliches Rechnen |0 (DE-588)4338507-2 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Python |g Programmiersprache |0 (DE-588)4434275-5 |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=027471336&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-027471336 |
Datensatz im Suchindex
DE-BY-862_location | 2000 |
---|---|
DE-BY-FWS_call_number | 2000/ST 250 P99 L286(4) |
DE-BY-FWS_katkey | 529990 |
DE-BY-FWS_media_number | 083000511241 083000511242 |
_version_ | 1806176877885259776 |
adam_text | CONTENTS
1 COMPUTING WITH FORMULAS 1
1.1 THE FIRST PROGRAMMING ENCOUNTER: A FORMULA 2
1.1.1 USING A PROGRAM AS A CALCULATOR 2
1.1.2 ABOUT PROGRAMS AND PROGRAMMING 3
1.1.3 TOOLS FOR WRITING PROGRAMS 3
1.1.4 WRITING AND RUNNING YOUR FIRST PYTHON PROGRAM . . 4
1.1.5 WARNING ABOUT TYPING PROGRAM TEXT 5
1.1.6 VERIFYING THE RESULT 6
1.1.7 USING VARIABLES 6
1.1.8 NAMES OF VARIABLES 7
1.1.9 RESERVED WORDS IN PYTHON 8
1.1.10 COMMENTS 9
1.1.11 FORMATTING TEXT AND NUMBERS 10
1.2 COMPUTER SCIENCE GLOSSARJ^ 13
1.3 ANOTHER FORMULA: CELSIUS-FAHRENHEIT CONVERSION 18
1.3.1 POTENTIAL ERROR: INTEGER DIVISION 18
1.3.2 OBJECTS IN PYTHON 19
1.3.3 AVOIDING INTEGER DIVISION 20
1.3.4 ARITHMETIC OPERATORS AND PRECEDENCE 21
1.4 EVALUATING STANDARD MATHEMATICAL FUNCTIONS 22
1.4.1 EXAMPLE: USING THE SQUARE ROOT FUNCTION 22
1.4.2 EXAMPLE: COMPUTING WITH SINH X 24
1.4.3 A FIRST GLIMPSE OF ROUND-OFF ERRORS 25
1.5 INTERACTIVE COMPUTING 26
1.5.1 USING THE PYTHON SHELL 27
1.5.2 TYPE CONVERSION 27
1.5.3 IPYTHON 28
1.6 COMPLEX NUMBERS 31
1.6.1 COMPLEX ARITHMETICS IN PYTHON 32
XI
HTTP://D-NB.INFO/1048239055
XII CONTENTS
1.6.2 COMPLEX FUNCTIONS IN PYTHON 33
1.6.3 UNIFIED TREATMENT OF COMPLEX AND REAL FUNCTIONS . 33
1.7 SYMBOLIC COMPUTING 35
1.7.1 BASIC DIFFERENTIATION AND INTEGRATION 35
1.7.2 EQUATION SOLVING AND TAYLOR SERIES 36
1.8 SUMMARY 37
1.8.1 CHAPTER TOPICS 37
1.8.2 EXAMPLE: TRAJECTORY OF A BALL 41
1.8.3 ABOUT TYPESETTING CONVENTIONS IN THIS BOOK 42
1.9 EXERCISES 43
2 LOOPS AND LISTS 53
2.1 WHILE LOOPS 53
2.1.1 A NAIVE SOLUTION 53
2.1.2 WHILE LOOPS 54
2.1.3 BOOLEAN EXPRESSIONS 56
2.1.4 LOOP IMPLEMENTATION OF A SUM 58
2.2 LISTS 60
2.2.1 BASIC LIST OPERATIONS 60
2.2.2 FOR LOOPS 63
2.3 ALTERNATIVE IMPLEMENTATIONS WITH LISTS AND LOOPS 64
2.3.1 WHILE LOOP IMPLEMENTATION OF A FOR LOOP 65
2.3.2 THE RANGE CONSTRUCTION 65
2.3.3 FOR LOOPS WITH LIST INDICES 66
2.3.4 CHANGING LIST ELEMENTS 67
2.3.5 LIST COMPREHENSION 68
2.3.6 TRAVERSING MULTIPLE LISTS SIMULTANEOUSLY 68
2.4 NESTED LISTS 69
2.4.1 A TABLE AS A LIST OF ROWS OR COLUMNS 69
2.4.2 PRINTING OBJECTS 71
2.4.3 EXTRACTING SUBLISTS 72
2.4.4 TRAVERSING NESTED LISTS 74
2.5 TUPLES 76
2.6 SUMMARY 77
2.6.1 CHAPTER TOPICS 77
2.6.2 EXAMPLE: ANALYZING LIST DATA 80
2.6.3 HOW TO FIND MORE PYTHON INFORMATION 82
2.7 EXERCISES 84
3 FUNCTIONS AND BRANCHING 93
3.1 FUNCTIONS 93
3.1.1 MATHEMATICAL FUNCTIONS AS PYTHON FUNCTIONS 93
3.1.2 UNDERSTANDING THE PROGRAM FLOW 95
3.1.3 LOCAL AND GLOBAL VARIABLES 96
3.1.4 MULTIPLE ARGUMENTS 98
CONTENTS XIII
3.1.5 FUNCTION ARGUMENT OF GLOBAL VARIABLE? 99
3.1.6 BEYOND MATHEMATICAL FUNCTIONS 100
3.1.7 MULTIPLE RETURN VALUES 101
3.1.8 COMPUTING SUMS 102
3.1.9 FUNCTIONS WITH NO RETURN VALUES 103
3.1.10 KEYWORD ARGUMENTS 105
3.1.11 DOC STRINGS 107
3.1.12 FUNCTIONS AS ARGUMENTS TO FUNCTIONS 109
3.1.13 THE MAIN PROGRAM ILL
3.1.14 LAMBDA FUNCTIONS ILL
3.2 BRANCHING 112
3.2.1 IF-ELSE BLOCKS 113
3.2.2 INLINE IF TESTS 114
3.3 MIXING LOOPS, BRANCHING, AND FUNCTIONS IN BIOINFORMATICS
EXAMPLES 115
3.3.1 COUNTING LETTERS IN DNA STRINGS 116
3.3.2 EFFICIENCY ASSESSMENT 119
3.3.3 VERIFYING THE IMPLEMENTATIONS 121
3.4 SUMMARY 122
3.4.1 CHAPTER TOPICS 122
3.4.2 EXAMPLE: NUMERICAL INTEGRATION 124
3.5 EXERCISES 128
4 USER INPUT AND ERROR HANDLING 147
4.1 ASKING QUESTIONS AND READING ANSWERS 148
4.1.1 READING KEYBOARD INPUT 148
4.2 READING FROM THE COMMAND LINE 149
4.2.1 PROVIDING INPUT ON THE COMMAND LINE 149
4.2.2 A VARIABLE NUMBER OF COMMAND-LINE ARGUMENTS . . 150
4.2.3 MORE ON COMMAND-LINE ARGUMENTS 151
4.3 TURNING USER TEXT INTO LIVE OBJECTS 152
4.3.1 THE MAGIC EVAL FUNCTION 152
4.3.2 THE MAGIC EXEC FUNCTION 156
4.3.3 TURNING STRING EXPRESSIONS INTO FUNCTIONS 158
4.4 OPTION-VALUE PAIRS ON THE COMMAND LINE 159
4.4.1 BASIC USAGE OF THE ARGPARSE MODULE 160
4.4.2 MATHEMATICAL EXPRESSIONS AS VALUES 161
4.5 R.EADING DATA FROM FILE 163
4.5.1 READING A FILE LINE BY LINE 164
4.5.2 ALTERNATIVE WAYS OF READING A FILE 165
4.5.3 READING A MIXTURE OF TEXT AND NUMBERS 167
4.6 WRITING DATA TO FILE 169
4.6.1 EXAMPLE: WRITING A TABLE TO FILE 169
4.6.2 STANDARD INPUT AND OUTPUT AS FILE OBJECTS 171
4.6.3 WHAT IS A FILE, REALLY? 173
XIV
CONTENTS
4.7 HANDLING ERRORS 177
4.7.1 EXCEPTION HANDLING 178
4.7.2 RAISING EXCEPTIONS 181
4.8 A GLIMPSE OF GRAPHICAL USER INTERFACES 183
4.9 MAKING MODULES 186
4.9.1 EXAMPLE: INTEREST ON BANK DEPOSITS 187
4.9.2 COLLECTING FUNCTIONS IN A MODULE FILE 188
4.9.3 TEST BLOCK 188
4.9.4 VERIFICATION OF THE MODULE CODE 190
4.9.5 GETTING INPUT DATA 191
4.9.6 DOC STRINGS IN MODULES 194
4.9.7 USING MODULES 194
4.9.8 DISTRIBUTING MODULES 197
4.9.9 MAKING SOFTWARE AVAILABLE ON THE INTERNET 198
4.10 SUMMARY 199
4.10.1 CHAPTER TOPICS 199
4.10.2 EXAMPLE: BISECTION ROOT FINDING 203
4.11 EXERCISES 211
5 ARRAY COMPUTING AND CURVE PLOTTING 221
5.1 VECTORS 222
5.1.1 THE VECTOR CONCEPT 222
5.1.2 MATHEMATICAL OPERATIONS ON VECTORS 224
5.1.3 VECTOR ARITHMETICS AND VECTOR FUNCTIONS 225
5.2 ARRAYS IN PYTHON PROGRAMS 227
5.2.1 USING LISTS FOR COLLECTING FUNCTION DATA 227
5.2.2 BASICS OF NUMERICAL PYTHON ARRAYS 228
5.2.3 COMPUTING COORDINATES AND FUNCTION VALUES 230
5.2.4 VECTORIZATION 231
5.3 CURVE PLOTTING 233
5.3.1 MATPLOTLIB; PYLAB 233
5.3.2 MATPLOTLIB; PYPLOT 237
5.3.3 SCITOOLS AND EASYVIZ 239
5.3.4 MAKING ANIMATIONS 244
5.3.5 MAKING VIDEOS 249
5.3.6 CURVE PLOTS IN PURE TEXT 251
5.4 PLOTTING DIFFICULTIES 252
5.4.1 PIECEWISELY DEFINED FUNCTIONS 252
5.4.2 RAPIDLY VARYING FUNCTIONS 255
5.5 MORE ADVANCED VECTORIZATION OF FUNCTIONS 256
5.5.1 VECTORIZATION OF STRINGPUNCTION OBJECTS 256
5.5.2 VECTORIZATION OF THE HEAVISIDE FUNCTION 257
5.5.3 VECTORIZATION OF A HAT FUNCTION 260
5.6 MORE ON NUMERICAL PYTHON ARRAYS 262
5.6.1 COPYING ARRAYS 263
CONTENTS XV
5.6.2 IN-PLACE ARITHMETICS 263
5.6.3 ALLOCATING ARRAYS 264
5.6.4 GENERALIZED INDEXING 264
5.6.5 TESTING FOR THE ARRAY TYPE 265
5.6.6 COMPACT SYNTAX FOR ARRAY GENERATION 266
5.6.7 SHAPE MANIPULATION 266
5.7 HIGHER-DIMENSIONAL ARRAYS 267
5.7.1 MATRICES AND ARRAYS 267
5.7.2 TWO-DIMENSIONAL NUMERICAL PYTHON ARRAYS 268
5.7.3 ARRAY COMPUTING 271
5.7.4 TWO-DIMENSIONAL ARRAYS AND FUNCTIONS OF TWO
VARIABLES 272
5.7.5 MATRIX OBJECTS 272
5.8 SUMMARY 274
5.8.1 CHAPTER TOPICS 274
5.8.2 EXAMPLE: ANIMATING A FUNCTION 275
5.9 EXERCISES 280
6 DICTIONARIES AND STRINGS 301
6.1 DICTIONARIES 302
6.1.1 MAKING DICTIONARIES 302
6.1.2 DICTIONARY OPERATIONS 303
6.1.3 EXAMPLE: POLYNOMIALS AS DICTIONARIES 304
6.1.4 DICTIONARIES WITH DEFAULT VALUES AND ORDERING .... 306
6.1.5 EXAMPLE: FILE DATA IN DICTIONARIES 309
6.1.6 EXAMPLE: FILE DATA IN NESTED DICTIONARIES 310
6.1.7 EXAMPLE: READING AND PLOTTING DATA RECORDED AT
SPECIFIC DATES 314
6.2 STRINGS 318
6.2.1 COMMON OPERATIONS ON STRINGS 318
6.2.2 EXAMPLE: READING PAIRS OF NUMBERS 322
6.2.3 EXAMPLE: READING COORDINATES 325
6.3 READING DATA FROM WEB PAGES 327
6.3.1 ABOUT WEB PAGES 327
6.3.2 HOW TO ACCESS WEB PAGES IN PROGRAMS 329
6.3.3 EXAMPLE: READING PURE TEXT FILES 329
6.3.4 EXAMPLE: EXTRACTING DATA FROM HTML 331
6.3.5 HANDLING NON-ENGLISH TEXT 332
6.4 READING AND WRITING SPREADSHEET FILES 335
6.4.1 CSV FILES 335
6.4.2 READING CSV FILES 336
6.4.3 PROCESSING SPREADSHEET DATA 337
6.4.4 WRITING CSV FILES 338
6.4.5 REPRESENTING NUMBER CELLS WITH NUMERICAL PYTHON
ARRAYS 339
XVI CONTENTS
6.4.6 USING MORE HIGH-LEVEL NUMERICAL PYTHON
FUNCTIONALITY 340
6.5 EXAMPLES FROM ANALYZING DNA 341
6.5.1 COMPUTING FREQUENCIES 341
6.5.2 ANALYZING THE FREQUENCY MATRIX 348
6.5.3 FINDING BASE FREQUENCIES 351
6.5.4 TRANSLATING GENES INTO PROTEINS 353
6.5.5 SOME HUMANS CAN DRINK MILK, WHILE OTHERS CANNOT 358
6.6 SUMMARY 359
6.6.1 CHAPTER TOPICS 359
6.6.2 EXAMPLE: A FILE DATABASE 361
6.7 EXERCISES 364
7 INTRODUCTION TO CLASSES 373
7.1 SIMPLE FUNCTION CLASSES 374
7.1.1 CHALLENGE: FUNCTIONS WITH PARAMETERS 374
7.1.2 REPRESENTING A FUNCTION AS A CLASS 376
7.1.3 ANOTHER FUNCTION CLASS EXAMPLE 382
7.1.4 ALTERNATIVE FUNCTION CLASS IMPLEMENTATIONS 383
7.1.5 MAKING CLASSES WITHOUT THE CLASS CONSTRUCT 385
7.2 MORE EXAMPLES ON CLASSES 387
7.2.1 BANK ACCOUNTS 387
7.2.2 PHONE BOOK 389
7.2.3 A CIRCLE 391
7.3 SPECIAL METHODS 393
7.3.1 THE CALL SPECIAL METHOD 393
7.3.2 EXAMPLE: AUTOMAGIC DIFFERENTIATION 394
7.3.3 EXAMPLE: AUTOMAGIC INTEGRATION 397
7.3.4 TURNING AN INSTANCE INTO A STRING 399
7.3.5 EXAMPLE: PHONE BOOK WITH SPECIAL METHODS 400
7.3.6 ADDING OBJECTS 402
7.3.7 EXAMPLE: CLASS FOR POLYNOMIALS 402
7.3.8 ARITHMETIC OPERATIONS AND OTHER SPECIAL METHODS. 407
7.3.9 SPECIAL METHODS FOR STRING CONVERSION 408
7.4 EXAMPLE: CLASS FOR VECTORS IN THE PLANE 410
7.4.1 SOME MATHEMATICAL OPERATIONS ON VECTORS 410
7.4.2 IMPLEMENTATION 410
7.4.3 USAGE 412
7.5 EXAMPLE: CLASS FOR COMPLEX NUMBERS 413
7.5.1 IMPLEMENTATION 414
7.5.2 ILLEGAL OPERATIONS 415
7.5.3 MIXING COMPLEX AND REAL NUMBERS 416
7.5.4 DYNAMIC, STATIC, STRONG, WEAK, AND DUCK TYPING . . 417
7.5.5 SPECIAL METHODS FOR RIGHT OPERANDS 419
7.5.6 INSPECTING INSTANCES 420
CONTENTS XVII
7.6 STATIC METHODS AND ATTRIBUTES 421
7.7 SUMMARY 423
7.7.1 CHAPTER TOPICS 423
7.7.2 EXAMPLE: INTERVAL ARITHMETICS 424
7.8 EXERCISES 429
8 RANDOM NUMBERS AND SIMPLE CAMES 447
8.1 DRAWING RANDOM NUMBERS 448
8.1.1 THE SEED 448
8.1.2 UNIFORMLY DISTRIBUTED RANDOM NUMBERS 449
8.1.3 VISUALIZING THE DISTRIBUTION 450
8.1.4 VECTORIZED DRAWING OF RANDOM NUMBERS 451
8.1.5 COMPUTING THE MEAN AND STANDARD DEVIATION .... 452
8.1.6 THE GAUSSIAN OR NORMAL DISTRIBUTION 454
8.2 DRAWING INTEGERS 455
8.2.1 RANDOM INTEGER FUNCTIONS 455
8.2.2 EXAMPLE: THROWING A DIE 456
8.2.3 DRAWING A RANDOM ELEMENT FROM A LIST 459
8.2.4 EXAMPLE: DRAWING CARDS FROM A DECK 459
8.2.5 EXAMPLE: CLASS IMPLEMENTATION OF A DECK 461
8.3 COMPUTING PROBABILITIES 464
8.3.1 PRINCIPLES OF MONTE CARLO SIMULATION 464
8.3.2 EXAMPLE: THROWING DICE 465
8.3.3 EXAMPLE: DRAWING BALLS FROM A HAT 468
8.3.4 RANDOM MUTATIONS OF GENES 470
8.3.5 EXAMPLE: POLICIES FOR LIMITING POPULATION GROWTH . 475
8.4 SIMPLE GAMES 478
8.4.1 GUESSING A NUMBER 478
8.4.2 ROLLING TWO DICE 479
8.5 MONTE CARLO INTEGRATION 482
8.5.1 DERIVATION OF MONTE CARLO INTEGRATION 482
8.5.2 IMPLEMENTATION OF STANDARD MONTE CARLO
INTEGRATION 484
8.5.3 AREA COMPUTING BY THROWING RANDOM POINTS 487
8.6 RANDOM WALK IN ONE SPACE DIMENSION 489
8.6.1 BASIC IMPLEMENTATION 490
8.6.2 VISUALIZATION 490
8.6.3 RANDOM WALK AS A DIFFERENCE EQUATION 491
8.6.4 COMPUTING STATISTICS OF THE PARTICLE POSITIONS .... 492
8.6.5 VECTORIZED IMPLEMENTATION 493
8.7 RANDOM WALK IN TWO SPACE DIMENSIONS 494
8.7.1 BASIC IMPLEMENTATION 495
8.7.2 VECTORIZED IMPLEMENTATION 496
8.8 SUMMARY 497
8.8.1 CHAPTER TOPICS 497
XVIII CONTENTS
8.8.2 EXAMPLE: RANDOM GROWTH 499
8.9 EXERCISES 504
9 OBJECT-ORIENTED PROGRAMMING 523
9.1 INHERITANCE AND CLASS HIERARCHIES 523
9.1.1 A CLASS FOR STRAIGHT LINES 524
9.1.2 A FIRST TRY ON A CLASS FOR PARABOLAS 525
9.1.3 A CLASS FOR PARABOLAS USING INHERITANCE 525
9.1.4 CHECKING THE CLASS TYPE 527
9.1.5 ATTRIBUTE VS INHERITANCE: HAS-A VS IS-A RELATIONSHIP 528
9.1.6 SUPERCLASS FOR DEFINING AN INTERFACE 530
9.2 CLASS HIERARCHY FOR NUMERICAL DIFFERENTIATION 532
9.2.1 CLASSES FOR DIFFERENTIATION 533
9.2.2 VERIFICATION 536
9.2.3 A FLEXIBLE MAIN PROGRAM 538
9.2.4 EXTENSIONS 539
9.2.5 ALTERNATIVE IMPLEMENTATION VIA FUNCTIONS 542
9.2.6 ALTERNATIVE IMPLEMENTATION VIA FUNCTIONAL
PROGRAMMING 543
9.2.7 ALTERNATIVE IMPLEMENTATION VIA A SINGLE CLASS .... 544
9.3 CLASS HIERARCHY FOR NUMERICAL INTEGRATION 546
9.3.1 NUMERICAL INTEGRATION METHODS 546
9.3.2 CLASSES FOR INTEGRATION 548
9.3.3 VERIFICATION 551
9.3.4 USING THE CLASS HIERARCHY 552
9.3.5 ABOUT OBJECT-ORIENTED PROGRAMMING 555
9.4 CLASS HIERARCHY FOR MAKING DRAWINGS 556
9.4.1 USING THE OBJECT COLLECTION 557
9.4.2 EXAMPLE OF CLASSES FOR GEOMETRIC OBJECTS 566
9.4.3 ADDING FUNCTIONALITY VIA RECURSION 571
9.4.4 SCALING, TRANSLATING, AND ROTATING A FIGURE 574
9.5 CLASSES FOR DNA ANALYSIS 577
9.5.1 CLASS FOR REGIONS 577
9.5.2 CLASS FOR GENES 577
9.5.3 SUBCLASSES 582
9.6 SUMMARY 584
9.6.1 CHAPTER TOPICS 584
9.6.2 EXAMPLE: INPUT DATA READER 585
9.7 EXERCISES 591
A SEQUENCES AND DIFFERENCE EQUATIONS 601
A.L MATHEMATICAL MODELS BASED ON DIFFERENCE EQUATIONS .... 602
A. 1.1 INTEREST RATES 603
A. 1.2 THE FACTORIAL AS A DIFFERENCE EQUATION 606
A. 1.3 FIBONACCI NUMBERS 606
CONTENTS XIX
A. 1.4 GROWTH OF A POPULATION 608
A. 1.5 LOGISTIC GROWTH 608
A.1.6 PAYBACK OF A LOAN 610
A. 1.7 THE INTEGRAL AS A DIFFERENCE EQUATION 611
A. 1.8 TAYLOR SERIES AS A DIFFERENCE EQUATION 613
A. 1.9 MAKING A LIVING FROM A FORTUNE 615
A.L.LONEWTON S METHOD 615
A.L.LLTHE INVERSE OF A FUNCTION 619
A.2 PROGRAMMING WITH SOUND 621
A.2.1 WRITING SOUND TO FILE 622
A.2.2 READING SOUND FROM FILE 622
A.2.3 PLAYING MANY NOTES 623
A.2.4 MUSIC OF A SEQUENCE 624
A.3 EXERCISES 627
B INTRODUCTION TO DISCRETE CALCULUS 639
B.L DISCRETE FUNCTIONS 639
B.L.L THE SINE FUNCTION 640
B.L.2 INTERPOLATION 641
B.1.3 EVALUATING THE APPROXIMATION 642
B.1.4 GENERALIZATION 643
B.2 DIFFERENTIATION BECOMES FINITE DIFFERENCES 644
B.2.1 DIFFERENTIATING THE SINE FUNCTION 645
B.2.2 DIFFERENCES ON A MESH 646
B.2.3 GENERALIZATION 648
B.3 INTEGRATION BECOMES SUMMATION 649
B.3.1 DIVIDING INTO SUBINTERVALS 649
B.3.2 INTEGRATION ON SUBINTERVALS 651
B.3.3 ADDING THE SUBINTERVALS 652
B.3.4 GENERALIZATION 652
B.4 TAYLOR SERIES 654
B.4.1 APPROXIMATING FUNCTIONS CLOSE TO ONE POINT 654
B.4.2 APPROXIMATING THE EXPONENTIAL FUNCTION 655
B.4.3 MORE ACCURATE EXPANSIONS 655
B.4.4 ACCURACY OF THE APPROXIMATION 657
B.4.5 DERIVATIVES REVISITED 659
B.4.6 MORE ACCURATE DIFFERENCE APPROXIMATIONS 660
B.4.7 SECOND-ORDER DERIVATIVES 662
B.5 EXERCISES 664
C INTRODUCTION TO DIFFERENTIAL EQUATIONS 669
C.L THE SIMPLEST CASE 670
C.2 EXPONENTIAL GROWTH 673
C.3 LOGISTIC GROWTH 677
C.4 A SIMPLE PENDULUM 678
XX
CONTENTS
C.5 A MODEL FOR THE SPREAD OF A DISEASE 681
C.6 EXERCISES 683
D A COMPLETE DIFFERENTIAL EQUATION PROJECT 685
D.L ABOUT THE PROBLEM: MOTION AND FORCES IN PHYSICS 685
D.L.L THE PHYSICAL PROBLEM 685
D.L.2 THE COMPUTATIONAL ALGORITHM 688
D.L.3 DERIVATION OF THE MATHEMATICAL MODEL 688
D.L.4 DERIVATION OF THE ALGORITHM 690
D.2 PROGRAM DEVELOPMENT AND TESTING 692
D.2.1 IMPLEMENTATION 692
D.2.2 CALLBACK FUNCTIONALITY 694
D.2.3 MAKING A MODULE 697
D.2.4 VERIFICATION 697
D.3 VISUALIZATION 700
D.3.1 SIMULTANEOUS COMPUTATION AND PLOTTING 700
D.3.2 SOME APPLICATIONS 703
D.3.3 REMARK ON CHOOSING AT 703
D.3.4 COMPARING SEVERAL QUANTITIES IN SUBPLOTS 704
D.3.5 COMPARING APPROXIMATE AND EXACT SOLUTIONS 705
D.3.6 EVOLUTION OF THE ERROR AS AT DECREASES 706
D.4 EXERCISES 710
E PROGRAMMING OF DIFFERENTIAL EQUATIONS 711
E.L SCALAR ORDINARY DIFFERENTIAL EQUATIONS 712
E.L.L EXAMPLES ON RIGHT-HAND-SIDE FUNCTIONS 712
E.1.2 THE FORWARD EULER SCHEME 714
E.L.3 FUNCTION IMPLEMENTATION 715
E.L.4 VERIFYING THE IMPLEMENTATION 716
E.L.5 FROM DISCRETE TO CONTINUOUS SOLUTION 718
E.1.6 SWITCHING NUMERICAL METHOD 718
E.L.7 CLASS IMPLEMENTATION 719
E.L.8 LOGISTIC GROWTH VIA A FUNCTION-BASED APPROACH .. . 723
E.L.9 LOGISTIC GROWTH VIA A CLASS-BASED APPROACH 724
E.2 SYSTEMS OF ORDINARY DIFFERENTIAL EQUATIONS 727
E.2.1 MATHEMATICAL PROBLEM 727
E.2.2 EXAMPLE OF A SYSTEM OF ODES 728
E.2.3 FUNCTION IMPLEMENTATION 729
E.2.4 CLASS IMPLEMENTATION 732
E.3 THE ODESOLVER CLASS HIERARCHY 733
E.3.1 NUMERICAL METHODS 733
E.3.2 CONSTRUCTION OF A SOLVER HIERARCHY 735
E.3.3 THE BACKWARD EULER METHOD 738
E.3.4 VERIFICATION 740
E.3.5 EXAMPLE: EXPONENTIAL DECAY 742
CONTENTS XXI
E.3.6 EXAMPLE: THE LOGISTIC EQUATION WITH PROBLEM AND
SOLVER CLASSES 744
E.3.7 EXAMPLE: AN OSCILLATING SYSTEM 752
E.3.8 APPLICATION 4: THE TRAJECTORY OF A BALL 754
E.3.9 FURTHER DEVELOPMENTS OF ODESOLVER 756
E.4 EXERCISES 756
F DEBUGGING 791
F.L USING A DEBUGGER 791
F.2 HOW TO DEBUG 794
F.2.1 A RECIPE FOR PROGRAM WRITING AND DEBUGGING 794
F.2.2 APPLICATION OF THE RECIPE 797
F.2.3 GETTING HELP FROM A CODE ANALYZER 809
G MIGRATING PYTHON TO COMPILED CODE 811
G.L PURE PYTHON CODE FOR MONTE CARLO SIMULATION 812
G.L.L THE COMPUTATIONAL PROBLEM 812
G.1.2 A SCALAR PYTHON IMPLEMENTATION 812
G.1.3 A VECTORIZED PYTHON IMPLEMENTATION 813
G.2 MIGRATING SCALAR PYTHON CODE TO CYTHON 815
G.2.1 A PLAIN CYTHON IMPLEMENTATION 815
G.2.2 A BETTER CYTHON IMPLEMENTATION 817
G.3 MIGRATING CODE TO C 819
G.3.1 WRITING A C PROGRAM 819
G.3.2 MIGRATING LOOPS TO C CODE VIA F2PY 820
G.3.3 MIGRATING LOOPS TO C CODE VIA CYTHON 822
G.3.4 COMPARING EFFICIENCY 822
H TECHNICAL TOPICS 825
H.L GETTING ACCESS TO PYTHON 825
H. 1.1 REQUIRED SOFTWARE 825
H.1.2 INSTALLING SOFTWARE ON YOUR LAPTOP: MAC OS X AND
WINDOWS 826
H.1.3 ANACONDA AND SPYDER 827
H.1.4 VMWARE FUSION VIRTUAL MACHINE 828
H.1.5 WUBI FOR DUAL BOOT ON WINDOWS 831
H.1.6 VAGRANT VIRTUAL MACHINE 831
H.L.7 HOW TO WRITE AND RUN A PYTHON PROGRAM 831
H.L.8 THE SAGEMATHCLOUD AND WAKARI WEB SERVICES ... 834
H.L.9 WRITING IPYTHON NOTEBOOKS 835
H.2 DIFFERENT WAYS OF RUNNING PYTHON PROGRAMS 837
H.2.1 EXECUTING PYTHON PROGRAMS IN IPYTLION 837
H.2.2 EXECUTING PYTHON PROGRAMS IN UNIX 838
H.2.3 EXECUTING PYTHON PROGRAMS IN WINDOWS 839
H.2.4 EXECUTING PYTHON PROGRAMS IN MAC OS X 840
H.2.5 MAKING A COMPLETE STAND-ALONE EXECUTABLE 841
XXII CONTENTS
H.3 DOING OPERATING SYSTEM TASKS IN PYTHON 841
H.4 VARIABLE NUMBER OF FUNCTION ARGUMENTS 844
H.4.1 VARIABLE NUMBER OF POSITIONAL ARGUMENTS 845
H.4.2 VARIABLE NUMBER OF KEYWORD ARGUMENTS 847
H.5 EVALUATING PROGRAM EFFICIENCY 849
H.5.1 MAKING TIME MEASUREMENTS 849
H.5.2 PROFILING PYTHON PROGRAMS 851
H.6 SOFTWARE TESTING 852
H.6.1 REQUIREMENTS OF THE TEST FUNCTION 852
H.6.2 WRITING THE TEST FUNCTION; PRECOMPUTED DATA .... 853
H.6.3 WRITING THE TEST FUNCTION; EXACT NUMERICAL SOLUTION 854
H.6.4 TESTING OF FUNCTION ROBUSTNESS 855
H.6.5 AUTOMATIC EXECUTION OF TESTS 857
REFERENCES 859
INDEX 861
|
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 | BV042029869 |
classification_rvk | ST 250 |
classification_tum | DAT 366f |
ctrlnum | (OCoLC)889984436 (DE-599)BVBBV042029869 |
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 | 4. ed. |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01787nam a2200433 cb4500</leader><controlfield tag="001">BV042029869</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20140912 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">140819s2014 gw ad|| |||| 00||| eng d</controlfield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9783642549588</subfield><subfield code="c">Print</subfield><subfield code="9">978-3-642-54958-8</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9783642549595</subfield><subfield code="c">EBook</subfield><subfield code="9">978-3-642-54959-5</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)889984436</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BVBBV042029869</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-11</subfield><subfield code="a">DE-91G</subfield><subfield code="a">DE-188</subfield><subfield code="a">DE-862</subfield><subfield code="a">DE-29T</subfield><subfield code="a">DE-83</subfield><subfield code="a">DE-92</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">68N15</subfield><subfield code="2">msc</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">4. ed.</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Berlin [u.a.]</subfield><subfield code="b">Springer</subfield><subfield code="c">2014</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XXXI, 865 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">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="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="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=027471336&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-027471336</subfield></datafield></record></collection> |
id | DE-604.BV042029869 |
illustrated | Illustrated |
indexdate | 2024-08-01T11:28:17Z |
institution | BVB |
isbn | 9783642549588 9783642549595 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-027471336 |
oclc_num | 889984436 |
open_access_boolean | |
owner | DE-11 DE-91G DE-BY-TUM DE-188 DE-862 DE-BY-FWS DE-29T DE-83 DE-92 |
owner_facet | DE-11 DE-91G DE-BY-TUM DE-188 DE-862 DE-BY-FWS DE-29T DE-83 DE-92 |
physical | XXXI, 865 S. Ill., graph. Darst. |
publishDate | 2014 |
publishDateSearch | 2014 |
publishDateSort | 2014 |
publisher | Springer |
record_format | marc |
series | Texts in computational science and engineering |
series2 | Texts in computational science and engineering |
spellingShingle | Langtangen, Hans Petter 1962- A primer on scientific programming with Python Texts in computational science and engineering Wissenschaftliches Rechnen (DE-588)4338507-2 gnd Python Programmiersprache (DE-588)4434275-5 gnd |
subject_GND | (DE-588)4338507-2 (DE-588)4434275-5 |
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 | Wissenschaftliches Rechnen (DE-588)4338507-2 gnd Python Programmiersprache (DE-588)4434275-5 gnd |
topic_facet | Wissenschaftliches Rechnen Python Programmiersprache |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=027471336&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
volume_link | (DE-604)BV016971315 |
work_keys_str_mv | AT langtangenhanspetter aprimeronscientificprogrammingwithpython |
Inhaltsverzeichnis
THWS Schweinfurt Zentralbibliothek Lesesaal
Signatur: |
2000 ST 250 P99 L286(4) |
---|---|
Exemplar 1 | ausleihbar Verfügbar Bestellen |
Exemplar 2 | ausleihbar Verfügbar Bestellen |