VERSION 5.00 Begin VB.Form Form7 BackColor = &H00FFC0C0& Caption = "Исследование погрешности метода " ClientHeight = 7650 ClientLeft = 60 ClientTop = 450 ClientWidth = 8565 LinkTopic = "Form7" ScaleHeight = 7650 ScaleWidth = 8565 StartUpPosition = 3 'Windows Default Begin VB.Frame Frame1 BackColor = &H00FF80FF& Caption = "Сведения к графику" Height = 2055 Left = 240 TabIndex = 16 Top = 4800 Width = 7095 Begin VB.PictureBox Picture3 BackColor = &H80000009& Height = 495 Left = 120 ScaleHeight = 435 ScaleWidth = 1275 TabIndex = 22 Top = 1320 Width = 1335 End Begin VB.PictureBox Picture2 BackColor = &H80000009& Height = 495 Left = 120 ScaleHeight = 435 ScaleWidth = 1275 TabIndex = 21 Top = 480 Width = 1335 End Begin VB.TextBox Text2 Height = 285 Left = 3600 TabIndex = 19 Text = "N" Top = 1200 Width = 735 End Begin VB.TextBox Text1 Height = 285 Left = 3600 TabIndex = 17 Text = "eps" Top = 480 Width = 615 End Begin VB.Label Label3 BackColor = &H00C0FFC0& Caption = "Метод Симпсона" Height = 375 Left = 1680 TabIndex = 24 Top = 1440 Width = 1335 End Begin VB.Label Label2 BackColor = &H00C0FFC0& Caption = "Метод трапеций" Height = 375 Left = 1680 TabIndex = 23 Top = 600 Width = 1455 End Begin VB.Label Label7 BackColor = &H00C0FFC0& Caption = "Количество разбиений" Height = 375 Left = 4560 TabIndex = 20 Top = 1200 Width = 2055 End Begin VB.Label Label6 BackColor = &H00C0FFC0& Caption = "Погрешность метода" Height = 315 Left = 4560 TabIndex = 18 Top = 480 Width = 1815 End End Begin VB.PictureBox Picture1 BackColor = &H80000009& FillColor = &H00FFFFFF& Height = 4455 Left = 0 ScaleHeight = 4395 ScaleWidth = 8355 TabIndex = 2 Top = 120 Width = 8415 Begin VB.Label Label8 BackColor = &H8000000E& Height = 200 Index = 10 Left = 5160 TabIndex = 15 Top = 3840 Width = 370 End Begin VB.Label Label8 BackColor = &H8000000E& Height = 200 Index = 0 Left = 1200 TabIndex = 14 Top = 3720 Width = 300 End Begin VB.Label Label8 BackColor = &H8000000E& Height = 200 Index = 9 Left = 2880 TabIndex = 13 Top = 3480 Width = 350 End Begin VB.Label Label8 BackColor = &H8000000E& Height = 200 Index = 8 Left = 3240 TabIndex = 12 Top = 1680 Width = 375 End Begin VB.Label Label8 BackColor = &H8000000E& Height = 200 Index = 7 Left = 720 TabIndex = 11 Top = 2040 Width = 350 End Begin VB.Label Label8 BackColor = &H8000000E& Height = 200 Index = 6 Left = 2280 TabIndex = 10 Top = 3120 Width = 350 End Begin VB.Label Label8 BackColor = &H8000000E& Height = 195 Index = 5 Left = 4560 TabIndex = 9 Top = 1680 Width = 350 End Begin VB.Label Label8 BackColor = &H8000000E& Height = 200 Index = 4 Left = 3480 TabIndex = 8 Top = 1200 Width = 300 End Begin VB.Label Label8 BackColor = &H8000000E& Height = 200 Index = 3 Left = 2400 TabIndex = 7 Top = 3600 Width = 300 End Begin VB.Label Label8 BackColor = &H8000000E& Height = 200 Index = 2 Left = 4200 TabIndex = 6 Top = 3600 Width = 300 End Begin VB.Label Label8 BackColor = &H8000000E& Height = 200 Index = 1 Left = 1800 TabIndex = 5 Top = 3600 Width = 300 End Begin VB.Label Label5 BackColor = &H8000000E& Height = 200 Left = 720 TabIndex = 4 Top = 3480 Width = 255 End Begin VB.Label Label4 BackColor = &H8000000E& Height = 255 Left = 120 TabIndex = 3 Top = 3480 Width = 375 End End Begin VB.CommandButton Command2 BackColor = &H000080FF& Caption = "Возврат" Height = 495 Left = 4920 TabIndex = 1 Top = 6960 Width = 1215 End Begin VB.CommandButton Command1 BackColor = &H00C0C0FF& Caption = "Построить" Height = 495 Left = 1080 TabIndex = 0 Top = 7080 Width = 1215 End End Attribute VB_Name = "Form7" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Command1_Click() eps = Abs(trap(a, b, 10) - (nuton(b) - nuton(a))) p = Abs(trap(a, b, 200) - (nuton(b) - nuton(a))) Picture1.Scale (-30, eps + 20 * p)-(220, -50 * p) Picture1.Line (0, -10 * p)-(220, -10 * p) Picture1.Line (0, -10 * p)-(0, eps + 20 * p) Label4.AutoSize = True Label4.Left = -13 Label4.Top = eps + 18 * p Label4.Caption = "eps" Label5.AutoSize = True Label5.Left = 215 Label5.Top = -25 * p Label5.Caption = "N" For j = 0 To 200 Step 10 Picture1.CurrentX = j - 5 Picture1.CurrentY = -12 * p Picture1.Print Str(j) Next 'm = 20 'n = 0 'For j = 0 To 10 'Label8(j).Width = 350 'Label8(j).Left = n - 5 'Label8(j).Top = -20 * p 'Label8(j).Caption = Str(n) 'n = n + m 'Next For l = 0 To 200 Step 10 Picture1.Line (l, -9 * p)-(l, -12 * p) Next 'Label1.AutoSize = True 'Label1.AutoSize = True 'Label1.Left = a 'Label1.Top = -40 * p 'Label1.Caption = "a=1" h = 10 For n = 10 To 200 - h Step h eps1 = Abs(trap(a, b, n) - (nuton(b) - nuton(a))) eps2 = Abs(trap(a, b, n + h) - (nuton(b) - nuton(a))) Picture1.Line (n, eps1)-(n + h, eps2), vbRed For i = 1 To 10000000 Next Next For n = 10 To 200 - h Step h eps3 = Abs(simpson(a, b, n) - (nuton(b) - nuton(a))) eps4 = Abs(simpson(a, b, n + h) - (nuton(b) - nuton(a))) Picture1.Line (n, eps3)-(n + h, eps4), vbGreen For i = 1 To 10000000 Next Next For n = 10 To 40 Step h eps1 = Abs(trap(a, b, n) - (nuton(b) - nuton(a))) Picture1.Line (n, eps1)-(n, -12 * p) Picture1.Line (-0.5, eps1)-(n, eps1), vbRed Picture1.CurrentX = -25 Picture1.CurrentY = eps1 + 0.000001 Picture1.Print Format(eps1, "0.0000000") Next For n = 10 To 20 Step h eps3 = Abs(simpson(a, b, n) - (nuton(b) - nuton(a))) Picture1.Line (n, eps3)-(n, -12 * p) Picture1.Line (-0.5, eps3)-(n, eps3), vbGreen Picture1.CurrentX = -25 Picture1.CurrentY = eps3 + 0.000001 Picture1.Print Format(eps3, "0.0000000") Next Picture2.Scale (0, 2)-(8, 0) Picture2.Line (0, 1)-(8, 1), vbRed Picture3.Scale (0, 2)-(8, 0) Picture3.Line (0, 1)-(8, 1), vbGreen For i = 1 To 100000000 Next Picture1.Line (-0.5, 0)-(220, 0) Picture1.CurrentX = -10 Picture1.CurrentY = 0.000001 m = 0 Picture1.Print Str(m) End Sub Private Sub Command2_Click() Form7.Hide Form1.Show End Sub