Private Sub Command1_Click() Dim tolerance, ZetaGuess1, ZetaGuess2, ZetaGuess3, ZetaGuess4, Zeta1, Zeta2, Zeta3, Zeta4, f1, f1d, f2, f2d, f3, f3d, f4, f4d, damping, error As Double tolerance = 0.00001 h = Val(Text_h.Text) L = Val(Text_L.Text) k = Val(Text_k.Text) bi = h * L / k 'use damping for large bi numbers, but limit damping for large bi numbers If bi <= 1 Then damping = 1 ElseIf bi < 500 Then damping = 1 / bi Else damping = 0.001 End If Label_bi.Caption = bi 'For loop for number of roots For j = 1 To 4 Zeta = (j - 1) * (3) + 0.7 'For loop for iterations of Newton's Method Do 'Newton's Method f = Zeta * Tan(Zeta) - bi fd = (Sin(Zeta) * Cos(Zeta) + Zeta) / (Cos(Zeta)) ^ 2 Zeta = Zeta - (f / fd) * damping 'Label roots If j = 1 Then Label_z1.Caption = Format(Zeta, "0.0000") ElseIf j = 2 Then Label_z2.Caption = Format(Zeta, "0.0000") ElseIf j = 3 Then Label_z3.Caption = Format(Zeta, "0.0000") Else Label_z4.Caption = Format(Zeta, "0.0000") End If Loop While Abs(f) > tolerance Next j End Sub Private Sub Command2_Click() End End Sub Private Sub Label9_Click() End Sub