You are previewing Computing for Numerical Methods Using Visual C++.
O'Reilly logo
Computing for Numerical Methods Using Visual C++

Book Description

A visual, interdisciplinary approach to solving problems in numerical methods

Computing for Numerical Methods Using Visual C++ fills the need for a complete, authoritative book on the visual solutions to problems in numerical methods using C++. In an age of boundless research, there is a need for a programming language that can successfully bridge the communication gap between a problem and its computing elements through the use of visual-ization for engineers and members of varying disciplines, such as biologists, medical doctors, mathematicians, economists, and politicians. This book takes an interdisciplinary approach to the subject and demonstrates how solving problems in numerical methods using C++ is dominant and practical for implementation due to its flexible language format, object-oriented methodology, and support for high numerical precisions.

In an accessible, easy-to-follow style, the authors cover:

  • Numerical modeling using C++

  • Fundamental mathematical tools

  • MFC interfaces

  • Curve visualization

  • Systems of linear equations

  • Nonlinear equations

  • Interpolation and approximation

  • Differentiation and integration

  • Eigenvalues and Eigenvectors

  • Ordinary differential equations

  • Partial differential equations

This reader-friendly book includes a companion Web site, giving readers free access to all of the codes discussed in the book as well as an equation parser called "MyParser" that can be used to develop various numerical applications on Windows. Computing for Numerical Methods Using Visual C++ serves as an excellent reference for students in upper undergraduate- and graduate-level courses in engineering, science, and mathematics. It is also an ideal resource for practitioners using Microsoft Visual C++.

Table of Contents

  1. Copyright
  2. TRADEMARKS
  3. PREFACE
  4. CODES FOR DOWNLOAD
  5. 1. Modeling and Simulation
    1. 1.1. NUMERICAL APPROXIMATIONS
    2. 1.2. C++ FOR NUMERICAL MODELING
    3. 1.3. MATHEMATICAL MODELING
    4. 1.4. SIMULATION AND ITS VISUALIZATION
    5. 1.5. NUMERICAL METHODS
    6. 1.6. NUMERICAL APPLICATIONS
      1. 1.6.1. Bacteria Population Growth
      2. 1.6.2. Computational Fluid Dynamics
      3. 1.6.3. Finite-Element Modeling
      4. 1.6.4. Printed-Circuit Board Design
      5. 1.6.5. Wireless Sensor Networks
      6. 1.6.6. Flood Control Modeling
  6. REFERENCES
  7. 2. Fundamental Tools for Mathematical Computing
    1. 2.1. C++ FOR HIGH-PERFORMANCE COMPUTING
    2. 2.2. DYNAMIC MEMORY ALLOCATION
      1. 2.2.1. Allocation for One-Dimensional Arrays
      2. 2.2.2. Allocation for Higher Dimensional Arrays
      3. 2.2.3. Case Study: Matrix Multiplication Problem
    3. 2.3. MATRIX REDUCTION PROBLEMS
      1. 2.3.1. Vector and Matrix Norms
      2. 2.3.2. Row Operations
      3. 2.3.3. Matrix Reduction to Triangular Form
      4. 2.3.4. Computing the Determinant of a Matrix
      5. 2.3.5. Computing the Inverse of a Matrix
    4. 2.4. MATRIX ALGEBRA
      1. 2.4.1. Data Passing Between Functions
      2. 2.4.2. Matrix Addition and Substraction
      3. 2.4.3. Matrix Multiplication
      4. 2.4.4. Matrix Inverse
      5. 2.4.5. Putting the Pieces Together
    5. 2.5. ALGEBRA OF COMPLEX NUMBERS
      1. 2.5.1. Addition and substraction
      2. 2.5.2. Multiplication
      3. 2.5.3. Conjugate
      4. 2.5.4. Division
      5. 2.5.5. Inverse of a Complex Number
      6. 2.5.6. Performing Complex Number Arithmetic
    6. 2.6. NUMBER SORTING
    7. 2.7. SUMMARY
    8. 2.8. PROGRAMMING CHALLENGES
  8. 3. Numerical Interface Designs
    1. 3.1. MICROSOFT FOUNDATION CLASSES
    2. 3.2. GRAPHICS DEVICE INTERFACE
      1. 3.2.1. Color Management
    3. 3.3. WRITING A BASIC WINDOWS PROGRAM
      1. 3.3.1. Code3A: The Skeleton Program
      2. 3.3.2. Code3A: Discussion
    4. 3.4. DISPLAYING TEXT AND GRAPHICS
    5. 3.5. EVENTS AND METHODS
    6. 3.6. STANDARD CONTROL RESOURCES
      1. 3.6.1. Push Button
      2. 3.6.2. Edit Box
      3. 3.6.3. Static Box
      4. 3.6.4. List View Box
      5. 3.6.5. Code3B: Simple Multiplication Calculator
    7. 3.7. MENU AND FILE I/O
      1. 3.7.1. File Input and Output
      2. 3.7.2. Code3C: Displaying Menu and File I/O
    8. 3.8. KEYBOARD CONTROL
      1. 3.8.1. Code3D: Creativity with Keyboard Graphics
    9. 3.9. MFC COMPATIBILITY WITH .NET
      1. 3.9.1. Accessing .Net from MFC: Code3E
      2. 3.9.2. Accessing MFC from .Net
    10. 3.10. SUMMARY
  9. 4. Curve Visualization
    1. 4.1. TOOLS FOR VISUALIZATION
    2. 4.2. MYPARSER
      1. 4.2.1. Code4A: Scientific Calculator
    3. 4.3. DRAWING CURVES
      1. 4.3.1. Strategies for Drawing a Curve
      2. 4.3.2. Cartesian-to-Windows Coordinates Conversion
      3. 4.3.3. Code4B: Drawing a Polynomial
    4. 4.4. GENERATING CURVES USING MYPARSER
    5. 4.5. SUMMARY
    6. 4.6. PROGRAMMING CHALLENGES
  10. 5. Systems of Linear Equations
    1. 5.1. INTRODUCTION
    2. 5.2. EXISTENCE OF SOLUTIONS
    3. 5.3. GAUSSIAN ELIMINATION TECHNIQUES
      1. 5.3.1. Gaussian Elimination Method
      2. 5.3.2. Gaussian Elimination Method with Partial Pivoting
      3. 5.3.3. Gauss-Jordan Method
    4. 5.4. LU FACTORIZATION METHODS
      1. 5.4.1. LU Factorization Concepts
      2. 5.4.2. Crout Method
      3. 5.4.3. Doolittle Method
      4. 5.4.4. Cholesky Method
      5. 5.4.5. Thomas Algorithm
    5. 5.5. ITERATIVE TECHNIQUES
      1. 5.5.1. Jacobi Method
      2. 5.5.2. Gauss-Seidel Method
    6. 5.6. VISUALIZING THE SOLUTION: CODE5
    7. 5.7. SUMMARY
    8. 5.8. NUMERICAL EXERCISES
    9. 5.9. PROGRAMMING CHALLENGES
  11. 6. Nonlinear Equations
    1. 6.1. INTRODUCTION
    2. 6.2. EXISTENCE OF SOLUTIONS
    3. 6.3. BISECTION METHOD
    4. 6.4. FALSE POSITION METHOD
    5. 6.5. NEWTON-RAPHSON METHOD
    6. 6.6. SECANT METHOD
    7. 6.7. FIXED-POINT ITERATION METHOD
    8. 6.8. VISUAL SOLUTION: CODE6
    9. 6.9. SUMMARY
    10. 6.10. NUMERICAL EXERCISES
    11. 6.11. PROGRAMMING CHALLENGES
  12. 7. Interpolation and Approximation
    1. 7.1. CURVE FITTING
    2. 7.2. LAGRANGE INTERPOLATION
    3. 7.3. NEWTON INTERPOLATIONS
      1. 7.3.1. Divided-Difference Method
      2. 7.3.2. Forward-Difference Method
      3. 7.3.3. Backward-Difference Method
      4. 7.3.4. Stirling's Method
    4. 7.4. CUBIC SPLINE
    5. 7.5. LEAST-SQUARES APPROXIMATION
    6. 7.6. VISUAL SOLUTION: CODE7
      1. 7.6.1. Mouse's Left-Click Event
      2. 7.6.2. Main Window Update
      3. 7.6.3. Lagrange's Solution
      4. 7.6.4. Newton's Divided-Difference Solution
      5. 7.6.5. Cubic Spline Solution
      6. 7.6.6. Least-Squares Solution
    7. 7.7. SUMMARY
    8. 7.8. NUMERICAL EXERCISES
    9. 7.9. PROGRAMMING CHALLENGES
  13. 8. Differentiation and Integration
    1. 8.1. INTRODUCTION
    2. 8.2. NUMERICAL DIFFERENTIATION
    3. 8.3. NUMERICAL INTEGRATION
      1. 8.3.1. Trapezium Method
      2. 8.3.2. Simpson's Method
      3. 8.3.3. Gaussian Quadrature
    4. 8.4. VISUAL SOLUTION: CODE8
      1. 8.4.1. Differentiation
      2. 8.4.2. Integration
      3. 8.4.3. Table and Graph Output
    5. 8.5. SUMMARY
    6. 8.6. NUMERICAL EXERCISES
    7. 8.7. PROGRAMMING CHALLENGES
  14. 9. Eigenvalues and Eigenvectors
    1. 9.1. EIGENVALUES AND THEIR SIGNIFICANCE
    2. 9.2. EXACT SOLUTION AND ITS EXISTENCE
    3. 9.3. POWER METHOD
    4. 9.4. SHIFTED POWER METHOD
    5. 9.5. QR METHOD
      1. 9.5.1. Householder Transformation
      2. 9.5.2. QR Factorization
    6. 9.6. VISUAL SOLUTION: CODE9
      1. 9.6.1. Power Method
      2. 9.6.2. QR Method
      3. 9.6.3. Output
    7. 9.7. SUMMARY
    8. 9.8. NUMERICAL EXERCISES
    9. 9.9. PROGRAMMING CHALLENGES
  15. 10. Ordinary Differential Equations
    1. 10.1. INTRODUCTION
    2. 10.2. INITIAL-VALUE PROBLEM FOR FIRST-ORDER ODE
    3. 10.3. TAYLOR SERIES METHOD
      1. 10.3.1. Euler's Method
    4. 10.4. RUNGE-KUTTA OF ORDER 2 METHOD
      1. 10.4.1. Heun's Method
      2. 10.4.2. Modified Euler-Cauchy Method
    5. 10.5. RUNGE-KUTTA OF ORDER 4 METHOD
    6. 10.6. PREDICTOR-CORRECTOR MULTISTEP METHOD
      1. 10.6.1. Adams-Bashforth-Moulton Method
    7. 10.7. SYSTEM OF FIRST-ORDER ODEs
    8. 10.8. SECOND-ORDER ODE
    9. 10.9. INITIAL-VALUE PROBLEM FOR SECOND-ORDER ODE
    10. 10.10. FINITE-DIFFERENCE METHOD FOR SECOND-ORDER ODE
    11. 10.11. DIFFERENTIATED BOUNDARY CONDITIONS
    12. 10.12. VISUAL SOLUTION: CODE10
      1. 10.12.1. Taylor Series of Order 3 Solution
      2. 10.12.2. Runge-Kutta of Order 2 Solution
      3. 10.12.3. Runge-Kutta of Order 4 Solution
      4. 10.12.4. Adams-Bashforth-Moulton Multistep Solution
      5. 10.12.5. ODE System Solution
      6. 10.12.6. ODE2 to ODE1 Solution
      7. 10.12.7. ODE2 Finite-Difference 1 Solution
      8. 10.12.8. ODE2 Finite-Difference 2 Solution
    13. 10.13. SUMMARY
    14. 10.14. NUMERICAL EXERCISES
    15. 10.15. PROGRAMMING CHALLENGES
  16. 11. Partial Differential Equations
    1. 11.1. INTRODUCTION
      1. 11.1.1. Boundary-Value Problem
      2. 11.1.2. Central-Difference Rules
    2. 11.2. POISSON'S EQUATION
    3. 11.3. LAPLACE'S EQUATION
    4. 11.4. HEAT EQUATION
      1. 11.4.1. Crank−Nicolson's Method
    5. 11.5. WAVE EQUATION
    6. 11.6. VISUAL SOLUTION: CODE11
      1. 11.6.1. Solution to Poisson's Equation
      2. 11.6.2. Solution to the Heat Equation
      3. 11.6.3. Solution to the Wave Equation
    7. 11.7. SUMMARY
    8. 11.8. NUMERICAL EXERCISES
    9. 11.9. PROGRAMMING CHALLENGES