Numerical Analysis

Algorithms in C

Version 4.2

 

 

 

 

 

 

 

 

 

 

 

 

 

Examples Book

For

"Numerical Analysis", fourth edition

Richard L. Burden and J. Douglas Faires

1988

 

 

 

 

 

Written by:

Harold A. Toomey, MSEE

Care-Free Software

3rd Quarter 1991

 


 

 

Technical Publications:

Harold A. Toomey

 

Programming:

Harold A. Toomey

 

 

© Copyright 1988-1993, Harold A. Toomey - All rights reserved

 

This document contains proprietary information of Harold A. Toomey and is protected by Federal copyright law.  The contents of this document may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without prior written consent of Harold A. Toomey.  Limited rights exist for individual and university site licenses.  The software may be used or copied only in accordance with the terms of the license agreement.  Students may copy this software with the intent to join the $20.00 Club, paying for the right to use this software.  See the sample license agreements in the User's Manual.

 

The information in this document is subject to change without notice.

 

 

"Numerical Analysis Algorithms in C" Examples Book

Version 4.2

Document Number 9307-42C-EB2

 

 

Care-Free Software

Attn: Harold Allen Toomey

464 North 750 East

Lindon, UT  84042

1-801-785-0464


Table of Contents

 

 

 

CHAPTER 1    Mathematical Preliminaries

 

COMPLEX.C   - "Numerical Recipes in C" Complex Number Routines

EQEVAL.C      - Equation Evaluator Routines

GAUSSJ.C       - "Numerical Recipes in C" Gauss-Jordan Matrix Solver

NAAUTIL.C      - "Numerical Analysis Algorithms in C" Utilities I        (standard)

NAAUTIL2.C    - "Numerical Analysis Algorithms in C" Utilities II       (extended)

NAAUTIL3.C    - "Numerical Analysis Algorithms in C" Utilities III      (complex)

ROUND.C        - Rounds a floating point value to SIG significant digits

TRUNC.C         - Truncates a floating point value to SIG significant digits

011B.C*            - Taylor Polynomial Approximation                                          Algorithm 1.1B

 

 

CHAPTER 2    Solutions of Equations in One Variable

 

021.C*              -  Bisection (or Binary-Search)                                                 Algorithm 2.1

022.C*              -  Fixed-Point                                                                              Algorithm 2.2

023.C                -  Newton-Raphson                                                                    Algorithm 2.3

024.C*              -  Secant                                                                                     Algorithm 2.4

024B.C*            -  Method of False Position (or Regula Falsi)                         Algorithm 2.4B

024C.C             -  Modified Newton-Raphson Method                                      Algorithm 2.4C

025.C*              -  Steffensen                                                                               Algorithm 2.5

026.C*              -  Horner                                                                                      Algorithm 2.6

027.C*              -  Müller                                                                                       Algorithm 2.7

028A.C*            +  Complex Polynomial Solver (CPOLY)                    Algorithm 2.8A

 

 

CHAPTER 3    Interpolation and Polynomial Approximation

 

031.C*              -  Neville's Iterated Interpolation                                               Algorithm 3.1

031B.C*            -  Neville's Iterated Interpolation (with rounding)                     Algorithm 3.1B

031C.C*           -  Aitken's Iterated Interpolation                                                Algorithm 3.1C

032.C*              -  Newton's Interpolatory Divided-Difference Formula           Algorithm 3.2

033.C*              -  Hermite Interpolation                                                              Algorithm 3.3

034.C*              -  Natural Cubic Spline                                                              Algorithm 3.4

035.C*              -  Clamped Cubic Spline                                                          Algorithm 3.5

 

 

CHAPTER 4    Numerical Differentiation and Integration

 

040B1.C           -  1st Derivative Approximation (for functions)                       Algorithm 4.0B1

040B2.C*         -  1st Derivative Approximation (for tabulated data)  Algorithm 4.0B2

040B3.C           -  1st Derivative Approximation (for functions w/TOL)           Algorithm 4.0B3

040C1.C           -  2nd Derivative Approximation (for functions)                      Algorithm 4.0C1

040C2.C*         -  2nd Derivative Approximation (for tabulated data) Algorithm 4.0C2

040D1.C*         -  Richardson's Extrapolation                                       Algorithm 4.0D1

040D2.C*         -  Richardson's Extrapolation (with rounding)                         Algorithm 4.0D2

041.C*              -  Composite Simpson's Rule                                                  Algorithm 4.1

041B.C*            -  Composite Trapezoidal Rule                                                Algorithm 4.1B

041C.C*           -  Composite Midpoint Rule                                          Algorithm 4.1C

041D.C*           -  Newton-Cotes Formulas for Integrals (8 total)                     Algorithm 4.1D

042.C*              -  Adaptive Quadrature                                                              Algorithm 4.2

043.C*              -  Romberg                                                                                 Algorithm 4.3

043B.C*            -  Gaussian Quadrature                                                             Algorithm 4.3B

044.C                -  Composite Simpson's Rule for Double Integrals    Algorithm 4.4

044B.C             -  Composite Trapezoid Rule for Double Integrals     Algorithm 4.4B

044C.C             -  Gaussian Quadrature for Double Integrals                          Algorithm 4.4C

045.C                -  Composite Simpson's Rule for Triple Integrals                   Algorithm 4.5

045B.C             -  Composite Trapezoid Rule for Triple Integrals                   Algorithm 4.5B

045C.C             -  Gaussian Quadrature for Triple Integrals                             Algorithm 4.5C

 

 

CHAPTER 5    Initial-Value Problems for Ordinary Differential Equations

 

051.C*              -  Euler                                                                                         Algorithm 5.1

051B.C*            -  Midpoint, Modified Euler, and Heun's Methods      Algorithm 5.1B

052.C*              -  Runge-Kutta (Order Four)                                          Algorithm 5.2

053.C                -  Runge-Kutta-Fehlberg                                                           Algorithm 5.3

054.C*              -  Adam's Fourth-Order Predictor-Corrector                          Algorithm 5.4

054B.C*            -  Adams-Bashforth (all four) and Milne's Methods    Algorithm 5.4B

054C.C*           -  Milne-Simpson Predictor-Corrector                                     Algorithm 5.4C

055.C*              -  Adam's Variable Step-size Predictor-Corrector                Algorithm 5.5

056.C*              +  Extrapolation                                                                          Algorithm 5.6

057.C                -  Runge-Kutta for Systems of Differential Equations            Algorithm 5.7

057B.C             -  Euler's Variable Step-Size for Systems                              Algorithm 5.7B

058.C                -  Trapezoidal with Newton Iteration                                         Algorithm 5.8

 

 

CHAPTER 6    Direct Methods for Solving Linear Systems

 

060B.C*            -  Matrix Inverter                                                                          Algorithm 6.0B

060C.C*           -  Determinant of a Matrix                                                         Algorithm 6.0C

060D.C*           -  Matrix Multiplier                                                           Algorithm 6.0D

061.C*              -  Gaussian Elimination with Backward Substitution Algorithm 6.1

061B.C*            -  Gaussian Elimination with Backward Substitution Algorithm 6.1B 

                              (with rounding)

061C1.C*         - Gauss-Jordan Method                                                            Algorithm 6.1C1

061C2.C*         - Gauss-Jordan Method (with rounding)                      Algorithm 6.1C2

061D1.C*         - Gaussian-Elimination - Gauss-Jordan Hybrid Method        Algorithm 6.1D1

061D2.C*         - Gaussian-Elimination - Gauss-Jordan Hybrid Method        Algorithm 6.1D2

                             (with rounding)

062.C*              -  Gaussian Elimination with Maximal Column Pivoting        Algorithm 6.2

062B.C*            -  Gaussian Elimination with Maximal Column Pivoting        Algorithm 6.2B

                              (with rounding)

063.C*              -  Gaussian Elimination with Scaled Column Pivoting           Algorithm 6.3

063B.C*            -  Gaussian Elimination with Scaled Column Pivoting           Algorithm 6.3B

                              (with rounding)

064.C*              -  Direct Factorization                                                                Algorithm 6.4

064B.C*            -  Direct Factorization which solves AX=B                             Algorithm 6.4B

064C.C*           -  Direct Factorization with Maximal Column Pivoting           Algorithm 6.4C

                              (3rd edition)

065.C*              -  LDLt Factorization                                                                  Algorithm 6.5

065B.C*            -  LDLt Factorization which solves AX=B                               Algorithm 6.5B

066.C*              -  Choleski                                                                                  Algorithm 6.6

066B.C*            -  Choleski which solves AX=B                                                Algorithm 6.6B

067.C*              -  Crout Reduction for Tridiagonal Linear Systems    Algorithm 6.7

 

 

CHAPTER 7    Iterative Techniques in Matrix Algebra

 

070B.C*            -  Vector and Matrix Norms                                                       Algorithm 7.0B

071.C*              -  Jacobi Iterative                                                           Algorithm 7.1

072.C*              -  Gauss-Seidel Iterative                                                           Algorithm 7.2

073.C*              -  Successive Over Relaxation (SOR)                                     Algorithm 7.3

074.C*              -  Iterative Refinement (with rounding)                                     Algorithm 7.4

074B.C*            -  Iterative Refinement (single-precision)                    Algorithm 7.4B

 

 

CHAPTER 8    Approximation Theory

 

080B.C*            -  Least-Squares Polynomial Approximation                          Algorithm 8.0B

081.C*              +  Fast Fourier Transformation                                                Algorithm 8.1

 

 

CHAPTER 9    Approximating Eigenvalues

 

091.C*              -  Power Method                                                            Algorithm 9.1

091B.C*            -  Power Method with Aitken's Delta^2 Method                      Algorithm 9.1B

092.C*              -  Symmetric Power Method                                         Algorithm 9.2

093.C*              -  Inverse Power Method                                                           Algorithm 9.3

094.C*              -  Wielandt's Deflation                                                               Algorithm 9.4

094B.C*            -  Wielandt's Deflation using Power Method for                     Algorithm 9.4B

                              lambda1

095.C*              -  Householder Method                                                              Algorithm 9.5

095B.C*            -  Householder Method (3rd edition)                                        Algorithm 9.5B

095C.C*           -  Householder Method for Non-Symmetric Matrices            Algorithm 9.5C

                              (Upper Hessenberg)

095D.C*           -  Householder Method (with rounding)                       Algorithm 9.5D

096.C*              -  QR Algorithm                                                                          Algorithm 9.6

096B.C*            -  QL Algorithm (3rd edition)                                         Algorithm 9.6B

 

 

CHAPTER 10 Numerical Solutions of Nonlinear Systems of Equations

 

101.C                -  Newton's Method for Systems                                              Algorithm 10.1

101A.C             -  Steffensen's Method for Systems                                         Algorithm 10.1A

102.C                -  Broyden's Method for Systems                                             Algorithm 10.2

103.C                -  Steepest Descent Method (with F(x) and J(x))                    Algorithm 10.3

103B.C             -  Steepest Descent Method (with G(x) and gradG(x))          Algorithm 10.3B

 

 

CHAPTER 11 Boundary-Value Problems for Ordinary Differential Equations

 

111.C                -  Linear Shooting                                                                      Algorithm 11.1

112.C                -  Nonlinear Shooting with Newton's Method                          Algorithm 11.2

112B.C             -  Nonlinear Shooting with Secant Method                              Algorithm 11.2B

113.C                -  Linear Finite Difference                                                         Algorithm 11.3

113B.C             -  Linear Finite Difference (Richardson's Extrapolation)       Algorithm 11.3B

114.C                -  Nonlinear Finite Difference                                       Algorithm 11.4

114B.C             -  Nonlinear Finite Difference (Richardson's Extrap.)            Algorithm 11.4B

115.C                -  Piecewise Linear Rayleigh-Ritz                                            Algorithm 11.5

116.C                -  Cubic Spline Rayleigh-Ritz                                        Algorithm 11.6

 

 

CHAPTER 12 Numerical Solutions to Partial-Differential Equations

 

121.C                -  Poisson Equation Finite-Difference (Elliptic)                      Algorithm 12.1

122.C*              -  Heat Equation Backward-Difference (Parabolic)   Algorithm 12.2

122B.C*            -  Heat Equation Forward-Difference (Parabolic)                  Algorithm 12.2B

122C.C*           -  Heat Equation Richardson's Method (Parabolic)   Algorithm 12.2C

123.C*              -  Crank-Nicolson (Parabolic)                                                   Algorithm 12.3

124.C                -  Wave Equation Finite-Difference (Hyperbolic)                   Algorithm 12.4

125.C                -  Finite-Element                                                                        Algorithm 12.5

126A.C             -  Parabolic Equations With Newton Iteration in 1-D Algorithm 12.6A

127A.C             -  Parabolic Equations With Newton Iteration in 2-D Algorithm 12.7A

128A.C             -  Elliptic Equations With Newton Iteration in 2-D                   Algorithm 12.8A

129A.C             -  Biharmonic Equation Using Gauss-Jordan Method           Algorithm 12.9A

 

 

APPENDIX A  "Numerical Analysis Algorithms in C" Supporting C Source Code

 

041EE.C*         - Composite Simpson's Rule Using the Equation Evaluator Routines

041FUN.C        - Composite Simpson's Rule as a Function

CONVERT.C*  - Converts Files from 8-bit Extended ASCII to 7-bit Standard ASCII

EE.C*                - Command-Line Calculator using the Equation Evaluator Routines


This Examples Book contains the C source code for over a hundred algorithms found in the text Numerical Analysis, fourth edition, Richard L. Burden and J. Douglas Faires.  The algorithms include listings of the C source code as well as the accompanying output files for the examples problems given in the text.  The inputs can be easily extracted from the output listings or can be obtained from the diskettes.  Other needed programs and routines are printed in the appendix.

 

The '+'s above mean the program may need a larger stack when compiled and linked.

 

The '*'s after the above algorithms mean the programs need to be compiled only once.  After the initial compilation, the executable can be used over and over again.

 

See the User's Manual for a detailed description on how to use these algorithms most effectively.

 

The header file "naautil.c" is included inside every algorithm.  This is the only file which may need to be modified.  It contains some flags which can be set to make the code more portable for various compilers.  It also contains flags which allow the user to turn on or off the following options:

 

       1.  Prompt for an optional title

       2.  Save output to a file

       3.  Use the Equation Evaluator Routines

 

The following compilers have successfully run all of the "Numerical Analysis Algorithms in C" v4.2 programs:

 

       1.  Microsoft C 5.0 for MS-DOS on an IBM PC

       2.  THINK C 4.0 on a Macintosh SE         (Set ANSI_FUNCT == TRUE)

       3.  MIPS C compiler (IRIX 3.3.1) on a Silicon Graphics 4D workstation

       4.  VAX C v3.1 and v3.2 compilers on a VAX


CHAPTER 1

 

Mathematical

Preliminaries

 



CHAPTER 1    Mathematical Preliminaries

 

COMPLEX.C   - "Numerical Recipes in C" Complex Number Routines

EQEVAL.C      - Equation Evaluator Routines

GAUSSJ.C       - "Numerical Recipes in C" Gauss-Jordan Matrix Solver

NAAUTIL.C      - "Numerical Analysis Algorithms in C" Utilities I        (standard)

NAAUTIL2.C    - "Numerical Analysis Algorithms in C" Utilities II       (extended)

NAAUTIL3.C    - "Numerical Analysis Algorithms in C" Utilities III      (complex)

ROUND.C        - Rounds a floating point value to SIG significant digits

TRUNC.C         - Truncates a floating point value to SIG significant digits

011B.C*            - Taylor Polynomial Approximation                                          Algorithm 1.1B

 


CHAPTER 2

 

Solutions

of Equations

in One Variable

 



CHAPTER 2    Solutions of Equations in One Variable

 

021.C*              -  Bisection (or Binary-Search)                                                 Algorithm 2.1

022.C*              -  Fixed-Point                                                                              Algorithm 2.2

023.C                -  Newton-Raphson                                                                    Algorithm 2.3

024.C*              -  Secant                                                                                     Algorithm 2.4

024B.C*            -  Method of False Position (or Regula Falsi)                         Algorithm 2.4B

024C.C             -  Modified Newton-Raphson Method                                      Algorithm 2.4C

025.C*              -  Steffensen                                                                               Algorithm 2.5

026.C*              -  Horner                                                                                      Algorithm 2.6

027.C*              -  Müller                                                                                       Algorithm 2.7

028A.C*            +  Complex Polynomial Solver (CPOLY)                    Algorithm 2.8A

 


CHAPTER 3

 

Interpolation

and Polynomial

Approximation

 



CHAPTER 3    Interpolation and Polynomial Approximation

 

031.C*              -  Neville's Iterated Interpolation                                               Algorithm 3.1

031B.C*            -  Neville's Iterated Interpolation (with rounding)                     Algorithm 3.1B

031C.C*           -  Aitken's Iterated Interpolation                                                Algorithm 3.1C

032.C*              -  Newton's Interpolatory Divided-Difference Formula           Algorithm 3.2

033.C*              -  Hermite Interpolation                                                              Algorithm 3.3

034.C*              -  Natural Cubic Spline                                                              Algorithm 3.4

035.C*              -  Clamped Cubic Spline                                                          Algorithm 3.5

 


CHAPTER 4

 

Numerical

Differentiation

and Integration

 



CHAPTER 4    Numerical Differentiation and Integration

 

040B1.C           -  1st Derivative Approximation (for functions)                       Algorithm 4.0B1

040B2.C*         -  1st Derivative Approximation (for tabulated data)  Algorithm 4.0B2

040B3.C           -  1st Derivative Approximation (for functions w/TOL)           Algorithm 4.0B3

040C1.C           -  2nd Derivative Approximation (for functions)                      Algorithm 4.0C1

040C2.C*         -  2nd Derivative Approximation (for tabulated data) Algorithm 4.0C2

040D1.C*         -  Richardson's Extrapolation                                       Algorithm 4.0D1

040D2.C*         -  Richardson's Extrapolation (with rounding)                         Algorithm 4.0D2

041.C*              -  Composite Simpson's Rule                                                  Algorithm 4.1

041B.C*            -  Composite Trapezoidal Rule                                                Algorithm 4.1B

041C.C*           -  Composite Midpoint Rule                                          Algorithm 4.1C

041D.C*           -  Newton-Cotes Formulas for Integrals (8 total)                     Algorithm 4.1D

042.C*              -  Adaptive Quadrature                                                              Algorithm 4.2

043.C*              -  Romberg                                                                                 Algorithm 4.3

043B.C*            -  Gaussian Quadrature                                                             Algorithm 4.3B

044.C                -  Composite Simpson's Rule for Double Integrals    Algorithm 4.4

044B.C             -  Composite Trapezoid Rule for Double Integrals     Algorithm 4.4B

044C.C             -  Gaussian Quadrature for Double Integrals                          Algorithm 4.4C

045.C                -  Composite Simpson's Rule for Triple Integrals                   Algorithm 4.5

045B.C             -  Composite Trapezoid Rule for Triple Integrals                   Algorithm 4.5B

045C.C             -  Gaussian Quadrature for Triple Integrals                             Algorithm 4.5C

 


CHAPTER 5

 

Initial-Value Problems

for Ordinary

Differential Equations

 



CHAPTER 5    Initial-Value Problems for Ordinary Differential Equations

 

051.C*              -  Euler                                                                                         Algorithm 5.1

051B.C*            -  Midpoint, Modified Euler, and Heun's Methods      Algorithm 5.1B

052.C*              -  Runge-Kutta (Order Four)                                          Algorithm 5.2

053.C                -  Runge-Kutta-Fehlberg                                                           Algorithm 5.3

054.C*              -  Adam's Fourth-Order Predictor-Corrector                          Algorithm 5.4

054B.C*            -  Adams-Bashforth (all four) and Milne's Methods    Algorithm 5.4B

054C.C*           -  Milne-Simpson Predictor-Corrector                                     Algorithm 5.4C

055.C*              -  Adam's Variable Step-size Predictor-Corrector                Algorithm 5.5

056.C*              +  Extrapolation                                                                          Algorithm 5.6

057.C                -  Runge-Kutta for Systems of Differential Equations            Algorithm 5.7

057B.C             -  Euler's Variable Step-Size for Systems                              Algorithm 5.7B

058.C                -  Trapezoidal with Newton Iteration                                         Algorithm 5.8

 


CHAPTER 6

 

Direct Methods

for Solving

Linear Systems

 



CHAPTER 6    Direct Methods for Solving Linear Systems

 

060B.C*            -  Matrix Inverter                                                                          Algorithm 6.0B

060C.C*           -  Determinant of a Matrix                                                         Algorithm 6.0C

060D.C*           -  Matrix Multiplier                                                           Algorithm 6.0D

061.C*              -  Gaussian Elimination with Backward Substitution Algorithm 6.1

061B.C*            -  Gaussian Elimination with Backward Substitution Algorithm 6.1B 

                              (with rounding)

061C1.C*         - Gauss-Jordan Method                                                            Algorithm 6.1C1

061C2.C*         - Gauss-Jordan Method (with rounding)                      Algorithm 6.1C2

061D1.C*         - Gaussian-Elimination - Gauss-Jordan Hybrid Method        Algorithm 6.1D1

061D2.C*         - Gaussian-Elimination - Gauss-Jordan Hybrid Method        Algorithm 6.1D2

                             (with rounding)

062.C*              -  Gaussian Elimination with Maximal Column Pivoting        Algorithm 6.2

062B.C*            -  Gaussian Elimination with Maximal Column Pivoting        Algorithm 6.2B

                              (with rounding)

063.C*              -  Gaussian Elimination with Scaled Column Pivoting           Algorithm 6.3

063B.C*            -  Gaussian Elimination with Scaled Column Pivoting           Algorithm 6.3B

                              (with rounding)

064.C*              -  Direct Factorization                                                                Algorithm 6.4

064B.C*            -  Direct Factorization which solves AX=B                             Algorithm 6.4B

064C.C*           -  Direct Factorization with Maximal Column Pivoting           Algorithm 6.4C

                              (3rd edition)

065.C*              -  LDLt Factorization                                                                  Algorithm 6.5

065B.C*            -  LDLt Factorization which solves AX=B                               Algorithm 6.5B

066.C*              -  Choleski                                                                                  Algorithm 6.6

066B.C*            -  Choleski which solves AX=B                                                Algorithm 6.6B

067.C*              -  Crout Reduction for Tridiagonal Linear Systems    Algorithm 6.7

 


CHAPTER 7

 

Iterative Techniques

in Matrix Algebra

 



CHAPTER 7    Iterative Techniques in Matrix Algebra

 

070B.C*            -  Vector and Matrix Norms                                                       Algorithm 7.0B

071.C*              -  Jacobi Iterative                                                           Algorithm 7.1

072.C*              -  Gauss-Seidel Iterative                                                           Algorithm 7.2

073.C*              -  Successive Over Relaxation (SOR)                                     Algorithm 7.3

074.C*              -  Iterative Refinement (with rounding)                                     Algorithm 7.4

074B.C*            -  Iterative Refinement (single-precision)                    Algorithm 7.4B

 


CHAPTER 8

 

Approximation

Theory

 



CHAPTER 8    Approximation Theory

 

080B.C*            -  Least-Squares Polynomial Approximation                          Algorithm 8.0B

081.C*              +  Fast Fourier Transformation                                                Algorithm 8.1

 


CHAPTER 9

 

Approximating

Eigenvalues

 



CHAPTER 9    Approximating Eigenvalues

 

091.C*              -  Power Method                                                            Algorithm 9.1

091B.C*            -  Power Method with Aitken's Delta^2 Method                      Algorithm 9.1B

092.C*              -  Symmetric Power Method                                         Algorithm 9.2

093.C*              -  Inverse Power Method                                                           Algorithm 9.3

094.C*              -  Wielandt's Deflation                                                               Algorithm 9.4

094B.C*            -  Wielandt's Deflation using Power Method for                     Algorithm 9.4B

                              lambda1

095.C*              -  Householder Method                                                              Algorithm 9.5

095B.C*            -  Householder Method (3rd edition)                                        Algorithm 9.5B

095C.C*           -  Householder Method for Non-Symmetric Matrices            Algorithm 9.5C

                              (Upper Hessenberg)

095D.C*           -  Householder Method (with rounding)                       Algorithm 9.5D

096.C*              -  QR Algorithm                                                                          Algorithm 9.6

096B.C*            -  QL Algorithm (3rd edition)                                         Algorithm 9.6B

 


CHAPTER 10

 

Numerical Solutions

of Nonlinear Systems

of Equations

 



CHAPTER 10 Numerical Solutions of Nonlinear Systems of Equations

 

101.C                -  Newton's Method for Systems                                              Algorithm 10.1

101A.C             -  Steffensen's Method for Systems                                         Algorithm 10.1A

102.C                -  Broyden's Method for Systems                                             Algorithm 10.2

103.C                -  Steepest Descent Method (with F(x) and J(x))                    Algorithm 10.3

103B.C             -  Steepest Descent Method (with G(x) and gradG(x))          Algorithm 10.3B

 


CHAPTER 11

 

Boundary-Value

Problems for Ordinary

Differential Equations

 



CHAPTER 11 Boundary-Value Problems for Ordinary Differential Equations

 

111.C                -  Linear Shooting                                                                      Algorithm 11.1

112.C                -  Nonlinear Shooting with Newton's Method                          Algorithm 11.2

112B.C             -  Nonlinear Shooting with Secant Method                              Algorithm 11.2B

113.C                -  Linear Finite Difference                                                         Algorithm 11.3

113B.C             -  Linear Finite Difference (Richardson's Extrapolation)       Algorithm 11.3B

114.C                -  Nonlinear Finite Difference                                       Algorithm 11.4

114B.C             -  Nonlinear Finite Difference (Richardson's Extrap.)            Algorithm 11.4B

115.C                -  Piecewise Linear Rayleigh-Ritz                                            Algorithm 11.5

116.C                -  Cubic Spline Rayleigh-Ritz                                        Algorithm 11.6

 


CHAPTER 12

 

Numerical Solutions

to Partial-Differential

Equations

 



CHAPTER 12 Numerical Solutions to Partial-Differential Equations

 

121.C                -  Poisson Equation Finite-Difference (Elliptic)                      Algorithm 12.1

122.C*              -  Heat Equation Backward-Difference (Parabolic)   Algorithm 12.2

122B.C*            -  Heat Equation Forward-Difference (Parabolic)                  Algorithm 12.2B

122C.C*           -  Heat Equation Richardson's Method (Parabolic)   Algorithm 12.2C

123.C*              -  Crank-Nicolson (Parabolic)                                                   Algorithm 12.3

124.C                -  Wave Equation Finite-Difference (Hyperbolic)                   Algorithm 12.4

125.C                -  Finite-Element                                                                        Algorithm 12.5

126A.C             -  Parabolic Equations With Newton Iteration in 1-D Algorithm 12.6A

127A.C             -  Parabolic Equations With Newton Iteration in 2-D Algorithm 12.7A

128A.C             -  Elliptic Equations With Newton Iteration in 2-D                   Algorithm 12.8A

129A.C             -  Biharmonic Equation Using Gauss-Jordan Method           Algorithm 12.9A

 


APPENDIX A

 

"Numerical Analysis

Algorithms in C"

Supporting

C Source Code

 



APPENDIX A  "Numerical Analysis Algorithms in C" Supporting C Source Code

 

041EE.C*         - Composite Simpson's Rule Using the Equation Evaluator Routines

041FUN.C        - Composite Simpson's Rule as a Function

CONVERT.C*  - Converts Files from 8-bit Extended ASCII to 7-bit Standard ASCII

EE.C*                - Command-Line Calculator using the Equation Evaluator Routines