Dim s as string
Dim i as integer
dim f() as double
dim fn() as double
dim n As Integer
dim fout as FolderItem
Dim txtout as TextOutputStream
s = "Program START!"
lbResult.AddRow(s)
Redim f(ixmx)
Redim fn(ixmx)
For i = 1 to ixmx
f(i) = 0.0
fn(i) = 0.0
If i>10 And i<20 Then
f(i) = 1.0
fn(i) =1.0
end if
s =str(i) +","+ str(f(i))
lbResult.AddRow(s)
next i
For n=1 to 100
for i =2 to Ixmx-1
'1次風上
fn(i) = f(i) - u*dt/dx *(f(i) - f(i-1))
'オリジナルLaxWendroff法
fn(i) = f(i) -u*dt/(2.0*dx)*(f(i+1)-f(i-1))+0.5*u*u*dt*dt/dx/dx*(f(i+1)-2*f(i)+f(i-1))
next i
for i = 2 to ixmx
f(i) = fn(i)
next i
next n
For i = 1 to ixmx
s = str(i) + ","+str(f(i))
lbResult.AddRow(s)
next i
0 件のコメント:
コメントを投稿