Option Strict On
Module Module1

    Sub Main()
        Const k As Double = 100
        Dim time As Double = 1
        Dim Lmin As Double = 0.2
        Dim Lmax As Double = 2.8
        Dim dL As Double = 0.2
        Dim L As Double
        Dim n As Integer = 0
        Dim Tsum As Double = 0
        Dim T As Double = Tsum
        Console.WriteLine(" t={0}", time)
        Console.WriteLine()
        Console.WriteLine(" L   Температура")
        Console.WriteLine(" ----------------")
        For i As Integer = 0 To CInt((Lmax - Lmin) / dL)
            L = Lmin + i * dL
            n = 0
            Tsum = 0
            T = Tsum
            Do
                n = n + 1
                Tsum = 30 / n / Math.PI * (Math.Exp(-2 * (n ^ 2 * Math.PI ^ 2) * time / (9 * k)) * (Math.Cos(n * Math.PI) - 1) * Math.Sin(n * Math.PI * L / 3))
                T = T + Tsum
            Loop Until (Math.Exp(-2 * (n ^ 2 * Math.PI ^ 2) * time / (9 * k)) < 0.000001)
            T = 10 * L + 10 + T
            Console.WriteLine(" {0:F1}    {1,6:F3}", L, T)
        Next i
       
        Console.ReadLine()
    End Sub

End Module
