{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Comp_Fin_HW6

# Comp_Fin_HW6 - Jaime Frade Computational Finance Dr Kopriva...

This preview shows pages 1–4. Sign up to view the full content.

Jaime Frade Computational Finance: Dr. Kopriva Homework #6 1. Show that once can approximate the intial value problem for y = F ( t, y ) by Y n +1 = Y n + Δ t F ( t n +1 / 2 , Y n +1 / 2 ) (1) where t n +1 / 2 = t n + Δ t 2 . NOTE: For Midpoint Rule over [ a, b ] b a f ( x ) dx = ( b - a ) f a + b 2 (2) Integrating y = F ( t, y ) over [ t n +1 , t n ], by using the midpoint quadrature will obtain: t n +1 t n y dt = t n +1 t n F ( t, y ) dt = ( t n +1 - t n ) F ( t n +1 / 2 , y ( t n +1 / 2 )) + τ n From (2) = Δ t F ( t n +1 / 2 , y ( t n +1 / 2 )) + τ n From Δ t = t n +1 - t n (3) where τ n is the local truncation error. Define Δ t = ( t n +1 - t n ) and t n +1 / 2 = t n + Δ t 2 From (3), obtain the following: y ( t n +1 ) - y ( t n ) = Δ t F ( t n +1 / 2 , y ( t n +1 / 2 )) + τ n (4) Define y ( t n ) = y n Y n , y ( t n +1 ) = y n +1 Y n +1 , and y ( t n +1 / 2 ) = y n +1 / 2 Y n +1 / 2 . From above, can redefine (4) to obtain the following: Y n +1 = Y n + Δ t F ( t n +1 / 2 , Y n +1 / 2 ) (5) Show that this approximation is second order. I will use a-posterior approach using the Talyor Series. Let Δ t * = Δ t 2 . y n +1 = y n +1 / 2 + Δ t * y n +1 / 2 + (Δ t * ) 2 y n +1 / 2 2! + (Δ t * ) 3 y ( ξ ) 3! (6) y n = y n +1 / 2 - Δ t * y n +1 / 2 + (Δ t * ) 2 y n +1 / 2 2! - t * ) 3 y ( ξ ) 3! (7) Taking the difference between (6) and (7), will obtain: y n +1 - y n = Δ t y n +1 / 2 + (Δ t * ) 3 y ( ξ ) 3 = Δ t F ( t n +1 / 2 , Y n +1 / 2 ) + (Δ t * ) 3 y ( ξ ) 3 = LTE (8) Comparing (8) and (4), obtain the following for the local truncation error(LTE): τ n = O ((Δ t ) 3 ) (9) The approximation when using (5) is second order from above (9) 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2. To solve (5), one needs the value for Y n +1 / 2 . This can be approximated using Euler’s Method to give the following scheme. Y * n +1 / 2 = Y n + Δ t 2 F ( t n , Y n ) (10) Y n +1 = Y n + Δ t F ( t n +1 / 2 , Y * n +1 / 2 ) (11) Show that this method is second order. Let Δ t * = Δ t 2 . From (10), can approximate with a local trunction error using the talyor series as: y * n +1 / 2 = y n + (Δ t * ) y n + τ * (12) I will use a-posterior approach using the Talyor Series for y n +1 / 2 Y n +1 / 2 . y n +1 / 2 = y n + Δ t * y n +(Δ t * ) 2 y n 2! + O ((Δ t * ) 3 ) = Y * n +1 / 2 + τ * + (Δ t * ) 2 y n 2! + O ((Δ t * ) 3 ) From (12) (13) Using Talyor Series on to expand F ( t n +1 / 2 , Y * n +1 / 2 ), from (11). F ( t n +1 / 2 , Y * n +1 / 2 ) = F ( t n +1 / 2 , Y n +1 / 2 ) + ( Y * n +1 / 2 - Y n +1 / 2 =(13) ) ∂F ∂Y + O (( Y * n +1 / 2 - Y n +1 / 2 ) 2 t 2 ) 2 ) = F ( t n +1 / 2 , Y n +1 / 2 ) + Y * n +1 / 2 - Y * n +1 / 2 - t * ) 2 Y n 2! + O ((Δ t * ) 3 ) ∂F ∂Y + O ((Δ t ) 4 ) = F ( t n +1 / 2 , Y n +1 / 2 ) + - t * ) 2 Y n 2! + O ((Δ t * ) 3 ) ∂F ∂Y + O ((Δ t ) 4 ) (14) Multiplying both sides of (14) by (Δ t ), will then subsitute into (11). Δ t F ( t n +1 / 2 , Y * n +1 / 2 ) = Δ t F ( t n +1 / 2 , Y n +1 / 2 ) + Δ t - t * ) 2 Y n 2! + O ((Δ t * ) 3 ) ∂F ∂Y + O ((Δ t ) 5 ) = Δ t F ( t n +1 / 2 , Y n +1 / 2 ) + O ((Δ t * ) 3 ) (15) From (11) and using (14) from above, will obtain the local truncation error for this method of approximation y n +1 - y n = Δ t F ( t n +1 / 2 , Y * n +1 / 2 ) =(15) From (11) = Δ t F ( t n +1 / 2 , Y n +1 / 2 ) + O ((Δ t * ) 3 ) (16) Obtain the following for the local truncation error(LTE) for the approximation which is second order: τ n = O ((Δ t ) 3 ) (17) 2
2. To solve (5), one needs the value for Y n +1 / 2 . This can be approximated using Euler’s Method to give the following scheme.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 14

Comp_Fin_HW6 - Jaime Frade Computational Finance Dr Kopriva...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online