Ordinary and Partial Differential Equation Routines in C, C++, Fortran, Java, Maple, and MATLAB
eBook - ePub

Ordinary and Partial Differential Equation Routines in C, C++, Fortran, Java, Maple, and MATLAB

  1. 528 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Ordinary and Partial Differential Equation Routines in C, C++, Fortran, Java, Maple, and MATLAB

Book details
Book preview
Table of contents
Citations

About This Book

This book provides a set of ODE/PDE integration routines in the six most widely used computer languages, enabling scientists and engineers to apply ODE/PDE analysis toward solving complex problems. This text concisely reviews integration algorithms, then analyzes the widely used Runge-Kutta method. It first presents a complete code before discussin

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Ordinary and Partial Differential Equation Routines in C, C++, Fortran, Java, Maple, and MATLAB by H.J. Lee,W.E. Schiesser in PDF and/or ePUB format, as well as other popular books in Mathématiques & Mathématiques générales. We have over one million books available in our catalogue for you to explore.

Information

Year
2003
ISBN
9781135437794

1

Some Basics of ODE Integration


The central topic of this book is the programming and use of a set of library routines for the numerical solution (integration) of systems of initial value ordinary differential equations (ODEs). We start by reviewing some of the basic concepts of ODEs, including methods of integration, that are the mathematical foundation for an understanding of the ODE integration routines.

1.1 General Initial Value ODE Problem


The general problem for a single initial-value ODE is simply stated as
(1.1)(1.2)
image
where
y = dependent variable
t = independent variable
f (y, t) = derivative function
t0 = initial value of the independent variable
y0 = initial value of the dependent variable

Equations 1.1 and 1.2 will be termed a 1x1 problem (one equation in one unknown). The solution of this 1x1 problem is the dependent variable as a function of the independent variable, y(t) (this function when substituted into Equations 1.1 and 1.2 satisfies these equations). This solution may be a mathematical function, termed an analytical solution.
To illustrate these ideas, we consider the 1x1 problem, from Braun1 (which will be discussed subsequently in more detail)

(1.3)(1.4)
image
where λ and α are positive constants.
Equation 1.3 is termed a first-order, linear, ordinary differential equation with variable coefficients. These terms are explained below.

See Table

The analytical solution to Equations 1.3 and 1.4 is from Braun:1
(1.5)
image
where exp(x) = ex. Equation 1.5 is easily verified as the solution to Equations 1.3 and 1.4 by substitution in these equations:
image
thus confirming Equation 1.5 satisfies Equations 1.3 and 1.4.
As an example of a nxn problem (n ODEs in n unknowns), we will also subsequently consider in detail the 2x2 system

(1.6)
image
The solution to Equations 1.6 is again the dependent variables, y1, y2, as a function of the independent variable, t. Since Equations 1.6 are linear, constant coefficient ODEs, their solution is easily derived, e.g., by assuming exponential functions in t or by the Laplace transform. If we assume exponential functions
image
(1.7)
image
where c1, c2, and λ are constants to be determined, substitution of Equations 1.7 in Equations 1.6 gives
image
image
Cancellation of eλt gives a system of algebraic equations (this is the reason assuming exponential solutions works in the case of linear, constant coefficient ODEs)
image
or
image
(1.8)
image
Equations 1.8 are the 2x2 case of the linear algebraic eigenvalue problem

(1.9)

(AλI)c = 0
where
image
image
image
image
n = 2 for Equations 1.8, and we use a bold faced symbol for a matrix or a vector.
The preceding matrices and vectors are

A nxn coefficient matrix
I nxn identity matrix
c nx1 solution vector
0 nx1 zero vector

The reader should confirm that the matrices and vectors in Equation 1.9 have the correct dimensions for all of the indicated operations (e.g., matrix additions, matrix-vector multiples).
Note that Equation 1.9 is a linear, homogeneous algebraic system (homogeneous means that the right-hand side (RHS) is the zero vector). Thus, Equation 1.9, or its 2x2 counterpart, Equations 1.8, will have nontrivial solutions (c ≠ 0) if and only if (iff) the determinant of the coefficient matrix is zero, i.e.,
(1.10)

|AλI| = 0

Equation 1.10 is the characteristic equation for Equation 1.9 (note that it is a scalar equation). The values of λthat satisfy Equation 1.10 are the eigenvalues of Equation 1.9. For the 2x2 problem of Equations 1.8, Equation 1.10 is
image
or
(1.11)

image
Equation 1.11 is the characteristic equation or characteristic polynomial for Equations 1.8; note that since Equations 1.8 are a 2x2 linear homogeneous algebraic system, the characteristic equation (Equation 1.11) is a second-order polynomial. Similarly, since Equation 1.9 is a nxn linear homogeneous algebraic system, its characteristic equation is a nth-order polynomial.
Equation 1.11 can be factored by the quadratic formula

(1.12)
image
Thus, as expected, the 2x2 system of Equations 1.8 has two eigenvalues. In general, the nxn algebraic system, Equation 1.9, will have n eigenvalues, λ1, λ2, . . ., λn (which may be real or complex conjugates, distinct or repeated).
Since Equations 1.6 are linear constant coefficient ODEs, their general solution will be a linear combination of exponential functions, one for each eigenvalue

(1.13)

image
Equations 1.13 have four constants which occur in pairs, one pair for each eigenvalue. Thus, the pair [c11 c21]T is the eigenvector for eigenvalue λ1 while [c12 c22]T is the eigenvector for eigenvalue λ2. In general, the nxn system of Equation 1.9 will have a nx1 eigenvector for each of its n eigenvalues. Note that the naming convention for any constant in an eigenvector, ci j, is the ith constant for the jth eigenvalue. We can restate the two eigenvectors for Equation 1.13 (or Equations 1.8) as

(1.14)
image
Finally, the four constants in eigenvectors (Equations 1.14) are related through the initial conditions of Equations 1.6 and either of Equations 1.8

(1.15)
image
To simplify the analysis somewhat, we consider the special case a11 = a22 = −a, a21 = a12 = b, where a and b are constants. Then from Equation 1.12,

(1.16)
image
From the first of Equations 1.8 for λ = λ1

(a11λ1)c11 + a12c21 = 0
or

(a + (ab))c11 + bc21 = 0
c11 = c21
Similarly, for λ = λ2

(a11λ2)c12 + a12c22 = 0
or

(a + (a + b))c12 + bc22 = 0
c12 = −c22
Substitution of these results in Equations 1.15 gives

y10 = c11c22
y20 = c11 + c22
or
image
Finally, the solution from Equations 1.13 is
(1.17)
image
Equations 1.17 can easily be checked by substitution in Equations 1.6 (with a11 = a22 = −a, a21 = a12 = b) and application of the initial conditions at t = 0:
image
For the initial conditions of Equations 1.6
image
as required.
The ODE problems of Eq...

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Preface
  5. 1
  6. 2
  7. 3
  8. 4
  9. 5
  10. Appendix A
  11. Appendix B
  12. Appendix C
  13. Appendix D
  14. Appendix E
  15. Appendix F