Académique Documents
Professionnel Documents
Culture Documents
Value = 1 Then
IdentificadorDeMatriz.Rows(im - 1).Cells(0).Value = 0
IdentificadorDeMatriz.Rows(im - 1).Cells(1).Value = 0
IdentificadorDeMatriz.Rows(im - 1).Cells(2).Value = 0
End If
If IdentificadorDeMatriz.Rows(im - 1).Cells(3).Value = 1 And
IdentificadorDeMatriz.Rows(im - 1).Cells(4).Value = 1 And IdentificadorDeMatriz.Rows(im 1).Cells(5).Value = 1 Then
IdentificadorDeMatriz.Rows(im - 1).Cells(3).Value = 0
IdentificadorDeMatriz.Rows(im - 1).Cells(4).Value = 0
IdentificadorDeMatriz.Rows(im - 1).Cells(5).Value = 0
End If
TRASY = 0
Dim im As Integer
For im = 0 To O - 1
If dataGridView1.Rows(im).Cells(0).Value <> "" Then
If dataGridView1.Rows(im).Cells(1).Value <> "" Then
X = dataGridView1.Rows(im).Cells(0).Value
Y = dataGridView1.Rows(im).Cells(1).Value
If X > MAYORX Then
MAYORX = X
End If
If Y > MAYORY Then
MAYORY = Y
End If
If X < MENORX Then
MENORX = X
End If
If Y < MENORY Then
MENORY = Y
End If
TRASX = (TRASX + X)
TRASY = (TRASY + Y)
End If
End If
Next
If im = 0 Then
TRASX = 0
TRASY = 0
Else
TRASX = TRASX / im
TRASY = TRASY / im
If MAYORX - MENORX <> 0 Then
ESCX = 300 / Math.Abs(MAYORX - MENORX)
Else
ESCX = 0
End If
If MAYORY - MENORY <> 0 Then
ESCY = 300 / Math.Abs(MAYORY - MENORY)
Else
ESCY = 0
End If
End If
Dim COORDX As Double
Dim COORDY As Double
COORDX = (PictureBox1.Width / 2) - ((TRASX - MENORX) * ESCX)
COORDY = (PictureBox1.Height / 2) + ((TRASY - MENORY) * ESCY)
dibujo.TranslateTransform(COORDX, COORDY)
dibujo.ScaleTransform(1, -1)
Dim lapiz1 As New Pen(Color.Red)
Dim pincelRelleno As SolidBrush
pincelRelleno = New SolidBrush(Color.Red)
For im = 0 To O - 1
If dataGridView1.Rows(im).Cells(0).Value <> "" Then
If dataGridView1.Rows(im).Cells(1).Value <> "" Then
X = ((dataGridView1.Rows(im).Cells(0).Value) - MENORX) * ESCX - 1.5
Y = ((dataGridView1.Rows(im).Cells(1).Value) - MENORY) * ESCY - 1.5
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
Catch ex As Exception
MessageBox.Show(ex.Message, "vb.net", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub Restricciones_RowPostPaint(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.DataGridViewRowPostPaintEventArgs) Handles
Restricciones.RowPostPaint
Try
'Captura el numero de filas del datagridview
Dim RowsNumber As String = (e.RowIndex + 1).ToString
While RowsNumber.Length < Restricciones.RowCount.ToString.Length
RowsNumber = "0" & RowsNumber
End While
Dim size As SizeF = e.Graphics.MeasureString(RowsNumber, Me.Font)
If Restricciones.RowHeadersWidth < CInt(size.Width + 20) Then
Restricciones.RowHeadersWidth = CInt(size.Width + 20)
End If
Dim ob As Brush = SystemBrushes.ControlText
e.Graphics.DrawString(RowsNumber, Me.Font, ob, e.RowBounds.Location.X + 15,
e.RowBounds.Location.Y + ((e.RowBounds.Height - size.Height) / 2))
Catch ex As Exception
MessageBox.Show(ex.Message, "vb.net", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub Articulaciones_RowPostPaint(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.DataGridViewRowPostPaintEventArgs) Handles
Articulaciones.RowPostPaint
Try
'Captura el numero de filas del datagridview
Dim RowsNumber As String = (e.RowIndex + 1).ToString
While RowsNumber.Length < Restricciones.RowCount.ToString.Length
RowsNumber = "0" & RowsNumber
End While
Dim size As SizeF = e.Graphics.MeasureString(RowsNumber, Me.Font)
If Articulaciones.RowHeadersWidth < CInt(size.Width + 20) Then
Articulaciones.RowHeadersWidth = CInt(size.Width + 20)
End If
Dim ob As Brush = SystemBrushes.ControlText
e.Graphics.DrawString(RowsNumber, Me.Font, ob, e.RowBounds.Location.X + 15,
e.RowBounds.Location.Y + ((e.RowBounds.Height - size.Height) / 2))
Catch ex As Exception
MessageBox.Show(ex.Message, "vb.net", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub Cargas_RowPostPaint(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.DataGridViewRowPostPaintEventArgs) Handles Cargas.RowPostPaint
Try
'Captura el numero de filas del datagridview
Dim RowsNumber As String = (e.RowIndex + 1).ToString
While RowsNumber.Length < Cargas.RowCount.ToString.Length
RowsNumber = "0" & RowsNumber
End While
Dim size As SizeF = e.Graphics.MeasureString(RowsNumber, Me.Font)
If Cargas.RowHeadersWidth < CInt(size.Width + 20) Then
Cargas.RowHeadersWidth = CInt(size.Width + 20)
End If
Dim ob As Brush = SystemBrushes.ControlText
e.Graphics.DrawString(RowsNumber, Me.Font, ob, e.RowBounds.Location.X + 15,
e.RowBounds.Location.Y + ((e.RowBounds.Height - size.Height) / 2))
Catch ex As Exception
MessageBox.Show(ex.Message, "vb.net", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub RESULTADOS_RowPostPaint(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.DataGridViewRowPostPaintEventArgs) Handles
RESULTADOS.RowPostPaint
Try
'Captura el numero de filas del datagridview
Dim RowsNumber As String = (e.RowIndex + 1).ToString
While RowsNumber.Length < Cargas.RowCount.ToString.Length
RowsNumber = "0" & RowsNumber
End While
Dim size As SizeF = e.Graphics.MeasureString(RowsNumber, Me.Font)
If Cargas.RowHeadersWidth < CInt(size.Width + 20) Then
Cargas.RowHeadersWidth = CInt(size.Width + 20)
End If
Dim ob As Brush = SystemBrushes.ControlText
e.Graphics.DrawString(RowsNumber, Me.Font, ob, e.RowBounds.Location.X + 15,
e.RowBounds.Location.Y + ((e.RowBounds.Height - size.Height) / 2))
Catch ex As Exception
MessageBox.Show(ex.Message, "vb.net", _
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub Coordenadas_RowsAdded(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewRowsAddedEventArgs) Handles dataGridView1.RowsAdded
O=O+1
End Sub
Private Sub CoordenadasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CoordenadasToolStripMenuItem.Click
Restricciones.Visible = False
dataGridView1.Visible = True
Cargas.Visible = False
RESULTADOS.Visible = False
CargaDistribuida.Visible = False
ApoyosElasticos.Visible = False
dataGridView1.Columns(0).HeaderText = "X"
dataGridView1.Columns(1).HeaderText = "Y"
C=0
End Sub
Private Sub DefinicionDeMiembrosToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles DefinicionDeMiembrosToolStripMenuItem.Click
Restricciones.Visible = False
dataGridView1.Visible = True
Cargas.Visible = False
RESULTADOS.Visible = False
CargaDistribuida.Visible = False
CargaTriangular.Visible = False
ApoyosElasticos.Visible = False
dataGridView1.Columns(0).HeaderText = "i"
dataGridView1.Columns(1).HeaderText = "j"
C=1
Me.dataGridView1.CurrentCell = Me.dataGridView1(0, O)
Dim im, jm As Integer
For im = 0 To O
For jm = 0 To 1
dataGridView1.Rows(im).Cells(jm).Value = ""
Next
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
If (C = 0) Then
Dim im, jm As Integer
Nt = 0
For im = 0 To O
If (dataGridView1.Rows(im).Cells(0).Value <> "") Then
Nt = Nt + 1
End If
Next
ReDim F(Nt * 3)
ReDim Xx(Nt)
ReDim Yy(Nt)
For jm = 1 To Nt
Xx(jm) = dataGridView1.Rows(jm - 1).Cells(0).Value
Yy(jm) = dataGridView1.Rows(jm - 1).Cells(1).Value
Next
For im = 1 To Nt
With ApoyosElasticos
.Rows.Add()
End With
ApoyosElasticos.Rows(im - 1).Cells(0).Value = 0
ApoyosElasticos.Rows(im - 1).Cells(1).Value = 0
ApoyosElasticos.Rows(im - 1).Cells(2).Value = 0
Next
ElseIf (C = 1) Then
Dim im, jm As Integer
Mt = 0
For im = 0 To O
If (dataGridView1.Rows(im).Cells(0).Value <> "") Then
Mt = Mt + 1
End If
Next
ReDim Fu(Mt)
ReDim Fd(Mt)
ReDim Fdd(Mt)
ReDim j(Mt)
ReDim i(Mt)
For jm = 1 To Mt
If (dataGridView1.Rows(jm - 1).Cells(0).Value < dataGridView1.Rows(jm 1).Cells(1).Value) Then
i(jm) = dataGridView1.Rows(jm - 1).Cells(0).Value
j(jm) = dataGridView1.Rows(jm - 1).Cells(1).Value
Else
i(jm) = dataGridView1.Rows(jm - 1).Cells(1).Value
j(jm) = dataGridView1.Rows(jm - 1).Cells(0).Value
End If
Next
ReDim ANG(Mt)
ReDim L(Mt)
For im = 1 To Mt
L((im)) = (((Xx(j(im))) - (Xx(i(im)))) ^ 2 + ((Yy(j(im))) - (Yy(i(im)))) ^ 2) ^ 0.5
Dim formula As Double
formula = ((Xx(j(im))) - (Xx(i(im)))) / ((((Xx(j(im))) - (Xx(i(im)))) ^ 2 + ((Yy(j(im))) (Yy(i(im)))) ^ 2) ^ 0.5)
ANG(im) = Math.Acos(formula)
If ((Yy(j(im))) - (Yy(i(im))) < 0) Then
ANG(im) = 2 * pi - ANG(im)
End If
Next
'DIBUJO DE BARRAS'
Dim COORDX As Double
Dim COORDY As Double
COORDX = (PictureBox1.Width / 2) - ((TRASX - MENORX) * ESCX)
COORDY = (PictureBox1.Height / 2) + ((TRASY - MENORY) * ESCY)
Dim dibujo As Graphics = PictureBox1.CreateGraphics
dibujo.TranslateTransform(COORDX, COORDY)
dibujo.ScaleTransform(1, -1)
Dim lapiz2 As New Pen(Color.Blue, 3)
Dim X As Double
Dim Y As Double
Dim X1 As Single
Dim Y1 As Single
Dim XXX As Double
Dim YYY As Double
Dim XXX1 As Single
Dim YYY1 As Single
For im = 0 To Mt - 1
X = (Xx(i(im + 1)) - MENORX) * ESCX
Y = (Yy(i(im + 1)) - MENORY) * ESCY
XXX = (Xx(j(im + 1)) - MENORX) * ESCX
YYY = (Yy(j(im + 1)) - MENORY) * ESCY
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
XXX1 = Convert.ToSingle(XXX)
YYY1 = Convert.ToSingle(YYY)
dibujo.DrawLine(lapiz2, X1, Y1, XXX1, YYY1)
Next
ElseIf (C = 2) Then
Dim im As Integer
ReDim Ee(Mt)
For im = 1 To Mt
Ee(im) = dataGridView1.Rows(im - 1).Cells(0).Value
Next
'DIBUJO'
Dim COORDX As Double
Dim COORDY As Double
COORDX = (PictureBox1.Width / 2) - ((TRASX - MENORX) * ESCX)
Dim im As Integer
'VECTOR FUERZA'
For im = 1 To Nt
F(3 * im - 2) = Cargas.Rows(im - 1).Cells(0).Value
F(3 * im - 1) = Cargas.Rows(im - 1).Cells(1).Value
F(3 * im) = Cargas.Rows(im - 1).Cells(2).Value
Next
ElseIf (C = 6) Then
Dim im As Integer
'VECTOR DESPLAZAMIENTO'
ReDim D(Nt * 3)
ReDim AP(Nt * 3)
ReDim IdentFuer(6 * Mt)
ReDim IdentMat(6 * Mt)
For im = 1 To Nt
AP(3 * im - 2) = 0
AP(3 * im - 1) = 0
AP(3 * im) = 0
If Restricciones.Rows(im - 1).Cells(0).Value = 0 Then
AP(3 * im - 2) = 1
End If
If Restricciones.Rows(im - 1).Cells(1).Value = 0 Then
AP(3 * im - 1) = 1
End If
If Restricciones.Rows(im - 1).Cells(2).Value = 0 Then
AP(3 * im) = 1
End If
Next
'IDENTIFICAR APOYOS'
Dim CONTAP As Integer
For im = 1 To Mt
If (AP(3 * i(im) - 2)) <> 0 Then
IdentificadorDeMatriz.Rows(im - 1).Cells(0).Value = 1
IdentFuer(CONTAP + 1) = 1
IdentMat(CONTAP + 1) = 1
Else
IdentificadorDeMatriz.Rows(im
End If
If (AP(3 * i(im) - 1)) <> 0 Then
IdentificadorDeMatriz.Rows(im
IdentFuer(CONTAP + 2) = 1
IdentMat(CONTAP + 2) = 1
Else
IdentificadorDeMatriz.Rows(im
End If
If (AP(3 * i(im))) <> 0 Then
IdentificadorDeMatriz.Rows(im
IdentFuer(CONTAP + 3) = 1
IdentMat(CONTAP + 3) = 1
Else
IdentificadorDeMatriz.Rows(im
End If
If (AP(3 * j(im) - 2)) <> 0 Then
IdentificadorDeMatriz.Rows(im
- 1).Cells(0).Value = 0
- 1).Cells(1).Value = 1
- 1).Cells(1).Value = 0
- 1).Cells(2).Value = 1
- 1).Cells(2).Value = 0
- 1).Cells(3).Value = 1
IdentFuer(CONTAP + 4) = 1
IdentMat(CONTAP + 4) = 1
Else
IdentificadorDeMatriz.Rows(im
End If
If (AP(3 * j(im) - 1)) <> 0 Then
IdentificadorDeMatriz.Rows(im
IdentFuer(CONTAP + 5) = 1
IdentMat(CONTAP + 5) = 1
Else
IdentificadorDeMatriz.Rows(im
End If
If (AP(3 * j(im))) <> 0 Then
IdentificadorDeMatriz.Rows(im
IdentFuer(CONTAP + 6) = 1
IdentMat(CONTAP + 6) = 1
Else
IdentificadorDeMatriz.Rows(im
End If
- 1).Cells(3).Value = 0
- 1).Cells(4).Value = 1
- 1).Cells(4).Value = 0
- 1).Cells(5).Value = 1
- 1).Cells(5).Value = 0
IdentFuer(CONTAP + 6) = 0
End If
If j(im) = j(imm) Then
IdentificadorDeMatriz.Rows(im - 1).Cells(3).Value = 0
IdentificadorDeMatriz.Rows(im - 1).Cells(4).Value = 0
IdentificadorDeMatriz.Rows(im - 1).Cells(5).Value = 0
IdentMat(CONTAP + 4) = 0
IdentMat(CONTAP + 5) = 0
IdentMat(CONTAP + 6) = 0
IdentFuer(CONTAP + 4) = 0
IdentFuer(CONTAP + 5) = 0
IdentFuer(CONTAP + 6) = 0
End If
End If
Next
CONTAP = CONTAP + 6
Next
APOYDIBUJO = 1
PictureBox1_Click(sender, e)
'Articulaciones'
ElseIf (C = 7) Then
ReDim ARTI(Mt)
ReDim ARTJ(Mt)
ReDim igiro(Mt)
ReDim jgiro(Mt)
For im = 1 To Mt
ARTI(im) = 0
ARTJ(im) = 0
igiro(im) = 1
jgiro(im) = 1
If Articulaciones.Rows(im - 1).Cells(0).Value <> 0 Then
ARTI(im) = i(im)
igiro(im) = 0
End If
If Articulaciones.Rows(im - 1).Cells(1).Value <> 0 Then
ARTJ(im) = j(im)
jgiro(im) = 0
End If
Next
Dim contap As Integer
For im = 1 To Mt
If igiro(im) = 0 Then
IdentificadorDeMatriz.Rows(im
IdentificadorDeMatriz.Rows(im
IdentificadorDeMatriz.Rows(im
IdentMat(CONTAP + 1) = 0
IdentMat(CONTAP + 2) = 0
IdentMat(contap + 3) = 1
IdentFuer(CONTAP + 1) = 0
IdentFuer(CONTAP + 2) = 0
IdentFuer(contap + 3) = 1
End If
If jgiro(im) = 0 Then
IdentificadorDeMatriz.Rows(im
IdentificadorDeMatriz.Rows(im
- 1).Cells(0).Value = 0
- 1).Cells(1).Value = 0
- 1).Cells(2).Value = 1
- 1).Cells(3).Value = 0
- 1).Cells(4).Value = 0
IdentificadorDeMatriz.Rows(im - 1).Cells(5).Value = 1
IdentMat(contap + 4) = 0
IdentMat(contap + 5) = 0
IdentMat(contap + 6) = 1
IdentFuer(contap + 4) = 0
IdentFuer(contap + 5) = 0
IdentFuer(contap + 6) = 1
End If
If igiro(im) = 0 And jgiro(im) = 0 Then
IdentificadorDeMatriz.Rows(im - 1).Cells(0).Value
IdentificadorDeMatriz.Rows(im - 1).Cells(1).Value
IdentificadorDeMatriz.Rows(im - 1).Cells(2).Value
IdentificadorDeMatriz.Rows(im - 1).Cells(3).Value
IdentificadorDeMatriz.Rows(im - 1).Cells(4).Value
IdentificadorDeMatriz.Rows(im - 1).Cells(5).Value
IdentMat(contap + 1) = 0
IdentMat(contap + 2) = 0
IdentMat(contap + 3) = 1
IdentFuer(contap + 1) = 0
IdentFuer(contap + 2) = 0
IdentFuer(contap + 3) = 1
IdentMat(contap + 4) = 0
IdentMat(contap + 5) = 0
IdentMat(contap + 6) = 1
IdentFuer(contap + 4) = 0
IdentFuer(contap + 5) = 0
IdentFuer(contap + 6) = 1
End If
contap = contap + 6
Next
'Artificio articulacion'
Dim C1 As Double = 0
Dim C2 As Double = 0
Dim C3 As Double = 0
Dim C4 As Double = 0
For im = 1 To Mt
'Artificio para i'
If ARTI(im) <> 0 Then
C1 = 0
C2 = 0
C3 = 0
C4 = 0
For jm = 1 To Mt
If i(jm) = ARTI(im) Then
C1 = C1 + 1
End If
If j(jm) = ARTI(im) Then
C1 = C1 + 1
End If
Next
For JMM = 1 To Mt
If ARTI(JMM) = ARTI(im) Then
C2 = C2 + 1
End If
If ARTJ(JMM) = ARTI(im) Then
C2 = C2 + 1
End If
=
=
=
=
=
=
0
0
1
0
0
1
Next
If C2 = C1 Then
For JM = 1 To Mt
If ARTI(JM) = ARTI(im) Or ARTJ(JM) = ARTI(im) Then
If JM > C4 Then
C4 = JM
End If
End If
Next
If im = C4 Then
igiro(im) = 1
End If
End If
End If
'Artificio para j'
If ARTJ(im) <> 0 Then
C1 = 0
C2 = 0
C3 = 0
C4 = 0
For jm = 1 To Mt
If i(jm) = ARTJ(im) Then
C1 = C1 + 1
End If
If j(jm) = ARTJ(im) Then
C1 = C1 + 1
End If
Next
For JMM = 1 To Mt
If ARTI(JMM) = ARTJ(im) Then
C2 = C2 + 1
End If
If ARTJ(JMM) = ARTJ(im) Then
C2 = C2 + 1
End If
Next
If C2 = C1 Then
For JM = 1 To Mt
If ARTI(JM) = ARTJ(im) Or ARTJ(JM) = ARTJ(im) Then
If JM > C4 Then
C4 = JM
End If
End If
Next
If im = C4 Then
jgiro(im) = 1
End If
End If
End If
Next
ArtDIBUJO = 1
PictureBox1_Click(sender, e)
'Carga Distribuida UNIFORME'
ElseIf C = 8 Then
For im = 1 To Mt
Fu(im) = CargaDistribuida.Rows(im - 1).Cells(1).Value
Next
For hk = 0 To 5
For ik = 0 To 5
valork = 0
For jk = 0 To 5
valork = valork + Ka(hk, jk) * Rt(jk, ik)
Next
K(hk, ik) = valork
Next
Next
'Matriz de rigidez desensamblada KD'
Dim ikd, jkd As Integer
For ikd = 0 To 5
For jkd = 0 To 5
KD(ikd + ckd, jkd + ckd) = K(ikd, jkd)
Next
Next
If IdentMat(1 + ckd) = 1 And IdentMat(2 + ckd) = 1 And IdentMat(3 + ckd) = 1 Then
IdentMat(1 + ckd) = 0
IdentMat(2 + ckd) = 0
IdentMat(3 + ckd) = 0
End If
If IdentMat(4 + ckd) = 1 And IdentMat(5 + ckd) = 1 And IdentMat(6 + ckd) = 1 Then
IdentMat(4 + ckd) = 0
IdentMat(5 + ckd) = 0
IdentMat(6 + ckd) = 0
End If
'Cargas uniformes'
Dim signo As Integer
If ANG(im) > pi / 2 And ANG(im) <= 3 * pi / 2 Then
signo = -1
Else
signo = 1
End If
If Fu(im) <> 0 Then
Dim Fuu(6) As Double
Dim Fuuu(6) As Double
'EMPOTRADO-EMPOTRADO'
If IdentFuer(2 + ckd) = 0 And IdentFuer(3 + ckd) = 0 And IdentFuer(5 + ckd) = 0 And
IdentFuer(6 + ckd) = 0 Then
Fuu(2) = signo * Fu(im) * L(im) / 2
Fuu(3) = signo * Fu(im) * (L(im) ^ 2) / 12
Fuu(5) = signo * Fu(im) * L(im) / 2
Fuu(6) = signo * (-Fu(im)) * (L(im) ^ 2) / 12
'ARTICULADO-EMPOTRADO'
ElseIf IdentFuer(2 + ckd) = 0 And IdentFuer(3 + ckd) = 1 And IdentFuer(5 + ckd) = 0
And IdentFuer(6 + ckd) = 0 Then
Fuu(2) = signo * 3 * Fu(im) * L(im) / 8
Fuu(5) = signo * 5 * Fu(im) * L(im) / 8
Fuu(6) = signo * (-Fu(im)) * (L(im) ^ 2) / 8
'EMPOTRADO-ARTICULADO'
ElseIf IdentFuer(2 + ckd) = 0 And IdentFuer(3 + ckd) = 0 And IdentFuer(5 + ckd) = 0
And IdentFuer(6 + ckd) = 1 Then
Fuu(5) = signo * 3 * Fu(im) * L(im) / 8
Fuu(2) = signo * 5 * Fu(im) * L(im) / 8
Fuu(3) = signo * Fu(im) * L(im) * L(im) / 8
'ARTICULADO-ARTICULADO'
Fdx2(hreee + 1) = valor3
Next
F(3 * i(im) - 2) = Fdx2(1) + F(3 * i(im)
F(3 * i(im) - 1) = Fdx2(2) + F(3 * i(im)
F(3 * i(im)) = Fdx2(3) + F(3 * i(im))
F(3 * j(im) - 2) = Fdx2(4) + F(3 * j(im)
F(3 * j(im) - 1) = Fdx2(5) + F(3 * j(im)
F(3 * j(im)) = Fdx2(6) + F(3 * j(im))
- 2)
- 1)
- 2)
- 1)
ckd = ckd + 6
Next
MatrisDesensamblada.ColumnCount = 6 * Mt
MatrisDesensamblada.RowCount = 6 * Mt
MatrisDesensamblada.ColumnHeadersVisible = True
MatrisDesensamblada.RowHeadersVisible = True
For immm = 0 To 6 * Mt - 1
For jmmm = 0 To 6 * Mt - 1
MatrisDesensamblada.Rows(immm).Cells(jmmm).Value = KD(immm, jmmm)
Next
Next
'Matriz de Compatibilidad A y Matriz de Equilibrio At'
Dim A(Mt * 6 - 1, Nt * 3 - 1) As Integer
Dim At(Nt * 3 - 1, Mt * 6 - 1) As Integer
Dim S As Double = 0
For im = 1 To Mt
S=S+1
A(3 * S - 3, 3 * i(im) - 3) = 1
A(3 * S - 2, 3 * i(im) - 2) = 1
A(3 * S - 1, 3 * i(im) - 1) = 1
At(3 * i(im) - 3, 3 * S - 3) = 1
At(3 * i(im) - 2, 3 * S - 2) = 1
At(3 * i(im) - 1, 3 * S - 1) = 1
S=S+1
A(3 * S - 3, 3 * j(im) - 3) = 1
A(3 * S - 2, 3 * j(im) - 2) = 1
A(3 * S - 1, 3 * j(im) - 1) = 1
At(3 * j(im) - 3, 3 * S - 3) = 1
At(3 * j(im) - 2, 3 * S - 2) = 1
At(3 * j(im) - 1, 3 * S - 1) = 1
Next
MatrizdeCompatibilidad.ColumnCount = Nt * 3
MatrizdeCompatibilidad.RowCount = Mt * 6
MatrizdeCompatibilidad.ColumnHeadersVisible = False
MatrizdeCompatibilidad.RowHeadersVisible = False
For immm = 0 To Mt * 6 - 1
For jmmm = 0 To Nt * 3 - 1
MatrizdeCompatibilidad.Rows(immm).Cells(jmmm).Value = A(immm, jmmm)
Next
Next
MatrizdeEquilibrio.ColumnCount = Mt * 6
MatrizdeEquilibrio.RowCount = Nt * 3
MatrizdeEquilibrio.ColumnHeadersVisible = False
MatrizdeEquilibrio.RowHeadersVisible = False
For immm = 0 To Nt * 3 - 1
For jmmm = 0 To Mt * 6 - 1
MatrizdeEquilibrio.Rows(immm).Cells(jmmm).Value = At(immm, jmmm)
Next
Next
= 0 And IdentFuer(5 +
= 1 And IdentFuer(5 +
= 1 And IdentFuer(5 +
= 1 And IdentFuer(5 +
End If
'ESFUERZOS DEBIDO A LOS DESPLAZAMIENTOS NODALES'
Dim ke(5, 5) As Double
'EMPOTRADO-EMPOTRADO'
If IdentMat(1 + ContEI) = 0 And IdentMat(2 + ContEI) = 0 And IdentMat(3 + ContEI) = 0
And IdentMat(4 + ContEI) = 0 And IdentMat(5 + ContEI) = 0 And IdentMat(6 + ContEI) = 0 Then
ke(0, 0) = Ee(im) * Aa(im) / L(im)
For hk = 0 To 5
For ik = 0 To 5
valork = 0
For jk = 0 To 5
valork = valork + ke(hk, jk) * Rt(jk, ik)
Next
K(hk, ik) = valork
Next
Next
For hk = 0 To 5
For jk = 0 To 5
MsgBox(hk & "," & jk & "=" & ke(hk, jk))
Next
Next
'MULTIPLICACION POR DESPLAZAMIENTOS NODALES
Dim href, iref As Integer
Dim Fdn(6) As Double
Dim valorf3 As Double
For href = 0 To 5
valorf3 = 0
For iref = 0 To 5
valorf3 = valorf3 + K(href, iref) * DM(iref + 1)
Next
Fdn(href + 1) = valorf3
MsgBox(href + 1 & "=" & Fdn(href + 1))
Next
VEI(ContEI + 1) = Fdn(1)
VEI(ContEI + 2) = Fdn(2)
VEI(ContEI + 3) = Fdn(3)
VEI(ContEI + 4) = Fdn(4)
VEI(ContEI + 5) = Fdn(5)
VEI(ContEI + 6) = Fdn(6)
ContEI = ContEI + 6
Next
+
+
+
+
+
+
VEI(ContEI
VEI(ContEI
VEI(ContEI
VEI(ContEI
VEI(ContEI
VEI(ContEI
+
+
+
+
+
+
1)
2)
3)
4)
5)
6)
End Sub
Private Sub ModuloElasticoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ModuloElasticoToolStripMenuItem.Click
dataGridView1.Columns(0).HeaderText = "E [tn/m2]"
dataGridView1.Columns(1).HeaderText = ""
C=2
'BORRAR CELDAS'
Me.dataGridView1.CurrentCell = Me.dataGridView1(0, 0)
Dim im, jm As Integer
For im = 0 To O
For jm = 0 To 1
dataGridView1.Rows(im).Cells(jm).Value = ""
Next
Next
End Sub
Private Sub CIRCULARToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CIRCULARToolStripMenuItem.Click
dataGridView1.Columns(0).HeaderText = "D"
dataGridView1.Columns(1).HeaderText = ""
C=3
'BORRAR CELDAS'
Me.dataGridView1.CurrentCell = Me.dataGridView1(0, O)
Dim im, jm As Integer
For im = 0 To O
For jm = 0 To 1
dataGridView1.Rows(im).Cells(jm).Value = ""
Next
Next
End Sub
Private Sub CUADRADAToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CUADRADAToolStripMenuItem.Click
dataGridView1.Columns(0).HeaderText = "B [m]"
dataGridView1.Columns(1).HeaderText = "H [m]"
C=4
'BORRAR CELDAS'
Me.dataGridView1.CurrentCell = Me.dataGridView1(0, 0)
Dim im, jm As Integer
For im = 0 To O
For jm = 0 To 1
dataGridView1.Rows(im).Cells(jm).Value = ""
Next
Next
End Sub
Private Sub pruebas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
MsgBox(Math.Abs(-5))
End Sub
Private Sub ApoyoMovilToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles IntroduccionCargas.Click
Restricciones.Visible = False
dataGridView1.Visible = False
Cargas.Visible = True
RESULTADOS.Visible = False
Articulaciones.Visible = False
CargaDistribuida.Visible = False
CargaTriangular.Visible = False
ApoyosElasticos.Visible = False
C=5
Dim i As Integer = 0
For i = 1 To Nt
With Cargas
.Rows.Add()
End With
Next
'Fuerzas = 0'
Dim im, jm As Integer
For im = 0 To Nt - 1
For jm = 0 To 2
Cargas.Rows(im).Cells(jm).Value = 0
Next
Next
Me.Cargas.CurrentCell = Me.Cargas(0, 0)
End Sub
ke(0,
ke(1,
ke(1,
ke(1,
ke(3,
ke(3,
ke(4,
ke(4,
ke(4,
ke(5,
ke(5,
ke(5,
3)
1)
4)
5)
0)
3)
1)
4)
5)
1)
4)
5)
=
=
=
=
=
=
=
=
=
=
=
=
End Sub
Private Sub MatrisDesensamblada_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MatrisDesensamblada.Click
MatrisDesensamblada.Visible = False
End Sub
Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
PictureBox1_Click(sender, e)
For im = 1 To Mt
MsgBox(Xx(i(im)))
Next
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles PictureBox1.Click
'DIBUJO'
Dim COORDX As Double
Dim COORDY As Double
COORDX = (PictureBox1.Width / 2) - ((TRASX - MENORX) * ESCX)
COORDY = (PictureBox1.Height / 2) + ((TRASY - MENORY) * ESCY)
Dim dibujo As Graphics = PictureBox1.CreateGraphics
dibujo.TranslateTransform(COORDX, COORDY)
dibujo.ScaleTransform(1, -1)
Dim lapiz1 As New Pen(Color.Red)
Dim pincelRelleno As SolidBrush
pincelRelleno = New SolidBrush(Color.Red)
Dim lapiz2 As New Pen(Color.Blue, 3)
Dim X As Double
Dim Y As Double
Dim X1 As Single
Dim Y1 As Single
Dim XXX As Double
Dim YYY As Double
Dim XXX1 As Single
Dim YYY1 As Single
pincelRelleno = New SolidBrush(Color.Red)
For im = 1 To Nt
X = ((Xx(im)) - MENORX) * ESCX - 1.5
Y = ((Yy(im)) - MENORY) * ESCY - 1.5
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
dibujo.DrawEllipse(lapiz1, X1, Y1, 3, 3)
dibujo.FillEllipse(pincelRelleno, X1, Y1, 3, 3)
Next
For im = 0 To Mt - 1
X = (Xx(i(im + 1)) - MENORX) * ESCX + Math.Cos(ANG(im + 1)) * 20 * ESCX / 40
Y = (Yy(i(im + 1)) - MENORY) * ESCY + Math.Sin(ANG(im + 1)) * 20 * ESCY / 40
XXX = (Xx(j(im + 1)) - MENORX) * ESCX - Math.Cos(ANG(im + 1)) * 20 * ESCX / 40
YYY = (Yy(j(im + 1)) - MENORY) * ESCY - Math.Sin(ANG(im + 1)) * 20 * ESCY / 40
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
XXX1 = Convert.ToSingle(XXX)
YYY1 = Convert.ToSingle(YYY)
dibujo.DrawLine(lapiz2, X1, Y1, XXX1, YYY1)
Next
If APOYDIBUJO = 1 Then
dibujo.DrawLine(lapiz4,
dibujo.DrawLine(lapiz4,
dibujo.DrawLine(lapiz4,
dibujo.DrawLine(lapiz4,
dibujo.DrawLine(lapiz4,
dibujo.DrawLine(lapiz4,
'apoyo movil x
ElseIf AP(3 * j(im) - 2) = 0 And AP(3 * j(im) - 1) = 1 And AP(3 * j(im)) = 1 Then
X = (Xx(j(im)) - MENORX) * ESCX
Y = (Yy(j(im)) - MENORY) * ESCY
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
dibujo.DrawLine(lapiz4, X1, Y1, X1 - 10, Y1 + 10)
dibujo.DrawLine(lapiz4, X1, Y1, X1 - 10, Y1 - 10)
dibujo.DrawLine(lapiz4, X1 - 10, Y1 + 10, X1 - 10, Y1 - 10)
dibujo.DrawLine(lapiz4, X1 - 12, Y1 + 10, X1 - 12, Y1 - 10)
'apoyo empotrado
ElseIf AP(3 * j(im) - 2) = 0 And AP(3 * j(im) - 1) = 0 And AP(3 * j(im)) = 0 Then
If ANG(im) = pi Then
X = (Xx(j(im)) - MENORX) * ESCX
Y = (Yy(j(im)) - MENORY) * ESCY
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
dibujo.DrawLine(lapiz4, X1, Y1 + 10, X1, Y1 - 10)
dibujo.DrawLine(lapiz4, X1, Y1 + 10, X1 - 7, Y1 + 3)
dibujo.DrawLine(lapiz4, X1, Y1 - 10, X1 - 7, Y1 - 15)
dibujo.DrawLine(lapiz4, X1, Y1, X1 - 7, Y1 - 7)
ElseIf ANG(im) = 0 Then
X = (Xx(j(im)) - MENORX) * ESCX
Y = (Yy(j(im)) - MENORY) * ESCY
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
dibujo.DrawLine(lapiz4, X1, Y1 + 10, X1, Y1 - 10)
dibujo.DrawLine(lapiz4, X1, Y1 + 10, X1 + 7, Y1 + 17)
dibujo.DrawLine(lapiz4, X1, Y1 - 10, X1 + 7, Y1 - 3)
dibujo.DrawLine(lapiz4, X1, Y1, X1 + 7, Y1 + 7)
ElseIf ANG(im) > 0 And ANG(im) < pi Then
X = (Xx(j(im)) - MENORX) * ESCX
Y = (Yy(j(im)) - MENORY) * ESCY
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
dibujo.DrawLine(lapiz4, X1 + 10, Y1, X1 - 10, Y1)
dibujo.DrawLine(lapiz4, X1 - 10, Y1, X1 - 17, Y1 + 7)
dibujo.DrawLine(lapiz4, X1, Y1, X1 - 7, Y1 + 7)
dibujo.DrawLine(lapiz4, X1 + 10, Y1, X1 + 3, Y1 + 7)
ElseIf ANG(im) > pi And ANG(im) < 2 * pi Then
X = (Xx(j(im)) - MENORX) * ESCX
Y = (Yy(j(im)) - MENORY) * ESCY
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
dibujo.DrawLine(lapiz4, X1 + 10, Y1, X1 - 10, Y1)
dibujo.DrawLine(lapiz4, X1 - 10, Y1, X1 - 17, Y1 - 7)
dibujo.DrawLine(lapiz4, X1, Y1, X1 - 7, Y1 - 7)
dibujo.DrawLine(lapiz4, X1 + 10, Y1, X1 + 3, Y1 - 7)
End If
'apoyo guiado y
ElseIf AP(3 * j(im) - 1) = 0 And AP(3 * j(im) - 2) = 1 And AP(3 * j(im)) = 0 Then
X = (Xx(j(im)) - MENORX) * ESCX
Y = (Yy(j(im)) - MENORY) * ESCY
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
dibujo.DrawLine(lapiz4, X1, Y1, X1, Y1 - 5)
dibujo.DrawLine(lapiz4, X1 - 10, Y1 - 5, X1 + 10, Y1 - 5)
dibujo.DrawLine(lapiz4, X1 - 10, Y1 - 10, X1 + 10, Y1 - 10)
'apoyo guiado x
ElseIf AP(3 * j(im) - 2) = 0 And AP(3 * j(im) - 1) = 1 And AP(3 * j(im)) = 0 Then
X = (Xx(j(im)) - MENORX) * ESCX
Y = (Yy(j(im)) - MENORY) * ESCY
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
dibujo.DrawLine(lapiz4, X1, Y1, X1 - 5, Y1)
dibujo.DrawLine(lapiz4, X1 - 5, Y1 + 10, X1 - 5, Y1 - 10)
dibujo.DrawLine(lapiz4, X1 - 10, Y1 + 10, X1 - 10, Y1 - 10)
End If
Next
End If
If ArtDIBUJO = 1 Then
Dim lapiz3 As New Pen(Color.Black)
Dim pincelRelleno3 As SolidBrush
pincelRelleno3 = New SolidBrush(Color.Gray)
For im = 1 To Mt
If ARTI(im) <> 0 Then
X = (Xx(i(im)) - MENORX) * ESCX + Math.Cos(ANG(im)) * 20 * ESCX / 40 - 3
Y = (Yy(i(im)) - MENORY) * ESCY + Math.Sin(ANG(im)) * 20 * ESCY / 40 - 3
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
dibujo.DrawEllipse(lapiz3, X1, Y1, 6, 6)
dibujo.FillEllipse(pincelRelleno3, X1, Y1, 6, 6)
End If
If ARTJ(im) <> 0 Then
X = (Xx(j(im)) - MENORX) * ESCX - Math.Cos(ANG(im)) * 20 * ESCX / 40 - 3
Y = (Yy(j(im)) - MENORY) * ESCY - Math.Sin(ANG(im)) * 20 * ESCY / 40 - 3
X1 = Convert.ToSingle(X)
Y1 = Convert.ToSingle(Y)
dibujo.DrawEllipse(lapiz3, X1, Y1, 6, 6)
dibujo.FillEllipse(pincelRelleno3, X1, Y1, 6, 6)
End If
Next
End If
End Sub
Private Sub ResultadosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ResultadosToolStripMenuItem.Click
Restricciones.Visible = False
dataGridView1.Visible = False
Cargas.Visible = False
RESULTADOS.Visible = True
Articulaciones.Visible = False
CargaDistribuida.Visible = False
CargaTriangular.Visible = False
ApoyosElasticos.Visible = False
Dim i As Integer = 0
For i = 1 To 3 * Nt
With RESULTADOS
.Rows.Add()
End With
Next
'Desplazamientos'
Dim im As Integer
For im = 0 To 3 * Nt - 1
RESULTADOS.Rows(im).Cells(0).Value = D(im + 1)
Next
'Reacciones'
For im = 0 To 3 * Nt - 1
RESULTADOS.Rows(im).Cells(1).Value = REACCIONES(im + 1)
Next
End Sub
Private Sub ArticulacionesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ArticulacionesToolStripMenuItem.Click
Restricciones.Visible = False
dataGridView1.Visible = False
Cargas.Visible = False
RESULTADOS.Visible = False
Articulaciones.Visible = True
CargaDistribuida.Visible = False
CargaTriangular.Visible = False
ApoyosElasticos.Visible = False
C=7
For im = 1 To Mt
With Articulaciones
.Rows.Add()
End With
Articulaciones.Rows(im - 1).Cells(0).Value = 0
Articulaciones.Rows(im - 1).Cells(1).Value = 0
Next
End Sub
Private Sub MenuStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked
End Sub
Private Sub CargaUniformeEnLosMiembrosToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CargaUniformeEnLosMiembrosToolStripMenuItem.Click
Restricciones.Visible = False
dataGridView1.Visible = False
Cargas.Visible = False
RESULTADOS.Visible = False
Articulaciones.Visible = False
CargaDistribuida.Visible = True
CargaTriangular.Visible = False
ApoyosElasticos.Visible = False
C=8
For im = 1 To Mt
With CargaDistribuida
.Rows.Add()
End With
CargaDistribuida.Rows(im - 1).Cells(0).Value = "MIEMBRO " & (im)
CargaDistribuida.Rows(im - 1).Cells(1).Value = 0
Next
End Sub
Private Sub CargaDistribuidaEnLosMiembrosToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CargaDistribuidaEnLosMiembrosToolStripMenuItem.Click
Restricciones.Visible = False
dataGridView1.Visible = False
Cargas.Visible = False
RESULTADOS.Visible = False
Articulaciones.Visible = False
CargaDistribuida.Visible = False
CargaTriangular.Visible = True
ApoyosElasticos.Visible = False
C=9
For im = 1 To Mt
With CargaTriangular
.Rows.Add()
End With
CargaTriangular.Rows(im - 1).Cells(0).Value = "MIEMBRO " & (im)
CargaTriangular.Rows(im - 1).Cells(1).Value = 0
CargaTriangular.Rows(im - 1).Cells(2).Value = 0
Next
End Sub
Private Sub ApoyosElasticosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ApoyosElasticosToolStripMenuItem.Click
Restricciones.Visible = False
dataGridView1.Visible = False
Cargas.Visible = False
RESULTADOS.Visible = False
Articulaciones.Visible = False
CargaDistribuida.Visible = False
CargaTriangular.Visible = False
ApoyosElasticos.Visible = True
C = 10
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
For im = 1 To 6 * Mt
MsgBox(P(im))
Next
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button4.Click
PictureBox1.Image = Nothing
End Sub