Shampine, Allen, Pruess - Fundamentals of Numerical Computing (523185), страница 34
Текст из файла (страница 34)
R. Borrelli and C. Coleman, Differential Equations: A Modeling Approach, Prentice Hall, Englewood Cliffs, N.J., 1987.2. W. Boyce and R. DiPrima, Elementary Differential Equations and Boundary Value Problems,Wiley, New York, 1992.3. R. Brent, Algorithms for Minimization without Derivatives, Prentice Hall, Englewood Cliffs,N.J., 1973.4.
P. David and J. Voge, Propagation of Waves, Pergamon Press, New York, 1969.5. H. Davis, Introduction to Nonlinear Differential and Integral Equations, Dover, New York,1962.6. T. Dekker, “Finding a zero by means of successive linear interpolation,” in Constructive Aspectsof the Fundamental Theorem of Algebra, B. Dejon and P. Henrici, eds., Wiley, London, 1969.7. J. Dennis, Jr., and R. Schnabel, Numerical Methods for Unconstrained Optimization and Nonlinear Equations, Prentice Hall, Englewood Cliffs, N.J., 1983.8. J.
Eberhardt and T. Sweet, ‘The numerical solution of equations in chemistry,” J. Chem. Ed., 37(1960), pp. 422-430.9. S. Timoshenko, Theory of Elastic Stability, McGraw Hill, New York, 1961.10. L. Vant-Hull and A. Hildebrandt, “Solar thermal power systems based on optical transmission,”Solar Energy, 18 (1976), pp. 3l-40.11. J. Wilkinson, Rounding Errors in Algebraic Processes, Dover, Mineola, N.Y., 1994.12. G.M. Wing, An Introduction to Transport Theory, Wiley, New York, 1962.MISCELLANEOUS EXERCISES FOR CHAPTER 44.27 A semi-infinite medium is at a uniform initial temperature T0 = 70°F. For time t > 0, a constant heatflux density q = 300 Btu/hr sq ft is maintained on thesurface x = 0. Knowing the thermal conductivity k =1.0 Btu/hr/ft/°F and the thermal diffusivity α = 0.04168CHAPTER 4ROOTS OF NONLINEAR EQUATIONSsq ft/hr, the resulting temperature T(x, t) is given byShow thata0 = (-1)n r 1 r 2 ···r nand then thatwhereThis implies thatis the error function.
Find the times t required for thetemperature at distances x = 0.1, 0.2, . . . ,0.5 to reach apreassigned value T = 100°F. Use ABSERR = 10-8and RELERR = 10-6. The function erf(y) is availablein many FORTRAN and some C and C++ libraries.4.28 Write a code like Zero based upon bisection and Newton’s method. Are there advantages to using Newton’smethod instead of the secant rule?4.29 Modify Zero so as to input f´(x) along with f(x).The code is to compute roots via the function u(x) =f(x)/f´(x) as described in the text. This makes themodified code faster for multiple roots and permits thecomputation of roots of even multiplicity.which says that there is some zero that is approximated with a relative error of no more thanThis bound is very pessimistic when σ approximateswell a zero that is much larger than some other zero.To understand this assertion, work out a numerical example for a quadratic with σr1 and |r1| >> |r2|.Then argue that the assertion is true in general.(b) Show that4.30 Givenby differentiating ln P(x).
This then implies thatdevise an algorithm using the codes Zero and Factor/Solve to solve for x1, x2, x3 and θ. Sketch a program in FORTRAN or C or C++ to implement yourscheme. Do not worry about input/output nor an initial bracket, but do define F(x) carefully.4.31 In parts (a) and (b) below, error bounds are derived foran approximate root σ (real or complex) of the polynomial equationandThis is an absolute error bound, but we get the following relative error bound easily:In each case we require an accurate value of P(σ).How is this error bound related to the error estimateSince root solvers may make this residual about asderived for Newton’s method?small as possible in the working precision, it is necessary to compute P(σ) in higher precision.
Let 4.32 The book [4, p. 65] contains a cubic equation for a par1,r2. . . , rn be the roots of P(x) = 0.rameter s in the context of corrections for the earth’s(a) The theory of equations tells us that P(x) can becurvature in the interference zone. The equationfactored in the formP(x) = (x - r1)(x - r2)···(x - r n).MISCELLANEOUS EXERCISESdepends on two parameters, u and v, which are obtamed from the heights of the towers, the distance between stations, and the radius of the earth. Representative values are v = 1/291, u = 30. The smallest positive root is the one of interest, but calculate them all.169The residuals of the larger roots are quite large.
Arethey inaccurate? Compare with Exercise 4.1. Use thecomputable error bounds of Exercise 4.31 to boundthe errors of the roots.Previous Home NextCHAPTER 5NUMERICAL INTEGRATIONApproximatingnumerically is called numerical integration or quadrature.Most of this chapter is concerned with finite intervals [a,b], but there is some discussion of integrals with a and/or b infinite. Sometimes it is useful to introduce a weightfunction w(x) > 0 and so approximate integrals of the formThere area number of reasons for studying numerical integration. The antiderivative of f maynot be known or may not be elementary. The integral may not be available becausethe function f is defined by values in a table or by a subprogram. Or, definite integralsmust be approximated as part of a more complicated numerical scheme, such as onefor the solution of differential equations by finite elements by means of variational orGalerkin methods.A basic principle in numerical analysis is that if we cannot do what we want witha given function f(x), we approximate it with a function for which we can.
Often theapproximating function is an interpolating polynomial. Using this principle we shallderive some basic quadrature rules and study their errors. When approximating functions we found that piecewise polynomial interpolants had advantages over polynomialinterpolants, and the same is true in this context. In a way piecewise polynomial interpolants are more natural for quadrature because using such a function amounts tobreaking up the interval of integration into pieces and approximating by a polynomialon each piece.
A key idea in quadrature is to take account of the behavior of f(x)when splitting up the interval. This “adaptive” quadrature is described in Section 5.2and a code is discussed in the following section. Adaptive quadrature is the main topicof the chapter, but some attention is given to the integration of tabular data and to theintegration of functions of two independent variables. Particular attention is paid topreparing problems for their effective solution by codes of the kind developed here.5.1 BASIC QUADRATURE RULESTo approximate(5.1)1705.1 BASIC QUADRATURE RULES171suppose that values of f are available at N distinct points {xl,.
. . ,xN}. Let PN(x) bethe polynomial that interpolates f at these points. The Lagrangian form of PN(x) leadseasily to the approximation(5.2)It is assumed here that the weights Ai exist. This is equivalent to the existence of theintegralsIn the case of most interest in this chapter, namely w(x) = 1, a and b finite, there is nodoubt about this. However, if the interval is infinitethe approachjfails because none of the x has an integral over this interval.The fundamental difficulty with the approach in the case ofis that itis based on approximating f(x) by a polynomial, and polynomials do not have finiteintegrals over infinite intervals.
For the integral of f(x) to exist, it must tend to zerorapidly asA useful device is to isolate the behavior that is different froma polynomial in a weight function that is handled analytically in the formula. Forexample, if we introduce the weight function w(x) = e-x and define F(x) = f(x)ex,the integral can be rewritten asIt is straightforward to obtain formulasfor integrals of the formbecause the integralsexist for all j.Whether this device results in a good approximation tois a question aboutwhether F(x) behaves more like a polynomial than f(x).Infinite intervals are one kind of problem that presents difficulties.
An integrandthat is singular also presents difficulties because it does not behave like a polynomial.Often a weight function is a good way to deal with such problems. For example, in thesolution of plane potential problems by boundary element methods, it is necessary toapproximate a great many integrals of the form(and subsequently to solve a system of linear equations to produce a numerical solutionto an integral equation of potential theory).
The function ln x can be used as a weightfunction because it is nonpositive over the interval and the integralsexist for all j (so the weight function w(x) in (5.1) can be taken to be - ln x). Similarlyto what was done with the example of an integral over an infinite interval, if we wish toand f(x) behaves like ln (x) aswe could introduce ln (x) ascompute172CHAPTER 5NUMERICAL INTEGRATIONa weight function and write F(x) = f(x)/ln(x). By “behaves like” asis meantFrom here on this will be written as f(x) ~ c ln( x). Because F(x) has a finite limit atx = 0, it is better approximated by a polynomial than f(x), which is infinite there.A formula of the form(5.3)for approximating (5.1) is called a quadrature formula or quadrature rule.
The schemefor generating rules just described leads to interpolutory quadrature rules. Such arule will integrate exactly any polynomial of degree less than N. This is because iff(x) is a polynomial of degree less than N, then by the uniqueness of interpolation,PN(x) = f(x) and the rule is constructed so as to integrate PN(x) exactly. In general,we say that a quadrature formula (5.3) has the degree of precision d > 0 if it integratesexactly any polynomial of degree at most d, but not one of degree d + 1. We shall findthat a judicious selection of the interpolation points {xi } in the construction of (5.2)leads to formulas with a degree of precision greater than N - 1.