CH-06 (523176)
Текст из файла
6Ordinary DifferentialEquations — Initial andBoundary Value Problems6.1 INTRODUCTIONAn example of historical interest in solving an unknown function which is governedby an ordinary differential equation and an initial condition is the case of findingy(x) from:dy=ydxy( x = 0 ) = 1and(1)As we all know, y(x) = ex. In fact, the exponential function ex is defined by aninfinite series:ex = 1 +x1 x 2++… =1! 2!∝∑i=0xii!(2)To prove that Equation 2 indeed is the solution for y satisfying Equation 1, herewe apply an iterative procedure of successive integration using a counter k. First,we integrate both sides of Equation 1 with respect to x:∫x0dydx =dxx∫ y dx(3)0After substituting the initial condition of y(x = 0) = 1, we obtain:∫xy(x) = 1 + y dx(4)0So we are expected to find an unknown y(x) which is to be obtained by integrating it? Numerically, we can do it by assuming a y(x) initially (k = 1) equal to1, investigate how Equation 4 would help us to obtain the next (k = 2), guessed y(x),and hope eventually the iterative process would lead us to a solution.
The iterativeequation, therefore, is for k = 1,2,…© 2001 by CRC Press LLC∫xy( k +1) (x) = 1 + y( k )dx(5)0The results are y(1) = 1, y(2) = 1 + x, y(3) = 1 + x + (x2/2!), and eventually thefinal answer is the infinite series given by Equation 2.What really need to be discussed in this chapter is not to obtain an analyticalexpression for y(x) by solving Equation 1 and rather to compute the numerical valuesof y(x) when x is equally incremented. That is, for a selected x increment, x (or,stepsize h), to find yiy(xi) for i = 1,2,… until x reaches a terminating value of xeand xi = (i–1) x. A simplest method to find y2 is to approximate the derivative ofy(x) by using the forward difference at x1. That is, according to the notation usedin Chapter 4, we can have:dydxx = x1=˙∆y1 y 2 − y1== y1∆x∆x(6)Or, y2 = (1 + x)y1. In fact, this result can be extended to any xi to obtain yi + 1 =1 + (x)yi.
For the general case when the right-hand side of Equation 1 is equal to aprescribed function f(x), we arrive at the Euler’s formula yi + 1 = yi + f(xi) x. Euler’sformula is easy to apply but is inaccurate. For example, using a x = 0.1 in solvingEquation 1 with the Euler’s formula, it leads to y2 = (1 + 0.1)y1 = 1.1, y3 = (1 +0.1)y2 = 1.21 when the exact values are y2 = e0.1 = 1.1052 and y3 = e0.2 = 1.2214,respectively. The computational errors accumulate very rapidly.In this chapter, we shall introduce the most commonly adopted method of RungeKutta for solution of the initial-value problems governed by ordinary differentialequation(s). For the fourth-order Runge-Kutta method, the error per each computational step is of order h5 where h is the stepsize.
Converting the higher-orderordinary differential equation(s) into the standardized form using the state variableswill be illustrated and computer programs will be developed for numerical solutionof the problem.Engineering problems which are governed by ordinary differential equations andalso some associated conditions at certain boundaries will be also be discussed.Numerical methods of solution based on the Runge-Kutta procedure and the finitedifference approximation will both be explained.6.2 PROGRAM RUNGEKUT — APPLICATIONOF THE RUNGE-KUTTA METHODFOR SOLVING THE INITIAL-VALUE PROBLEMSProgram RungeKut is designed for solving the initial-value problems governed byordinary differential equations using the fourth-order Runge-Kutta method.
Thereare numerous physical problems which are mathematically governed by a set ofordinary differential equations (ODE) involving many unknown functions. Theseunknown functions are all dependent of a variable t. Supplementing to this set of© 2001 by CRC Press LLCFIGURE 1. The often cited vibration problem shown requires the changes of the elevationx and velocity v to be calculated.ordinary differential equations are the initial conditions of the dependent functionswhen t is equal to zero. For example, the often cited vibration1 problem shown inFigure 1 requires the changes of the elevation x and velocity v to be calculated usingthe equations:()m d 2 x dt 2 + c(dx dt ) + kx = f (t )(1)dx dt = v(2)andwhere m is the mass, c is the damping coefficient, k is the spring constant, t is thetime, and f(t) is a disturbing force applied to the mass.
When the physical parameters m, c, and k, and the history of the applied force f(t) are specified, the completehistories of the mass’ elevation x and velocity v can be calculated analytically, or,numerically if the initial elevation x(t = 0) and v(t = 0) are known. If m, c, and kremain unchanged throughout the period of investigation and f(t) is a commonlyencountered function, Equation 1 can be solved analytically.1 Otherwise, a numericalmethod has to be applied to obtain approximate solution of Equation 1.Many numerical methods are available for solving such initial-value problemsgoverned by ordinary differential equations. Most of the numerical methods requirethat the governing differential equation be rearranged into a standard form of:© 2001 by CRC Press LLCdx1 dt = F1 (x1, x 2 ,…, x n , t; parameters)dx 2 dt = F2 (x1, x 2 ,…, x n , t; parameters)(3).
. . . . . . . . .dx n dt = Fn (x1, x 2 ,…, x n , t; parameters)For example, the variables x and v in Equations 1 and 2 are to be renamed x1and x2, respectively. Equation 1 is to be rewritten as:m(dv dt ) + cv + kx = f (t )and then as:dv dt = [f (t ) − cv − kx] mand finally as:dx 2 dt = F2 (x1, x 2 , t; m, c, k )Meanwhile. Equation 2 is rewritten as:dx1 dt = F1 (x1, x 2 , t; m, c, k )Or, more systematically the problem is described by the equations:dx1 dt = F1 (x1, x 2 , t; m, c, k ) = x 2dx 2 dt = F2 (x1, x 2 , t; m, c, k ) = [f (t ) − kx1 − cx 2 ] m(4)and having the initial conditions x1(t = 0) and x2(t = 0) prescribed.Runge-Kutta method is a commonly used method for numerical solution of asystem of first-order ordinary differential equations expressed in the general formof (3).
It is to be introduced and illustrated with a number of practical applications.RUNGE-KUTTA METHOD (FOURTH-ORDER)Consider the problem of finding x and y values at t>0 when they are governedby the equations:(dx dt ) − 4x + (dy dt ) − 6y = −2© 2001 by CRC Press LLC(5)and2(dx dt ) + x + 3(dy dt ) + 2 y = 0(6)when initially their values are x(t = 0) = 7 and y(t = 0) = –4.
The analytical solutionsare obtainable2 and they are:x = 5e t + 2andy = −3e t − 1(7)To solve the problem numerically, Equations 5 and 6 need to be decoupled andexpressed in the form of Equation 3. Cramer’s rule can be applied by treating dx/dtand dy/dt as two unknowns and x and y as parameters, the converted standard formafter changing x to x1 and y to x2 is:dx1 dt = F1 (x1, x 2 , t; constants), x1 (0) = 7(8)dx 2 dt = F2 (x1, x 2 , t; constants), x 2 (0) = −4(9)F1 (x1, x 2 , t;constants) = −6 + 13x1 + 20 x 2(10)F2 (x1, x 2 , t;constants) = 4 − 9x1 − 14 x 2(11)where:andNumerical solution of x1 and x2 for t>0 is to use a selected time increment t(often referred to as the stepsize h for the independent variable t). Denote t0 as theinitial instant t = 0 and tj + 1 as the instant after j increments of time, that is, tj + 1 =(j + 1)h.
If the values for x1 and x2 at tj, denoted as x1,j and x2,j respectively, arealready known, the fourth-order Runge-Kutta method is to use the following formulas to calculate x1 and x2 at tj + 1, denoted as x1,j + 1 and x2,j + 1:()x i, j+1 = x i, j + p i,1 + 2 p i,2 + 2 p i,3 + p i,4 6(12)for i = 1,2. The p’s in Equation 12 are the Runge-Kutta parameters to be calculatedusing the functions F1 and F2 by adjusting the values of the variables x1 and x2 attj. The formulas for calculating these p’s are, for i = 1,2(p i,1 = hFi t j , x1, j , x 2, j© 2001 by CRC Press LLC)(13)[()()](14)[()()](15)p i,2 = hFi t j + ( h 2), x1, j + p1,1 2 , x 2, j + p2,1 2p i,3 = hFi t j + ( h 2), x1, j + p1,2 2 , x 2, j + p2,2 2(p i,4 = hFi t j + h, x1, j + p1,3 , x 2, j + p2,3)(16)Equations 12 to 16 are to be used to generate x1 and x2 values at tj for j = 1,2,3,…which can be tabulated as:tx1x207–4h??2h??3h??.........jhx1,jx2,j.........te??where te is the ending value of t at which the computation is to be terminated.
Thefirst pair of values to be filled into the above table is for x1 and x2 at t = h (j = 1).Based first on Equations 13 to 16 and then Equation 12, the actual computations forh = 0.1 and at t1 go as follows:p1,1 = hF1(t0,x1,0,x2,0) = 0.1F1(0,7,–4) = 0.1(–6 + 91-80) = 0.5p2,1 = hF2(t0,x1,0,x2,0) = 0.1F2(0,7,–4) = 0.1(4-63 + 56) = –0.3p1,2 = hF1(t0 + 0.05,x1,0 + 0.25,x2,0–0.15) = 0.1F1(.05,7.25,–4.15)= 0.1(–6 + 13x7.25-20x4.15) = 0.525p2,2 = hF2(t0 + 0.05,x1,0 + 0.25,x2,0–0.15) = 0.1F2(.05,7.25,–4.15)= 0.1(4-9x7.25 + 14x4.15) = –0.315p1,3 = hF1(t0 + 0.05,x1,0 + 0.2625,x2,0–0.1575)= .1F1(.05,7.2625,–4.1575)= 0.1(–6 + 13x7.2625-20x4.1575) = .52625p2,3 = hF2(t0 + 0.05,x1,0 + 0.2625,x2,0–0.1575)= .1F2(.05,7.2625,–4.1575) = 0.1(4–9x7.2625 + 14x4.1575)= –0.31575p1,4 = hF1(t0 + 0.1,x1,0 + 0.52625,x2,0–0.31575)= 0.1F1(0.1,7.52625,–4.31575)= 0.1(–6 + 13x7.52625–20x4.31575) = 0.552625p2,4 = hF2(t0 + 0.1,x1,0 + 0.52625,x2,0–0.31575)= .1F2(.1,7.52625,–4.31575) = .1(4–9x7.52625 + 14x4.31575) = –0.331575x1,1 = 7 + (0.5 + 2x0.525 + 2x0.52625 + 0.552625)/6= 7 + (3.155125)/6 = 7.5258541(17)x2,1 = –4 + (–0.3–2x0.315–2x0.31575–0.331575)/6= –4 + (–1.893075)/6 = –4.3155125(18)The exact solution calculated by using Equation 7 are:x1,1 = 7.5258355© 2001 by CRC Press LLCandx2,1 = –4.3155013(19)The errors are 0.000247% and 0.000260% for x1 and x2, respectively.
Per-steperror for the fourth-order Runge-Kutta method is difficult to estimate because themethod is derived by matching terms in Equation 12 with Taylor-series expansionsof x1 and x2 about ti through and including the h4 terms. But approximately, the perstep error is of order h5. For better accuracy, the fifth-order Runge-Kutta methodshould be applied. For general use, the classic fourth-order Runge-Kutta method is,however, easier to develop a computer program which is to be discussed next.SUBROUTINE RKNA subroutine called RKN has been written for applying the fourth-order RungeKutta method to solve the initial-value problems governed by a set of first-orderordinary differential equations.
Характеристики
Тип файла PDF
PDF-формат наиболее широко используется для просмотра любого типа файлов на любом устройстве. В него можно сохранить документ, таблицы, презентацию, текст, чертежи, вычисления, графики и всё остальное, что можно показать на экране любого устройства. Именно его лучше всего использовать для печати.
Например, если Вам нужно распечатать чертёж из автокада, Вы сохраните чертёж на флешку, но будет ли автокад в пункте печати? А если будет, то нужная версия с нужными библиотеками? Именно для этого и нужен формат PDF - в нём точно будет показано верно вне зависимости от того, в какой программе создали PDF-файл и есть ли нужная программа для его просмотра.