这段代码是 两个方程的迭代
Private Function nN(a1 As Single, xq As Single, R As Single, XD As Single)
Dim n As Integer, x() As Single, y() As Single
ReDim Preserve y(1)
y(1) = XD
n = 0
Do
n = n + 1
If n > 10 ^ 2 Then
MsgBox "这样的n值过大,程序将崩溃,请检查常数值"
Exit Do
End If
ReDim Preserve x(n + 1)
ReDim Preserve y(n + 1)
x(n) = y(n) / (a1 - (a1 - 1) * y(n))
y(n + 1) = R * x(n) / (1 + R) + XD / (1 + R)
Form2.List1.AddItem n & " " & Format(x(n), "0.0000") & " " & Format(y(n + 1), "0.0000")
Loop Until x(n) <= xq
nN = n
End FunctionPrivate Function mN(a2 As Single, XW As Single, w1 As Single, W As Single, q As Single, L As Single, F As Single)
Dim m As Integer, x() As Single, y() As Single
ReDim Preserve x(1)
x(1) = w1
m = 0
Do
m = m + 1
If m > 10 ^ 2 Then
MsgBox "这样的m值过大,程序将崩溃,请检查常数值"
Exit Do
End If
ReDim Preserve x(m + 1)
ReDim Preserve y(m + 1)
y(m + 1) = (L + q * F) * x(m) / (L + q * F - W) - W * XW / (L + q * F - W)
x(m + 1) = y(m + 1) / (a2 - (a2 - 1) * y(m + 1))
Form2.List2.AddItem m & " " & Format(y(m + 1), "0.0000") & " " & Format(x(m + 1), "0.0000")
Loop Until x(m + 1) <= XW
mN = m
End Function
Private Function nN(a1 As Single, xq As Single, R As Single, XD As Single)
Dim n As Integer, x() As Single, y() As Single
ReDim Preserve y(1)
y(1) = XD
n = 0
Do
n = n + 1
If n > 10 ^ 2 Then
MsgBox "这样的n值过大,程序将崩溃,请检查常数值"
Exit Do
End If
ReDim Preserve x(n + 1)
ReDim Preserve y(n + 1)
x(n) = y(n) / (a1 - (a1 - 1) * y(n))
y(n + 1) = R * x(n) / (1 + R) + XD / (1 + R)
Form2.List1.AddItem n & " " & Format(x(n), "0.0000") & " " & Format(y(n + 1), "0.0000")
Loop Until x(n) <= xq
nN = n
End FunctionPrivate Function mN(a2 As Single, XW As Single, w1 As Single, W As Single, q As Single, L As Single, F As Single)
Dim m As Integer, x() As Single, y() As Single
ReDim Preserve x(1)
x(1) = w1
m = 0
Do
m = m + 1
If m > 10 ^ 2 Then
MsgBox "这样的m值过大,程序将崩溃,请检查常数值"
Exit Do
End If
ReDim Preserve x(m + 1)
ReDim Preserve y(m + 1)
y(m + 1) = (L + q * F) * x(m) / (L + q * F - W) - W * XW / (L + q * F - W)
x(m + 1) = y(m + 1) / (a2 - (a2 - 1) * y(m + 1))
Form2.List2.AddItem m & " " & Format(y(m + 1), "0.0000") & " " & Format(x(m + 1), "0.0000")
Loop Until x(m + 1) <= XW
mN = m
End Function
代表什么意思。