The Mathematics of Financial Modelingand Investment Management

(Brent) #1

9-DifferntEquations Page 252 Wednesday, February 4, 2004 12:51 PM


252 The Mathematics of Financial Modeling and Investment Management

f′(x+ ∆x)– f′()x
f′′()≈----------------------------------------------
∆x
( ( ( ()

x

fx+ 2 ∆x)– fx+ ∆x) fx+ ∆x)– fx
---------------------------------------------------------– ----------------------------------------
∆x ∆x
= --------------------------------------------------------------------------------------------------------
∆x
fx( + 2 ∆x)– 2 fx( + ∆x)+ fx()
= ------------------------------------------------------------------------------
(∆x)
2

With this approximation, the original equation becomes

f′′()+ kf x
fx+ 2 ∆x)– 2 fx+ ∆x)+ fx
x ()≈------------------------------------------------------------------------------+ kf x
( ( ()
()= 0
(∆x)
2

fx( + 2 ∆x)– 2 fx( + ∆x)+ ( 1 + kx(∆ )^2 )fx()= 0

We can thus write the approximation scheme:

fx( + ∆x)= fx()+ ∆xf′() x


fx( + 2 ∆x)= 2 fx( + ∆x)– ( 1 + kx(∆ ) ()
2
)fx

Given the increment ∆xand the initial values f(0),f′(0), using the above
formulas we can recursively compute f(0 + ∆x), f(0 + 2∆x), and so on.
Exhibit 9.2 illustrates this computation.
In practice, the Euler approximation scheme is often not sufficiently
precise and more sophisticated approximation schemes are used. For
example, a widely used approximation scheme is the Runge-Kutta
method. We give an example of the Runge-Kutta method in the case of
the equation f′′+ f= 0 which is equivalent to the linear system:

x′= y


y′= –x


In this case the Runge-Kutta approximation scheme is the following:

k 1 = hy i()

h 1 = –hx i()
Free download pdf