Download presentation
Presentation is loading. Please wait.
1
Computational Methods 2018/2019 Fall Chapter 9-A
CSE 551 Computational Methods 2018/2019 Fall Chapter 9-A Ordinary Differential Equations
2
Outline Taylor Series Methods Runge-Kutta Methods Stability and Adaptive Runge-Kutta and Multistep Methods
3
References W. Cheney, D Kincaid, Numerical Mathematics and Computing, 6ed, Chapter 10
4
Taylor Series Methods Initial-Value Problem: Analytical versus Numerical Solution Solving Differential Equations and Integration Taylor Series Methods Taylor Series Method of Higher Order Types of Errors
5
Initial-Value Problem: Analytical versus Numerical Solution
An ordinary differential equation (ODE) equation - one or more derivatives of an unknown function A solution - differential equation specific function - satisfies the equation
6
c - an arbitrary constant
Examples t - independent variable x - dependent variable. name of the unknown function of the independent variable t: c - an arbitrary constant
7
not determine a unique solution function
a DE not, in general, not determine a unique solution function accompanied by auxiliary conditions together with the DE specify the unknown function precisely.
8
Inıtial-Value Problem
initial-value problem for a first-order DE. x - function of t, (1): initial-value problem t - time and t = a - initial instant in time. determine the value of x at any time t before or after a.
9
Examples examples of initial-value problems, with solutions: A numerical solution DE table; functional form of the solution remains unknown
10
function f – depend on t and x
If f not involve x, - second example – DE solved - indefinite integration. illustrate, C - x(5) = 17. C = 4 ln(5) − arctan(5) − 108.
11
numerical solution DE:
(a) the closed form solution may be very complicated and difficult to evaluate or (b) there is no other choice; that is, no closed-form solution can be found e.g., for the DE solution - taking the integral of the right-hand side. can be done in principle but not in practice. a function x exists dx/dt - right-hand member (3) but it is not possible to write x(t) in terms of familiar functions..
12
Solving ODEs on a computer
require a large number of steps with small step size, significant amount of roundoff error can accumulate. multiple-precision computations may be necessary on small-word-length computers.
13
Solving Differential Equations and Integration
close connection between solving DEs and integration e.g.: Integrating from t to t + h,
14
Replacing the integral - numerical integration rules formula for solving the differential equation.
Euler’s method - obtained from the left rectangle approximation The trapezoid rule
15
Since x(t + h) appears on both sides of this equation, it is called an implicit formula. If
Euler’s method x(t + h) on the right-hand side, then we obtain the Runge-Kutta formula of order 2—namely, Equation (10) in Section 10.2.
16
Fundamental Theorem of Calculus,
approximate numerical value for the integral can be computed by solving the following initial-value problem for x(b):
17
Taylor Series Methods represent the solution of a DE locally by a few terms of its Taylor series. assume that solution function x - represented Taylor series:
18
numerical purposes, Taylor series truncated after m+1 terms compute x(t + h) rather accurately h is small and x(t), x’(t), x’’(t), , x(m)(t) - known. When terms through hmx(m)(t)/m! included in the Taylor series, the method Taylor series method of order m.
19
Euler’s Method Pseudocode
Taylor series method of order 1 - Euler’s method approximate values of the solutions to the initial-value problem: over the interval [a, b], first two terms - Taylor series (5) : the formula:
20
can be used to step from t = a to t = b with n steps of size h = (b−a)/n.
The pseudocode can be written as follows, where some prescribed values for n, a, b, and xa are used:
21
pseudocode for Euler’s method
22
Example 1 Using Euler’s method, compute an approximate value for x(2) for the differential equation x’ = 1 + x2 + t3 with the initial value x(1) = −4 using 100 steps.
23
Solution Use the pseudocode above with the initial values given and combine with the following function: The computed value is x(2) ≈
24
computer program - execute Euler’s method
simple problem: x(2) ≈ The solution, x(t) = et , points produced by Euler’s method - dots. why the dots are always below the curve?
25
Euler’s metho curves 0
26
some questions such as:
How accurate are the answers? Are higher-order Taylor series methods ever needed? Euler’s method - not very accurate only two terms in the Taylor series (5) –used truncation error is O(h2).
27
Taylor Series Method of Higher Order
Example 1: Taylor series method of higher order. initial-value problem: functions DE differentiated several times with respect to t (chain rule):
28
numerical values of t and x(t) known,
x’(t), x’’(t), x’’’(t), and x(4)(t) first five terms - Taylor series (5) x(1) = −4, suitable starting point, n = 100 – h. approximation - x(a + h) - from (5) and (8) same process - repeated compute: x(a + 2h) form x’(a + h), x’’(a + h), , x(4)(a + h).
30
The assignment statements that
determine - interval a = 1 t2 = b, and 100 steps. In each step, current value of t integer multiple of the step size h. The assignment statements that define x’, x’’, x’’’, and x(4) carrying out calculations of the derivatives according to (8)
31
evaluation of the TS in (5) nested multiplication,
five terms. polynomial in h, nested multiplication, The computation t ← t + h may cause a small amount of roundoff error to accumulate in the value of t avoided by using t ← a + kh.
32
two terms in TS (Euler’s method) not accurate - five terms :
Euler’s Method TS Method (Order 4) x(2) ≈ x(2) ≈ correct value to more significant figures: x(2) ≈ computations were done with more precision show that lack of precision was not a contributin factor.
33
Types of Errors what sort of accuracy expected? Are all the digits for the variable x accurate? not! not easy to say - how many digits are reliable a coarse assessment: Since terms up to (1/24)h4x(4)(t) included, first term not included in TS: (1/120) h5x(5)(t). The error may be larger than this, but the factor h5 = (10−2)5 ≈ 10−10 affecting only the tenth decimal place.
34
Trancation Error two types of errors At each step, if x(t) known and x(t+h) computed from the first fewterms of the Taylor series, an error occurs truncated theTaylor series truncation error - local truncation error. In the example, roughly (1/120) h5x(5)(ξ ). local truncation error of order h5 - O(h5).
35
The second type of error
Accumulaed Error The second type of error accumulated effects of all local truncation errors calculated value of x(t +h) - in error x(t) is already wrong previous truncation errors another local truncation error occurs in the computation of x(t + h)
36
Additional sources of errors: roundoff error
not serious in any one step of the solution procedure, after hundreds or thousands of steps, accumulate and contaminate the calculated solution seriously. an error - made at a certain step carried forward into all succeeding steps
37
Runge-Kutta Methods Taylor Series for f(x, y) Runge-Kutta Method of Order 2 Runge-Kutta Method of Order 4
38
Runge-Kutta Methods imitate the Taylor series method without analytic differentiation of the original DE. Taylor series method on the initial-value problem
39
differentiating the function f . a method for solving (1)
RK method of order 2 need to obtain x, x’ , . . . differentiating the function f . serious obstacle a method for solving (1) writing a code to evaluate f The Runge-Kutta (RK) methods. RK method of order 2 low precision RK method of order 4 - common use.
40
Hearth of an IV Problem heart of - initial-value problem advancing the solution function one step at a time; formula for x(t + h) - known quantities x(t), x(t − h), x(t − 2h), . . . At the beginning, only x(a) is known.
41
Taylor Series for f(x, y)
Taylor series in two variables: f and all partial derivatives evaluated at (x, y)
42
Taylor series - truncated
error term or remainder term - restore the equality: point (xb, yb) lies on the line segment joins (x, y) to (x + h, y + k) in the plane subscripts - denote partial derivatives.
43
functions - order of subscripts immaterial;
e.g. fxt = ftx . special cases:
44
Runge-Kutta Method of Order 2
Runge-Kutta method of order 2 - a formula: two function evaluations of the special form linear combination of these - added to the value of x at t - at t +h:
45
determine constants w1, w2, α, and β
(5) as accurate as possible reproduce as many terms as possible in the TS
46
One way to force them to agree up
compare (5) with (6). One way to force them to agree up through the term in h - set w1 = 1 and w2 = 0 x = f . Euler’s method - order of precision is only 1. Agreement up through the h2 term is possible by a more adroit choice of parameters. apply two-variable form TS - final term in (5). n = 2 - two-variable TS Formula (3), with t, αh, x, and βh f playing the role of x, h, y, and k, respectively:
47
new form for (5):
48
Equation (6) - new form by using DE (1).
x’ = f , (6) implies that Agreement between (7) and (8)
49
solution The resulting second-order Runge-Kutta method is then, from Equation (5),: equivalently,
50
(10) - solution function at t + h –
two evaluations of the function f other solutions - nonlinear System (9) possible. For example, α can be arbitrary,
51
Error Term error term for R-K methods of order 2: none of the secondorder RK methods - widely used error O(h3).
52
Runge-Kutta Method of Order 4
algorithm – IV Problem (1) fourth-order Runge-Kutta method.
53
solution at x(t + h) obtained evaluating the function f four times
About Error solution at x(t + h) obtained evaluating the function f four times The final formula agrees with the Taylor expansion up to and including the term in h4 The error contains h5 no lower powers of h. Without knowing the coefficient of h5 in the error, cannot be precise about the local truncation error.
54
Pseudocode
55
illustrate use of pseudocode, IV problem
Illustration illustrate use of pseudocode, IV problem exact solution: x(t) = 1 + t + tan(t − 1). on the interval [1, ] RK procedure: step size: dividing the length of the interval by the number of steps, say, n = 72.
57
The final value of the computed numerical solution:
x(1.5625) =
58
General-purpose routines RK algorithm monitor - truncation error
Software General-purpose routines RK algorithm monitor - truncation error make necessary adjustments step size as the solution progresses. In general terms, the step size can be large when the solution is slowly varying but should be small when it is rapidly varying.
59
Stability and Adaptive Runge-Kutta and Multistep Methods
An Adaptive Runge-Kutta-Fehlberg Method An Industrial Example Adams-Bashforth-Moulton Formulas
60
An Adaptive Runge-Kutta-Fehlberg Method
numerical solution of initial-value problems, estimate the precision attained in the computation. error tolerance the numerical solution must not deviate from the true solution beyond this tolerance. error tolerance - largest allowable step size local truncation error, determining appropriate step size – difficult small step size - on one portion of the solution curve, larger one - uffice elsewhere.
61
An Adapteive Procedure
methods for automatically adjusting the step size IV problem. One simple procedure: fourth-order RK method. To advance the solution curve from t to t + h, one step of size h RK formulas two steps of size h/2 to arrive at t + h If no truncation error: x(t + h) would be the same for both procedures difference numerical results – estimate of the local truncation error
62
An Adapteive Procedure
if this difference - within the prescribed tolerance the current step size h is satisfactory If this difference exceeds the tolerance the step size is halved If the difference is very much less than the tolerance, the step size is doubled.
63
Fehlberg Method of Order 4
The procedure - not recommended. A more sophisticated method by Fehlberg Fehlberg method of order 4 – RK type and uses these formulas:
64
Fehlberg Method of Order 4 (cont.)
requires one more function evaluation than the classical RK method of order 4, questionable value alone.
65
additional function evaluation
fifth-order Runge-Kutta method
66
The difference between the values of x(t + h)
obtained from the fourth- and fifth-order procedures estimate of the local truncation error fourth-order procedure six function evaluations – fifth-order approximation, together with an error estimate!
67
pseudode RK45
68
pseudode RK45 (cont.)
69
Non Adaptive Use of RL45
70
print the error estimation at each step.
can use it in an adaptive procedure, error estimate ε - when to adjust the step size to control the single-step error.
71
A Simple Adaptive Process
In the RK45 procedure, the fourth- and fifth-order approximations for x(t + h), say, x4 and x5, are computed from six function evaluations, and the error estimate ε = |x4 − x5| is known. From user-specified bounds on the allowable error estimate (εmin ε εmax), the step size h is doubled or halved as needed to keep ε within these bounds. A range for the allowable step size h is also specified by the user (hmin |h| hmax). the user must set the bounds (εmin, εmax, hmin, hmax) carefully the adaptive procedure does not get caught in a loop, trying repeatedly to halve and double the step size from the same point to meet error bounds that are too restrictive for the given differential equation.
72
adaptive process :
73
Parameter List The procedure - RK45 Adaptive. parameter list f: function f (t, x) for the DE, t and x : contain the initial values, h:the initial step size, tb: the final value for t, itmax: the maximum number of steps to be taken in going from a = ta to b = tb, εmin and εmax: lower and upper bounds on the allowable error estimate ε, hmin and hmax: bounds on the step size h,
74
Parameter List (cont.) and iflag: an error flag that returns one of the following values: iflag Meaning Successful march from ta to tb Maximum number of iterations reached On return, t and x are the exit values, and h is the final step size value considered or used:
75
In the pseudocode, several conditions must be checked to determine the size of the final step, floating-point arithmetic is involved and the step size varies.
76
a = 3, b = 5, and c = 0.2 are constants. adaptive RK formulas,
An Industrial Example A first-order DE arose in the modeling of an industrial chemical process : a = 3, b = 5, and c = 0.2 are constants. adaptive RK formulas, identify (and program) the function f f (t, x) = sin t + 0.2x. brief pseudocode for solving the equation on the interval [0, 10] particular values assigned to the parameters in the routine RK45 Adaptive:
77
obtain approximation: x(10) ≈ 135.917
78
Adams-Bashforth-Moulton Formulas
strategy - numerical quadrature formulas solve single first-order ODE. the values of the unknown function computed at several points to the left of t, t, t − h, t − 2h, , t − (n − 1)h compute x(t + h).
79
the theorems of calculus:
abbreviation: f j = f (t − ( j − 1)h, x(t − ( j − 1)h))
80
numerical integration formula. simplest case - for the interval [0, 1]
use values of the integrand at points 0,−1,−2, , 1−n in the case of an Adams-Bashforth formula. basic rule - change of variable the rule any other interval with any other uniform spacing.
81
a rule of the form n coefficients cj at our disposal. interpolation theory formula - exact for all polynomials of degree n −1. integrating each function 1, r, r 2, , r n−1 exactly. appropriate equation:
82
system Au = b n equations in n unknowns
Ai j = (1 − j )i−1, bi = 1/i . output: vector of coefficients ( 55/24 , −59/24 , 37/24 , −3/8) . higher-order formulas by changing the value of n in the code. Adams-Moulton formulas, start with a quadrature rule of the form
83
tt+h 01 A program similar to the one above yields the coefficients 9/24 , 19/24 ,− 5/24 , 1/24 The distinction between the two quadrature rules is that one involves the value of the integrand at 1 and the other does not.
84
How do we arrive at formulas for
tt+h g(s) ds from the work already done? Use the change of variable from s to σ given by s = hσ − t. In these considerations, think of t as a constant The new integral: 01 g(hσ + t) dσ, treated with either of the two formulas already designed for the interval [0, 1]. For example,
85
method of undetermined coefficients
obtain the quadrature formulas does not, by itself, provide the error terms that we would like to have. assessment of the error - interpolation theory, integrating an interpolating polynomial
86
Computational Methods 2018/2019 Fall Chapter 9-B
CSE 551 Computational Methods 2018/2019 Fall Chapter 9-B Systems of Ordinary Differentia Equations
87
Outline Methods for First-Order Systems Higher-Order Equations and Systems Adams-Bashforth-Moulton Methods
88
References W. Cheney, D Kincaid, Numerical Mathematics and Computing, 6ed, Chapter 11
89
Methods for First-Order Systems
Uncoupled and Coupled Systems Taylor Series Method Vector Notation Systems of ODEs Taylor Series Method: Vector Notation Runge-Kutta Method Autonomous ODE
90
Methods for First-Order Systems
ODEs single DE, first order with an accompanying auxiliary condition. systems of several first-order equations.
91
Uncoupled and Coupled Systems
The sun and the nine planets - system of particles Newton’s law of gravitation position vectors of the planets system of 27 functions, and the Newtonian laws of motion system of 54 first-order ODEs In principle, past and future positions of the planets can be obtained by solving these equations numerically.
92
Example two equations with two auxiliary conditions x and y be two functions of t: with initial conditions
93
initial-value problem - system of two first-order DEs.
not possible - solve either of the two DEs by itself first equation governing x involves the unknown function y, and the second equation governing y involves the unknown function x. two DEs - coupled. analytic solution:
94
simpler example: initial conditions: not coupled solved separately - two unrelated initialvalue problems
95
Taylor Series Method Taylor series (TS) method for System (1) differentiating the equations :
96
few terms of the Taylor series:
program to proceed from x(t) to x(t + h) and from y(t) to y(t + h) few terms of the Taylor series: together with equations for the various derivatives. x and y and all their derivatives - functions of t; x = x(t), y = y(t), x’ = x’(t), y’ = y’(t), and so on.
97
A pseudocode program generates and prints a numerical solution from 0 to 1 in 100 steps: Terms up to h4 have been used in the Taylor series.
99
Vector Notation (1) vector notation: initial conditions
100
more general problem: where F vector two components right-hand sides in (1). depends on t and X, - F(t, X).
101
Systems of ODEs ystem of n first-order differential equations. (4), ODE in vectornotation.
102
Taylor Series Method: Vector Notation
m-order Taylor series method X = X(t), X’ = X’(t), X’’ = X’’(t), and so on.
103
pseudocode TS method - order 4
preceding problem simple change of variables an array and, inner loop.
105
a two-dimensional array
instead of all the different derivative variables; di j ↔ xi( j ) . easy to program computer language supports vector operations.
106
Runge-Kutta Method RK extend to systems of DEs. fourth-order RK method for (4): where X = X(t), and all quantities are vectors with n components except variables t and h.
107
A procedure Runge-Kutta procedure
system to be solved - (4) n equations in The user furnishes: initial value of t, the initial value of X, the step size h, and the number of steps to be taken, nsteps. procedure XP System(n, t, (xi ), ( fi )) – needed: evaluates the right-hand side of (4) for a given value of array (xi ) stores the result in array ( fi ).
108
pseudocode RK4_System1
109
pseudocode RK4_System1
110
pseudocode RK4_System1
111
Illustration illustrate use of this procedure, use System (1) for example. rewritten in the form of (4)
113
A numerical experiment:
compare the results of the TS method and the RK method with the analytic solution of System (1) At the point t = 1.0, the results : TS RK AS x(1.0) ≈ y(1.0) ≈
114
use mathematical software routines found in Matlab, Maple, or Mathematica to
obtain the numerical solution of the system of ordinary differential equations (1) For t over the interval [0, 1], invoke an ODE procedure to march from t = 0 at which x(0) = 1 and y(0) = 0 to t = 1 at which x(1) = and y(1) = To obtain the numerical solution of the ordinary differential equation defined for t over the interval [1, 1.5], invoke an ordinary differential equation solving procedure to march from t = 0 at which x(1) = 2 and y(1) = −2 to t = 1.5 at which x(1.5) ≈ and y(1.5) ≈
115
Autonomous ODE system of differential equations in vector form variable t - explicitly separated from the other variables new variable x0 is t in disguise add a new DE x’0 = 1. a new initial condition x0(a) = a. increase # of DEs from n to n + 1
116
system in vector form: system of two equations given by (1). system with three variables:
117
auxiliary condition for X :
X(0) = [0, 1, 0]T . a system of n + 1 first-order differential equations
118
in general vector notation:
119
A system of DEs without the t variable explicitly present autonomous.
numerical methods not require x0 = t or f0 = 1 or s0 = a. For an autonomous system, the classical fourth-order Runge-Kutta method for System (6) uses these formulas: X = X(t),
120
procedure RK4 System1 modified:
beginning the arrays with 0 rather than 1 and omitting the variable t.
122
Higher-Order Equations and Systems
Higher-Order Differential Equations Systems of Higher-Order Differential Equations Autonomous ODE Systems
123
Higher-Order Equations and Systems
initial-value problem for ODEs of order higher than 1. A DE of order n - n auxiliary conditions initial conditions are needed to specify the solution of the differential equation precisely e.g., a particular second-order initial-value problem:
124
Without the auxiliary conditions, the general analytic solution:
c1 and c2 - arbitrary constants To select one specific solution, c1 and c2 fixed, two initial conditions x(0) = 0 - c2 = −3/8 , and x’(0) = 0 forces c1 = 0.
125
Higher-Order Differential Equations
general form of an ODE with initial conditions solved numerically - turning it into a system of first-order differential equations. define new variables x1, x2, , xn:
126
original initial-value problem (2) equivalent to
127
in vector notation,
128
problem - transformed - new variables, dictionary illustration:
relationship between the new and the old variables illustration: into a form - solution by the Runge-Kutta procedure.
129
A chart summarizing the transformed problem:
corresponding first-order system: X(0) = [3, 7, 13]T .
130
Systems of Higher-Order Differential Equations
introducing new variables, transform a system of DEs of various orders into a larger system of first-order equations e.g., solved by Runge-Kutta procedure
131
transform: X(1) = [2,−4,−2, 7, 6]T .
132
Autonomous ODE Systems
t present on the right-hand side of (3) x0 = t and x0 ’ = 1 introduced to form an autonomous system of ODEs in vector notation.
133
a higher-order system of DEs (2)
written in vector notation as
134
Example the ODE system in (4) in autonomous form: X(1) = [1, 2,−4,−2, 7, 6]T .
135
Adams-Bashforth-Moulton Methods
A Predictor-Corrector Scheme
136
A Predictor-Corrector Scheme
initial-value problem single-step numerical methods if X(t) – known at t, X(t + h) computed no knowledge at points earlier than t RK and TS methods: compute X(t + h) in terms of X(t) and various values of F.
137
More efficient methods computing X(t + h) multistep methods.
X(t), X(t −h), X(t −2h), . . . computing X(t + h) multistep methods. drawback: at the beginning of the numerical solution, no prior values of X are available start - single-step method, such as RK, transfer - multistep procedure enough starting values computed.
138
a multistep formula - Adams-Bashforth method
139
Xb (t + h) - predicted value of X(t + h) computed by (2).
solution X computed at four points t, t − h, t − 2h, t − 3h (2) used to compute X (t + h) one evaluation of F - required for each step. considerable savings over the fourth-order RK procedure; four evaluations of F per step. consideration of truncation error and stability permit a larger step size in RK method and make it much more competitive
140
Corrector (2) not used by itself predictor, another formula – corrector Adams-Moulton formula: (2) predicts a tentative value of X(t +h), (3) computes this X value more accurately predictor-corrector scheme.
141
initial values of X specified at a,
three steps RK method - determine enough X values ABM procedure can begin The fourth-order Adams-Bashforth and Adams-Moulton formulas, started with the fourth-order RK method, Adams-Moulton method. Predictor and corrector formulas of the same order only one application of the corrector formula needed
142
Computational Methods 2018/2019 Fall Chapter 9-C
CSE 551 Computational Methods 2018/2019 Fall Chapter 9-C Boundary-Value Problems for Ordinary Differential Equations
143
Outline Shooting Method
144
References W. Cheney, D Kincaid, Numerical Mathematics and Computing, 6ed, Chapter 14.1
145
Shooting Method A boundary-value problem exemplified: second-orderODE solution function prescribed at the endpoints of the interval
146
a DE - general solution involves two arbitrary parameters.
particular solution - two conditions must be given initial-value problem: x and x’ specified at some initial point In this problem: two points of the form (t, x(t)) - solution curve passes (0, 1) and (π/2,−3) general solution of DE: x(t) = c1 sin(t) + c2 cos(t), two conditions -boundary values determine: c1 = −3 and c2 = 1.
147
problem - unable to determine the general solution model the problem:
step-by-step numerical solution (1) requires two initial conditions one condition at t = a
148
guess x’(a), then carry out the solution of IVproblem as far as b, and hope that the computed solution agrees with β; that is, x(b) = β. If not go back and change guess for x’(a) Repeating this procedure until hit the target β good method learn something from the various trials systematic ways of utilizing this information, shooting.
149
final value x(b) - solution of initial-value problem
depends on guess for x’(a) Everything else remains fixed in this problem. Thus, the differential equation x = f (t, x, x’) and the first initial value, x(a) = α, do not change. If assign a real value z to the missing initial condition,
150
then the initial-value problem can be solved numerically.
x’(a) = z then the initial-value problem can be solved numerically. value of x at b - function of z - ϕ(z) for each choice of z - obtain a new value for x(b), and ϕ is the name of the function with this behavior. know very little about ϕ(z), but compute or evaluate it. an expensive function to evaluate each value of ϕ(z) is obtained only after solving an initial-value problem.
151
shooting method combines
any algorithm for the initial-value problem with any algorithm for finding a zero of a function
152
Shootin metho illustrated
153
Shooting Method Algorithm
a function ϕ(z) is computed: Solve the initial-value problem on the interval [a, b]. Let ϕ(z) = x(b) objective: adjust z until find a value for which ϕ(z) = β linear interpolation between ϕ(z1) and and ϕ(z2),
154
given two values of ϕ, we pretend that
where z1 and z2 : two guesses for the initial condition x’(a). given two values of ϕ, we pretend that ϕ is a linear function and determine an appropriate value of z based on this hypothesis. A sketch of the values of z versus ϕ(z) might look like Figure The strategy just outlined is the secant method for finding a zero of ϕ(z) − β.
155
To obtain an estimating formula for the next value z3, we compute ϕ(z1) and ϕ(z2) on
the basis of values z1 and z2, respectively.
156
By similar triangles repeat this process and generate the sequence all based on two starting values z1 and z2.
157
This procedure for solving the two-point boundary-value problem
is then as follows: Solve the initial-value problem
158
from t = a to t = b, letting the value of the solution at b be denoted by ϕ(z). Do this twice
with two different values of z, say, z1 and z2, and compute ϕ(z1) and ϕ(z2). Now calculate a new z, called z3, by Formula (2). Then compute ϕ(z3) by again solving (4). Obtain z4 from z2 and z3 in the same way, and so on. Monitor
159
ϕ(zn+1) − β to see whether progress is being made. When it is satisfactorily small, stop. This process is called a shooting method. Note that the numerically obtained values x(ti ) for a ti b must be saved until better ones are obtained (that is, one whose terminal value x(b) is closer to β than the present one) because the objective in solving Problem (3) is to obtain va
160
x(t) for values of t between a and b.
The shooting method may be very time-consuming if each solution of the associated initial-value problem involves a small value for the step size h. Consequently, we use a relatively large value of h until |ϕ(zn+1) − β| is sufficiently small and then reduce h to obtain the required accuracy.
161
Example What is the function ϕ for this two-point boundary-value problem?
162
Solution The general solution of the differential equation is x(t) = c1et +c21e-t . The solution of the initial-value problem is
163
Modifications and Refinements
Many modifications and refinements are possible. For instance, when ϕ(zn+1) is near β, one can use higher-order interpolation formulas to estimate successive values of zi . Suppose, for example, that instead of utilizing two values ϕ(z1) and ϕ(z2) to obtain z3, we utilize the four values to estimate z5. set up a cubic interpolatin polynomial p3 for
164
f nd solve for z5. Since p3 is a cubic, this would entail some additional work. A better way may be to set up a polynomial p3 to interpolate the data
165
and then use p3(β) as the estimate for z5
and then use p3(β) as the estimate for z5. This procedure is known as inverse interpolation
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.