Sub stressevaluation_Click()
Range(Cells(7, 2), Cells(100, 100)).Clear
w = Range("C2").Value: L = Range("C3").Value: x1 = Range("C4").Value
b = Range("G3").Value: h = Range("G4").Value
Ra = w * L ^ 2 / (L - x1) / 2
Ix = b * h ^ 3 / 12
For i = 1 To L / 10 + 1
x = 10 * (i - 1): Cells(7, i + 2) = x
If x1 > x Then
Cells(8, i + 2) = -w * x
Cells(9, i + 2) = -w * x ^ 2 / 2
Else
Cells(8, i + 2) = -w * x + Ra
Cells(9, i + 2) = -w * x ^ 2 / 2 + Ra * (x - x1)
End If
Next i
For i = 1 To L / 10 + 1
x = 10 * (i - 1): Cells(12, i + 2) = x
For j = 1 To h / 10 + 1
y = -10 * (j - 1) + h / 2: Cells(12 + j, 2) = y
M = Cells(9, 2 + i): Cells(12 + j, 2 + i) = M * y / Ix
Next j
kk = h / 10 + 4
x = 10 * (i - 1): Cells(12 + kk, i + 2) = x
For j = 1 To h / 10 + 1
y = -10 * (j - 1) + h / 2: Cells(12 + kk + j, 2) = y
V = Cells(8, 2 + i): Q = b / 2 * (h ^ 2 / 4 - y ^ 2): Cells(12 + kk + j, 2 + i)
= V * Q / (Ix * b)
Next j
kk3 = kk: kk = 2 * (h / 10 + 4)
x = 10 * (i - 1): Cells(12 + kk, i + 2) = x
For j = 1 To h / 10 + 1
y = -10 * (j - 1) + h / 2: Cells(12 + kk + j, 2) = y
sigma = Cells(12 + j, 2 + i): tau = Cells(12 + kk3 + j, 2 + i)
Cells(12 + kk + j, 2 + i) = Abs(sigma / 2) + Sqr((sigma / 2) ^ 2 + tau ^
Next j
Next i
mn = 10000000000#
For i = 2 To L / 10
For j = 2 To h / 10
If mn >= Cells(12 + kk + j, 2 + i) Then
mi = 12 + kk + j: mj = 2 + i
mn = Cells(mi, mj)
End If
Next j
Next i
Cells(mi, mj).Font.Bold = True
Cells(mi, mj).Font.Color = vbRed
Range(Cells(12 + kk + 2, 2 + 2), Cells(12 + kk + 2 + h / 10 - 2, 2 + 2 + L / 10 -
2)).BorderAround ColorIndex:=3, Weight:=xlThick
Range("B53").Value = mn
'Range("B53").Value = Application.WorksheetFunction.Min(Range(Cells(12 + kk + 2,
2 + 2), Cells(12 + kk + 2 + h / 10 - 2, 2 + 2 + L / 10 - 2)))
End Sub