You are previewing Mathematica Cookbook.
O'Reilly logo
Mathematica Cookbook

Book Description

Mathematica Cookbook helps you master the application's core principles by walking you through real-world problems. Ideal for browsing, this book includes recipes for working with numerics, data structures, algebraic equations, calculus, and statistics. You'll also venture into exotic territory with recipes for data visualization using 2D and 3D graphic tools, image processing, and music.

Although Mathematica 7 is a highly advanced computational platform, the recipes in this book make it accessible to everyone -- whether you're working on high school algebra, simple graphs, PhD-level computation, financial analysis, or advanced engineering models.

  • Learn how to use Mathematica at a higher level with functional programming and pattern matching
  • Delve into the rich library of functions for string and structured text manipulation
  • Learn how to apply the tools to physics and engineering problems
  • Draw on Mathematica's access to physics, chemistry, and biology data
  • Get techniques for solving equations in computational finance
  • Learn how to use Mathematica for sophisticated image processing
  • Process music and audio as musical notes, analog waveforms, or digital sound samples
Visit the catalog page for Mathematica CookbookVisit the errata page for Mathematica Cookbook

Table of Contents

  1. Mathematica Cookbook
  2. Dedication
  3. Preface
    1. Introduction
    2. MathematicaCookbook.com
    3. Structure of This Book
    4. Acknowledgments
    5. Conventions Used in This Book
    6. Using Code Examples
    7. Safari® Enabled
    8. How to Contact Us
  4. 1. Numerics
    1. 1.0 Introduction
      1. Numerical Types
      2. Exact and Approximate Results
      3. Numerical Expressions
      4. Numerical Approximations
    2. 1.1 Controlling Precision and Accuracy
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 1.2 Mixing Different Numerical Types
      1. Problem
      2. Solution
        1. Mixing exact values and symbols
        2. Mixing exact values and approximate values
        3. Mixing values of different precision and accuracy
      3. Discussion
      4. See Also
    4. 1.3 Representing Numbers in Other Bases
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 1.4 Extracting the Digits of a Number
      1. Problem
      2. Solution
      3. Discussion
    6. 1.5 Working with Intervals
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 1.6 Converting Between Numerical Types
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    8. 1.7 Displaying Numbers in Alternate Forms
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  5. 2. Functional Programming
    1. 2.0 Introduction
      1. Functional Programming
      2. The Elements of Functional Programming
      3. DownValues and UpValues
      4. Function Attributes
        1. Orderless
        2. Flat
        3. Listable
        4. HoldFirst
        5. HoldRest
        6. HoldAll
      5. See Also
    2. 2.1 Mapping Functions with More Than One Argument
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 2.2 Holding Arbitrary Arguments
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    4. 2.3 Creating Functions That Automatically Map Over Lists
      1. Problem
      2. Solution
      3. Discussion
    5. 2.4 Mapping Multiple Functions in a Single Pass
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    6. 2.5 Keeping Track of the Index of Each Item As You Map
      1. Problem
      2. Solution
      3. Discussion
    7. 2.6 Mapping a Function over a Moving Sublist
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    8. 2.7 Using Prefix and Postfix Notation to Produce More Readable Code
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    9. 2.8 Defining Indexed Functions
      1. Problem
      2. Solution
      3. Discussion
    10. 2.9 Understanding the Use of Fold As an Alternative to Recursion
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    11. 2.10 Incremental Construction of Lists
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    12. 2.11 Computing Through Repeated Function Application
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    13. 2.12 Building a Function Through Iteration
      1. Problem
      2. Solution
      3. Discussion
    14. 2.13 Exploiting Function Composition and Inverse Functions
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    15. 2.14 Implementing Closures
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    16. 2.15 Currying in Mathematica
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    17. 2.16 Creating Functions with Default Values
      1. Problem
      2. Solution
      3. Discussion
    18. 2.17 Creating Functions That Accept Options
      1. Problem
      2. Solution
      3. Discussion
  6. 3. Data Structures
    1. 3.0 Introduction
      1. List Functions
      2. Set Functions
      3. Vector Functions
      4. Matrix and Tensor Functions
    2. 3.1 Ensuring the Most Efficient Representation of Numerical Lists
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 3.2 Sorting Lists
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    4. 3.3 Determining Order Without Sorting
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 3.4 Extracting the Diagonals of a Matrix
      1. Problem
      2. Solution
      3. Discussion
    6. 3.5 Constructing Matrices of Specific Structure
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 3.6 Constructing Permutation and Shift Matrices
      1. Problem
      2. Solution
      3. Discussion
    8. 3.7 Manipulating Rows and Columns of Matrices
      1. Problem
      2. Solution
      3. Discussion
    9. 3.8 Using Sparse Arrays to Conserve Memory
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 3.9 Manipulating Deeply Nested Lists Using Functions with Level Specifications
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    11. 3.10 Implementing Bit Vectors and Using Format to Customize Their Presentation
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    12. 3.11 Implementing Trees and Traversals Using Lists
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    13. 3.12 Implementing Ordered Associative Lookup Using a Red-Black Tree
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    14. 3.13 Exploiting Mathematica’s Built-In Associative Lookup
      1. Problem
      2. Solution
      3. Discussion
    15. 3.14 Constructing Graphs Using the Combinatorica’ Package
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    16. 3.15 Using Graph Algorithms to Extract Information from Graphs
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  7. 4. Patterns and Rule-Based Programming
    1. 4.0 Introduction
      1. Blanks
      2. Alternatives
      3. Repeats
      4. PatternSequence
      5. Except
      6. Conditions and Pattern Tests
      7. Rules
      8. See Also
    2. 4.1 Collecting Items That Match (or Don’t Match) a Pattern
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 4.2 Excluding Items That Match (or Don’t Match) a Pattern
      1. Problem
      2. Solution
      3. Discussion
    4. 4.3 Counting Items That Match a Pattern
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 4.4 Replacing Parts of an Expression
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    6. 4.5 Finding the Longest (or Shortest) Match for a Pattern
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 4.6 Implementing Algorithms in Terms of Rules
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    8. 4.7 Debugging Infinite Loops When Using ReplaceRepeated
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    9. 4.8 Preventing Evaluation Until Replace Is Complete
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 4.9 Manipulating Patterns with Patterns
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    11. 4.10 Optimizing Rules
      1. Problem
      2. Solution
      3. Discussion
    12. 4.11 Using Patterns As a Query Language
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    13. 4.12 Semantic Pattern Matching
      1. Problem
      2. Solution
      3. Discussion
    14. 4.13 Unification Pattern Matching
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  8. 5. String and Text Processing
    1. 5.0 Introduction
      1. Characters and Character Encodings
      2. String and Regular Expressions
        1. String expressions
      3. See Also
    2. 5.1 Comparing Strings
      1. Problem
      2. Solution
      3. Discussion
    3. 5.2 Removing and Replacing Characters from Strings
      1. Problem
      2. Solution
        1. Using patterns
        2. Using positions
      3. Discussion
        1. Stripping comments
        2. Changing delimiters
      4. Removing XML markup
        1. Replacing with expression evaluation
      5. See Also
    4. 5.3 Extracting Characters and Substrings
      1. Problem
      2. Solution
        1. Using patterns
        2. Using positions
      3. Discussion
      4. See Also
    5. 5.4 Duplicating a String
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    6. 5.5 Matching and Searching Text
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 5.6 Tokenizing Text
      1. Problem
      2. Solution
      3. Discussion
    8. 5.7 Working with Natural Language Dictionaries
      1. Problem
      2. Solution
      3. Discussion
        1. Crossword puzzles
        2. Anagrams
        3. Palindromes
        4. Spell-checker
      4. See Also
    9. 5.8 Importing XML
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 5.9 Transforming XML Using Patterns and Rules
      1. Problem
      2. Solution
      3. Discussion
        1. XML-to-XML transformations
      4. See Also
    11. 5.10 Transforming XML Using Recursive Functions (à la XSLT)
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    12. 5.11 Writing Parsers and Grammars in Mathematica
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  9. 6. Two-Dimensional Graphics and Plots
    1. 6.0 Introduction
    2. 6.1 Plotting Functions in Cartesian Coordinates
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 6.2 Plotting in Polar Coordinates
      1. Problem
      2. Solution
      3. Discussion
    4. 6.3 Creating Plots Parametrically
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 6.4 Plotting Data
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    6. 6.5 Mixing Two or More Graphs into a Single Graph
      1. Problem
      2. Solution
      3. Discussion
    7. 6.6 Displaying Multiple Graphs in a Grid
      1. Problem
      2. Solution
      3. Discussion
    8. 6.7 Creating Plots with Legends
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    9. 6.8 Displaying 2D Geometric Shapes
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 6.9 Annotating Graphics with Text
      1. Problem
      2. Solution
      3. Discussion
    11. 6.10 Creating Custom Arrows
      1. Problem
      2. Solution
      3. Discussion
  10. 7. Three-Dimensional Graphics and Plots
    1. 7.0 Introduction
      1. The Symbolic Nature of Graphics
      2. See Also
    2. 7.1 Plotting Functions of Two Variables in Cartesian Coordinates
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 7.2 Plotting Functions in Spherical Coordinates
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    4. 7.3 Plotting Surfaces in Cylindrical Coordinates
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 7.4 Plotting 3D Surfaces Parametrically
      1. Problem
      2. Solution
      3. Discussion
    6. 7.5 Creating 3D Contour Plots
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 7.6 Combining 2D Contours with 3D Plots
      1. Problem
      2. Solution
      3. Discussion
    8. 7.7 Constraining Plots to Specified Regions
      1. Problem
      2. Solution
      3. Discussion
    9. 7.8 Plotting Data in 3D
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 7.9 Plotting 3D Regions Where a Predicate Is Satisfied
      1. Problem
      2. Solution
      3. Discussion
    11. 7.10 Displaying 3D Geometrical Shapes
      1. Problem
      2. Solution
      3. Discussion
    12. 7.11 Constructing Wireframe Models from Mesh
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    13. 7.12 Controlling Viewing Geometry
      1. Problem
      2. Solution
      3. Discussion
    14. 7.13 Controlling Lighting and Surface Properties
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    15. 7.14 Transforming 3D Graphics
      1. Problem
      2. Solution
      3. Discussion
    16. 7.15 Exploring Polyhedra
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    17. 7.16 Importing 3D Graphics from CAD and Other 3D Software
      1. Problem
      2. Solution
      3. Discussion
  11. 8. Image Processing
    1. 8.0 Introduction
      1. Image Representation
      2. Image Processing in Mathematica 7
      3. See Also
    2. 8.1 Extracting Image Information
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 8.2 Converting Images from RGB Color Space to HSV Color Space
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    4. 8.3 Enhancing Images Using Histogram Equalization
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 8.4 Correcting Images Using Histogram Specification
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    6. 8.5 Sharpening Images Using Laplacian Transforms
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 8.6 Sharpening and Smoothing with Fourier Transforms
      1. Problem
      2. Solution
      3. Discussion
    8. 8.7 Detecting Edges in Images
      1. Problem
      2. Solution
      3. Discussion
    9. 8.8 Image Recognition Using Eigenvectors (Eigenimages)
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  12. 9. Audio and Music Processing
    1. 9.0 Introduction
    2. 9.1 Creating Musical Notes
      1. Problem
      2. Solution
      3. Discussion
    3. 9.2 Creating a Scale or a Melody
      1. Problem
      2. Solution
    4. 9.3 Adding Rhythm to a Melody
      1. Problem
      2. Solution
    5. 9.4 Controlling the Volume
      1. Problem
      2. Solution
    6. 9.5 Creating Chords
      1. Problem
      2. Solution
    7. 9.6 Playing a Chord Progression
      1. Problem
      2. Solution
    8. 9.7 Writing Music with Traditional Chord Notation
      1. Problem
      2. Solution
      3. Discussion
    9. 9.8 Creating Percussion Grooves
      1. Problem
      2. Solution
    10. 9.9 Creating More Complex Percussion Grooves
      1. Problem
      2. Solution
      3. Discussion
    11. 9.10 Exporting MIDI files
      1. Problem
      2. Solution
    12. 9.11 Playing Functions As Sound
      1. Problem
      2. Solution
      3. Discussion
    13. 9.12 Adding Tremolo
      1. Problem
      2. Solution
    14. 9.13 Adding Vibrato
      1. Problem
      2. Solution
    15. 9.14 Applying an Envelope to a Signal
      1. Problem
      2. Solution
      3. Discussion
    16. 9.15 Exploring Alternate Tunings
      1. Problem
      2. Solution
      3. Discussion
    17. 9.16 Importing Digital Sound Files
      1. Problem
      2. Solution
      3. Discussion
    18. 9.17 Analyzing Digital Sound Files
      1. Problem
      2. Solution
    19. 9.18 Slicing a Sample
      1. Problem
      2. Solution
      3. Discussion
        1. A Spectrograph
  13. 10. Algebra
    1. 10.0 Introduction
      1. See Also
    2. 10.1 Solving Algebraic Equations
      1. Problem
      2. Solution
      3. Discussion
    3. 10.2 Finding a Polynomial from a Given Root
      1. Problem
      2. Solution
      3. Discussion
    4. 10.3 Transforming Expressions to Other Forms
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 10.4 Generating Polynomials
      1. Problem
      2. Solution
      3. Discussion
    6. 10.5 Decomposing Polynomials into Their Constituent Parts
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 10.6 Dividing Polynomials by Other Polynomials
      1. Problem
      2. Solution
      3. Discussion
  14. 11. Calculus: Continuous and Discrete
    1. 11.0 Introduction
      1. See Also
    2. 11.1 Computing Limits
      1. Problem
      2. Solution
      3. Discussion
    3. 11.2 Working with Piecewise Functions
      1. Problem
      2. Solution
      3. Discussion
    4. 11.3 Using Power Series Representations
      1. Problem
      2. Solution
      3. Discussion
    5. 11.4 Differentiating Functions
      1. Problem
      2. Solution
      3. Discussion
    6. 11.5 Integration
      1. Problem
      2. Solution
      3. Discussion
    7. 11.6 Solving Differential Equations
      1. Problem
      2. Solution
      3. Discussion
    8. 11.7 Solving Minima and Maxima Problems
      1. Problem
      2. Solution
      3. Discussion
    9. 11.8 Solving Vector Calculus Problems
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 11.9 Solving Problems Involving Sums and Products
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    11. 11.10 Solving Difference Equations
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    12. 11.11 Generating Functions and Sequence Recognition
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  15. 12. Statistics and Data Analysis
    1. 12.0 Introduction
    2. 12.1 Computing Common Statistical Metrics of Numerical and Symbolic Data
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 12.2 Generating Pseudorandom Numbers with a Given Distribution
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    4. 12.3 Working with Probability Distributions
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 12.4 Demonstrating the Central Limit Theorem
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    6. 12.5 Computing Covariance and Correlation of Vectors and Matrices
      1. Problem
      2. Solution
      3. Discussion
    7. 12.6 Measuring the Shape of Data
      1. Problem
      2. Solution
      3. Discussion
    8. 12.7 Finding and Adjusting for Outliers
      1. Problem
      2. Solution
      3. Discussion
    9. 12.8 Fitting Data Using a Linear Model
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 12.9 Fitting Data Using a Nonlinear Model
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    11. 12.10 Creating Interpolation Functions from Data
      1. Problem
      2. Solution
      3. Discussion
    12. 12.11 Testing for Statistically Significant Difference Between Groups Using ANOVA
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    13. 12.12 Hypothesis Testing with Categorical Data
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    14. 12.13 Grouping Data into Clusters
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    15. 12.14 Creating Common Statistical Plots
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    16. 12.15 Quasi-Random Number Generation
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    17. 12.16 Creating Stochastic Simulations
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  16. 13. Science and Engineering
    1. 13.0 Introduction
    2. 13.1 Working with Element Data
      1. Problem
      2. Solution
      3. Discussion
    3. 13.2 Working with Chemical Data
      1. Problem
      2. Solution
      3. Discussion
    4. 13.3 Working with Particle Data
      1. Problem
      2. Solution
      3. Discussion
    5. 13.4 Working with Genetic Data and Protein Data
      1. Problem
      2. Solution
      3. Discussion
    6. 13.5 Modeling Predator-Prey Dynamics
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 13.6 Solving Basic Rigid Bodies Problems
      1. Problem
      2. Solution
      3. Discussion
    8. 13.7 Solving Problems in Kinematics
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    9. 13.8 Computing Normal Modes for Coupled Mass Problems
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 13.9 Modeling a Vibrating String
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    11. 13.10 Modeling Electrical Circuits
      1. Problem
      2. Solution
      3. Discussion
    12. 13.11 Modeling Truss Structures Using the Finite Element Method
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  17. 14. Financial Engineering
    1. 14.0 Introduction
      1. See Also
    2. 14.1 Leveraging Mathematica’s Bundled Financial Data
      1. Problem
      2. Solution
      3. Discussion
    3. 14.2 Importing Financial Data from Websites
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    4. 14.3 Present Value of Future Cash Flows
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 14.4 Interest Rate Sensitivity of Bonds
      1. Problem
      2. Solution
      3. Discussion
    6. 14.5 Constructing and Manipulating Yield Curves
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 14.6 Black-Scholes for European Option Pricing
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    8. 14.7 Computing the Implied Volatility of Financial Derivatives
      1. Problem
      2. Solution
      3. Discussion
    9. 14.8 Speeding Up NDSolve When Solving Black-Scholes and Other PDEs
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 14.9 Developing an Explicit Finite Difference Method for the Black-Scholes Formula
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    11. 14.10 Compiling an Implementation of Explicit Trinomial for Fast Pricing of American Options
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    12. 14.11 Modeling the Value-at-Risk of a Portfolio Using Monte Carlo and Other Methods
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    13. 14.12 Visualizing Trees for Interest-Rate Sensitive Instruments
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  18. 15. Interactivity
    1. 15.0 Introduction
    2. 15.1 Manipulating a Variable
      1. Problem
      2. Solution
      3. Discussion
    3. 15.2 Manipulating a Symbolic Expression
      1. Problem
      2. Solution
      3. Discussion
    4. 15.3 Manipulating a Plot
      1. Problem
      2. Solution
      3. Discussion
    5. 15.4 Creating Expressions for Which Value Dynamically Updates
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    6. 15.5 Intercepting the Values of a Control Attached to a Dynamic Expression
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 15.6 Controlling Updates of Dynamic Values
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    8. 15.7 Using DynamicModule As a Scoping Construct in Interactive Notebooks
      1. Problem
      2. Solution
      3. Discussion
    9. 15.8 Using Scratch Variables with DynamicModule to Balance Speed Versus Space
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 15.9 Making a Manipulate Self-Contained
      1. Problem
      2. Solution
      3. Discussion
    11. 15.10 Remembering the Values Found Using Manipulate
      1. Problem
      2. Solution
      3. Discussion
    12. 15.11 Improving Performance of Manipulate by Segregating Fast and Slow Operations
      1. Problem
      2. Solution
      3. Discussion
    13. 15.12 Localizing a Function in a Manipulate
      1. Problem
      2. Solution
      3. Discussion
    14. 15.13 Sharing DynamicModule Variables across Cell or Window Boundaries
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    15. 15.14 Creating Your Own Custom Controls
      1. Problem
      2. Solution
      3. Discussion
    16. 15.15 Animating an Expression
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    17. 15.16 Creating Custom Interfaces
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    18. 15.17 Managing a Large Number of Controls in Limited Screen Real Estate
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  19. 16. Parallel Mathematica
    1. 16.0 Introduction
    2. 16.1 Configuring Local Kernels
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 16.2 Configuring Remote Services Kernels
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    4. 16.3 Sending a Command to Multiple Kernels for Parallel Evaluation
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 16.4 Automatically Parallelizing Existing Serial Expressions
      1. Problem
      2. Solution
      3. Discussion
    6. 16.5 Distributing Data Segments in Parallel and Combining the Results
      1. Problem
      2. Solution
      3. Discussion
    7. 16.6 Implementing Data-Parallel Algorithms by Using ParallelMap
      1. Problem
      2. Solution
      3. Discussion
    8. 16.7 Decomposing a Problem into Parallel Data Sets
      1. Problem
      2. Solution
      3. Discussion
    9. 16.8 Choosing an Appropriate Distribution Method
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 16.9 Running Different Algorithms in Parallel and Accepting the First to Complete
      1. Problem
      2. Solution
      3. Discussion
    11. 16.10 Sharing Data Between Parallel Kernels
      1. Problem
      2. Solution
      3. Discussion
    12. 16.11 Preventing Race Conditions When Multiple Kernels Access a Shared Resource
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    13. 16.12 Organizing Parallel Processing Operations Using a Pipeline Approach
      1. Problem
      2. Solution
      3. Discussion
    14. 16.13 Processing a Massive Number of Files Using the Map-Reduce Technique
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    15. 16.14 Diagnosing Parallel Processing Performance
      1. Problem
      2. Solution
      3. Discussion
    16. 16.15 Measuring the Overhead of Parallelization in Your Environment
      1. Problem
      2. Solution
      3. Discussion
  20. 17. Interfacing Mathematica
    1. 17.0 Introduction
    2. 17.1 Calling External Command Line Programs from Mathematica
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 17.2 Launching Windows Programs from Mathematica
      1. Problem
      2. Solution
      3. Discussion
    4. 17.3 Connecting the Frontend to a Remote Kernel
      1. Problem
      2. Solution
      3. Discussion
    5. 17.4 Using Mathematica with C and C++
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    6. 17.5 Using Mathematica with Java
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 17.6 Using Mathematica to Interact with Microsoft’s .NET Framework
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    8. 17.7 Using the Mathematica Kernel from a .NET Application
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    9. 17.8 Querying a Database
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 17.9 Updating a Database
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    11. 17.10 Introspection of Databases
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  21. 18. Tricks of the Trade
    1. 18.0 Introduction
    2. 18.1 Cleaning Up During Incremental Development
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 18.2 Modifying Built-in Functions and Constants
      1. Problem
      2. Solution
      3. Discussion
    4. 18.3 Locating Undocumented Functions
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 18.4 Packaging Your Mathematica Solutions into Libraries for Others to Use
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    6. 18.5 Compiling Functions to Improve Performance
      1. Problem
      2. Solution
      3. Discussion
    7. 18.6 Automating and Standardizing the Appearance of Notebooks Using Stylesheets
      1. Problem
      2. Solution
      3. Discussion
    8. 18.7 Transforming Notebooks into Other Forms
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    9. 18.8 Calling into the Mathematica Frontend
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 18.9 Initializing and Cleaning Up Automatically
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    11. 18.10 Customizing Frontend User Interaction
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  22. 19. Debugging and Testing
    1. 19.0 Introduction
    2. 19.1 Printing as the First Recourse to Debugging
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    3. 19.2 Debugging Functions Called Many Times
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    4. 19.3 Stack Tracing to Debug Recursive Functions
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    5. 19.4 Taming Trace to Extract Useful Debugging Information
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    6. 19.5 Creating a Poor Man’s Mathematica Debugger
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    7. 19.6 Debugging Built-In Functions with Evaluation and Step Monitors
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    8. 19.7 Visual Debugging with Wolfram Workbench
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    9. 19.8 Writing Unit Tests to Help Ensure Correctness of Your Code
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
    10. 19.9 Creating MUnit Tests Where Success Is Not Based on Equality Testing
      1. Problem
      2. Solution
      3. Discussion
    11. 19.10 Organizing and Controlling MUnit Tests and Test Suites
      1. Problem
      2. Solution
      3. Discussion
    12. 19.11 Integrating Wolfram Workbench’s MUnit Package into the Frontend
      1. Problem
      2. Solution
      3. Discussion
      4. See Also
  23. A. About the Author
  24. Index
  25. About the Author
  26. Colophon
  27. Copyright