' Sub Actionに記述した線形移流方程式
’f:スカラー量
’fn:スカラー量 (更新後)
’df/dt + u df/dx = 0
'dはパーシャルに読み替えてもらえれば。
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
fn(i) = f(i) - u*dt/dx *(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 件のコメント:
コメントを投稿