Public Sub aaaaaaaa() Dim Ht0 As Single Dim Ht1 As Single Dim Ht2 As Single Dim Ht3 As Single Dim Ht4 As Single Dim Ht5 As Single Dim Ht6 As Single Dim Ht7 As Single Dim Ht8 As Single Dim a0 As Single Dim alfa As Single Dim Hk0 As Single Dim Hk As Single Dim a() As Single Dim L() As Single Dim t(9) As Single Dim Ht(8) As Single Dim e(8) As Single Dim p1(8) As Single Dim p2(8) As Single Dim AT() As Single Dim N_() As Variant Dim W() As Single Dim X() As Variant Dim V0() As Single Dim V() As Single Dim VT() As Single Dim P() As Single Dim b() Hk0 = -22 a0 = 0.4 Do ai = 8 aj = 1 t(0) = 0 Ht(0) = 0 Ht(1) = -5 Ht(2) = -10 Ht(3) = -12.5 Ht(4) = -15 Ht(5) = -17.5 Ht(6) = -18.9 Ht(7) = -19.1 Ht(8) = -20 ReDim a(ai, aj) For i = 0 To 8 t(i + 1) = t(i) + 0.5 e(i) = Hk0 * (1 - Exp(-a0 * t(i))) - Ht(i) p1(i) = Hk0 * t(i) * Exp(-a0 * t(i)) p2(i) = 1 - Exp(-a0 * t(i)) a(i, 0) = p1(i) a(i, 1) = p2(i) Next i ReDim AT(aj, ai) For i = 0 To 8: For j = 0 To 1 AT(j, i) = a(i, j): Next j, i 'aue?enaiea n (oa?ae ?aaei) ReDim N_(aj, aj) For i = 0 To 1: For j = 0 To 1 N_(i, j) = 0 For k = 0 To 8 N_(i, j) = N_(i, j) + a(k, i) * a(k, j): Next k, j, i ReDim W(aj, aj - 1) For i = 0 To 1: For j = 0 To 0 W(i, j) = 0 For k = 0 To 8 W(i, j) = W(i, j) + AT(i, k) * e(k): Next k, j, i 'Ia?auaiea iao?eou With CreateObject("Excel.Application") b = .MInverse(N_) .Quit End With 'Ia?acaienuaaiea iao?eou ni ciaeii ieion e n eciaiaieai ioia?aoee For i = 0 To 1: For j = 0 To 1 N_(i, j) = -b(i + 1, j + 1) Next j, i 'Oiii?aiea ia?auaiiie io?eoaoaeuiie iao?eou ia iao?eoo W ReDim X(aj, aj - 1) For i = 0 To 1: For j = 0 To 0 X(i, j) = 0 For k = 0 To 1 X(i, j) = X(i, j) + N_(i, k) * W(k, aj - 1): Next k, j, i 'Oiii?aiea A ia O ReDim V0(ai, aj - 1) For i = 0 To ai: For j = 0 To aj - 1 V0(i, j) = 0 For k = 0 To aj V0(i, j) = V0(i, j) + a(i, k) * X(k, j): Next k, j, i 'Cei?aiea V0+L=V ReDim V(ai, aj - 1) For i = 0 To ai: For j = 0 To aj - 1 V(i, j) = V0(i, j) + e(i): Next j, i 'O?ainiiie?iaaiea V ReDim VT(aj - 1, ai) For i = 0 To ai: For j = 0 To aj - 1 VT(j, i) = V(i, j): Next j, i 'Oiii?aiea VT*V = P ' aoia A(n_x_m) auoia N_(m_x_m)=AT * A ReDim P(aj - 1, aj - 1) For i = 0 To aj - 1: For j = 0 To aj - 1 P(i, j) = 0 For k = 0 To ai P(i, j) = P(i, j) + V(k, i) * V(k, j): Next k, j, i a0 = a0 + X(0, 0) Hk0 = Hk0 + X(1, 0) Loop Until Abs(X(0, 0)) < 0.1 MsgBox (a0) MsgBox (Hk0) End Sub