Description
Efnisyfirlit
- Cover
- Half-title page
- Title page
- Copyright page
- Contents
- Preface to the Second Edition
- Preface to the First Edition
- 1 Introduction
- 1.1 Scientific Software
- 1.2 The Plan of This Book
- 1.3 Can Python Compete with Compiled Languages?
- 1.4 Limitations of This Book
- 1.5 Installing Python and Add-ons
- 2 Getting Started with IPython
- 2.1 Tab Completion
- 2.2 Introspection
- 2.3 History
- 2.4 Magic Commands
- 2.5 IPython in Action: An Extended Example
- 2.5.1 An IPython terminal workflow
- 2.5.2 An IPython notebook workflow
- 3 A Short Python Tutorial
- 3.1 Typing Python
- 3.2 Objects and Identifiers
- 3.3 Numbers
- 3.3.1 Integers
- 3.3.2 Real numbers
- 3.3.3 Boolean numbers
- 3.3.4 Complex numbers
- 3.4 Namespaces and Modules
- 3.5 Container Objects
- 3.5.1 Lists
- 3.5.2 List indexing
- 3.5.3 List slicing
- 3.5.4 List mutability
- 3.5.5 Tuples
- 3.5.6 Strings
- 3.5.7 Dictionaries
- 3.6 Python if Statements
- 3.7 Loop Constructs
- 3.7.1 The Python for loop
- 3.7.2 The Python continue statement
- 3.7.3 The Python break statement
- 3.7.4 List comprehensions
- 3.7.5 Python while loops
- 3.8 Functions
- 3.8.1 Syntax and scope
- 3.8.2 Positional arguments
- 3.8.3 Keyword arguments
- 3.8.4 Variable number of positional arguments
- 3.8.5 Variable number of keyword arguments
- 3.8.6 Python input/output functions
- 3.8.7 The Python print function
- 3.8.8 Anonymous functions
- 3.9 Introduction to Python Classes
- 3.10 The Structure of Python
- 3.11 Prime Numbers: A Worked Example
- 4 NumPy
- 4.1 One-Dimensional Arrays
- 4.1.1 Ab initio constructors
- 4.1.2 Look-alike constructors
- 4.1.3 Arithmetical operations on vectors
- 4.1.4 Ufuncs
- 4.1.5 Logical operations on vectors
- 4.2 Two-Dimensional Arrays
- 4.2.1 Broadcasting
- 4.2.2 Ab initio constructors
- 4.2.3 Look-alike constructors
- 4.2.4 Operations on arrays and ufuncs
- 4.3 Higher-Dimensional Arrays
- 4.4 Domestic Input and Output
- 4.4.1 Discursive output and input
- 4.4.2 NumPy text output and input
- 4.4.3 NumPy binary output and input
- 4.5 Foreign Input and Output
- 4.5.1 Small amounts of data
- 4.5.2 Large amounts of data
- 4.6 Miscellaneous Ufuncs
- 4.6.1 Maxima and minima
- 4.6.2 Sums and products
- 4.6.3 Simple statistics
- 4.7 Polynomials
- 4.7.1 Converting data to coefficients
- 4.7.2 Converting coefficients to data
- 4.7.3 Manipulating polynomials in coefficient form
- 4.8 Linear Algebra
- 4.8.1 Basic operations on matrices
- 4.8.2 More specialized operations on matrices
- 4.8.3 Solving linear systems of equations
- 4.9 More NumPy and Beyond
- 4.9.1 SciPy
- 4.9.2 SciKits
- 5 Two-Dimensional Graphics
- 5.1 Introduction
- 5.2 Getting Started: Simple Figures
- 5.2.1 Front-ends
- 5.2.2 Back-ends
- 5.2.3 A simple figure
- 5.2.4 Interactive controls
- 5.3 Object-Oriented Matplotlib
- 5.4 Cartesian Plots
- 5.4.1 The Matplotlib plot function
- 5.4.2 Curve styles
- 5.4.3 Marker styles
- 5.4.4 Axes, grid, labels and title
- 5.4.5 A not-so-simple example: partial sums of Fourier series
- 5.5 Polar Plots
- 5.6 Error Bars
- 5.7 Text and Annotations
- 5.8 Displaying Mathematical Formulae
- 5.8.1 Non-LATEXusers
- 5.8.2 LATEXusers
- 5.8.3 Alternatives for LATEXusers
- 5.9 Contour Plots
- 5.10 Compound Figures
- 5.10.1 Multiple figures
- 5.10.2 Multiple plots
- 5.11 Mandelbrot Sets: A Worked Example
- 6 Multi-Dimensional Graphics
- 6.1 Introduction
- 6.1.1 Multi-dimensional data sets
- 6.2 The Reduction to Two Dimensions
- 6.3 Visualization Software
- 6.4 Example Visualization Tasks
- 6.5 Visualization of Solitary Waves
- 6.5.1 The interactivity task
- 6.5.2 The animation task
- 6.5.3 The movie task
- 6.6 Visualization of Three-Dimensional Objects
- 6.7 A Three-Dimensional Curve
- 6.7.1 Visualizing the curve with mplot3d
- 6.7.2 Visualizing the curve with mlab
- 6.8 A Simple Surface
- 6.8.1 Visualizing the simple surface with mplot3d
- 6.8.2 Visualizing the simple surface with mlab
- 6.9 A Parametrically Defined Surface
- 6.9.1 Visualizing Enneper’s surface using mplot3d
- 6.9.2 Visualizing Enneper’s surface using mlab
- 6.10 Three-Dimensional Visualization of a Julia Set
- 7 SymPy: A Computer Algebra System
- 7.1 Computer Algebra Systems
- 7.2 Symbols and Functions
- 7.3 Conversions from Python to SymPy and Vice Versa
- 7.4 Matrices and Vectors
- 7.5 Some Elementary Calculus
- 7.5.1 Differentiation
- 7.5.2 Integration
- 7.5.3 Series and limits
- 7.6 Equality, Symbolic Equality and Simplification
- 7.7 Solving Equations
- 7.7.1 Equations with one independent variable
- 7.7.2 Linear equations with more than one independent variable
- 7.7.3 More general equations
- 7.8 Solving Ordinary Differential Equations
- 7.9 Plotting from within SymPy
- 8 Ordinary Differential Equations
- 8.1 Initial Value Problems
- 8.2 Basic Concepts
- 8.3 The odeint Function
- 8.3.1 Theoretical background
- 8.3.2 The harmonic oscillator
- 8.3.3 The van der Pol oscillator
- 8.3.4 The Lorenz equations
- 8.4 Two-Point Boundary Value Problems
- 8.4.1 Introduction
- 8.4.2 Formulation of the boundary value problem
- 8.4.3 A simple example
- 8.4.4 A linear eigenvalue problem
- 8.4.5 A non-linear boundary value problem
- 8.5 Delay Differential Equations
- 8.5.1 A model equation
- 8.5.2 More general equations and their numerical solution
- 8.5.3 The logistic equation
- 8.5.4 The Mackey–Glass equation
- 8.6 Stochastic Differential Equations
- 8.6.1 The Wiener process
- 8.6.2 The Itô calculus
- 8.6.3 Itô and Stratonovich stochastic integrals
- 8.6.4 Numerical solution of stochastic differential equations
- 9 Partial Differential Equations: A Pseudospectral Approach
- 9.1 Initial Boundary Value Problems
- 9.2 Method of Lines
- 9.3 Spatial Derivatives via Finite Differencing
- 9.4 Spatial Derivatives by Spectral Techniques for Periodic Problems
- 9.5 The IVP for Spatially Periodic Problems
- 9.6 Spectral Techniques for Non-Periodic Problems
- 9.7 An Introduction to f2py
- 9.7.1 Simple examples with scalar arguments
- 9.7.2 Vector arguments
- 9.7.3 A simple example with multi-dimensional arguments
- 9.7.4 Undiscussed features of f2py
- 9.8 A Real-Life f2py Example
- 9.9 Worked Example: Burgers’ Equation
- 9.9.1 Boundary conditions: the traditional approach
- 9.9.2 Boundary conditions: the penalty approach
- 10 Case Study: Multigrid
- 10.1 The One-Dimensional Case
- 10.1.1 Linear elliptic equations
- 10.1.2 Smooth and rough modes
- 10.2 The Tools of Multigrid
- 10.2.1 Relaxation methods
- 10.2.2 Residual and error
- 10.2.3 Prolongation and restriction
- 10.3 Multigrid Schemes
- 10.3.1 The two-grid algorithm
- 10.3.2 The V-cycle scheme
- 10.3.3 The full multigrid (FMG) scheme
- 10.4 A Simple Python Multigrid Implementation
- 10.4.1 Utility functions
- 10.4.2 Smoothing functions
- 10.4.3 Multigrid functions
- A Installing a Python Environment
- A.1 Installing Python Packages
- A.2 Communication with IPython Using the Jupyter Notebook
- A.2.1 Starting and stopping the notebook
- A.2.2 Working in the notebook
- A.2.2.1 Entering headers
- A.2.2.2 Entering Markdown text
- A.2.2.3 Converting notebooks to other formats
- A.3 Communication with IPython Using Terminal Mode
- A.3.1 Editors for programming
- A.3.2 The two-windows approach
- A.3.3 Calling the editor from within IPython
- A.3.4 Calling IPython from within the editor
- A.4 Communication with IPython via an IDE
- A.5 Installing Additional Packages
- B Fortran77 Subroutines for Pseudospectral Methods
- References
- Hints for Using the Index
- Index
Reviews
There are no reviews yet.