Mathematical Physics - Volume II - Numerical Methods

1.1 Finite difference method

19

where

D n = U n j +( 1 − W ) r δ 2 D 1 = U 1 j +( 1 − W ) r δ 2 D N − 1 = U N − 1 , j +( 1 − W ) r δ 2

x U n j ( n = 2 , 3 , . . . , N − 2 ) ,

(1.45) (1.46) (1.47)

x U 1 j + WrU 0 , j + 1 ,

x U N − 1 , j + WrU N , j + 1 .

Programs for implicit and explicit method are shown in the following section, along with their corresponding results. In the case of the explicit method, a total of ten steps were used and parameter r was equal to 1 / 6, and 1 / 2, whereas for the implicit method ( W = 0 . 5, and W = 1), this parameter was r = 1 / 2, with the same number of steps. Results have shown that the best compliance was obtained for r equal to 1 / 6, in the case of the explicit method.

W = . 50 N = 10

W = 1 . 00

VK = . 005000

N = 10

VK = . 005000

T = . 50 NUMERICKI TACˇ NO

T = . 50 NUMERICKI TACˇ NO

Z = . 0 Z = . 1 Z = . 2 Z = . 3 Z = . 4 Z = . 5 Z = . 6 Z = . 7 Z = . 8 Z = . 9 Z = 1 . 0

. 000000 . 231190 . 439749 . 605263 . 711529 . 748146 . 711529 . 605263 . 439749 . 231190 . 000000

. 000000 . 222242 . 422730 . 581837 . 683991 . 719190 . 683991 . 581837 . 422729 . 222242 . 000000

Z = . 0 Z = . 1 Z = . 2 Z = . 3 Z = . 4 Z = . 5 Z = . 6 Z = . 7 Z = . 8 Z = . 9 Z = 1 . 0

. 000000 . 259880 . 494321 . 680375 . 799828 . 840989 . 799828 . 680375 . 494321 . 259880 . 000000

. 000000 . 222242 . 422730 . 581837 . 683991 . 719190 . 683991 . 581837 . 422729 . 222242 . 000000

PROGRAM i1djd DIMENSION a(101) , b(101) , c(101) , d(101) , u(0:101)

OPEN (1,FILE=’ULAZ’) OPEN (2,FILE=’IZLAZ’) pi = 4.*atan(1.) READ (1,99005) n , vk , w DO 100 i = 0 , n h = 1./n z = i*h u(i) = 100.*sin(pi*z)

100 CONTINUE l = n - 1 200 DO 300 i = 1 , l

a(i) = -w*vk*n*n b(i) = 1. + 2.*w*vk*n*n

Made with FlippingBook flipbook maker