hallo leute,
ich habe in kleines proggi geschrieben, wass temperaturfelder speziell bei erdverlegten rohrleitungen im boden berechnet und dass dann graphisch in einem chart darstellen soll.
hier mal der code dazu:
Spoiler anzeigen
die berechnung läuft auch super, aber die bei der punktweisen darstellung im chart gibt es probleme. die punkte werden nicht vollflächig verteilt sonder liegen nur als eine art balken in dem chart.
hier mal ein bild, wie es aussieht:
hat jemand ne idee was da schief läuft?
ich habe in kleines proggi geschrieben, wass temperaturfelder speziell bei erdverlegten rohrleitungen im boden berechnet und dass dann graphisch in einem chart darstellen soll.
hier mal der code dazu:
VB.NET-Quellcode
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- d = Double.Parse(TextBox1.Text)
- TM = Double.Parse(TextBox2.Text)
- s = Double.Parse(TextBox3.Text)
- Lambda = Double.Parse(TextBox4.Text)
- z = Double.Parse(TextBox5.Text)
- Chart1.Series.Add("Rohr")
- Chart1.Series.Add("Serie1")
- Chart1.Series("Rohr").ChartType = DataVisualization.Charting.SeriesChartType.Line
- Chart1.Series("Serie1").ChartType = DataVisualization.Charting.SeriesChartType.Point
- LR = Math.Log((d + 2 * s) / d) / (2 * Lambda * Math.PI)
- j = 0
- For Me.alpha = 0 To Math.Atan(12 / z)
- i = 0
- z1 = z / Math.Cos(alpha)
- LE = arcosh((2 * z1) / ((d + 2 * s) / 1000)) / (4 * Math.PI)
- q = (TM - 10) / (LR + LE)
- T0 = 10 + q * LE
- Do
- Tx = T0 - i * ((T0 - 10) / (z1 - (d / 2000) - (s / 1000)))
- x = z * Math.Tan(alpha)
- y = ((d / 2000) + (s / 1000) + i) * Math.Cos(alpha)
- Chart1.Series("Serie1").Points.AddXY(x, y)
- If Tx >= 45 Then
- Chart1.Series("Serie1").Points(j).Color = Color.Red
- Else
- If Tx >= 35 And Tx < 45 Then
- Chart1.Series("Serie1").Points(j).Color = Color.Violet
- Else
- Chart1.Series("Serie1").Points(j).Color = Color.Blue
- End If
- End If
- i = i + 0.001
- j = j + 1
- Loop Until i > (z1 - (d / 2000) - (s / 1000))
- Next
- For x As Double = -((d + 2 * s) / 1000) To ((d + 2 * s) / 1000) Step 0.001
- Chart1.Series("Rohr").Points.AddXY(x, Math.Sqrt((((d + 2 * s) / 1000) ^ 2) - (x ^ 2)))
- Chart1.Series("Rohr").Points.AddXY(x, -Math.Sqrt((((d + 2 * s) / 1000) ^ 2) - (x ^ 2)))
- Next
- Chart1.ChartAreas("ChartArea1").AxisX.Minimum = 0
- Chart1.ChartAreas("ChartArea1").AxisX.Maximum = 12
- Chart1.ChartAreas("ChartArea1").AxisY.Minimum = 0
- Chart1.ChartAreas("ChartArea1").AxisY.Maximum = 2
- End Sub
die berechnung läuft auch super, aber die bei der punktweisen darstellung im chart gibt es probleme. die punkte werden nicht vollflächig verteilt sonder liegen nur als eine art balken in dem chart.
hier mal ein bild, wie es aussieht:
hat jemand ne idee was da schief läuft?