Public Function DiffOneOrder(ByVal tn As Double) As Double
        '步长h>0
        '采用四阶龙贝格算法求解
        '参考:王超能.数值分析简明教程(第二版)[M].高等教育出版社,北京,2004:105
        ' y'=Fun(t,y)
        '边界条件 t=t0，y=y0
        '求 t=tn时的y
        Dim h6, h2, K1, K2, K3, K4, f0, f1, x0, x1, t, x2, t0 ,y0,h As Double
        t0=0'这里设置初始时刻的值,视情况更改
        y0=0'这里设置边界条件t0时刻的值,视情况更改
        h=0.001'这里设置步长,视情况更改
        
        h = Math.Abs(h)
        If h < 0.000000000001 Then
            h = Math.Abs((tn - t0)) / 100
            If h < 0.000000000001 Then
                Return y0
            End If
        End If
        h6 = h / 6
        h2 = h / 2
        x1 = t0
        f1 = y0
        t = t0
        If tn < t0 Then
            GoTo StartStep
        ElseIf tn - t0 < h / 20 Then
            Return y0
        End If
        While t < tn
            x0 = x1
            f0 = f1
            x2 = t + h2
            t += h
            K1 = FunDiff(x0, f0)
            K2 = FunDiff(x2, f0 + h2 * K1)
            K3 = FunDiff(x2, f0 + h2 * K2)
            K4 = FunDiff(t, f0 + h * K3)
            f1 = K2 + K3
            f1 = f0 + h6 * (f1 + f1 + K1 + K4)
            x1 = t
        End While
        GoTo EndStep
StartStep:
        If t0 - tn < h / 20 Then
            Return y0
        End If
        While t > tn
            x0 = x1
            f0 = f1
            x2 = t - h2
            t += h
            K1 = FunDiff(x0, f0)
            K2 = FunDiff(x2, f0 - h2 * K1)
            K3 = FunDiff(x2, f0 - h2 * K2)
            K4 = FunDiff(t, f0 - h * K3)
            f1 = K2 + K3
            f1 = f0 - h6 * (f1 + f1 + K1 + K4)
            x1 = t
        End While
EndStep:

    End Function
    Public Function FunDiff(ByRef t As Double, ByRef y As Double) As Double
        Return @f'这个地方@F替换成你的函数表达式
    End Function