dim v(70,450) as double dim v1(70,450) as double dim v2(70,450) as double dim v3(70,450) as double dim v4(70,450) as double dim v5(70,450) as double dim alph as double dim beta as double dim weight as double dim count as integer dim check as integer dim con as integer dim x as integer dim y as integer dim track as integer dim e1 as double dim e2 as double weight = 0.1 open "2dacceltestw0p1c.csv" for output as #1 for x = 1 to 70 for y = 0 to 450 v(x,y) = 0 next next track = 1 again: for count = track to track+5 for x = 2 to 69 for y = 1 to 449 v5(x,y) = (v(x-1,y) + v(x+1,y)+v(x,y-1)+v(x,y+1)+1)/4 next next for y = 1 to 449 v5(1,y) = v(2,y) v5(70,y) = v(69,y) next for x = 1 to 70 v5(x,450) = v(x,449) next print #1, count;",";v5(35,1);",";v5(35,450) for x = 1 to 70 for y = 1 to 450 v1(x,y) = v2(x,y) v2(x,y) = v3(x,y) v3(x,y) = v4(x,y) v4(x,y) = v5(x,y) v(x,y) = v5(x,y) next next next track = track + 6 count = track con = 0 do if track / 100 = int(track/100) then print track for x = 2 to 69 for y = 1 to 449 v5(x,y) = (v(x-1,y) + v(x+1,y)+v(x,y-1)+v(x,y+1)+1)/4 next next for y = 1 to 449 v5(1,y) = v(2,y) v5(70,y) = v(69,y) next for x = 1 to 70 v5(x,450) = v(x,449) next for x = 1 to 70 for y = 1 to 450 v1(x,y) = v2(x,y) v2(x,y) = v3(x,y) v3(x,y) = v4(x,y) v4(x,y) = v5(x,y) v(x,y) = v5(x,y) next next check = 1 for x = 1 to 70 for y = 1 to 450 if (v4(x,y)-v3(x,y))/(v2(x,y)-v1(x,y)) >= 0 then alph = sqr((v4(x,y)-v3(x,y))/(v2(x,y)-v1(x,y))) if alph >= 1 then check = 0 if alph <= -1 then check = 0 else check = 0 end if next next if check = 1 then con = con + 1 if check = 0 then con = 0 print #1, count;",";v(35,1);",";v(35,450) count = count + 1 track = track + 1 loop until con >= 450 or count > 200000 if count > 200000 then goto finish REM Extrapolation step for x = 1 to 70 for y = 1 to 450 alph = sqr((v5(x,y)-v4(x,y))/(v3(x,y)-v2(x,y))) beta = (v5(x,y)+v4(x,y)+v3(x,y))/3 - (v4(x,y)+v3(x,y)+v2(x,y))*alph/3 e1 = beta/(1-alph) alph = sqr((v4(x,y)-v3(x,y))/(v2(x,y)-v1(x,y))) beta = (v4(x,y)+v3(x,y)+v2(x,y))/3 - (v3(x,y)+v2(x,y)+v1(x,y))*alph/3 e2 = beta/(1-alph) v(x,y) = (2-weight)/(weight/v(x,y) + (1-weight)*(1/e1+1/e2)) next next print #1, count;",";v(35,1);",";v(35,450) count = count + 1 track = track + 1 goto again finish: close #1