1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| Function matricemomentappui(longueurs As Range, foyer As Range, rotation As Range)
EI = 1
Dim matrice() As Double
Dim fg() As Double
Dim fd() As Double
Dim rotg() As Double
Dim rotd() As Double
Dim i As Integer 'pour parcourir les lignes de la matrice
Dim j As Integer 'pour parcourir les colonnes de la matrice
Dim n As Double 'taille de la matrice
n = Application.Count(longueurs)
ReDim matrice(1 To 2 * n, 1 To n)
ReDim fd(1 To n)
ReDim fg(1 To n)
ReDim rotd(1 To n)
ReDim rotg(1 To n)
For i = 1 To 2 * n
For j = 1 To n
fg(j) = foyer(1, j)
fd(j) = foyer(2, j)
rotg(j) = rotation(1, j)
rotd(j) = rotation(2, j)
If i = 2 * j - 1 Then
matrice(i, j) = (fg(j) * (rotg(j) / EI) + (fg(j) * fd(j) * rotd(j) / EI)) _
/ ((longueurs(j) / 6) * (1 - fg(j) * fd(j)))
ElseIf i = 2 * j Then
matrice(i, j) = -((fg(j) * fd(j) * (rotg(j) / EI)) + (fd(j) * rotd(j) / EI)) _
/ ((longueurs(j) / 6) * (1 - fg(j) * fd(j)))
ElseIf i > j Then
matrice(i, j) = -fg(j) * matrice(i = j, j = i)
Else
matrice(i, j) = -fg(j) * matrice(i = j, j = i)
End If
Next j
Next i
matricemomentappui = matrice(i, j)
End Function |
Partager