逐次代入法的定义:

Public Class Successive
    
Dim eps As Double = 0.001
    
Dim Iteration As Integer = 1000

    
Public Sub New()
    
End Sub

    
Public Sub New(ByVal eps As DoubleByVal iteration As Integer)
        
Me.eps = eps
        
Me.Iteration = iteration
    
End Sub

    
Public Function Solution(ByVal G As Func(Of DoubleDouble), ByVal x As DoubleAs Double
        
Dim i As Integer = 0

        
Dim x_new, x_old As Double
        x_old 
= x
        
Do
            i 
+= 1
            x_new 
= G(x_old)
            
If Math.Abs(x_old - x_new) < eps Then Return x_new
            x_old 
= x_new
        
Loop While i < Iteration
        
Throw New Exception()
    
End Function
End Class

相关文章:

  • 2021-06-22
  • 2021-12-21
  • 2021-08-11
  • 2021-06-12
  • 2021-11-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-03
  • 2022-01-01
  • 2021-06-15
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
相关资源
相似解决方案