Option Strict On
Module Module1

    Sub Main()
        Dim L, tc, T, sum, n, pi, k, eps, Lmax, Lmin, dL, tcmin, tcmax, dtc As Double
        k = 100
        tcmin = 1
        tcmax = 10
        dtc = 1
        Lmax = 2.8
        Lmin = 0.2
        dL = 0.2
        pi = Math.PI
        eps = 0.000001
        For i As Integer = 0 To CInt((Lmax - Lmin) / dL)
            L = Lmin + i * dL
            Console.Write("{0}  ", L)

        Next i
        Console.WriteLine()
        For j As Integer = 0 To CInt((tcmax - tcmin) / dtc)
            tc = tcmin + j * dtc
            For i As Integer = 0 To CInt((Lmax - Lmin) / dL)
                L = Lmin + i * dL
                n = 1
                sum = 0
                Do
                    sum = sum + 30 / n / pi * Math.Exp(-2 * n ^ 2 * pi ^ 2 * tc / 9 / k) * (Math.Cos(pi * n) - 1) * Math.Sin(n * pi * L / 3)
                    n = n + 1
                Loop Until (30 / n / pi * Math.Exp(-2 * n ^ 2 * pi ^ 2 * tc / 9 / k)) < eps
                T = 10 * L + 10 + sum

                Console.Write("{0:f3} ", T)
            Next i
            Console.WriteLine()

        Next j
        Console.ReadLine()
    End Sub

End Module
