none
How to create Charts from Listview? RRS feed

  • Question

  • Hello everyone!

    I was wondering whether it was possible to create charts from Listviews or not. I have some data on different Listviews, and I'd like to put it on different charts (three per List).

    Here's an example of the Listviews I actually have:

    What I want is to show through charts the behavior of Y(cm); V(Kgf) and M(Kgf*m) against X(cm).

    So charts would be something like:

    Chart1 ---->  Coordinates (X,Y)

    Chart2 ----> Coordinates (X,V)

    Chart3 ----> Coordinates (X,M)

    Important:

    Listviews may contain different amounts of Points. I mean, chart #1 may contain from 1 to 1,000,000 Points. The same applies to Chart #2.

    Here's an example of how I would like the charts to look like:

    The idea of the example is not only to show what kind of chart is needed, but also its style.

    Thanks in advance for any help or guidance you may give me.

    • Changed type Alexanderkng Tuesday, September 4, 2018 12:55 AM I chose wrong threat type
    Monday, September 3, 2018 3:21 AM

Answers

  • As you mentioned I tried this but I'm facing a problem I'm not sure how to fix.

    This is the code I wrote to add data to the chart from a list view:

            'add the data from the datatable
            For r As Integer = 0 To listvCarga1.Items.Count - 1
                Chart1.Series("X").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(2))
                Chart1.Series("Y").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(3))
                Chart1.Series("Z").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(4))
            Next
        End Sub

    But when I run the code it shows:

    which translate something like:

    Exception not found.

    System.ArgumentException: 'The Serie data points doesn't allow System.Windows.Forms.ListViewItems+ListViewSubItems type of values. It can only be used the following type of Values: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort.'

    So, Am I adding the Listview stored data to the Chart in a wrong way? or can't it definitely be added to a chart?

    I think I am having the same problem trying to use a listview. I dont know the listview and think its hard to work with so I never use it. It seems the subitem text is empty? Or need to convert to double or something like that there.

    Les et al should know if they are watching?

    Ask a new question if you need to but dont use a chart example just something simple like this example below as if you mention charts most wont look:

    This gives the error I think? But make it even simpler reproducible example if you can. 

       Dim x as double = CDbl(listvCarga1.Items(0).SubItems(0).Text)


    You may need to tryparse or directcast etc but it seems you are sure you have a number string??

    • Edited by tommytwotrain Sunday, September 23, 2018 7:52 PM
    • Marked as answer by Alexanderkng Sunday, September 23, 2018 10:11 PM
    Sunday, September 23, 2018 7:49 PM

All replies

  • Alex,

    Yes you can do that. You can bind a column from the list view to the chart.

    Here are instructions chart samples here:

    https://code.msdn.microsoft.com/Samples-Environments-for-b01e9c61

    THe samples are a visual studio project you run in visual studio. Very easy.

    and this

    https://msdn.microsoft.com/en-us/library/dd489237.aspx

    Look it over and then come back with questions.

    PS You should change this topic type from discussion to question.

    PS A million points? I think you are over doing that? I think you can get by with like less than 100 points per beam?


    Monday, September 3, 2018 11:21 AM
  • Tommy, Thanks for the feedback.

    I'm downloading the file from Link #1. Link #2 shows a 404 error, could you please check it and re-send it to me?

    At first I thought of my question as Question type post, but somehow I created a general discussion. I am willing to change it, but i'm not sure how to do so. If by the time you read this, it is still general discussion, it means I haven't figured out how to change topic type, so please tell me how to change it.

    A million points... Well, I haven't limited beam lenght, and points evaluate equations every 5 centimeters. This means I may firstly create a 20-points list (beam lenght = 1.00m) and then a 1000-points list (beam lenght = 50m). I'm trying to create an application that closely describes real foundation cases behaviour as well as hypothetical behaviour. So a million points is not a limit, just a way to say lists can contain a huge amount of points.

    Thanks for all the help and feedback. I'll comeback after reading the guides.

    Tuesday, September 4, 2018 12:55 AM
  • Alex,

    I corrected the second link in my post above. Its just the basic chart things.

    BTW I show you the chart control, I guess you are familiar with it or heard of it at least? That is the easy way. Although some may not think so.

    You can also draw a chart from scratch if there is some reason not to use the chart control.

    Yeah, well maybe you only need to draw every 1000 th point for graphing purposes. We'll see. I don't really know what the end result is suppose to be.

    :)

    Tuesday, September 4, 2018 2:36 AM
  • Alex,

    Yes you can do that. You can bind a column from the list view to the chart.

    Here are instructions chart samples here:

    https://code.msdn.microsoft.com/Samples-Environments-for-b01e9c61

    THe samples are a visual studio project you run in visual studio. Very easy.

    and this

    https://msdn.microsoft.com/en-us/library/dd489237.aspx

    Look it over and then come back with questions.

    PS You should change this topic type from discussion to question.

    PS A million points? I think you are over doing that? I think you can get by with like less than 100 points per beam?


    Hi Tommy!

    It's been quite a long time, but I hope you're doing fine.

    I've been kinda busy but I have managed my time to check the links you sent to me on this post i'm quoting and now I have a clearer perspective about what to ask.

    The thing is:

    I want to create a spline chart, on which the  DataPoint Collection is created automatically and each created point is attached to a pair of values on the ListView.

    If you forgot about the application i'm creating, I will paste the previous post I've created on the forum:

    #1 https://social.msdn.microsoft.com/Forums/vstudio/en-US/bfc1d31d-bf57-4230-ae9b-a7da752af00c/how-to-add-data-to-a-listview?forum=vbgeneral#bfc1d31d-bf57-4230-ae9b-a7da752af00c

    #2 https://social.msdn.microsoft.com/Forums/vstudio/en-US/bf2b2860-7ad1-4841-984b-35bb7dfb7018/how-to-sum-columns-from-different-listviews?forum=vbgeneral#d8e283a5-0753-42c9-9623-015574f6c9a4

    #3 https://social.msdn.microsoft.com/Forums/vstudio/en-US/21aa5383-ecdd-4971-b997-8f5dcc8dc972/fortonext-does-not-evaluate-the-border-numbers-of-range?forum=vbgeneral#350eb622-3297-42a5-ac17-360df36b820f

    Well, I'm kinda stuck on attaching listView columns to Chart Point Data Collection. What I need, as said before, is to automatically fill up the chart with the information contained on the listview columns (one column for XValues, and another Column for YValues). Any idea about how to do this?

    Anything help or guidance will be widely appreciated. Thanks in advances, Tommy.

    Greetings,

    Saturday, September 22, 2018 1:17 AM
  • Anything help or guidance will be widely appreciated. Thanks in advances, Tommy.

    Greetings,

    Hi Alex,

    Well I would do it this way more or less not knowing exactly what you want.

    Instead of a list view I used a datatable to store the data in memory and then I show the data with the datagridview and the chart.

    So its not exactly what you ask for but I think most of what you need is there. You can still use a list view if you like. But you should start storing your data in lists or tables not controls. Then you manipulate the data, not the control. The control is just to display the data.

    There are ways to link the table to the chart etc but lets start with this it should keep you busy for a while?

    Add a dgv and a chart to a new empty form as shown. Then paste the code and run.

    Imports System.Windows.Forms.DataVisualization.Charting
    
    Public Class Form3
        Private dt As New DataTable
    
        Private Sub Form3_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
            Text = "Shear and Moment Diagram"
    
            dt.Columns.Add("Pt")
            dt.Columns.Add("x")
            dt.Columns.Add("y")
            dt.Columns.Add("z")
    
            Dim dr As DataRow
            For r = 0 To 4
                dr = dt.NewRow
                dr(0) = r
                For c = 1 To dt.Columns.Count - 1
                    dr(c) = (r * 10) + (c * 10)
                Next
                dt.Rows.Add(dr)
            Next
    
            Dgv1.DataSource = dt
    
            'setup the chart
            With Chart1.ChartAreas(0)
                .AxisX.Title = "X Distance"
                .AxisX.MajorGrid.LineColor = Color.LightBlue
                .AxisY.Title = "Load"
                .AxisY.MajorGrid.LineColor = Color.LightGray
            End With
    
            'draw the chart
            Chart1.Series.Clear()
            Chart1.Series.Add("X")
            With Chart1.Series("X")
                .ChartType = DataVisualization.Charting.SeriesChartType.Line
                .BorderWidth = 2
                .Color = Color.Red
            End With
    
            Chart1.Series.Add("Y")
            With Chart1.Series("Y")
                .ChartType = DataVisualization.Charting.SeriesChartType.Line
                .BorderWidth = 2
                .Color = Color.Blue
    
            End With
    
            Chart1.Series.Add("Z")
            With Chart1.Series("Z")
                .ChartType = DataVisualization.Charting.SeriesChartType.Line
                .BorderWidth = 2
                .Color = Color.Green
            End With
    
            'add the data from the datatable
            For r As Integer = 0 To dt.Rows.Count - 1
                Chart1.Series("X").Points.AddXY(dt.Rows(r)(1), dt.Rows(r)(1))
                Chart1.Series("Y").Points.AddXY(dt.Rows(r)(1), dt.Rows(r)(2))
                Chart1.Series("Z").Points.AddXY(dt.Rows(r)(1), dt.Rows(r)(3))
            Next
    
        End Sub
    End Class

    Saturday, September 22, 2018 2:29 AM
  • Thanks Tommy,

    I will check this code and comeback.

    The problem is that I have stored a bunch of points to several listviews.

    Here's the code I used to create list views:

      Private Sub btnCalcular_Click(sender As Object, e As EventArgs) Handles btnCalcular.Click
    
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            '''''''''''''''''''''''''''''''''''CARGAS PUNTUALES'''''''''''''''''''''''''''''''''''''
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            ''''''''''
            ''' 
            ''' 
            ''' 
            '''''''''''''''PARA DEFLEXION, CORTE Y MOMENTO DE CARGA 1''''''''''''''''''''''''''''''''''''''''
    
            '    Coeficientes de Extremo Izquierdo a Posición de Carga 1
            decAaC1 = Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100) * Math.Cos(dblCaracteristicaSistema * dblPosicionCarga1 * 100) * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100) - Math.Sin(dblCaracteristicaSistema * dblLongitud * 100) * Math.Cosh(dblCaracteristicaSistema * dblPosicionCarga1 * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100)
            decBbC1 = Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100) * (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100) * Math.Sin(dblCaracteristicaSistema * dblPosicionCarga1 * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100) * Math.Cos(dblCaracteristicaSistema * dblPosicionCarga1 * 100)) + Math.Sin(dblCaracteristicaSistema * dblLongitud * 100) * (Math.Sinh(dblCaracteristicaSistema * dblPosicionCarga1 * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100) - Math.Cosh(dblCaracteristicaSistema * dblPosicionCarga1 * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100))
            '    Coeficientes de Extremo Derecho a Posición de Carga 1
            decCcC1 = Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100) * Math.Cosh(dblCaracteristicaSistema * dblPosicionCarga1 * 100) - Math.Sin(dblCaracteristicaSistema * dblLongitud * 100) * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100) * Math.Cos(dblCaracteristicaSistema * dblPosicionCarga1 * 100)
            decDdC1 = Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100) * (Math.Cosh(dblCaracteristicaSistema * dblPosicionCarga1 * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100) - Math.Sinh(dblCaracteristicaSistema * dblPosicionCarga1 * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100)) + Math.Sin(dblCaracteristicaSistema * dblLongitud * 100) * (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100) * Math.Cos(dblCaracteristicaSistema * dblPosicionCarga1 * 100) - Math.Cosh(dblCaracteristicaSistema * (dblLongitud - dblPosicionCarga1) * 100) * Math.Sin(dblCaracteristicaSistema * dblPosicionCarga1 * 100))
            '
            '
            '
            '  Cálculo para Lista de Carga 1
            With listvCarga1
                .View = View.Details
                .Columns.Add("Punto", 40, HorizontalAlignment.Center)
                .Columns.Add("X (cm)", 50, HorizontalAlignment.Center)
                .Columns.Add("Y (cm)", 70, HorizontalAlignment.Center)
                .Columns.Add("V (Kgf)", 70, HorizontalAlignment.Center)
                .Columns.Add("M (Kgf*m)", 70, HorizontalAlignment.Center)
            End With
            '
    
    
            ''''''''''''''''''''''''''''''''''''''''''''CALCULO CON 1 CARGA 
    
    
            Dim i As Integer
            Dim XC1 As Decimal
            '
            If combobCantidadCargas.Text = 1 Then 'Existen solo 1 carga1
    
                i = 0
                XC1 = 0
                ' de extremo izquierdo a posicion de carga 1
                While XC1 <= dblPosicionCarga1
                    Dim lviextc1 As New ListViewItem((XC1 / 0.05 + 1).ToString("0"))
                    lviextc1.SubItems.Add((XC1).ToString("0.00"))
                    lviextc1.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100) * decAaC1 + (Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) + Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.000000"))
                    lviextc1.SubItems.Add((dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) + Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decAaC1 + (Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.00"))
                    lviextc1.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) * decAaC1 + (Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) - Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lviextc1)
    
                    i += 1
                    XC1 = i * 0.05
    
                End While
    
                'de posicion de carga 1 a extremo derecho
                i = 0
                XC1 = dblPosicionCarga1
    
                While XC1 <= dblLongitud
                    Dim lvic1ext As New ListViewItem((XC1 / 0.05 + 2).ToString("0"))
                    lvic1ext.SubItems.Add((XC1).ToString("0.00"))
                    lvic1ext.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic1ext.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic1ext.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic1ext)
    
                    i += 1
                    XC1 = dblPosicionCarga1 + i * 0.05
    
                End While
    
            End If
    
    
    
            '''''''''''''''''''''''''''''''''''''''''CALCULO CON 2 CARGAS
    
            If combobCantidadCargas.Text = 2 Then 'Solo existen 2 cargas
    
    
                ' de extremo izquierdo a posicion de carga 1
                i = 0
                XC1 = 0
    
                While XC1 <= dblPosicionCarga1
                    Dim lviextc1 As New ListViewItem((XC1 / 0.05 + 1).ToString("0"))
                    lviextc1.SubItems.Add((XC1).ToString("0.00"))
                    lviextc1.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100) * decAaC1 + (Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) + Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.000000"))
                    lviextc1.SubItems.Add((dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) + Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decAaC1 + (Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.00"))
                    lviextc1.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) * decAaC1 + (Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) - Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lviextc1)
    
                    i += 1
                    XC1 = i * 0.05
    
                End While
    
                'de posicion de carga 1 a carga 2
                i = 0
                XC1 = dblPosicionCarga1
    
                While XC1 <= dblPosicionCarga2
                    Dim lvic1c2 As New ListViewItem((XC1 / 0.05 + 2).ToString("0"))
                    lvic1c2.SubItems.Add((XC1).ToString("0.00"))
                    lvic1c2.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic1c2.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic1c2.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic1c2)
    
                    i += 1
                    XC1 = dblPosicionCarga1 + i * 0.05
    
                End While
    
    
                'de posicion de carga 2 a extremo derecho
                i = 0
                XC1 = dblPosicionCarga2
    
                While XC1 <= dblLongitud
                    Dim lvic1c2ext As New ListViewItem((XC1 / 0.05 + 3).ToString("0"))
                    lvic1c2ext.SubItems.Add((XC1).ToString("0.00"))
                    lvic1c2ext.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic1c2ext.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic1c2ext.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic1c2ext)
    
                    i += 1
                    XC1 = dblPosicionCarga2 + i * 0.05
    
                End While
    
            End If
    
    
            '''''''''''''''''''''''''''''''''''''''''CALCULO CON 3 CARGAS
    
            If combobCantidadCargas.Text = 3 Then 'Solo existen 3 cargas
    
    
                ' de extremo izquierdo a posicion de carga 1
                i = 0
                XC1 = 0
    
                While XC1 <= dblPosicionCarga1
                    Dim lviextc1 As New ListViewItem((XC1 / 0.05 + 1).ToString("0"))
                    lviextc1.SubItems.Add((XC1).ToString("0.00"))
                    lviextc1.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100) * decAaC1 + (Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) + Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.000000"))
                    lviextc1.SubItems.Add((dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) + Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decAaC1 + (Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.00"))
                    lviextc1.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) * decAaC1 + (Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) - Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lviextc1)
    
                    i += 1
                    XC1 = i * 0.05
    
                End While
    
    
                'de posicion de carga 1 a carga 2
                i = 0
                XC1 = dblPosicionCarga1
    
                While XC1 <= dblPosicionCarga2
                    Dim lvic1c2 As New ListViewItem((XC1 / 0.05 + 2).ToString("0"))
                    lvic1c2.SubItems.Add((XC1).ToString("0.00"))
                    lvic1c2.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic1c2.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic1c2.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic1c2)
    
                    i += 1
                    XC1 = dblPosicionCarga1 + i * 0.05
    
                End While
    
    
                'de posicion de carga 2 a carga 3
                i = 0
                XC1 = dblPosicionCarga2
    
                While XC1 <= dblPosicionCarga3
                    Dim lvic2c3 As New ListViewItem((XC1 / 0.05 + 3).ToString("0"))
                    lvic2c3.SubItems.Add((XC1).ToString("0.00"))
                    lvic2c3.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic2c3.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic2c3.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic2c3)
    
                    i += 1
                    XC1 = dblPosicionCarga2 + i * 0.05
    
                End While
    
    
                'de posicion de carga 3 a extremo derecho
                i = 0
                XC1 = dblPosicionCarga3
    
                While XC1 <= dblLongitud
                    Dim lvic1c2c3ext As New ListViewItem((XC1 / 0.05 + 4).ToString("0"))
                    lvic1c2c3ext.SubItems.Add((XC1).ToString("0.00"))
                    lvic1c2c3ext.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic1c2c3ext.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic1c2c3ext.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic1c2c3ext)
    
                    i += 1
                    XC1 = dblPosicionCarga3 + i * 0.05
    
                End While
            End If
    
    
            '''''''''''''''''''''''''''''''''''''''''CALCULO CON 4 CARGAS
    
            If combobCantidadCargas.Text = 4 Then 'Solo existen 4 cargas
    
    
                ' de extremo izquierdo a posicion de carga 1
                i = 0
                XC1 = 0
    
                While XC1 <= dblPosicionCarga1
                    Dim lviextc1 As New ListViewItem((XC1 / 0.05 + 1).ToString("0"))
                    lviextc1.SubItems.Add((XC1).ToString("0.00"))
                    lviextc1.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100) * decAaC1 + (Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) + Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.000000"))
                    lviextc1.SubItems.Add((dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) + Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decAaC1 + (Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.00"))
                    lviextc1.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) * decAaC1 + (Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) - Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lviextc1)
    
                    i += 1
                    XC1 = i * 0.05
    
                End While
    
    
                'de posicion de carga 1 a carga 2
                i = 0
                XC1 = dblPosicionCarga1
    
                While XC1 <= dblPosicionCarga2
                    Dim lvic1c2 As New ListViewItem((XC1 / 0.05 + 2).ToString("0"))
                    lvic1c2.SubItems.Add((XC1).ToString("0.00"))
                    lvic1c2.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic1c2.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic1c2.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic1c2)
    
                    i += 1
                    XC1 = dblPosicionCarga1 + i * 0.05
    
                End While
    
    
                'de posicion de carga 2 a carga 3
                i = 0
                XC1 = dblPosicionCarga2
    
                While XC1 <= dblPosicionCarga3
                    Dim lvic2c3 As New ListViewItem((XC1 / 0.05 + 3).ToString("0"))
                    lvic2c3.SubItems.Add((XC1).ToString("0.00"))
                    lvic2c3.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic2c3.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic2c3.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic2c3)
    
                    i += 1
                    XC1 = dblPosicionCarga2 + i * 0.05
    
                End While
    
    
                'de posicion de carga 3 a carga 4
                i = 0
                XC1 = dblPosicionCarga3
    
                While XC1 <= dblPosicionCarga4
                    Dim lvic3c4 As New ListViewItem((XC1 / 0.05 + 4).ToString("0"))
                    lvic3c4.SubItems.Add((XC1).ToString("0.00"))
                    lvic3c4.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic3c4.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic3c4.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic3c4)
    
                    i += 1
                    XC1 = dblPosicionCarga3 + i * 0.05
    
                End While
    
    
                'de posicion de carga 4 a extremo derecho
                i = 0
                XC1 = dblPosicionCarga4
    
                While XC1 <= dblLongitud
                    Dim lvic1c2c3c4ext As New ListViewItem((XC1 / 0.05 + 5).ToString("0"))
                    lvic1c2c3c4ext.SubItems.Add((XC1).ToString("0.00"))
                    lvic1c2c3c4ext.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic1c2c3c4ext.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic1c2c3c4ext.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic1c2c3c4ext)
    
                    i += 1
                    XC1 = dblPosicionCarga4 + i * 0.05
    
                End While
            End If
    
    
            '''''''''''''''''''''''''''''''''''''''''CALCULO CON 5 CARGAS
    
            If combobCantidadCargas.Text = 5 Then 'Existen 5 cargas
    
    
                ' de extremo izquierdo a posicion de carga 1
                i = 0
                XC1 = 0
    
                While XC1 <= dblPosicionCarga1
                    Dim lviextc1 As New ListViewItem((XC1 / 0.05 + 1).ToString("0"))
                    lviextc1.SubItems.Add((XC1).ToString("0.00"))
                    lviextc1.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100) * decAaC1 + (Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) + Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.000000"))
                    lviextc1.SubItems.Add((dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) + Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decAaC1 + (Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.00"))
                    lviextc1.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) * decAaC1 + (Math.Cosh(dblCaracteristicaSistema * XC1 * 100) * Math.Sin(dblCaracteristicaSistema * XC1 * 100) - Math.Sinh(dblCaracteristicaSistema * XC1 * 100) * Math.Cos(dblCaracteristicaSistema * XC1 * 100)) * decBbC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lviextc1)
    
                    i += 1
                    XC1 = i * 0.05
    
                End While
    
    
                'de posicion de carga 1 a carga 2
                i = 0
                XC1 = dblPosicionCarga1
    
                While XC1 <= dblPosicionCarga2
                    Dim lvic1c2 As New ListViewItem((XC1 / 0.05 + 2).ToString("0"))
                    lvic1c2.SubItems.Add((XC1).ToString("0.00"))
                    lvic1c2.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic1c2.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic1c2.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic1c2)
    
                    i += 1
                    XC1 = dblPosicionCarga1 + i * 0.05
    
                End While
    
    
                'de posicion de carga 2 a carga 3
                i = 0
                XC1 = dblPosicionCarga2
    
                While XC1 <= dblPosicionCarga3
                    Dim lvic2c3 As New ListViewItem((XC1 / 0.05 + 3).ToString("0"))
                    lvic2c3.SubItems.Add((XC1).ToString("0.00"))
                    lvic2c3.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic2c3.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic2c3.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic2c3)
    
                    i += 1
                    XC1 = dblPosicionCarga2 + i * 0.05
    
                End While
    
    
                'de posicion de carga 3 a carga 4
                i = 0
                XC1 = dblPosicionCarga3
    
                While XC1 <= dblPosicionCarga4
                    Dim lvic3c4 As New ListViewItem((XC1 / 0.05 + 4).ToString("0"))
                    lvic3c4.SubItems.Add((XC1).ToString("0.00"))
                    lvic3c4.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic3c4.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic3c4.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic3c4)
    
                    i += 1
                    XC1 = dblPosicionCarga3 + i * 0.05
    
                End While
    
    
                'de posicion de carga 4 a carga 5
                i = 0
                XC1 = dblPosicionCarga4
    
                While XC1 <= dblPosicionCarga5
                    Dim lvic4c5 As New ListViewItem((XC1 / 0.05 + 5).ToString("0"))
                    lvic4c5.SubItems.Add((XC1).ToString("0.00"))
                    lvic4c5.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic4c5.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic4c5.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic4c5)
    
                    i += 1
                    XC1 = dblPosicionCarga4 + i * 0.05
    
                End While
    
    
                'de posicion de carga 5 a extremo derecho
                i = 0
                XC1 = dblPosicionCarga5
    
                While XC1 <= dblLongitud
                    Dim lvic1c2c3c4c5ext As New ListViewItem((XC1 / 0.05 + 6).ToString("0"))
                    lvic1c2c3c4c5ext.SubItems.Add((XC1).ToString("0.00"))
                    lvic1c2c3c4c5ext.SubItems.Add(((dblCarga1 * 10 * dblCaracteristicaSistema) / (dblBalasto * dblAncho) * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * (2 * Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.000000"))
                    lvic1c2c3c4c5ext.SubItems.Add((-dblCarga1 * 1000 * 1 / ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2) * ((Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) + Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decCcC1 + (Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
                    lvic1c2c3c4c5ext.SubItems.Add(((dblCarga1 * 10 / dblCaracteristicaSistema) * 1 / (2 * ((Math.Sinh(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2 - (Math.Sin(dblCaracteristicaSistema * dblLongitud * 100)) ^ 2)) * (2 * Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * decCcC1 + (Math.Cosh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Sin(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) - Math.Sinh(dblCaracteristicaSistema * (dblLongitud - XC1) * 100) * Math.Cos(dblCaracteristicaSistema * (dblLongitud - XC1) * 100)) * decDdC1)).ToString("0.00"))
    
                    listvCarga1.Items.Add(lvic1c2c3c4c5ext)
    
                    i += 1
                    XC1 = dblPosicionCarga5 + i * 0.05
    
                End While
            End If

    The code continues up to 5 loads, but it's the same structure. That is the way I create listviews. And the result is something like the listview shown on the first message of this thread. That, and the fact that I hadn't considered the idea of migrating to DataTables, is the main reason why I'm trying to figure out how to show those values on a chart. 

    Migrating to DataTables is a bit tedious because I have about 13 listviews on the application. 

    As I said before, I'll check the code you sent to me to learn how to manipulate it and adapt it to my needs.

    Thanks, Tommy!

    Saturday, September 22, 2018 3:27 AM
  • Yes well like I said I am not sure what you want for a result exactly.

    What I show using a datatable is basically the same as a listview and I think easier.

    Then showing the data in a datagridview is as hard as dgv.source = dt. You can almost do the chart the same way although I show the basics instead.

    You can use what you have and just use the listview instead of the datatable. Loop through the rows of the list view and add the values to the chart series just like I show. There is a series for each plotted line ie (x,y) (x,v) etc. Its the same thing data table or list view as far as the chart goes.

    I dont like list views so I am not going to make examples with them. I think you can use a datagridview better and or datatable.

    But up to you. I think you can do just as I show with a list view instead of datatable and datagridview.

    I am not sure how you make your 13 list views and combine them but that could be 13 tables and then can be combined to one table or make a chart with 13 lines or 13 charts or 13 datagridviews etc.

    But its all basically the same. You have a list view with your data. I changed it to use a datatable instead. It is the same thing more or less.

    However, you are storing data in your list view control and then reading data from your list view. It is better to use a datatable or lists. It will be faster and much more responsive. You may not notice it now but if you really plan on dealing with a million data points as you mentioned previously then you will need to do it my way or it will take like an hour to draw it.

    Comprende?

    Give it a try if you have not already.

    Here is a fun example of datatables.

    https://social.technet.microsoft.com/wiki/contents/articles/33041.vb-net-making-a-space-invaders-game-using-a-datatable-and-datagridview.aspx

    PS When we code we often should start over after we learn more about our problem exactly and learn more and etc. I would consider starting a new project if that what is stopping you from changing. It is good practice to start again and I guarantee your project will be better a second time around even if you use a listview again.

    PSS Seems you should have a subroutine to make your data. Then you call that 13 times. What you have now is 13 chunks of the same code with a few variables changing. You can make that a sub routine I suspect. And make it use a table instead of list view?

    Finally, for me the code is like a piece of artwork that I am making and when I am done I often revel in my work and admire it and feel good about it. When I take 130 lines of code and turn it into 12 lines of code that can be re-used over and over then that is a good feeling and a beautiful work of art.

    :)


    Saturday, September 22, 2018 12:16 PM

  • You can use what you have and just use the listview instead of the datatable. Loop through the rows of the list view and add the values to the chart series just like I show. There is a series for each plotted line ie (x,y) (x,v) etc. Its the same thing data table or list view as far as the chart goes.


    As you mentioned I tried this but I'm facing a problem I'm not sure how to fix.

    This is the code I wrote to add data to the chart from a list view:

            'add the data from the datatable
            For r As Integer = 0 To listvCarga1.Items.Count - 1
                Chart1.Series("X").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(2))
                Chart1.Series("Y").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(3))
                Chart1.Series("Z").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(4))
            Next
        End Sub

    But when I run the code it shows:

    which translate something like:

    Exception not found.

    System.ArgumentException: 'The Serie data points doesn't allow System.Windows.Forms.ListViewItems+ListViewSubItems type of values. It can only be used the following type of Values: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort.'

    So, Am I adding the Listview stored data to the Chart in a wrong way? or can't it definitely be added to a chart?

    I checked the code you sent me and you're right. That's an easier way to do the whole thing, but I already have around 5k code lines of storing data on listviews so I wouldn't like to throw it to the trash without trying this way.

    You are right too on the starting over process when we learn more about our problems (I've done it twice already on this project).

    In fact, I already duplicated my project and starting migrating to data tables on that one, but a question has emerged: How can I sum columns from different datagridviews?

    I totally agree with you about seeing the code as a piece of art. It actually is. I'm not a programmer by profession, but I've been learning about it by my own and It's totally fascinating.

    Thanks for your patience and help, Tommy.

    Sunday, September 23, 2018 5:51 PM
  • As you mentioned I tried this but I'm facing a problem I'm not sure how to fix.

    This is the code I wrote to add data to the chart from a list view:

            'add the data from the datatable
            For r As Integer = 0 To listvCarga1.Items.Count - 1
                Chart1.Series("X").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(2))
                Chart1.Series("Y").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(3))
                Chart1.Series("Z").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(4))
            Next
        End Sub

    But when I run the code it shows:

    which translate something like:

    Exception not found.

    System.ArgumentException: 'The Serie data points doesn't allow System.Windows.Forms.ListViewItems+ListViewSubItems type of values. It can only be used the following type of Values: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort.'

    So, Am I adding the Listview stored data to the Chart in a wrong way? or can't it definitely be added to a chart?

    I think I am having the same problem trying to use a listview. I dont know the listview and think its hard to work with so I never use it. It seems the subitem text is empty? Or need to convert to double or something like that there.

    Les et al should know if they are watching?

    Ask a new question if you need to but dont use a chart example just something simple like this example below as if you mention charts most wont look:

    This gives the error I think? But make it even simpler reproducible example if you can. 

       Dim x as double = CDbl(listvCarga1.Items(0).SubItems(0).Text)


    You may need to tryparse or directcast etc but it seems you are sure you have a number string??

    • Edited by tommytwotrain Sunday, September 23, 2018 7:52 PM
    • Marked as answer by Alexanderkng Sunday, September 23, 2018 10:11 PM
    Sunday, September 23, 2018 7:49 PM

  •         'add the data from the datatable
            For r As Integer = 0 To listvCarga1.Items.Count - 1
                Chart1.Series("X").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(2))
                Chart1.Series("Y").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(3))
                Chart1.Series("Z").Points.AddXY(listvCarga1.Items(r).SubItems(0), listvCarga1.Items(r).SubItems(4))
            Next
        End Sub

    But when I run the code it shows:

    which translate something like:

    Exception not found.

    System.ArgumentException: 'The Serie data points doesn't allow System.Windows.Forms.ListViewItems+ListViewSubItems type of values. It can only be used the following type of Values: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort.'


     Alex,

     This exception appears to be telling you that you are trying to supply ListViewItem classes to the two parameters of the AddXY method.  However,  the AddXY method is expecting one of the value types it shows you.  For the heck of it,  you can try using the Text property of those ListViewItems like this...

            'add the data from the datatable
            For r As Integer = 0 To listvCarga1.Items.Count - 1
                Chart1.Series("X").Points.AddXY(listvCarga1.Items(r).SubItems(0).Text, listvCarga1.Items(r).SubItems(2).Text)
                Chart1.Series("Y").Points.AddXY(listvCarga1.Items(r).SubItems(0).Text, listvCarga1.Items(r).SubItems(3).Text)
                Chart1.Series("Z").Points.AddXY(listvCarga1.Items(r).SubItems(0).Text, listvCarga1.Items(r).SubItems(4).Text)
            Next

     That may bring you two another problem though,  I'm not sure because I am have not tested it myself.  The problem might come from using the Text property String where it is expecting a numeric data type.  It may or may not successfully cast the Strings with numeric characters to a numeric data type internally in the AddXY method.  So,  you may need to convert the Text property of the ListViewItems to Double,  Decimal,  or Single type data (from the looks of your numbers) before using it in the two parameters of the AddXY method.


    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Sunday, September 23, 2018 10:22 PM
    Sunday, September 23, 2018 10:09 PM
  • It worked just by adding .text to the coordinates, just as I show on the following code:

    'add the data from the datatable
            For r As Integer = 0 To listvCarga1.Items.Count - 1
                Chart1.Series("X").Points.AddXY(listvCarga1.Items(r).SubItems(0).Text, listvCarga1.Items(r).SubItems(2).Text)
                Chart1.Series("Y").Points.AddXY(listvCarga1.Items(r).SubItems(0).Text, listvCarga1.Items(r).SubItems(3).Text)
                Chart1.Series("Z").Points.AddXY(listvCarga1.Items(r).SubItems(0).Text, listvCarga1.Items(r).SubItems(4).Text)
            Next
        End Sub

    This is the result:

    BIG THANKS, TOMMY! You were really helpful to me, I truly appreciate it.

    I will create another post in order to learn more about datatables and how to manage them. again, THANKS!

    Sunday, September 23, 2018 10:10 PM
  • It worked just by adding .text to the coordinates, just as I show on the following code:

    'add the data from the datatable
            For r As Integer = 0 To listvCarga1.Items.Count - 1
                Chart1.Series("X").Points.AddXY(listvCarga1.Items(r).SubItems(0).Text, listvCarga1.Items(r).SubItems(2).Text)
                Chart1.Series("Y").Points.AddXY(listvCarga1.Items(r).SubItems(0).Text, listvCarga1.Items(r).SubItems(3).Text)
                Chart1.Series("Z").Points.AddXY(listvCarga1.Items(r).SubItems(0).Text, listvCarga1.Items(r).SubItems(4).Text)
            Next
        End Sub

    This is the result:

    BIG THANKS, TOMMY! You were really helpful to me, I truly appreciate it.

    I will create another post in order to learn more about datatables and how to manage them. again, THANKS!

    Oh yeah. Gee willikers Batman!

    Did you get the ms chart samples installed and running? Now you can search that for things.

    You need to tell it to start the axis at zero. And or define the axis max mins yourself instead of leaving it to the chart.

    I think what you should do is make a subroutine that gens the data you have in your 13 listviews into 13  datatables. Then make a list ( of T) of the 13 datatables (like array). You should be able to call a function with the parameters dtList(4).rows()...  and other things you are changing in your 13 list views.

    Then you can loop the list of 13 data tables or whatever you can do more calcs of the table values as req'd.

    Finally you can just xyseries = dt.row() somehow simple if you want. Or just add things to the chart manually as you are.

    Ect.

    Wonderful.

    No, Ou la la!

    Sunday, September 23, 2018 10:32 PM

  • I think what you should do is make a subroutine that gens the data you have in your 13 listviews into 13  datatables. Then make a list ( of T) of the 13 datatables (like array). You should be able to call a function with the parameters dtList(4).rows()...  and other things you are changing in your 13 list views.


    That is actually pretty useful, but in my case, I need the 13 listviews separated. They are classified like:

     - Listviews from #1 to #5 shows Deflection, shear and moment from Point loads from #1 to #5.

     - Listview #6 shows Deflection, shear and moment from the sum of all Point Loads.

     - Listview from #7 to #11 show Deflection, shear and moment from Moments applied (up to 5 moments).

     - Listview #12 shows Deflection, shear and moment from the sum of all Moments applied.

     - Listview #13 shows  Deflection, shear and moment the sum of all loads applied (whether they are Point loads or moments).

    So, the important listview and graph are #13 (which will always be shown). The rest of them will be shown when needed to check results one by one, or to make reports.

    Also, Deflection, Shear and Moment must be graphed on different charts. That means having 3 charts per listview, 39 in total. Of course, They won't be created at the same time. I thought of creating a button for each different load case, just in case a teacher wants to check one by one.

    PS: I installed ms chart samples but haven't really used them yet. Adding data stored on listviews to charts was max priority. Now I will work on the UI and presentation. 

    I really want to thank you for helping me this much, Tommy. Hope you're doing fine, man.

    Sunday, September 23, 2018 11:47 PM