Thompson - Computing for Scientists and Engineers (523188), страница 48
Текст из файла (страница 48)
Change thefile name to SINDE_1 so that the file output from this problem and from the exponential-function problem do not become jumbled.(b) Run the modified program over an interesting range of x values, from sayxmin = 0 to xmax = 7, with h = 0.05. Use each method of solution,choice from 1 to 4 to study the accuracy of the four predictor methods ofsolving the differential equation. In methods 3 and 4 iteration-control values ofnmax = 5 and epsilon = 10-3 are reasonable. For all methods y [ 1 ] = 1,while the program will request for methods 2 and 4 the second starting value (forh = 0.05) y[2] = 0.9987503 to seven decimals.254INTRODUCTION TO DIFFERENTIAL EQUATIONS(c) Make a graphical comparison of the predicted y values over the range calculated.
With the above accuracy parameters, these will probably be indistinguishable at the resolution of your graphics device. To point out the differences between the results from each method of solution, display the actual errors on aconvenient scale. If you use relative errors, there will be anomalous spikes nearthe zeros of cos (x). Either believe me, or try it and see. nFigure 7.7 displays the numerical solution of the linear differential equation (7.48)and the actual errors from the four methods that we have developed. Note carefullythe scale factors that have ben applied before plotting the errors Generally, the errors increase in magnitude as the function decreases, and the errors in the Eulermethods, which are based on derivatives (f and c), are greater than those in theAdams methods (trap and Simp), which are based on integration-iteration.For the Adams-Simpson method the errors indicated by err (Simp) are actuallyalternating errors, for the even and odd k values in yk.
The analysis of such errorsis difficult because the accuracy of the computer, of the computation of the sinefunction used in function ANALYT, and of the starting value y2 are all interactingwith the errors of the numerical method. This may not be of much practical consequence because all the errors are about 0.5 × 1O-7 or less, which is about a factorof 10 million less than the value of the function that is being computed numerically.Now that you have some experience with numerical solution of first-order differential equations, you may like to try other equations, such as the world-recordsprints equation in Section 7.2, the logistic equation in Section 7.3, or an interesting equation from your research and study.FIGURE 7.7 Solutions of the differential equation (7.48) with boundary condition y (0) = 1.The solid curve shows the analytical solution cos (x), The curve of long dashes shows 10 timesthe error in the forward-difference Euler method, the shorter dashes show 103 times the error in thecentral-difference Euler predictor, the dotted curve shows 103 times the error in the Adams-trapezoidpredictor, and the dashed band shows 107 times the error in the Adams-Simpson predictor.REFERENCES ON FIRST-ORDER EQUATIONS255REFERENCES ON FIRST-ORDER EQUATIONSBalakrishnan, N., Ed.
Handbook of the Logistic Distribution, Dekker, New York,1992.Beltrami, E., Mathematics for Dynamic Modeling, Academic Press, Boston, 1987.Diamond, J., “The Athlete’s Dilemma,” Discover, 12, August 1991, p. 79.Gleick, J., Chaos: Making a New Science, Penguin Books, New York, 1987.Haberman, R., Mathematical Models, Prentice Hall, Englewood Cliffs, NewJersey, 1977.Hasse, R. W., and W. D. Myers, Geometrical Relationships of MacroscopicNuclear Physics, Springer-Verlag, Berlin, 1988.Hosmer, D. W., and S. Lemeshow, Applied Logistic Regression, Wiley, NewYork, 1989.Hubbard, J. H., and B. H. West, Differential Equations, Part 1, Springer-Verlag,New York, 1991.Hubbard, J.
H., and B. H. West, MacMath: A Dynamical Systems SoftwarePackage for the Macintosh, Springer-Verlag, New York, 1991.Jain, M. K., Numerical Solution of Differential Equations, Wiley Eastern, NewDelhi, second edition, 1984.Keller, J. B., “A Theory of Competitive Running, “Physics Today, September1973, p. 43.Lichtenberg, D. B., A. L. Julin, and P.
H. Sugden, Nature, 356, 21 (1992).Thompson, D’Arcy W., On Growth and Form, Cambridge University Press, NewYork, 1943.Tuchinsky, P. M., “Least Squares, Fish Ecology, and the Chain Rule,” UMAPModule 670, in UMAP Modules Tools for Teaching, COMAP, Arlington,Massachusetts, 1986, pp. 195 - 240.Vandergraft, J. S., Introduction to Numerical Computations, Academic Press, NewYork, 1978.Whipp, B. J., and S.
A. Ward, “Will Women Soon Outrun Men?,” Nature, 355,25 (1992).Wolfram, S., Mathematica: A System for Doing Mathematics by Computer,Addison-Wesley, Redwood City, California, second edition, 1991.Wylie, C. R., and L. C. Barrett, Advanced Engineering Mathematics, McGrawHill, New York, fifth edition, 1982.Yee, H. C., P. K.
Sweby, and D. F. Griffiths, “Dynamical Approach Study ofSpurious Steady-State Numerical Solutions of Nonlinear DifferentialEquations,” Journal of Computational Physics, 97, 249 (1991).Zill, D. G., Differential Equations with Boundary-Value Problems, Prindle, Weber& Schmidt, Boston, 1986.256Previous Home NextChapter 8SECOND-ORDER DIFFERENTIAL EQUATIONSDifferential equations of second order, both linear and nonlinear, are very commonin the natural sciences and in many applications. In the physical sciences and engineering Newton’s force equations are ubiquitous, and they are second-order equations in the displacement as a function of the variable x = t, where t denotes time.In the quantum mechanics of molecules, atoms, and subatomic systems the Schrödinger equation for the wave function of a time-independent state is a second-orderdifferential equation which is usually also linear.
Thus, much of the mathematics(and therefore much of the computing) that describes dynamics in the natural sciences is encompassed by second-order differential equations.This chapter builds on the foundation of first-order differential equations that welaid in Chapter 7, both analytically and computationally. For example, the Eulerpredictors developed in Sections 7.4 and 7.5 are now extended to second-orderequations in Sections 8.3 and 8.4.
Examples of second-order equations are drawnfrom both classical and quantum physics, such as the equations for resonance inSection 8.1, generalized catenaries in Section 8.2, and the quantum harmonic oscillator in Section 8.5. We introduce some new computing concepts, methods, andprograms that are especially relevant to second-order differential equations, such asthe notion of stiff differential equations (Section 8.6), the Noumerov method forlinear second-order equations (Section 8.3), and the two programming projects forsecond-order Euler methods (Project 8A in Section 8.4) and for the Noumerovmethod (Project 8B in Section 8.5).By understanding the materials in this chapter and the preceding, you will havegood preparation for using a wide variety of analytical and computational techniquesinvolving differential equations, The background that you have acquired should besufficient for you to read and use the research literature on differential equations inapplied mathematics and in the natural and applied sciences.257258SECOND-ORDER DIFFERENTIAL EQUATIONS8.1 FORCES, SECOND-ORDER EQUATIONS, RESONANCESIn this section we review the relations between forces, second-order equations, andresonances.
The background and more details are given in texts such as Part 1 ofPippard’s treatise on the physics of vibration. The analogies between the differentialequations for mechanical and electrical systems are summarized. Then second-orderequations for free motion are presented, and their solutions are derived and interpreted. This analysis is preparatory to describing forced motion and resonant behavior.The latter topic is re-examined from the Fourier-transform viewpoint in Sections 10.2 and 10.3 when discussing the transform of a Lorentzian function that describes a resonance.Forces and second-order equationsWe summarize here the relation between forces and second-order differential equations in nonrelativistic classical mechanics. For simplicity of notation, we work implicitly with a single directional component of forces, momenta, and displacements.Recall that Newton’s equation for the momentum, p, and displacement, y, of aparticle of mass M as a function of time, t, when subjected to a force F can be written as a single second-order equation(8.1)or, with more information content, as a pair of first-order equations, one for themomentum(8.2)and one for the displacement(8.3)The distinction between a single second-order equation and a pair of first-orderequations is also relevant when considering numerical methods for solving secondorder differential equations.
In principle, but usually not optimally in practice, anysecond-order differential equation can be treated by this two-step process. We illustrate the strengths and weaknesses of this procedure by adapting the first-order Eulermethods from Sections 7.4 and 7.5 to solve second-order equations in Sections 8.3and 8.4. The one-step solution of second-order equations using specially formulated methods is illustrated by the Noumerov method, which is derived in Section 8.3 then programmed and used in Section 8.5.8.1FORCES, SECOND-ORDER EQUATIONS, RESONANCES259The greater information content in the pair of first-order equations is quite clearin the example of forces, momenta, and displacements.
The momentum (or velocity) components can be measured, and they have dynamical interpretations. Although analytically the momentum can be obtained by differentiating the displacement with respect to time, in a numerical context this is usually not an accurate procedure, as is clear in the discussions of numerical noise and numerical differentiationSections 4.3, 4.4, and 4.5.Exercise 8.1Make a list of basic equations in your scientific or engineering discipline. Whichof the equations usually appear as second-order differential equations? Forwhich of these equations is the interpretation clearer and more meaningful if thedifferential equation is written as a pair of first-order equations? nWith this overview and viewpoint of second-order differential equations, we areprepared to consider to consider specific equations for mechanical and analogouselectrical systems.Mechanical and electrical analogsWe consider first a mechanical system to model, for example the vertical displacement, y, of an automobile suspension system as the auto is driven over a bumpyroad.