The Mathematics of Financial Modelingand Investment Management

(Brent) #1

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


Differential Equations and Difference Equations 255

EXHIBIT 9.4 Numerical Solution of the Equation f ′′ + f = 0 with the Runge-Kutta
Method

that is, knowledge of the future position of a system. However, they often
appear in static systems and when trying to determine what initial condi-
tions should be imposed to reach a given goal at a given date.
In the case of boundary conditions, one cannot write a direct recur-
sive scheme; it’s necessary to solve a system of equations. For instance, we
could introduce the derivative f′(x) = δ as an unknown quantity. The dif-
ference quotient that approximates the derivative becomes an unknown.
We can now write a system of linear equations in the following way:

fx(∆
∆x

 )^ = f^0 +δ^ ∆x
         
( ) 2 fx(∆^2
∆x

f 2 = ) – (
1 +k( ∆x ) )f (^0)
f(
3 ∆x) = 2 f (
2
) – (
1 +k( ∆x )
2 )fx ( )∆
.
.
.
2
f 1000 =
2 f (
999
∆x ) – (
1



  • k ( ∆x ) ) f (
    998
    ∆x )

Free download pdf