Курсовая работа: Визуализация численных методов
Min = y0
Max = y0
l(0) = x0
y(0) = y0
YE(0) = y0
YR(0) = y0
YT(0) = y0
For i = 0 To N
l(i + 1) = x0 + i * h
k1 = h * fun(l(i), YR(i))
k2 = h * fun(l(i) + h / 2, YR(i) + k1 / 2)
k3 = h * fun(l(i) + h / 2, YR(i) + k2 / 2)
k4 = h * fun(l(i) + h, YR(i) + k3)
k = (k1 + 2 * k2 + 2 * k3 + k4) / 6
YR(i + 1) = YR(i) + k
YE(i + 1) = YE(i) + h * fun(l(i), YE(i))
YT(i) = (l(i + 1) + 1) * 2 - 2
MSFlexGrid1.TextMatrix(i + 1, 0) = l(i + 1)
MSFlexGrid1.TextMatrix(i + 1, 1) = YE(i)
MSFlexGrid1.TextMatrix(i + 1, 2) = YR(i)
MSFlexGrid1.TextMatrix(i + 1, 3) = YT(i)
If YE(i) > Max Then max1 = YE(i)
If YE(i) < Min Then min1 = YE(i)
If YR(i) > Max Then Max2 = YR(i)
If YR(i) < Min Then Min2 = YR(i)
If YT(i) > Max Then Max3 = YT(i)
If YT(i) < Min Then Min3 = YT(i)
Next i
For i = 0 To N - 1