*参考(指定した)n個-偶数のstehfestの係数を与える関数)
Rem StehfestCoefficients returns coefficients in Stehfest inversion formula
Function StehfestCoefficients(Nterms As Integer) As Variant
Dim i As Integer, j As Integer, k As Integer, nh As Integer, sn As Integer, nn As Integer
nh = Nterms / 2 'Must be even
Nterms = 2 * nh
ReDim Coeffs(0 To Nterms) As Double, g(0 To Nterms) As Double, h(0 To nh) As Double
g(0) = 1
For i = 1 To Nterms
g(i) = g(i - 1) * i
Next i
h(1) = 2# / g(nh - 1)
For i = 2 To nh
h(i) = Exp(nh * Log(i)) * g(2 * i) / (g(nh - i) * g(i) * g(i - 1))
Next i
If nh Mod 2 = 0 Then sn = 1 Else sn = -1
For i = 1 To Nterms
Coeffs(i) = 0
If i < nh Then nn = i Else nn = nh
j = Int((i + 1) / 2)
For k = j To nn
Coeffs(i) = Coeffs(i) + h(k) / (g(i - k) * g(2 * k - i))
Next k
sn = -sn
Coeffs(i) = Coeffs(i) * sn
Next i
StehfestCoefficients = Coeffs
End Function
Cv:一定暴露時の濃度
hm:対流伝達係数(気相側)
単位はhr, cm, μg, mlに統一、ただしKsc-gとKve-gは濃度比なので単位はありません。
以下ソースコードです
Rem エクセル 開発 --> visual basic --> 挿入 --> 標準モジュール --> 下記コードの貼り付け
Rem 2層膜累積透過量q(t) gas-phase -------
Public Function layer2shqtgas(time As Double, dsLs2 As Double, KsLs As Double, ddLd2 As Double, KdLd As Double, Cv As Double, hm As Double) As Double
Dim vv(100) As Double
Dim qtsh As Double
Dim qs As Double
Dim ds As Double
Dim dd As Double
Dim zs As Double
Dim gs As Double
Dim cosh As Double
Dim sinh As Double
Dim coshd As Double
Dim sinhd As Double
Dim ss As Double