12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

systems of equations with matrices; data fitting 181determine these derivatives in terms of the N tabulated g i values. The matching ofg i at the nodes that connect one interval to the next provides the equationsg i (x i+1 )=g i+1 (x i+1 ), i=1,N− 1. (8.40)The matching of the first and second derivatives at each interval’s boundariesprovides the equationsg ′ i−1(x i )=g ′ i(x i ), g ′′i−1(x i )=g ′′i (x i ). (8.41)The additional equations needed to determine all constants is obtained by matchingthe third derivatives at adjacent nodes. Values for the third derivatives are foundby approximating them in terms of the second derivatives:g ′′′i≃ g′′ i+1 − g′′ i. (8.42)x i+1 − x iAs discussed in Chapter 7, “Differentiation & Searching,” a central-difference approximationwould be better than a forward-difference approximation, yet (8.42) keepsthe equations simpler.It is straightforward though complicated to solve for all the parameters in (8.39).We leave that to other reference sources [Thom 92, Pres 94]. We can see, however,that matching at the boundaries of the intervals results in only (N − 2) linearequations for N unknowns. Further input is required. It usually is taken to bethe boundary conditions at the endpoints a = x 1 and b = x N , specifically, the secondderivatives g ′′ (a) and g ′′ (b). There are several ways to determine these secondderivatives:Natural spline: Set g ′′ (a)=g ′′ (b)=0; that is, permit the function to have a slopeat the endpoints but no curvature. This is “natural” because the derivativevanishes for the flexible spline drafting tool (its ends being free).Input values for g ′ at the boundaries: The computer uses g ′ (a) to approximateg ′′ (a). If you do not know the first derivatives, you can calculate themnumerically from the table of g i values.Input values for g ′′ at the boundaries: Knowing values is of course better thanapproximating values, but it requires the user to input information. If thevalues of g ′′ are not known, they can be approximated by applying a forwarddifferenceapproximation to the tabulated values:g ′′ (x) ≃ [g(x 3) − g(x 2 )]/[x 3 − x 2 ] − [g(x 2 ) − g(x 1 )]/[x 2 − x 1 ]. (8.43)[x 3 − x 1 ]/28.5.4.1 CUBIC SPLINE QUADRATURE (EXPLORATION)A powerful integration scheme is to fit an integrand with splines and then integratethe cubic polynomials analytically. If the integrand g(x) is known only at itstabulated values, then this is about as good an integration scheme as is possible;−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 181

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!