Option Strict On
Module Module1
    Function f(ByVal s As Double, ByVal r As Double) As Double
        Return Math.Exp(-0.0076 * (s ^ 2)) * Math.Sin(2.67 * s - 0.00004 * (s ^ 3)) * Math.Sin(s * r) / s / (s * r)
    End Function
    Function g(ByVal s As Double, ByVal r As Double) As Double
        If s = 0.0000000001 Then
            Return f(s, r)
        Else
            Return f(s - 0.2, r) + f(s, r)
        End If
    End Function
    Sub Main()

        Dim r As Double
        Dim s1 As Double = 30.0000000001
        Dim P As Double
        Dim rmax As Double = 3.0
        Dim rmin As Double = 2.2
        Dim dr As Double = 0.05
        Dim a As Double = 0
        Dim b As Double = 30
        Dim dx As Double = 0.2
        Console.WriteLine("Шаг интегрирования по s:   {0:F2}", dx)
        Console.WriteLine()
        Console.WriteLine("     r            P(r)   ")
        Console.WriteLine("--------------------------------")
        For r = rmin To rmax Step dr
            P = g(s1, r)
            Dim T As Double = f(0.0000000001, r)
            Dim Q As Double = f(s1, r)
            Console.WriteLine(" {0} ,   {1}  ", P, Q)
        Next
        Console.ReadLine()
    End Sub

End Module
