0% found this document useful (0 votes)
2 views

plot graphs

The document contains a code snippet for a Visual Basic application that performs calculations related to industrial engineering. It computes values based on logarithmic functions and updates a chart with the results, while also displaying maximum and minimum values in text boxes. Additionally, it includes functionality for navigating between forms in the application.

Uploaded by

Chisom Amaechi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

plot graphs

The document contains a code snippet for a Visual Basic application that performs calculations related to industrial engineering. It computes values based on logarithmic functions and updates a chart with the results, while also displaying maximum and minimum values in text boxes. Additionally, it includes functionality for navigating between forms in the application.

Uploaded by

Chisom Amaechi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

AMAECHI CHISOM VICTOR

ENG1905413

INDUSTRIAL ENGINEERING

Dim W, A(1000), B(1000), C, D, G, H, XW(10000), BM(10000), BMAX, BMIN As Single


Dim I As Integer
W = 0.01
C = ((0.01 + (W - 0.995) ^ 2)) ^ 0.5
D = ((0.01 + (W + 0.995) ^ 2)) ^ 0.5
G = ((0.36 + (W - 2.9394) ^ 2)) ^ 0.5
H = ((0.36 + (W + 2.9394) ^ 2)) ^ 0.5
BM(1) = 20 * (Math.Log10(9) + Math.Log10(C) + Math.Log10(D) - Math.Log10(W) -
Math.Log10(G) - Math.Log10(H))
BMAX = BM(1) * 1
BMIN = BM(1) * 1
With Chart1.ChartAreas(0)
.AxisY.Minimum = -25
.AxisY.Maximum = 40
.AxisX.Maximum = 2
.AxisX.Minimum = -2
End With
For I = 1 To 10000
W = 0.01 * I
XW(I) = Math.Log10(W)
C = ((0.01 + (W - 0.995) ^ 2)) ^ 0.5
D = ((0.01 + (W + 0.995) ^ 2)) ^ 0.5
G = ((0.36 + (W - 2.9394) ^ 2)) ^ 0.5
H = ((0.36 + (W + 2.9394) ^ 2)) ^ 0.5
BM(I) = 20 * (Math.Log10(9) + Math.Log10(C) + Math.Log10(D) - Math.Log10(W) -
Math.Log10(G) - Math.Log10(H))
BMIN = Math.Min(BM(I), BMIN)
With Chart1.Series(0)
.ChartType = DataVisualization.Charting.SeriesChartType.Line
.BorderWidth = 1
.Color = Color.Red

.MarkerStyle = DataVisualization.Charting.MarkerStyle.Square
.MarkerSize = 1
.Points.AddXY(XW(I), BM(I))
End With
Next I
TextBox1.Text = BMAX
TextBox2.Text = BMIN
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


Me.Hide()
Form2.Show()

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click


Me.Hide()
Form1.Show()
End Sub
Private Sub compute_Click(sender As Object, e As EventArgs) Handles compute.Click
DataGridView1.Columns.Add("W", "W")
DataGridView1.Columns.Add("BM", "BM")
DataGridView1.Columns.Add("math.log10(W)", "math.log10(W)")
Dim W, A(1000), B(1000), C, D, G, H, XW(10000), BM(10000), BMAX, BMIN As Single
Dim I As Integer
For I = 0 To 10000
W = 0.01 * I
XW(I) = Math.Log10(W)
C = ((0.01 + (W - 0.995) ^ 2)) ^ 0.5
D = ((0.01 + (W + 0.995) ^ 2)) ^ 0.5
G = ((0.36 + (W - 2.9394) ^ 2)) ^ 0.5
H = ((0.36 + (W + 2.9394) ^ 2)) ^ 0.5
BM(I) = 20 * (Math.Log10(9) + Math.Log10(C) + Math.Log10(D) - Math.Log10(W) -
Math.Log10(G) - Math.Log10(H))
DataGridView1.Rows.Add(W, XW(I), BM(I))
Next
End Sub
End Class

You might also like