├── 00-General_Calculation_Tools ├── ini.py ├── linsub.bas └── linsub_polynomial_example.xlsm ├── 01-General Analysis ├── 01 - 3 or 2 Span Beam Moment Distribution.xlsx ├── 01 - General_Beam_Analysis_MR.xlsm ├── 01 - Rigid Diaphragm.xlsx ├── 01 - Section Properties.xlsm ├── 01 - beam_user_functions.xlam ├── 01 - beam_user_functions.xlsm ├── CantileverLeftFormulas.bas ├── CantileverRightFormulas.bas ├── SimpleBeamFormulas.bas ├── esap_UserDocumentation.docx ├── esap_example_input.xlsx └── esap_v0.99.xlsm ├── 03-Concrete ├── 03 - Unit Width Strip Foundation-MR.xlsm ├── 03_Circular_Section_Analysis_MR.xlsm ├── 03_T_L_R_Beam Capacity_MR.xlsm └── 03_retain_wall.xlsx ├── 04-Masonry └── ini.py ├── 05-Metals ├── 05 - Elastic Weld Analysis_MR.xlsm ├── 05_Rigid Base Plate Analysis_MR.xlsm ├── Single_Angle.xlsx └── rigid_plate_animation.gif ├── 06-Wood ├── 03 - Wood Shear Wall Foundation - MR.xlsm └── ini.py ├── LICENSE └── README.md /00-General_Calculation_Tools/ini.py: -------------------------------------------------------------------------------- 1 | # place holder file 2 | -------------------------------------------------------------------------------- /00-General_Calculation_Tools/linsub.bas: -------------------------------------------------------------------------------- 1 | Attribute VB_Name = "linsub" 2 | Option Explicit 3 | 4 | 'LU decomposition including partial pivoting 5 | Function lu_decomp(a() As Variant) As Variant() 6 | Dim n As Long 7 | Dim m As Long 8 | Dim pvt As Double 9 | Dim new_pvt_row As Long 10 | Dim org_pvt_row As Long 11 | Dim j As Long 12 | Dim i As Long 13 | Dim k As Long 14 | Dim Aov(0 To 1) As Variant 15 | Dim nmo As Long 16 | Dim temp_pvt_row As Long 17 | Dim temp_pvt_row2 As Long 18 | 19 | n = UBound(a, 1) 20 | m = UBound(a, 2) 21 | 22 | nmo = n - 1 23 | 24 | Dim ov() As Variant 25 | ReDim ov(n) 26 | 27 | 'initialize order vector 28 | For i = 0 To n 29 | ov(i) = i 30 | Next i 31 | 32 | If n <> m Then 33 | Err.Raise 5, "LU Decomposition", "Non-sqaure matrix; can't decompose" 34 | End If 35 | 36 | For j = 0 To nmo 37 | pvt = Abs(a(ov(j), j)) 38 | new_pvt_row = -1 39 | org_pvt_row = j 40 | 41 | For i = j + 1 To n 42 | If Abs(a(ov(i), j)) > pvt Then 43 | pvt = Abs(a(ov(i), j)) 44 | new_pvt_row = i 45 | End If 46 | Next 47 | 48 | If new_pvt_row <> -1 And org_pvt_row <> new_pvt_row Then 49 | temp_pvt_row = ov(org_pvt_row) 50 | temp_pvt_row2 = ov(new_pvt_row) 51 | ov(org_pvt_row) = temp_pvt_row2 52 | ov(new_pvt_row) = temp_pvt_row 53 | End If 54 | 55 | For i = j + 1 To n 56 | a(ov(i), j) = a(ov(i), j) / a(ov(j), j) 57 | Next 58 | 59 | For i = j + 1 To n 60 | For k = j + 1 To n 61 | a(ov(i), k) = a(ov(i), k) - a(ov(i), j) * a(ov(j), k) 62 | Next 63 | Next 64 | Next 65 | 66 | 'Packing up things to return 67 | 'VBA can't return more than one item 68 | Aov(0) = a 69 | Aov(1) = ov 70 | 71 | lu_decomp = Aov 72 | 73 | End Function 74 | 75 | Private Function forward_elim(lu() As Variant, ov() As Variant, b() As Variant) As Variant() 76 | Dim n As Integer 77 | Dim m As Integer 78 | Dim j As Integer 79 | Dim i As Integer 80 | 81 | n = UBound(lu, 1) 82 | m = UBound(lu, 2) 83 | 84 | For j = 0 To n 85 | For i = j + 1 To n 86 | b(ov(i)) = b(ov(i)) - lu(ov(i), j) * b(ov(j)) 87 | Next 88 | Next 89 | 90 | forward_elim = b 91 | 92 | End Function 93 | 94 | Private Function back_sub(lu() As Variant, ov() As Variant, b() As Variant) As Variant() 95 | Dim n As Integer 96 | Dim m As Integer 97 | Dim j As Integer 98 | Dim k As Integer 99 | Dim i As Integer 100 | 101 | n = UBound(lu, 1) 102 | m = UBound(lu, 2) 103 | 104 | Dim x() As Variant 105 | ReDim x(n) 106 | 107 | For i = 0 To n 108 | x(i) = 0 109 | Next i 110 | 111 | x(ov(n)) = b(ov(n)) / lu(ov(n), n) 112 | For j = n - 1 To 0 Step -1 113 | x(ov(j)) = b(ov(j)) 114 | For k = n To j + 1 Step -1 115 | x(ov(j)) = x(ov(j)) - x(ov(k)) * lu(ov(j), k) 116 | Next 117 | x(ov(j)) = x(ov(j)) / lu(ov(j), j) 118 | Next 119 | 120 | back_sub = x 121 | 122 | End Function 123 | 'Reorders solutions according to order vector 124 | Private Function reorder(x() As Variant, ov() As Variant) As Variant() 125 | 126 | Dim n As Integer 127 | Dim i As Integer 128 | 129 | n = UBound(x, 1) 130 | 131 | Dim y() As Variant 132 | ReDim y(n) 133 | 134 | For i = 0 To n 135 | y(i) = x(ov(i)) 136 | Next 137 | 138 | reorder = y 139 | 140 | End Function 141 | 142 | 'Performs LU decomp, forward and back substitution returns solution vector 143 | 'to a linear set of equations 144 | Function solve(lu() As Variant, ov() As Variant, b() As Variant) As Variant() 145 | Dim n As Integer 146 | Dim m As Integer 147 | Dim xo() As Variant 148 | 149 | n = UBound(lu, 1) 150 | m = UBound(lu, 2) 151 | 152 | Dim c() As Variant 153 | ReDim c(n) 154 | Dim x() As Variant 155 | ReDim x(n) 156 | 157 | c = forward_elim(lu, ov, b) 158 | x = back_sub(lu, ov, c) 159 | xo = reorder(x, ov) 160 | 161 | solve = xo 162 | 163 | End Function 164 | 165 | 'Matrix-matrix multiplication 166 | Function matmul(a() As Variant, b() As Variant) As Variant() 167 | Dim i As Integer 168 | Dim j As Integer 169 | Dim k As Integer 170 | Dim m As Integer 171 | Dim x As Integer 172 | Dim y As Integer 173 | Dim z As Integer 174 | Dim c() As Variant 175 | 176 | i = UBound(a, 1) 177 | j = UBound(a, 2) 178 | k = UBound(b, 1) 179 | m = UBound(b, 2) 180 | 181 | If j <> k Then 182 | Err.Raise 5, "Matrix Multiplication", "Dims don't match" 183 | End If 184 | 185 | ReDim c(i, m) 186 | 187 | For x = 0 To i 188 | For y = 0 To m 189 | For z = 0 To j 190 | c(x, y) = c(x, y) + a(x, z) * b(z, y) 191 | Next z 192 | Next y 193 | Next x 194 | 195 | matmul = c 196 | 197 | End Function 198 | 199 | 'Matrix-vector multiplication 200 | Function matvecmul(a() As Variant, b() As Variant) As Variant() 201 | Dim i As Integer 202 | Dim j As Integer 203 | Dim k As Integer 204 | Dim x As Integer 205 | Dim z As Integer 206 | Dim c() As Variant 207 | 208 | i = UBound(a, 1) 209 | j = UBound(a, 2) 210 | k = UBound(b, 1) 211 | 212 | If j <> k Then 213 | Err.Raise 5, "Matrix Vector Multiplication", "Dims don't match" 214 | End If 215 | 216 | ReDim c(i) 217 | 218 | For x = 0 To i 219 | For z = 0 To j 220 | c(x) = c(x) + a(x, z) * b(z) 221 | Next z 222 | Next x 223 | 224 | matvecmul = c 225 | 226 | End Function 227 | 228 | 'Transpose matrix 229 | Function mattran(a() As Variant) As Variant() 230 | Dim i As Integer 231 | Dim j As Integer 232 | Dim x As Integer 233 | Dim y As Integer 234 | Dim b As Variant 235 | 236 | i = UBound(a, 1) 237 | j = UBound(a, 2) 238 | 239 | ReDim b(j, i) 240 | 241 | For x = 0 To i 242 | For y = 0 To j 243 | b(y, x) = a(x, y) 244 | Next y 245 | Next x 246 | 247 | mattran = b 248 | 249 | End Function 250 | 251 | 'Matrix-matrix addition 252 | Function matadd(a() As Variant, b() As Variant) As Variant() 253 | Dim i As Integer 254 | Dim j As Integer 255 | Dim am As Long 256 | Dim an As Long 257 | Dim bm As Long 258 | Dim bn As Long 259 | Dim c() As Variant 260 | 261 | am = UBound(a, 1) 262 | an = UBound(a, 2) 263 | bm = UBound(b, 1) 264 | bn = UBound(b, 2) 265 | 266 | If am <> bm Or an <> bn Then 267 | Err.Raise "Matrix Addition", "Matrices not same dimensions" 268 | End If 269 | 270 | ReDim c(am, an) 271 | 272 | For i = 0 To am 273 | For j = 0 To an 274 | c(i, j) = a(i, j) + b(i, j) 275 | Next j 276 | Next i 277 | 278 | matadd = c 279 | End Function 280 | 281 | 'Vector-vector addition 282 | Function vecadd(a() As Variant, b() As Variant) As Variant() 283 | Dim i As Integer 284 | Dim am As Long 285 | Dim bm As Long 286 | Dim c() As Variant 287 | 288 | am = UBound(a, 1) 289 | bm = UBound(b, 1) 290 | 291 | If am <> bm Then 292 | Err.Raise "Vector Addition", "Vectors not same dimensions" 293 | End If 294 | 295 | ReDim c(am) 296 | 297 | For i = 0 To am 298 | c(i) = a(i) + b(i) 299 | Next i 300 | 301 | vecadd = c 302 | End Function 303 | 304 | -------------------------------------------------------------------------------- /00-General_Calculation_Tools/linsub_polynomial_example.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/00-General_Calculation_Tools/linsub_polynomial_example.xlsm -------------------------------------------------------------------------------- /01-General Analysis/01 - 3 or 2 Span Beam Moment Distribution.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/01-General Analysis/01 - 3 or 2 Span Beam Moment Distribution.xlsx -------------------------------------------------------------------------------- /01-General Analysis/01 - General_Beam_Analysis_MR.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/01-General Analysis/01 - General_Beam_Analysis_MR.xlsm -------------------------------------------------------------------------------- /01-General Analysis/01 - Rigid Diaphragm.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/01-General Analysis/01 - Rigid Diaphragm.xlsx -------------------------------------------------------------------------------- /01-General Analysis/01 - Section Properties.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/01-General Analysis/01 - Section Properties.xlsm -------------------------------------------------------------------------------- /01-General Analysis/01 - beam_user_functions.xlam: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/01-General Analysis/01 - beam_user_functions.xlam -------------------------------------------------------------------------------- /01-General Analysis/01 - beam_user_functions.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/01-General Analysis/01 - beam_user_functions.xlsm -------------------------------------------------------------------------------- /01-General Analysis/CantileverLeftFormulas.bas: -------------------------------------------------------------------------------- 1 | Attribute VB_Name = "CantileverLeftFormulas" 2 | 3 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 4 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 5 | ''' BSD 3-Clause License ''' 6 | ''' ''' 7 | ''' Copyright (c) 2020, open-struct-engineer ''' 8 | ''' All rights reserved. ''' 9 | ''' ''' 10 | ''' Redistribution and use in source and binary forms, with or without ''' 11 | ''' modification, are permitted provided that the following conditions are met: ''' 12 | ''' ''' 13 | ''' 1. Redistributions of source code must retain the above copyright notice, this ''' 14 | ''' list of conditions and the following disclaimer. ''' 15 | ''' ''' 16 | ''' 2. Redistributions in binary form must reproduce the above copyright notice, ''' 17 | ''' this list of conditions and the following disclaimer in the documentation ''' 18 | ''' and/or other materials provided with the distribution. ''' 19 | ''' ''' 20 | ''' 3. Neither the name of the copyright holder nor the names of its ''' 21 | ''' contributors may be used to endorse or promote products derived from ''' 22 | ''' this software without specific prior written permission. ''' 23 | ''' ''' 24 | ''' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ''' 25 | ''' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ''' 26 | ''' IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ''' 27 | ''' DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE ''' 28 | ''' FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ''' 29 | ''' DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ''' 30 | ''' SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ''' 31 | ''' CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ''' 32 | ''' OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ''' 33 | ''' OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' 34 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 35 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 36 | 37 | 38 | Function cant_left_initialSlope(slope As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 39 | 40 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 41 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 42 | ''' ''' 43 | ''' Function for a Starting slope on a left side cantilever ''' 44 | ''' ''' 45 | ''' Important Note: ''' 46 | ''' All inputs must have consistent units ''' 47 | ''' ''' 48 | ''' Result key: ''' 49 | ''' 0 = Left Reaction ''' 50 | ''' 1 = Right Reaction ''' 51 | ''' 2 = Shear at x ''' 52 | ''' 3 = Moment at x ''' 53 | ''' 4 = Cross Section Rotation/Slope at x ''' 54 | ''' 5 = Deflection at x ''' 55 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 56 | ''' 7 = Fixed End Moment at left Support (clockwise positive) ''' 57 | ''' ''' 58 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 59 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 60 | 61 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 62 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 63 | ''' ''' 64 | ''' Sign Convention: ''' 65 | ''' Loads applied in the (-)y direction are positive ''' 66 | ''' Clockwise moments are positive ''' 67 | ''' ''' 68 | ''' Reactions in the (+)y direction are positive ''' 69 | ''' ''' 70 | ''' Internal: ''' 71 | ''' Shear is positive in the (+)y direction ''' 72 | ''' Moment is positive clockwise ''' 73 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 74 | ''' Upward deflection is in the (+)y direction ''' 75 | ''' ''' 76 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 77 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 78 | 79 | 80 | '''''''''''''''''''''''''''''' 81 | '' Variable Definitions '' 82 | '''''''''''''''''''''''''''''' 83 | 84 | Dim rl As Double 'Left Reaction for a simple span beam 85 | Dim rr As Double 'Right Reaction foa smiple span beam 86 | Dim c1 As Double 'Integration constant - C1 87 | Dim c2 As Double 'Integration constant - C2 88 | Dim vx As Double 'Shear at x 89 | Dim mx As Double 'Moment at x 90 | Dim sx As Double 'Cross section Rotation/Slope at x 91 | Dim dx As Double 'Deflection at x 92 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 93 | Dim femR As Double 'left End Fixed End Moment - Clockwise Positive 94 | 95 | '''''''''''''''''''''''''''' 96 | '' Common Calculations '' 97 | '''''''''''''''''''''''''''' 98 | 99 | 'Support Reactions 100 | rl = 0 101 | rr = 0 102 | 103 | 'Integration Constants 104 | c1 = slope 105 | c2 = -1 * c1 * L 106 | 107 | ''''''''''''''''''''''''''' 108 | '' Result Selection '' 109 | ''''''''''''''''''''''''''' 110 | 111 | If result = 0 Then 112 | 113 | 'Left Support Reaction 114 | cant_left_initialSlope = rl 115 | 116 | ElseIf result = 1 Then 117 | 118 | 'left Support Reaction 119 | cant_left_initialSlope = rr 120 | 121 | ElseIf result = 2 Then 122 | 123 | 'Shear at x 124 | vx = 0 125 | 126 | cant_left_initialSlope = vx 127 | 128 | ElseIf result = 3 Then 129 | 130 | 'Moment at x 131 | mx = 0 132 | 133 | cant_left_initialSlope = mx 134 | 135 | ElseIf result = 4 Then 136 | 137 | 'Cross Section Rotation/Slope at x 138 | If 0 <= x And x <= L Then 139 | sx = c1 140 | Else 141 | sx = 0 142 | End If 143 | 144 | cant_left_initialSlope = sx 145 | 146 | ElseIf result = 5 Then 147 | 148 | 'Deflection at x 149 | If 0 <= x And x <= L Then 150 | dx = (c1 * x) + c2 151 | Else 152 | dx = 0 153 | End If 154 | 155 | cant_left_initialSlope = dx 156 | 157 | ElseIf result = 6 Then 158 | 'Fixed End Moment Left 159 | femL = 0 160 | 161 | cant_left_initialSlope = femL 162 | 163 | ElseIf result = 7 Then 164 | 165 | 'Fixed End Moment left 166 | femR = 0 167 | 168 | cant_left_initialSlope = femR 169 | 170 | Else 171 | 172 | cant_left_initialSlope = CVErr(xlErrNA) 173 | 174 | End If 175 | 176 | End Function 177 | 178 | Function cant_left_point_load(p As Double, a As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 179 | 180 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 181 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 182 | ''' ''' 183 | ''' Function for a Point Load anywhere on a left side cantilever ''' 184 | ''' ''' 185 | ''' Important Note: ''' 186 | ''' All inputs must have consistent units ''' 187 | ''' ''' 188 | ''' Result key: ''' 189 | ''' 0 = Left Reaction ''' 190 | ''' 1 = Right Reaction ''' 191 | ''' 2 = Shear at x ''' 192 | ''' 3 = Moment at x ''' 193 | ''' 4 = Cross Section Rotation/Slope at x ''' 194 | ''' 5 = Deflection at x ''' 195 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 196 | ''' 7 = Fixed End Moment at left Support (clockwise positive) ''' 197 | ''' ''' 198 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 199 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 200 | 201 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 202 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 203 | ''' ''' 204 | ''' Sign Convention: ''' 205 | ''' Loads applied in the (-)y direction are positive ''' 206 | ''' Clockwise moments are positive ''' 207 | ''' ''' 208 | ''' Reactions in the (+)y direction are positive ''' 209 | ''' ''' 210 | ''' Internal: ''' 211 | ''' Shear is positive in the (+)y direction ''' 212 | ''' Moment is positive clockwise ''' 213 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 214 | ''' Upward deflection is in the (+)y direction ''' 215 | ''' ''' 216 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 217 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 218 | 219 | 220 | '''''''''''''''''''''''''''''' 221 | '' Variable Definitions '' 222 | '''''''''''''''''''''''''''''' 223 | 224 | Dim b As Double 'Distance from load to free end 225 | Dim rl As Double 'Left Reaction for a simple span beam 226 | Dim rr As Double 'Right Reaction foa smiple span beam 227 | Dim c1 As Double 'Integration constant - C1 228 | Dim c2 As Double 'Integration constant - C2 229 | Dim c3 As Double 'Integration constant - C3 230 | Dim c4 As Double 'Integration constant - C4 231 | Dim vx As Double 'Shear at x 232 | Dim mx As Double 'Moment at x 233 | Dim sx As Double 'Cross section Rotation/Slope at x 234 | Dim dx As Double 'Deflection at x 235 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 236 | Dim femR As Double 'left End Fixed End Moment - Clockwise Positive 237 | 238 | '''''''''''''''''''''''''''' 239 | '' Input Error Handling '' 240 | '''''''''''''''''''''''''''' 241 | If p = 0 Then 242 | 'Capture case where load may be a place holder with no value 243 | 'so return 0 instead of an error 244 | cant_left_point_load = 0 245 | Else 246 | 247 | If a > L Or a < 0 Then 248 | cant_left_point_load = " A , must be between 0 and L" 249 | 250 | Else 251 | '''''''''''''''''''''''''''' 252 | '' Common Calculations '' 253 | '''''''''''''''''''''''''''' 254 | 255 | b = L - a 256 | 257 | 'Support Reactions 258 | rl = 0 259 | rr = p 260 | ml = 0 261 | mr = -1 * p * (L - a) 262 | 263 | 'Integration Constants 264 | c3 = 0 + (0.5 * p * (L - a) * (L - a)) 265 | c4 = ((1 / 6) * p * (L - a) * (L - a) * (L - a)) - (c3 * L) 266 | c1 = c3 267 | c2 = (c3 * a) + c4 - (c1 * a) 268 | 269 | ''''''''''''''''''''''''''' 270 | '' Result Selection '' 271 | ''''''''''''''''''''''''''' 272 | 273 | If result = 0 Then 274 | 275 | 'Left Support Reaction 276 | cant_left_point_load = rl 277 | 278 | ElseIf result = 1 Then 279 | 280 | 'left Support Reaction 281 | cant_left_point_load = rr 282 | 283 | ElseIf result = 2 Then 284 | 285 | 'Shear at x 286 | If 0 <= x And x <= a Then 287 | vx = 0 288 | ElseIf a < x And x <= L Then 289 | vx = -1 * p 290 | Else 291 | vx = 0 292 | End If 293 | 294 | cant_left_point_load = vx 295 | 296 | ElseIf result = 3 Then 297 | 298 | 'Moment at x 299 | If 0 <= x And x <= a Then 300 | mx = 0 301 | ElseIf a < x And x <= L Then 302 | mx = -1 * p * (x - a) 303 | Else 304 | mx = 0 305 | End If 306 | 307 | cant_left_point_load = mx 308 | 309 | ElseIf result = 4 Then 310 | 311 | 'Cross Section Rotation/Slope at x 312 | If 0 <= x And x <= a Then 313 | sx = c1 / (E * I) 314 | ElseIf a < x And x <= L Then 315 | sx = ((-0.5 * p * (x - a) * (x - a)) + c3) / (E * I) 316 | Else 317 | sx = 0 318 | End If 319 | 320 | cant_left_point_load = sx 321 | 322 | ElseIf result = 5 Then 323 | 324 | 'Deflection at x 325 | If 0 <= x And x <= a Then 326 | dx = ((c1 * x) + c2) / (E * I) 327 | ElseIf a < x And x <= L Then 328 | dx = (((-1 / 6) * p * (x - a) * (x - a) * (x - a)) + (c3 * x) + c4) / (E * I) 329 | Else 330 | dx = 0 331 | End If 332 | 333 | cant_left_point_load = dx 334 | 335 | ElseIf result = 6 Then 336 | 'Fixed End Moment Left 337 | femL = 0 338 | 339 | cant_left_point_load = femL 340 | 341 | ElseIf result = 7 Then 342 | 343 | 'Fixed End Moment left 344 | femR = mr 345 | 346 | cant_left_point_load = femR 347 | 348 | Else 349 | 350 | cant_left_point_load = CVErr(xlErrNA) 351 | 352 | End If 353 | End If 354 | End If 355 | 356 | End Function 357 | 358 | Function cant_left_point_moment(m As Double, a As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 359 | 360 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 361 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 362 | ''' ''' 363 | ''' Function for a Point Moment anywhere on a left side cantilever ''' 364 | ''' ''' 365 | ''' Important Note: ''' 366 | ''' All inputs must have consistent units ''' 367 | ''' ''' 368 | ''' Result key: ''' 369 | ''' 0 = Left Reaction ''' 370 | ''' 1 = Right Reaction ''' 371 | ''' 2 = Shear at x ''' 372 | ''' 3 = Moment at x ''' 373 | ''' 4 = Cross Section Rotation/Slope at x ''' 374 | ''' 5 = Deflection at x ''' 375 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 376 | ''' 7 = Fixed End Moment at left Support (clockwise positive) ''' 377 | ''' ''' 378 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 379 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 380 | 381 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 382 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 383 | ''' ''' 384 | ''' Sign Convention: ''' 385 | ''' Loads applied in the (-)y direction are positive ''' 386 | ''' Clockwise moments are positive ''' 387 | ''' ''' 388 | ''' Reactions in the (+)y direction are positive ''' 389 | ''' ''' 390 | ''' Internal: ''' 391 | ''' Shear is positive in the (+)y direction ''' 392 | ''' Moment is positive clockwise ''' 393 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 394 | ''' Upward deflection is in the (+)y direction ''' 395 | ''' ''' 396 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 397 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 398 | 399 | 400 | '''''''''''''''''''''''''''''' 401 | '' Variable Definitions '' 402 | '''''''''''''''''''''''''''''' 403 | 404 | Dim b As Double 'Distance from load to free end 405 | Dim rl As Double 'Left Reaction for a simple span beam 406 | Dim rr As Double 'Right Reaction foa smiple span beam 407 | Dim c1 As Double 'Integration constant - C1 408 | Dim c2 As Double 'Integration constant - C2 409 | Dim c3 As Double 'Integration constant - C3 410 | Dim c4 As Double 'Integration constant - C4 411 | Dim vx As Double 'Shear at x 412 | Dim mx As Double 'Moment at x 413 | Dim sx As Double 'Cross section Rotation/Slope at x 414 | Dim dx As Double 'Deflection at x 415 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 416 | Dim femR As Double 'left End Fixed End Moment - Clockwise Positive 417 | 418 | '''''''''''''''''''''''''''' 419 | '' Input Error Handling '' 420 | '''''''''''''''''''''''''''' 421 | If m = 0 Then 422 | 'Capture case where load may be a place holder with no value 423 | 'so return 0 instead of an error 424 | cant_left_point_moment = 0 425 | Else 426 | 427 | If a > L Or a < 0 Then 428 | cant_left_point_moment = " A , must be between 0 and L" 429 | 430 | Else 431 | '''''''''''''''''''''''''''' 432 | '' Common Calculations '' 433 | '''''''''''''''''''''''''''' 434 | 435 | b = L - a 436 | 437 | 'Support Reactions 438 | rl = 0 439 | rr = 0 440 | mr = m 441 | 442 | 'Integration Constants 443 | c3 = 0 - (m * L) 444 | c4 = (-0.5 * m * L * L) - (c3 * L) 445 | c1 = (1 * m * a) + c3 446 | c2 = (0.5 * m * a * a) + (c3 * a) + c4 - (c1 * a) 447 | 448 | ''''''''''''''''''''''''''' 449 | '' Result Selection '' 450 | ''''''''''''''''''''''''''' 451 | 452 | If result = 0 Then 453 | 454 | 'Left Support Reaction 455 | cant_left_point_moment = rl 456 | 457 | ElseIf result = 1 Then 458 | 459 | 'left Support Reaction 460 | cant_left_point_moment = rr 461 | 462 | ElseIf result = 2 Then 463 | 464 | 'Shear at x 465 | vx = 0 466 | 467 | cant_left_point_moment = vx 468 | 469 | ElseIf result = 3 Then 470 | 471 | 'Moment at x 472 | If 0 <= x And x <= a Then 473 | mx = 0 474 | 475 | ElseIf a < x And x <= L Then 476 | mx = m 477 | Else 478 | mx = 0 479 | End If 480 | 481 | cant_left_point_moment = mx 482 | 483 | ElseIf result = 4 Then 484 | 485 | 'Cross Section Rotation/Slope at x 486 | If 0 <= x And x <= a Then 487 | sx = c1 / (E * I) 488 | ElseIf a < x And x <= L Then 489 | sx = ((m * x) + c3) / (E * I) 490 | Else 491 | sx = 0 492 | End If 493 | 494 | cant_left_point_moment = sx 495 | 496 | ElseIf result = 5 Then 497 | 498 | 'Deflection at x 499 | If 0 <= x And x <= a Then 500 | dx = ((c1 * x) + c2) / (E * I) 501 | ElseIf a < x And x <= L Then 502 | dx = ((0.5 * m * x * x) + (c3 * x) + c4) / (E * I) 503 | Else 504 | dx = 0 505 | End If 506 | 507 | cant_left_point_moment = dx 508 | 509 | ElseIf result = 6 Then 510 | 'Fixed End Moment Left 511 | femL = 0 512 | 513 | cant_left_point_moment = femL 514 | 515 | ElseIf result = 7 Then 516 | 517 | 'Fixed End Moment left 518 | femR = mr 519 | 520 | cant_left_point_moment = femR 521 | 522 | Else 523 | 524 | cant_left_point_moment = CVErr(xlErrNA) 525 | 526 | End If 527 | End If 528 | End If 529 | 530 | End Function 531 | 532 | Function cant_left_uniform_load(w As Double, a As Double, b As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 533 | 534 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 535 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 536 | ''' ''' 537 | ''' Function for a Uniform Distributed Load anywhere on ''' 538 | ''' a left side cantilever ''' 539 | ''' ''' 540 | ''' Important Note: ''' 541 | ''' All inputs must have consistent units ''' 542 | ''' ''' 543 | ''' Result key: ''' 544 | ''' 0 = Left Reaction ''' 545 | ''' 1 = Right Reaction ''' 546 | ''' 2 = Shear at x ''' 547 | ''' 3 = Moment at x ''' 548 | ''' 4 = Cross Section Rotation/Slope at x ''' 549 | ''' 5 = Deflection at x ''' 550 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 551 | ''' 7 = Fixed End Moment at left Support (clockwise positive) ''' 552 | ''' ''' 553 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 554 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 555 | 556 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 557 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 558 | ''' ''' 559 | ''' Sign Convention: ''' 560 | ''' Loads applied in the (-)y direction are positive ''' 561 | ''' Clockwise moments are positive ''' 562 | ''' ''' 563 | ''' Reactions in the (+)y direction are positive ''' 564 | ''' ''' 565 | ''' Internal: ''' 566 | ''' Shear is positive in the (+)y direction ''' 567 | ''' Moment is positive clockwise ''' 568 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 569 | ''' Upward deflection is in the (+)y direction ''' 570 | ''' ''' 571 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 572 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 573 | 574 | 575 | '''''''''''''''''''''''''''''' 576 | '' Variable Definitions '' 577 | '''''''''''''''''''''''''''''' 578 | 579 | Dim c As Double 'Width of load area 580 | Dim rl As Double 'Left Reaction for a simple span beam 581 | Dim rr As Double 'Right Reaction foa smiple span beam 582 | Dim c1 As Double 'Integration constant - C1 583 | Dim c2 As Double 'Integration constant - C2 584 | Dim c3 As Double 'Integration constant - C3 585 | Dim c4 As Double 'Integration constant - C4 586 | Dim c5 As Double 'Integration constant - C5 587 | Dim c6 As Double 'Integration constant - C6 588 | Dim w_tot As Double 'Area of load or equivalent point load 589 | Dim vx As Double 'Shear at x 590 | Dim mx As Double 'Moment at x 591 | Dim sx As Double 'Cross section Rotation/Slope at x 592 | Dim dx As Double 'Deflection at x 593 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 594 | Dim femR As Double 'left End Fixed End Moment - Clockwise Positive 595 | 596 | '''''''''''''''''''''''''''' 597 | '' Input Error Handling '' 598 | '''''''''''''''''''''''''''' 599 | If w = 0 Then 600 | 'Capture case where load may be a place holder with no value 601 | 'so return 0 instead of an error 602 | cant_left_uniform_load = 0 603 | Else 604 | 605 | If a > L Or b > L Or a = b Or a < 0 Or b < 0 Then 606 | cant_left_uniform_load = "A,B cannot be equal and must be between 0 and L" 607 | ElseIf b < a Then 608 | cant_left_uniform_load = "B must be greater than A" 609 | Else 610 | '''''''''''''''''''''''''''' 611 | '' Common Calculations '' 612 | '''''''''''''''''''''''''''' 613 | 614 | c = b - a 615 | w_tot = w * c 616 | 617 | 'Support Reactions 618 | rl = 0 619 | rr = w_tot 620 | mr = -1 * w_tot * (L - (a + (c / 2))) 621 | 622 | 'Integration Constants 623 | 624 | c5 = 0 + (0.5 * w_tot * (L - (a + (0.5 * c))) * (L - (a + (0.5 * c)))) 625 | c6 = ((1 / 6) * w_tot * (L - (a + (0.5 * c))) * (L - (a + (0.5 * c))) * (L - (a + (0.5 * c)))) - (c5 * L) 626 | c3 = ((-0.5) * w_tot * (b - (a + (0.5 * c))) * (b - (a + (0.5 * c)))) + c5 + ((1 / 6) * w * (b - a) * (b - a) * (b - a)) 627 | c1 = c3 628 | c4 = ((-1 / 6) * w_tot * (b - (a + (0.5 * c))) * (b - (a + (0.5 * c))) * (b - (a + (0.5 * c)))) + (c5 * b) + c6 + ((1 / 24) * w * (b - a) * (b - a) * (b - a) * (b - a)) - (c3 * b) 629 | c2 = (c3 * a) + c4 - (c1 * a) 630 | 631 | 632 | ''''''''''''''''''''''''''' 633 | '' Result Selection '' 634 | ''''''''''''''''''''''''''' 635 | 636 | If result = 0 Then 637 | 638 | 'Left Support Reaction 639 | cant_left_uniform_load = rl 640 | 641 | ElseIf result = 1 Then 642 | 643 | 'left Support Reaction 644 | cant_left_uniform_load = rr 645 | 646 | ElseIf result = 2 Then 647 | 648 | 'Shear at x 649 | If 0 <= x And x <= a Then 650 | vx = 0 651 | ElseIf a < x And x <= b Then 652 | vx = -1 * (w * (x - a)) 653 | ElseIf b < x And x <= L Then 654 | vx = -1 * w_tot 655 | Else 656 | vx = 0 657 | End If 658 | 659 | cant_left_uniform_load = vx 660 | 661 | ElseIf result = 3 Then 662 | 663 | 'Moment at x 664 | If 0 <= x And x <= a Then 665 | mx = 0 666 | ElseIf a < x And x <= b Then 667 | mx = -0.5 * w * (x - a) * (x - a) 668 | ElseIf b < x And x <= L Then 669 | mx = -1 * w_tot * (x - (a + (0.5 * c))) 670 | Else 671 | mx = 0 672 | End If 673 | 674 | cant_left_uniform_load = mx 675 | 676 | ElseIf result = 4 Then 677 | 678 | 'Cross Section Rotation/Slope at x 679 | If 0 <= x And x <= a Then 680 | sx = c1 / (E * I) 681 | ElseIf a < x And x <= b Then 682 | sx = (((-1 / 6) * w * (x - a) * (x - a) * (x - a)) + c3) / (E * I) 683 | ElseIf b < x And x <= L Then 684 | sx = ((-0.5 * w_tot * (x - (a + (0.5 * c))) * (x - (a + (0.5 * c)))) + c5) / (E * I) 685 | Else 686 | sx = 0 687 | End If 688 | 689 | cant_left_uniform_load = sx 690 | 691 | ElseIf result = 5 Then 692 | 693 | 'Deflection at x 694 | If 0 <= x And x <= a Then 695 | dx = ((c1 * x) + c2) / (E * I) 696 | ElseIf a < x And x <= b Then 697 | dx = (((-1 / 24) * w * (x - a) * (x - a) * (x - a) * (x - a)) + c3 * x + c4) / (E * I) 698 | ElseIf b < x And x <= L Then 699 | dx = (((-1 / 6) * w_tot * (x - (a + (0.5 * c))) * (x - (a + (0.5 * c))) * (x - (a + (0.5 * c)))) + (c5 * x) + c6) / (E * I) 700 | Else 701 | dx = 0 702 | End If 703 | 704 | cant_left_uniform_load = dx 705 | 706 | ElseIf result = 6 Then 707 | 'Fixed End Moment Left 708 | femL = 0 709 | 710 | cant_left_uniform_load = femL 711 | 712 | ElseIf result = 7 Then 713 | 714 | 'Fixed End Moment left 715 | femR = mr 716 | 717 | cant_left_uniform_load = femR 718 | 719 | Else 720 | 721 | cant_left_uniform_load = CVErr(xlErrNA) 722 | 723 | End If 724 | End If 725 | End If 726 | 727 | End Function 728 | 729 | Function cant_left_variable_load(w1 As Double, w2 As Double, a As Double, b As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 730 | 731 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 732 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 733 | ''' ''' 734 | ''' Function for a Variable Distributed Load anywhere on ''' 735 | ''' a left side cantilever ''' 736 | ''' ''' 737 | ''' Important Note: ''' 738 | ''' All inputs must have consistent units ''' 739 | ''' ''' 740 | ''' Result key: ''' 741 | ''' 0 = Left Reaction ''' 742 | ''' 1 = Right Reaction ''' 743 | ''' 2 = Shear at x ''' 744 | ''' 3 = Moment at x ''' 745 | ''' 4 = Cross Section Rotation/Slope at x ''' 746 | ''' 5 = Deflection at x ''' 747 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 748 | ''' 7 = Fixed End Moment at left Support (clockwise positive) ''' 749 | ''' ''' 750 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 751 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 752 | 753 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 754 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 755 | ''' ''' 756 | ''' Sign Convention: ''' 757 | ''' Loads applied in the (-)y direction are positive ''' 758 | ''' Clockwise moments are positive ''' 759 | ''' ''' 760 | ''' Reactions in the (+)y direction are positive ''' 761 | ''' ''' 762 | ''' Internal: ''' 763 | ''' Shear is positive in the (+)y direction ''' 764 | ''' Moment is positive clockwise ''' 765 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 766 | ''' Upward deflection is in the (+)y direction ''' 767 | ''' ''' 768 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 769 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 770 | 771 | 772 | '''''''''''''''''''''''''''''' 773 | '' Variable Definitions '' 774 | '''''''''''''''''''''''''''''' 775 | 776 | Dim c As Double 'Width of load area 777 | Dim rl As Double 'Left Reaction for a simple span beam 778 | Dim rr As Double 'Right Reaction foa smiple span beam 779 | Dim c1 As Double 'Integration constant - C1 780 | Dim c2 As Double 'Integration constant - C2 781 | Dim c3 As Double 'Integration constant - C3 782 | Dim c4 As Double 'Integration constant - C4 783 | Dim c5 As Double 'Integration constant - C5 784 | Dim c6 As Double 'Integration constant - C6 785 | Dim c7 As Double 'Integration constant - C7 786 | Dim w As Double 'Area of load or equivalent point load 787 | Dim s As Double 'Slope of load area 788 | Dim dl As Double 'Center of load area from left 789 | Dim dr As Double 'Center of load area from right 790 | Dim cc As Double 791 | Dim vx As Double 'Shear at x 792 | Dim mx As Double 'Moment at x 793 | Dim sx As Double 'Cross section Rotation/Slope at x 794 | Dim dx As Double 'Deflection at x 795 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 796 | Dim femR As Double 'left End Fixed End Moment - Clockwise Positive 797 | 798 | '''''''''''''''''''''''''''' 799 | '' Input Error Handling '' 800 | '''''''''''''''''''''''''''' 801 | If w1 = 0 And w2 = 0 Then 802 | 'Capture case where load may be a place holder with no value 803 | 'so return 0 instead of an error 804 | cant_left_variable_load = 0 805 | Else 806 | 807 | If a > L Or b > L Or a = b Or a < 0 Or b < 0 Then 808 | cant_left_variable_load = "A,B cannot be equal and must be between 0 and L" 809 | ElseIf b < a Then 810 | cant_left_variable_load = "B must be greater than A" 811 | ElseIf Sgn(w1) <> Sgn(w2) And w1 <> 0 And w2 <> 0 Then 812 | cant_left_variable_load = "W1,W2 must have the same sign" 813 | Else 814 | '''''''''''''''''''''''''''' 815 | '' Common Calculations '' 816 | '''''''''''''''''''''''''''' 817 | 818 | c = b - a 819 | w = 0.5 * (w1 + w2) * c 820 | dl = a + (((w1 + (2 * w2)) / (3 * (w2 + w1))) * c) 821 | dr = L - dl 822 | s = (w1 - w2) / c 823 | cc = (((w1 + (2 * w2)) / (3 * (w2 + w1))) * c) + a 824 | 825 | 'Support Reactions 826 | rl = 0 827 | rr = w 828 | mr = -1 * rr * (L - cc) 829 | 830 | 'Integration Constants 831 | c6 = 0 + (0.5 * w * (L - cc) * (L - cc)) 832 | c7 = ((1 / 6) * w * (L - cc) * (L - cc) * (L - cc)) - (c6 * L) 833 | c3 = -1 * ((1 / 6) * a * ((a * a * s) - (3 * a * ((a * s) + w1)) + (3 * a * ((a * s) + (2 * w1))))) 834 | c4 = (-0.5 * w * (b - cc) * (b - cc)) + c6 - (c3 * b) - ((1 / 24) * b * b * ((b * b * s) - (4 * b * ((a * s) + w1)) + (6 * a * ((a * s) + (2 * w1))))) 835 | c5 = ((-1 / 6) * w * (b - cc) * (b - cc) * (b - cc)) + (c6 * b) + c7 - (0.5 * c3 * b * b) - (c4 * b) - ((1 / 120) * b * b * b * ((b * b * s) - (5 * b * ((a * s) + w1)) + (10 * a * ((a * s) + (2 * w1))))) 836 | c1 = ((1 / 24) * a * a * ((a * a * s) - (4 * a * ((a * s) + w1)) + (6 * a * ((a * s) + (2 * w1))))) + (c3 * a) + c4 837 | c2 = ((1 / 120) * a * a * a * ((a * a * s) - (5 * a * ((a * s) + w1)) + (10 * a * ((a * s) + (2 * w1))))) + (0.5 * c3 * a * a) + (c4 * a) + c5 - (c1 * a) 838 | 839 | ''''''''''''''''''''''''''' 840 | '' Result Selection '' 841 | ''''''''''''''''''''''''''' 842 | 843 | If result = 0 Then 844 | 845 | 'Left Support Reaction 846 | cant_left_variable_load = rl 847 | 848 | ElseIf result = 1 Then 849 | 850 | 'left Support Reaction 851 | cant_left_variable_load = rr 852 | 853 | ElseIf result = 2 Then 854 | 855 | 'Shear at x 856 | If 0 <= x And x <= a Then 857 | vx = 0 858 | ElseIf a < x And x <= b Then 859 | vx = (-0.5 * ((2 * w1) - (s * (x - a)))) * (x - a) 860 | ElseIf b < x And x <= L Then 861 | vx = -1 * rr 862 | Else 863 | vx = 0 864 | End If 865 | 866 | cant_left_variable_load = vx 867 | 868 | ElseIf result = 3 Then 869 | 870 | 'Moment at x 871 | If 0 <= x And x <= a Then 872 | mx = 0 873 | ElseIf a < x And x <= b Then 874 | mx = ((1 / 6) * x * ((x * x * s) - (3 * x * ((a * s) + w1)) + (3 * a * ((a * s) + (2 * w1))))) + c3 875 | ElseIf b < x And x <= L Then 876 | mx = -1 * w * (x - cc) 877 | Else 878 | mx = 0 879 | End If 880 | 881 | cant_left_variable_load = mx 882 | 883 | ElseIf result = 4 Then 884 | 885 | 'Cross Section Rotation/Slope at x 886 | If 0 <= x And x <= a Then 887 | sx = c1 / (E * I) 888 | ElseIf a < x And x <= b Then 889 | sx = (((1 / 24) * x * x * ((x * x * s) - (4 * x * ((a * s) + w1)) + (6 * a * ((a * s) + (2 * w1))))) + (c3 * x) + c4) / (E * I) 890 | ElseIf b < x And x <= L Then 891 | sx = ((-0.5 * w * (x - cc) * (x - cc)) + c6) / (E * I) 892 | Else 893 | sx = 0 894 | End If 895 | 896 | cant_left_variable_load = sx 897 | 898 | ElseIf result = 5 Then 899 | 900 | 'Deflection at x 901 | If 0 <= x And x <= a Then 902 | dx = ((c1 * x) + c2) / (E * I) 903 | ElseIf a < x And x <= b Then 904 | dx = (((1 / 120) * x * x * x * ((x * x * s) - (5 * x * ((a * s) + w1)) + (10 * a * ((a * s) + (2 * w1))))) + (0.5 * c3 * x * x) + (c4 * x) + c5) / (E * I) 905 | ElseIf b < x And x <= L Then 906 | dx = (((-1 / 6) * w * (x - cc) * (x - cc) * (x - cc)) + (c6 * x) + c7) / (E * I) 907 | Else 908 | dx = 0 909 | End If 910 | 911 | cant_left_variable_load = dx 912 | 913 | ElseIf result = 6 Then 914 | 'Fixed End Moment Left 915 | femL = 0 916 | 917 | cant_left_variable_load = femL 918 | 919 | ElseIf result = 7 Then 920 | 921 | 'Fixed End Moment left 922 | femR = mr 923 | 924 | cant_left_variable_load = femR 925 | 926 | Else 927 | 928 | cant_left_variable_load = CVErr(xlErrNA) 929 | 930 | End If 931 | End If 932 | End If 933 | End Function 934 | 935 | 936 | -------------------------------------------------------------------------------- /01-General Analysis/CantileverRightFormulas.bas: -------------------------------------------------------------------------------- 1 | Attribute VB_Name = "CantileverRightFormulas" 2 | 3 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 4 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 5 | ''' BSD 3-Clause License ''' 6 | ''' ''' 7 | ''' Copyright (c) 2020, open-struct-engineer ''' 8 | ''' All rights reserved. ''' 9 | ''' ''' 10 | ''' Redistribution and use in source and binary forms, with or without ''' 11 | ''' modification, are permitted provided that the following conditions are met: ''' 12 | ''' ''' 13 | ''' 1. Redistributions of source code must retain the above copyright notice, this ''' 14 | ''' list of conditions and the following disclaimer. ''' 15 | ''' ''' 16 | ''' 2. Redistributions in binary form must reproduce the above copyright notice, ''' 17 | ''' this list of conditions and the following disclaimer in the documentation ''' 18 | ''' and/or other materials provided with the distribution. ''' 19 | ''' ''' 20 | ''' 3. Neither the name of the copyright holder nor the names of its ''' 21 | ''' contributors may be used to endorse or promote products derived from ''' 22 | ''' this software without specific prior written permission. ''' 23 | ''' ''' 24 | ''' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ''' 25 | ''' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ''' 26 | ''' IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ''' 27 | ''' DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE ''' 28 | ''' FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ''' 29 | ''' DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ''' 30 | ''' SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ''' 31 | ''' CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ''' 32 | ''' OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ''' 33 | ''' OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' 34 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 35 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 36 | 37 | Function cant_right_initialSlope(slope As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 38 | 39 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 40 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 41 | ''' ''' 42 | ''' Function for a Starting slope on a right side cantilever ''' 43 | ''' ''' 44 | ''' Important Note: ''' 45 | ''' All inputs must have consistent units ''' 46 | ''' ''' 47 | ''' Result key: ''' 48 | ''' 0 = Left Reaction ''' 49 | ''' 1 = Right Reaction ''' 50 | ''' 2 = Shear at x ''' 51 | ''' 3 = Moment at x ''' 52 | ''' 4 = Cross Section Rotation/Slope at x ''' 53 | ''' 5 = Deflection at x ''' 54 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 55 | ''' 7 = Fixed End Moment at Right Support (clockwise positive) ''' 56 | ''' ''' 57 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 58 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 59 | 60 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 61 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 62 | ''' ''' 63 | ''' Sign Convention: ''' 64 | ''' Loads applied in the (-)y direction are positive ''' 65 | ''' Clockwise moments are positive ''' 66 | ''' ''' 67 | ''' Reactions in the (+)y direction are positive ''' 68 | ''' ''' 69 | ''' Internal: ''' 70 | ''' Shear is positive in the (+)y direction ''' 71 | ''' Moment is positive clockwise ''' 72 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 73 | ''' Upward deflection is in the (+)y direction ''' 74 | ''' ''' 75 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 76 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 77 | 78 | 79 | '''''''''''''''''''''''''''''' 80 | '' Variable Definitions '' 81 | '''''''''''''''''''''''''''''' 82 | 83 | Dim rl As Double 'Left Reaction for a simple span beam 84 | Dim rr As Double 'Right Reaction foa smiple span beam 85 | Dim vx As Double 'Shear at x 86 | Dim mx As Double 'Moment at x 87 | Dim sx As Double 'Cross section Rotation/Slope at x 88 | Dim dx As Double 'Deflection at x 89 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 90 | Dim femR As Double 'Right End Fixed End Moment - Clockwise Positive 91 | 92 | '''''''''''''''''''''''''''' 93 | '' Common Calculations '' 94 | '''''''''''''''''''''''''''' 95 | 96 | 'Support Reactions 97 | rl = 0 98 | rr = 0 99 | 100 | ''''''''''''''''''''''''''' 101 | '' Result Selection '' 102 | ''''''''''''''''''''''''''' 103 | 104 | If result = 0 Then 105 | 106 | 'Left Support Reaction 107 | cant_right_initialSlope = rl 108 | 109 | ElseIf result = 1 Then 110 | 111 | 'Right Support Reaction 112 | cant_right_initialSlope = rr 113 | 114 | ElseIf result = 2 Then 115 | 116 | 'Shear at x 117 | vx = 0 118 | 119 | cant_right_initialSlope = vx 120 | 121 | ElseIf result = 3 Then 122 | 123 | 'Moment at x 124 | mx = 0 125 | 126 | cant_right_initialSlope = mx 127 | 128 | ElseIf result = 4 Then 129 | 130 | 'Cross Section Rotation/Slope at x 131 | sx = slope 132 | 133 | cant_right_initialSlope = sx 134 | 135 | ElseIf result = 5 Then 136 | 137 | 'Deflection at x 138 | If 0 <= x And x <= L Then 139 | dx = (slope * x) 140 | Else 141 | dx = 0 142 | End If 143 | 144 | cant_right_initialSlope = dx 145 | 146 | ElseIf result = 6 Then 147 | 'Fixed End Moment Left 148 | femL = 0 149 | 150 | cant_right_initialSlope = femL 151 | 152 | ElseIf result = 7 Then 153 | 154 | 'Fixed End Moment Right 155 | femR = 0 156 | 157 | cant_right_initialSlope = femR 158 | 159 | Else 160 | 161 | cant_right_initialSlope = CVErr(xlErrNA) 162 | 163 | End If 164 | 165 | End Function 166 | 167 | Function cant_right_point_load(p As Double, a As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 168 | 169 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 170 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 171 | ''' ''' 172 | ''' Function for a Point Load anywhere on a right side cantilever ''' 173 | ''' ''' 174 | ''' Important Note: ''' 175 | ''' All inputs must have consistent units ''' 176 | ''' ''' 177 | ''' Result key: ''' 178 | ''' 0 = Left Reaction ''' 179 | ''' 1 = Right Reaction ''' 180 | ''' 2 = Shear at x ''' 181 | ''' 3 = Moment at x ''' 182 | ''' 4 = Cross Section Rotation/Slope at x ''' 183 | ''' 5 = Deflection at x ''' 184 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 185 | ''' 7 = Fixed End Moment at Right Support (clockwise positive) ''' 186 | ''' ''' 187 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 188 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 189 | 190 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 191 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 192 | ''' ''' 193 | ''' Sign Convention: ''' 194 | ''' Loads applied in the (-)y direction are positive ''' 195 | ''' Clockwise moments are positive ''' 196 | ''' ''' 197 | ''' Reactions in the (+)y direction are positive ''' 198 | ''' ''' 199 | ''' Internal: ''' 200 | ''' Shear is positive in the (+)y direction ''' 201 | ''' Moment is positive clockwise ''' 202 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 203 | ''' Upward deflection is in the (+)y direction ''' 204 | ''' ''' 205 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 206 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 207 | 208 | 209 | '''''''''''''''''''''''''''''' 210 | '' Variable Definitions '' 211 | '''''''''''''''''''''''''''''' 212 | 213 | Dim b As Double 'Distance from load to free end 214 | Dim rl As Double 'Left Reaction for a simple span beam 215 | Dim rr As Double 'Right Reaction foa smiple span beam 216 | Dim c1 As Double 'Integration constant - C1 217 | Dim c2 As Double 'Integration constant - C2 218 | Dim c3 As Double 'Integration constant - C3 219 | Dim c4 As Double 'Integration constant - C4 220 | Dim vx As Double 'Shear at x 221 | Dim mx As Double 'Moment at x 222 | Dim sx As Double 'Cross section Rotation/Slope at x 223 | Dim dx As Double 'Deflection at x 224 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 225 | Dim femR As Double 'Right End Fixed End Moment - Clockwise Positive 226 | 227 | '''''''''''''''''''''''''''' 228 | '' Input Error Handling '' 229 | '''''''''''''''''''''''''''' 230 | If p = 0 Then 231 | 'Capture case where load may be a place holder with no value 232 | 'so return 0 instead of an error 233 | cant_right_point_load = 0 234 | Else 235 | 236 | If a > L Or a < 0 Then 237 | cant_right_point_load = " A , must be between 0 and L" 238 | 239 | Else 240 | '''''''''''''''''''''''''''' 241 | '' Common Calculations '' 242 | '''''''''''''''''''''''''''' 243 | 244 | b = L - a 245 | 246 | 'Support Reactions 247 | rl = p 248 | rr = 0 249 | ml = -1 * p * a 250 | 251 | 'Integration Constants 252 | c1 = 0 253 | c2 = 0 254 | c3 = (0.5 * rl * a * a) + (ml * a) + c1 255 | c4 = (-1 * c3 * a) + ((1 / 6) * rl * a * a * a) + (0.5 * ml * a * a) + (c1 * a) + c2 256 | 257 | ''''''''''''''''''''''''''' 258 | '' Result Selection '' 259 | ''''''''''''''''''''''''''' 260 | 261 | If result = 0 Then 262 | 263 | 'Left Support Reaction 264 | cant_right_point_load = rl 265 | 266 | ElseIf result = 1 Then 267 | 268 | 'Right Support Reaction 269 | cant_right_point_load = rr 270 | 271 | ElseIf result = 2 Then 272 | 273 | 'Shear at x 274 | If 0 <= x And x <= a Then 275 | If x = 0 And a = 0 Then 276 | vx = 0 277 | Else 278 | vx = p 279 | End If 280 | Else 281 | vx = 0 282 | End If 283 | 284 | cant_right_point_load = vx 285 | 286 | ElseIf result = 3 Then 287 | 288 | 'Moment at x 289 | If 0 <= x And x <= a Then 290 | mx = (rl * x) + ml 291 | Else 292 | mx = 0 293 | End If 294 | 295 | cant_right_point_load = mx 296 | 297 | ElseIf result = 4 Then 298 | 299 | 'Cross Section Rotation/Slope at x 300 | If 0 <= x And x <= a Then 301 | sx = ((0.5 * rl * x * x) + (ml * x) + c1) / (E * I) 302 | ElseIf a < x And x <= L Then 303 | sx = c3 / (E * I) 304 | Else 305 | sx = 0 306 | End If 307 | 308 | cant_right_point_load = sx 309 | 310 | ElseIf result = 5 Then 311 | 312 | 'Deflection at x 313 | If 0 <= x And x <= a Then 314 | dx = (((1 / 6) * rl * x * x * x) + (0.5 * ml * x * x) + (c1 * x) + c2) / (E * I) 315 | ElseIf a < x And x <= L Then 316 | dx = ((c3 * x) + c4) / (E * I) 317 | Else 318 | dx = 0 319 | End If 320 | 321 | cant_right_point_load = dx 322 | 323 | ElseIf result = 6 Then 324 | 'Fixed End Moment Left 325 | femL = ml 326 | 327 | cant_right_point_load = femL 328 | 329 | ElseIf result = 7 Then 330 | 331 | 'Fixed End Moment Right 332 | femR = 0 333 | 334 | cant_right_point_load = femR 335 | 336 | Else 337 | 338 | cant_right_point_load = CVErr(xlErrNA) 339 | 340 | End If 341 | End If 342 | End If 343 | 344 | End Function 345 | 346 | Function cant_right_point_moment(m As Double, a As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 347 | 348 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 349 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 350 | ''' ''' 351 | ''' Function for a Point Moment anywhere on a right side cantilever ''' 352 | ''' ''' 353 | ''' Important Note: ''' 354 | ''' All inputs must have consistent units ''' 355 | ''' ''' 356 | ''' Result key: ''' 357 | ''' 0 = Left Reaction ''' 358 | ''' 1 = Right Reaction ''' 359 | ''' 2 = Shear at x ''' 360 | ''' 3 = Moment at x ''' 361 | ''' 4 = Cross Section Rotation/Slope at x ''' 362 | ''' 5 = Deflection at x ''' 363 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 364 | ''' 7 = Fixed End Moment at Right Support (clockwise positive) ''' 365 | ''' ''' 366 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 367 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 368 | 369 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 370 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 371 | ''' ''' 372 | ''' Sign Convention: ''' 373 | ''' Loads applied in the (-)y direction are positive ''' 374 | ''' Clockwise moments are positive ''' 375 | ''' ''' 376 | ''' Reactions in the (+)y direction are positive ''' 377 | ''' ''' 378 | ''' Internal: ''' 379 | ''' Shear is positive in the (+)y direction ''' 380 | ''' Moment is positive clockwise ''' 381 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 382 | ''' Upward deflection is in the (+)y direction ''' 383 | ''' ''' 384 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 385 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 386 | 387 | 388 | '''''''''''''''''''''''''''''' 389 | '' Variable Definitions '' 390 | '''''''''''''''''''''''''''''' 391 | 392 | Dim b As Double 'Distance from load to free end 393 | Dim rl As Double 'Left Reaction for a simple span beam 394 | Dim rr As Double 'Right Reaction foa smiple span beam 395 | Dim c1 As Double 'Integration constant - C1 396 | Dim c2 As Double 'Integration constant - C2 397 | Dim c3 As Double 'Integration constant - C3 398 | Dim c4 As Double 'Integration constant - C4 399 | Dim vx As Double 'Shear at x 400 | Dim mx As Double 'Moment at x 401 | Dim sx As Double 'Cross section Rotation/Slope at x 402 | Dim dx As Double 'Deflection at x 403 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 404 | Dim femR As Double 'Right End Fixed End Moment - Clockwise Positive 405 | 406 | '''''''''''''''''''''''''''' 407 | '' Input Error Handling '' 408 | '''''''''''''''''''''''''''' 409 | If m = 0 Then 410 | 'Capture case where load may be a place holder with no value 411 | 'so return 0 instead of an error 412 | cant_right_point_moment = 0 413 | 414 | Else 415 | 416 | If a > L Or a < 0 Then 417 | cant_right_point_moment = " A , must be between 0 and L" 418 | 419 | Else 420 | '''''''''''''''''''''''''''' 421 | '' Common Calculations '' 422 | '''''''''''''''''''''''''''' 423 | 424 | b = L - a 425 | 426 | 'Support Reactions 427 | rl = 0 428 | rr = 0 429 | ml = -1 * m 430 | 431 | 'Integration Constants 432 | c1 = 0 433 | c2 = 0 434 | c3 = (ml * a) + c1 435 | c4 = (0.5 * ml * a * a) + (c1 * a) + c2 - (c3 * a) 436 | 437 | ''''''''''''''''''''''''''' 438 | '' Result Selection '' 439 | ''''''''''''''''''''''''''' 440 | 441 | If result = 0 Then 442 | 443 | 'Left Support Reaction 444 | cant_right_point_moment = rl 445 | 446 | ElseIf result = 1 Then 447 | 448 | 'Right Support Reaction 449 | cant_right_point_moment = rr 450 | 451 | ElseIf result = 2 Then 452 | 453 | 'Shear at x 454 | vx = 0 455 | 456 | cant_right_point_moment = vx 457 | 458 | ElseIf result = 3 Then 459 | 460 | 'Moment at x 461 | If 0 <= x And x <= a Then 462 | mx = ml 463 | Else 464 | mx = 0 465 | End If 466 | 467 | cant_right_point_moment = mx 468 | 469 | ElseIf result = 4 Then 470 | 471 | 'Cross Section Rotation/Slope at x 472 | If 0 <= x And x <= a Then 473 | sx = ((ml * x) + c1) / (E * I) 474 | ElseIf a < x And x <= L Then 475 | sx = c3 / (E * I) 476 | Else 477 | sx = 0 478 | End If 479 | 480 | cant_right_point_moment = sx 481 | 482 | ElseIf result = 5 Then 483 | 484 | 'Deflection at x 485 | If 0 <= x And x <= a Then 486 | dx = ((0.5 * ml * x * x) + (c1 * x) + c2) / (E * I) 487 | ElseIf a < x And x <= L Then 488 | dx = ((c3 * x) + c4) / (E * I) 489 | Else 490 | dx = 0 491 | End If 492 | 493 | cant_right_point_moment = dx 494 | 495 | ElseIf result = 6 Then 496 | 'Fixed End Moment Left 497 | femL = ml 498 | 499 | cant_right_point_moment = femL 500 | 501 | ElseIf result = 7 Then 502 | 503 | 'Fixed End Moment Right 504 | femR = 0 505 | 506 | cant_right_point_moment = femR 507 | 508 | Else 509 | 510 | cant_right_point_moment = CVErr(xlErrNA) 511 | 512 | End If 513 | End If 514 | End If 515 | 516 | End Function 517 | 518 | Function cant_right_uniform_load(w As Double, a As Double, b As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 519 | 520 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 521 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 522 | ''' ''' 523 | ''' Function for a Uniform Distributed Load anywhere on ''' 524 | ''' a right side cantilever ''' 525 | ''' ''' 526 | ''' Important Note: ''' 527 | ''' All inputs must have consistent units ''' 528 | ''' ''' 529 | ''' Result key: ''' 530 | ''' 0 = Left Reaction ''' 531 | ''' 1 = Right Reaction ''' 532 | ''' 2 = Shear at x ''' 533 | ''' 3 = Moment at x ''' 534 | ''' 4 = Cross Section Rotation/Slope at x ''' 535 | ''' 5 = Deflection at x ''' 536 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 537 | ''' 7 = Fixed End Moment at Right Support (clockwise positive) ''' 538 | ''' ''' 539 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 540 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 541 | 542 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 543 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 544 | ''' ''' 545 | ''' Sign Convention: ''' 546 | ''' Loads applied in the (-)y direction are positive ''' 547 | ''' Clockwise moments are positive ''' 548 | ''' ''' 549 | ''' Reactions in the (+)y direction are positive ''' 550 | ''' ''' 551 | ''' Internal: ''' 552 | ''' Shear is positive in the (+)y direction ''' 553 | ''' Moment is positive clockwise ''' 554 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 555 | ''' Upward deflection is in the (+)y direction ''' 556 | ''' ''' 557 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 558 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 559 | 560 | 561 | '''''''''''''''''''''''''''''' 562 | '' Variable Definitions '' 563 | '''''''''''''''''''''''''''''' 564 | 565 | Dim c As Double 'Width of load area 566 | Dim rl As Double 'Left Reaction for a simple span beam 567 | Dim rr As Double 'Right Reaction foa smiple span beam 568 | Dim c1 As Double 'Integration constant - C1 569 | Dim c2 As Double 'Integration constant - C2 570 | Dim c3 As Double 'Integration constant - C3 571 | Dim c4 As Double 'Integration constant - C4 572 | Dim c5 As Double 'Integration constant - C5 573 | Dim c6 As Double 'Integration constant - C6 574 | Dim w_tot As Double 'Area of load or equivalent point load 575 | Dim vx As Double 'Shear at x 576 | Dim mx As Double 'Moment at x 577 | Dim sx As Double 'Cross section Rotation/Slope at x 578 | Dim dx As Double 'Deflection at x 579 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 580 | Dim femR As Double 'Right End Fixed End Moment - Clockwise Positive 581 | 582 | '''''''''''''''''''''''''''' 583 | '' Input Error Handling '' 584 | '''''''''''''''''''''''''''' 585 | If w = 0 Then 586 | 'Capture case where load may be a place holder with no value 587 | 'so return 0 instead of an error 588 | cant_right_uniform_load = 0 589 | 590 | Else 591 | 592 | If a > L Or b > L Or a = b Or a < 0 Or b < 0 Then 593 | cant_right_uniform_load = "A,B cannot be equal and must be between 0 and L" 594 | ElseIf b < a Then 595 | cant_right_uniform_load = "B must be greater than A" 596 | Else 597 | 598 | '''''''''''''''''''''''''''' 599 | '' Common Calculations '' 600 | '''''''''''''''''''''''''''' 601 | 602 | c = b - a 603 | w_tot = w * c 604 | 605 | 'Support Reactions 606 | rl = w_tot 607 | rr = 0 608 | ml = -1 * w_tot * (b - (c / 2)) 609 | 610 | 'Integration Constants 611 | c1 = 0 612 | c2 = 0 613 | c3 = 0 614 | c4 = (c1 * a) + c2 - (c3 * a) 615 | c5 = (0.5 * w_tot * b * b) + (ml * b) - ((1 / 6) * w * (b - a) * (b - a) * (b - a)) + c3 616 | c6 = ((1 / 6) * w_tot * b * b * b) + (0.5 * ml * b * b) - ((1 / 24) * w * (b - a) * (b - a) * (b - a) * (b - a)) + (c3 * b) + c4 - (c5 * b) 617 | 618 | ''''''''''''''''''''''''''' 619 | '' Result Selection '' 620 | ''''''''''''''''''''''''''' 621 | 622 | If result = 0 Then 623 | 624 | 'Left Support Reaction 625 | cant_right_uniform_load = rl 626 | 627 | ElseIf result = 1 Then 628 | 629 | 'Right Support Reaction 630 | cant_right_uniform_load = rr 631 | 632 | ElseIf result = 2 Then 633 | 634 | 'Shear at x 635 | If 0 <= x And x <= a Then 636 | vx = rl 637 | ElseIf a < x And x <= b Then 638 | vx = rl - (w * (x - a)) 639 | Else 640 | vx = 0 641 | End If 642 | 643 | cant_right_uniform_load = vx 644 | 645 | ElseIf result = 3 Then 646 | 647 | 'Moment at x 648 | If 0 <= x And x <= a Then 649 | mx = (rl * x) + ml 650 | ElseIf a < x And x <= b Then 651 | mx = (rl * x) + ml - (w * (x - a) * ((x - a) / 2)) 652 | Else 653 | mx = 0 654 | End If 655 | 656 | cant_right_uniform_load = mx 657 | 658 | ElseIf result = 4 Then 659 | 660 | 'Cross Section Rotation/Slope at x 661 | If 0 <= x And x <= a Then 662 | sx = ((0.5 * rl * x * x) + (ml * x) + c1) / (E * I) 663 | ElseIf a < x And x <= b Then 664 | sx = ((0.5 * rl * x * x) + (ml * x) - ((1 / 6) * w * (x - a) * (x - a) * (x - a)) + c3) / (E * I) 665 | ElseIf b < x And x <= L Then 666 | sx = c5 / (E * I) 667 | Else 668 | sx = 0 669 | End If 670 | 671 | cant_right_uniform_load = sx 672 | 673 | ElseIf result = 5 Then 674 | 675 | 'Deflection at x 676 | If 0 <= x And x <= a Then 677 | dx = (((1 / 6) * rl * x * x * x) + (0.5 * ml * x * x) + (c1 * x) + c2) / (E * I) 678 | ElseIf a < x And x <= b Then 679 | dx = (((1 / 6) * rl * x * x * x) + (0.5 * ml * x * x) - ((1 / 24) * w * (x - a) * (x - a) * (x - a) * (x - a)) + (c3 * x) + c4) / (E * I) 680 | ElseIf b < x And x <= L Then 681 | dx = ((c5 * x) + c6) / (E * I) 682 | Else 683 | dx = 0 684 | End If 685 | 686 | cant_right_uniform_load = dx 687 | 688 | ElseIf result = 6 Then 689 | 'Fixed End Moment Left 690 | femL = ml 691 | 692 | cant_right_uniform_load = femL 693 | 694 | ElseIf result = 7 Then 695 | 696 | 'Fixed End Moment Right 697 | femR = 0 698 | 699 | cant_right_uniform_load = femR 700 | 701 | Else 702 | 703 | cant_right_uniform_load = CVErr(xlErrNA) 704 | 705 | End If 706 | End If 707 | End If 708 | 709 | End Function 710 | 711 | Function cant_right_variable_load(w1 As Double, w2 As Double, a As Double, b As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 712 | 713 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 714 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 715 | ''' ''' 716 | ''' Function for a Variable Distributed Load anywhere on ''' 717 | ''' a right side cantilever ''' 718 | ''' ''' 719 | ''' Important Note: ''' 720 | ''' All inputs must have consistent units ''' 721 | ''' ''' 722 | ''' Result key: ''' 723 | ''' 0 = Left Reaction ''' 724 | ''' 1 = Right Reaction ''' 725 | ''' 2 = Shear at x ''' 726 | ''' 3 = Moment at x ''' 727 | ''' 4 = Cross Section Rotation/Slope at x ''' 728 | ''' 5 = Deflection at x ''' 729 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 730 | ''' 7 = Fixed End Moment at Right Support (clockwise positive) ''' 731 | ''' ''' 732 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 733 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 734 | 735 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 736 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 737 | ''' ''' 738 | ''' Sign Convention: ''' 739 | ''' Loads applied in the (-)y direction are positive ''' 740 | ''' Clockwise moments are positive ''' 741 | ''' ''' 742 | ''' Reactions in the (+)y direction are positive ''' 743 | ''' ''' 744 | ''' Internal: ''' 745 | ''' Shear is positive in the (+)y direction ''' 746 | ''' Moment is positive clockwise ''' 747 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 748 | ''' Upward deflection is in the (+)y direction ''' 749 | ''' ''' 750 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 751 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 752 | 753 | 754 | '''''''''''''''''''''''''''''' 755 | '' Variable Definitions '' 756 | '''''''''''''''''''''''''''''' 757 | 758 | Dim c As Double 'Width of load area 759 | Dim rl As Double 'Left Reaction for a simple span beam 760 | Dim rr As Double 'Right Reaction foa smiple span beam 761 | Dim c1 As Double 'Integration constant - C1 762 | Dim c2 As Double 'Integration constant - C2 763 | Dim c3 As Double 'Integration constant - C3 764 | Dim c4 As Double 'Integration constant - C4 765 | Dim c5 As Double 'Integration constant - C5 766 | Dim c6 As Double 'Integration constant - C6 767 | Dim c7 As Double 'Integration constant - C7 768 | Dim w As Double 'Area of load or equivalent point load 769 | Dim s As Double 'Slope of load area 770 | Dim d As Double 'Center of load area 771 | Dim vx As Double 'Shear at x 772 | Dim mx As Double 'Moment at x 773 | Dim sx As Double 'Cross section Rotation/Slope at x 774 | Dim dx As Double 'Deflection at x 775 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 776 | Dim femR As Double 'Right End Fixed End Moment - Clockwise Positive 777 | 778 | '''''''''''''''''''''''''''' 779 | '' Input Error Handling '' 780 | '''''''''''''''''''''''''''' 781 | If w1 = 0 And w2 = 0 Then 782 | 'Capture case where load may be a place holder with no value 783 | 'so return 0 instead of an error 784 | cant_right_variable_load = 0 785 | 786 | Else 787 | 788 | If a > L Or b > L Or a = b Or a < 0 Or b < 0 Then 789 | cant_right_variable_load = "A,B cannot be equal and must be between 0 and L" 790 | ElseIf b < a Then 791 | cant_right_variable_load = "B must be greater than A" 792 | ElseIf Sgn(w1) <> Sgn(w2) And w1 <> 0 And w2 <> 0 Then 793 | cant_right_variable_load = "W1,W2 must have the same sign" 794 | Else 795 | 796 | '''''''''''''''''''''''''''' 797 | '' Common Calculations '' 798 | '''''''''''''''''''''''''''' 799 | 800 | c = b - a 801 | w = 0.5 * (w1 + w2) * c 802 | d = a + (((w1 + (2 * w2)) / (3 * (w2 + w1))) * c) 803 | s = (w1 - w2) / c 804 | 805 | 'Support Reactions 806 | rl = w 807 | rr = 0 808 | ml = -1 * w * d 809 | 810 | 'Integration Constants 811 | c1 = 0 812 | c2 = 0 813 | c3 = ml - ((1 / 6) * s * a * a * a) + (0.5 * (s * a + w1) * a * a) - (0.5 * (s * a + 2 * w1) * a * a) 814 | c4 = c1 - ((1 / 24) * s * a * a * a * a) + ((1# / 6#) * ((s * a) + w1) * a * a * a) - (0.25 * ((s * a) + (2 * w1)) * a * a * a) - (c3 * a) + (ml * a) 815 | c5 = (c1 * a) + c2 - (c4 * a) - ((1 / 120) * s * a * a * a * a * a) + ((1 / 24) * ((s * a) + w1) * a * a * a * a) - ((1 / 12) * ((s * a) + (2 * w1)) * a * a * a * a) + (0.5 * ml * a * a) - (0.5 * c3 * a * a) 816 | c6 = (0.5 * rl * b * b) + (c3 * b) + ((1 / 24) * s * b * b * b * b) - ((1 / 6) * ((s * a) + w1) * b * b * b) + (0.25 * ((s * a) + (2 * w1)) * a * b * b) + c4 817 | c7 = ((1 / 6) * rl * b * b * b) + (0.5 * c3 * b * b) + ((1 / 120) * s * b * b * b * b * b) - ((1 / 24) * ((s * a) + w1) * b * b * b * b) + ((1 / 12) * ((s * a) + (2 * w1)) * a * b * b * b) + (c4 * b) + c5 - (c6 * b) 818 | 819 | ''''''''''''''''''''''''''' 820 | '' Result Selection '' 821 | ''''''''''''''''''''''''''' 822 | 823 | If result = 0 Then 824 | 825 | 'Left Support Reaction 826 | cant_right_variable_load = rl 827 | 828 | ElseIf result = 1 Then 829 | 830 | 'Right Support Reaction 831 | cant_right_variable_load = rr 832 | 833 | ElseIf result = 2 Then 834 | 835 | 'Shear at x 836 | If 0 <= x And x <= a Then 837 | vx = rl 838 | ElseIf a < x And x <= b Then 839 | vx = rl + (0.5 * s * x * x) - (x * ((s * a) + w1)) + (0.5 * a * ((s * a) + (2 * w1))) 840 | Else 841 | vx = 0 842 | End If 843 | 844 | cant_right_variable_load = vx 845 | 846 | ElseIf result = 3 Then 847 | 848 | 'Moment at x 849 | If 0 <= x And x <= a Then 850 | mx = (rl * x) + ml 851 | ElseIf a < x And x <= b Then 852 | mx = (rl * x) + c3 + ((1 / 6) * s * x * x * x) - (0.5 * ((s * a) + w1) * x * x) + (0.5 * ((s * a) + (2 * w1)) * a * x) 853 | Else 854 | mx = 0 855 | End If 856 | 857 | cant_right_variable_load = mx 858 | 859 | ElseIf result = 4 Then 860 | 861 | 'Cross Section Rotation/Slope at x 862 | If 0 <= x And x <= a Then 863 | sx = ((0.5 * rl * x * x) + (ml * x) + c1) / (E * I) 864 | ElseIf a < x And x <= b Then 865 | sx = ((0.5 * rl * x * x) + (c3 * x) + ((1 / 24) * s * x * x * x * x) - ((1 / 6) * ((s * a) + w1) * x * x * x) + (0.25 * ((s * a) + (2 * w1)) * a * x * x) + c4) / (E * I) 866 | ElseIf b < x And x <= L Then 867 | sx = c6 / (E * I) 868 | Else 869 | sx = 0 870 | End If 871 | 872 | cant_right_variable_load = sx 873 | 874 | ElseIf result = 5 Then 875 | 876 | 'Deflection at x 877 | If 0 <= x And x <= a Then 878 | dx = (((1 / 6) * rl * x * x * x) + (0.5 * ml * x * x) + (c1 * x) + c2) / (E * I) 879 | ElseIf a < x And x <= b Then 880 | dx = (((1 / 6) * rl * x * x * x) + (0.5 * c3 * x * x) + ((1 / 120) * s * x * x * x * x * x) - ((1 / 24) * ((s * a) + w1) * x * x * x * x) + ((1 / 12) * ((s * a) + (2 * w1)) * a * x * x * x) + (c4 * x) + c5) / (E * I) 881 | ElseIf b < x And x <= L Then 882 | dx = ((c6 * x) + c7) / (E * I) 883 | Else 884 | dx = 0 885 | End If 886 | 887 | cant_right_variable_load = dx 888 | 889 | ElseIf result = 6 Then 890 | 'Fixed End Moment Left 891 | femL = ml 892 | 893 | cant_right_variable_load = femL 894 | 895 | ElseIf result = 7 Then 896 | 897 | 'Fixed End Moment Right 898 | femR = 0 899 | 900 | cant_right_variable_load = femR 901 | 902 | Else 903 | 904 | cant_right_variable_load = CVErr(xlErrNA) 905 | 906 | End If 907 | End If 908 | End If 909 | End Function 910 | -------------------------------------------------------------------------------- /01-General Analysis/SimpleBeamFormulas.bas: -------------------------------------------------------------------------------- 1 | Attribute VB_Name = "SimpleBeamFormulas" 2 | 3 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 4 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 5 | ''' BSD 3-Clause License ''' 6 | ''' ''' 7 | ''' Copyright (c) 2020, open-struct-engineer ''' 8 | ''' All rights reserved. ''' 9 | ''' ''' 10 | ''' Redistribution and use in source and binary forms, with or without ''' 11 | ''' modification, are permitted provided that the following conditions are met: ''' 12 | ''' ''' 13 | ''' 1. Redistributions of source code must retain the above copyright notice, this ''' 14 | ''' list of conditions and the following disclaimer. ''' 15 | ''' ''' 16 | ''' 2. Redistributions in binary form must reproduce the above copyright notice, ''' 17 | ''' this list of conditions and the following disclaimer in the documentation ''' 18 | ''' and/or other materials provided with the distribution. ''' 19 | ''' ''' 20 | ''' 3. Neither the name of the copyright holder nor the names of its ''' 21 | ''' contributors may be used to endorse or promote products derived from ''' 22 | ''' this software without specific prior written permission. ''' 23 | ''' ''' 24 | ''' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ''' 25 | ''' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ''' 26 | ''' IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ''' 27 | ''' DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE ''' 28 | ''' FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ''' 29 | ''' DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ''' 30 | ''' SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ''' 31 | ''' CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ''' 32 | ''' OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ''' 33 | ''' OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' 34 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 35 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 36 | 37 | Function point_load(p As Double, a As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 38 | 39 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 40 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 41 | ''' ''' 42 | ''' Function for a point load applied any where on a simply supported beam ''' 43 | ''' ''' 44 | ''' Important Note: ''' 45 | ''' All inputs must have consistent units ''' 46 | ''' ''' 47 | ''' Result key: ''' 48 | ''' 0 = Left Reaction ''' 49 | ''' 1 = Right Reaction ''' 50 | ''' 2 = Shear at x ''' 51 | ''' 3 = Moment at x ''' 52 | ''' 4 = Cross Section Rotation/Slope at x ''' 53 | ''' 5 = Deflection at x ''' 54 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 55 | ''' 7 = Fixed End Moment at Right Support (clockwise positive) ''' 56 | ''' ''' 57 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 58 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 59 | 60 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 61 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 62 | ''' ''' 63 | ''' Sign Convention: ''' 64 | ''' Loads applied in the (-)y direction are positive ''' 65 | ''' Clockwise moments are positive ''' 66 | ''' ''' 67 | ''' Reactions in the (+)y direction are positive ''' 68 | ''' ''' 69 | ''' Internal: ''' 70 | ''' Shear is positive in the (+)y direction ''' 71 | ''' Moment is positive clockwise ''' 72 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 73 | ''' Upward deflection is in the (+)y direction ''' 74 | ''' ''' 75 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 76 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 77 | 78 | '''''''''''''''''''''''''''''' 79 | '' Variable Definitions '' 80 | '''''''''''''''''''''''''''''' 81 | 82 | Dim b As Double 'Distance from load to right support 83 | Dim rl As Double 'Left Reaction for a simple span beam 84 | Dim rr As Double 'Right Reaction foa smiple span beam 85 | Dim c1 As Double 'Integration constant - C1 86 | Dim c2 As Double 'Integration constant - C2 87 | Dim c4 As Double 'Integration constant - C4 88 | Dim vx As Double 'Shear at x 89 | Dim mx As Double 'Moment at x 90 | Dim sx As Double 'Cross section Rotation/Slope at x 91 | Dim dx As Double 'Deflection at x 92 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 93 | Dim femR As Double 'Right End Fixed End Moment - Clockwise Positive 94 | 95 | 96 | '''''''''''''''''''''''''''' 97 | '' Input Error Handling '' 98 | '''''''''''''''''''''''''''' 99 | If p = 0 Then 100 | 'Capture case where load may be a place holder with no value 101 | 'so return 0 instead of an error 102 | point_load = 0 103 | 104 | Else 105 | 106 | If a > L Or a < 0 Then 107 | point_load = " A , must be between 0 and L" 108 | 109 | Else 110 | '''''''''''''''''''''''''''' 111 | '' Common Calculations '' 112 | '''''''''''''''''''''''''''' 113 | 114 | b = L - a 115 | 116 | 'Support Reactions 117 | rl = ((p * b) / L) 118 | rr = ((p * a) / L) 119 | 120 | 'Integration Constants 121 | c4 = ((-1 * rl * a * a * a) / 3) - ((rr * a * a * a) / 3) + ((rr * L * a * a) / 2) 122 | c2 = (-1 / L) * ((c4) + ((rr * L * L * L) / 3)) 123 | c1 = ((-1 * rr * a * a) / 2) - ((rl * a * a) / 2) + (rr * L * a) + c2 124 | 125 | 126 | ''''''''''''''''''''''''''' 127 | '' Result Selection '' 128 | ''''''''''''''''''''''''''' 129 | 130 | If result = 0 Then 131 | 132 | 'Left Support Reaction 133 | point_load = rl 134 | 135 | ElseIf result = 1 Then 136 | 137 | 'Right Support Reaction 138 | point_load = rr 139 | 140 | ElseIf result = 2 Then 141 | 142 | 'Shear at x 143 | If 0 <= x And x <= a And a <> 0 Then 144 | vx = rl 145 | 146 | ElseIf a < x And x <= L Then 147 | vx = -1 * rr 148 | 149 | Else 150 | vx = 0 151 | End If 152 | 153 | point_load = vx 154 | 155 | ElseIf result = 3 Then 156 | 157 | 'Moment at x 158 | If 0 <= x And x <= a Then 159 | mx = rl * x 160 | ElseIf a < x And x <= L Then 161 | mx = (-1 * rr * x) + (rr * L) 162 | Else 163 | mx = 0 164 | End If 165 | 166 | point_load = mx 167 | 168 | ElseIf result = 4 Then 169 | 170 | 'Cross Section Rotation/Slope at x 171 | If 0 <= x And x <= a Then 172 | sx = (((rl * x * x) / 2) + c1) / (E * I) 173 | ElseIf a < x And x <= L Then 174 | sx = (((-1 * rr * x * x) / 2) + (rr * L * x) + c2) / (E * I) 175 | Else 176 | sx = 0 177 | End If 178 | 179 | point_load = sx 180 | 181 | ElseIf result = 5 Then 182 | 183 | 'Deflection at x 184 | If 0 <= x And x <= a Then 185 | dx = (((rl * x * x * x) / 6) + (c1 * x)) / (E * I) 186 | ElseIf a < x And x <= L Then 187 | dx = (((-1 * rr * x * x * x) / 6) + ((rr * L * x * x) / 2) + (c2 * x) + c4) / (E * I) 188 | Else 189 | dx = 0 190 | End If 191 | 192 | point_load = dx 193 | 194 | ElseIf result = 6 Then 195 | 196 | 'Fixed End Moment Left 197 | femL = -1 * (p * a * b * b) / (L * L) 198 | 199 | point_load = femL 200 | 201 | ElseIf result = 7 Then 202 | 203 | 'Fixed End Moment Right 204 | femR = (p * a * a * b) / (L * L) 205 | point_load = femR 206 | 207 | Else 208 | 209 | point_load = CVErr(xlErrNA) 210 | 211 | End If 212 | End If 213 | End If 214 | 215 | End Function 216 | 217 | Function point_moment(m As Double, a As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 218 | 219 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 220 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 221 | ''' ''' 222 | ''' Function for a point moment applied any where on a simply supported beam ''' 223 | ''' ''' 224 | ''' Important Note: ''' 225 | ''' All inputs must have consistent units ''' 226 | ''' ''' 227 | ''' Result key: ''' 228 | ''' 0 = Left Reaction ''' 229 | ''' 1 = Right Reaction ''' 230 | ''' 2 = Shear at x ''' 231 | ''' 3 = Moment at x ''' 232 | ''' 4 = Cross Section Rotation/Slope at x ''' 233 | ''' 5 = Deflection at x ''' 234 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 235 | ''' 7 = Fixed End Moment at Right Support (clockwise positive) ''' 236 | ''' ''' 237 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 238 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 239 | 240 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 241 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 242 | ''' ''' 243 | ''' Sign Convention: ''' 244 | ''' Loads applied in the (-)y direction are positive ''' 245 | ''' Clockwise moments are positive ''' 246 | ''' ''' 247 | ''' Reactions in the (+)y direction are positive ''' 248 | ''' ''' 249 | ''' Internal: ''' 250 | ''' Shear is positive in the (+)y direction ''' 251 | ''' Moment is positive clockwise ''' 252 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 253 | ''' Upward deflection is in the (+)y direction ''' 254 | ''' ''' 255 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 256 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 257 | 258 | '''''''''''''''''''''''''''''' 259 | '' Variable Definitions '' 260 | '''''''''''''''''''''''''''''' 261 | 262 | Dim b As Double 'Distance from load to right support 263 | Dim rl As Double 'Left Reaction for a simple span beam 264 | Dim rr As Double 'Right Reaction foa smiple span beam 265 | Dim c1 As Double 'Integration constant - C1 266 | Dim c2 As Double 'Integration constant - C2 267 | Dim c3 As Double 'Integration constant - C3 268 | Dim c4 As Double 'Integration constant - C4 269 | Dim vx As Double 'Shear at x 270 | Dim mx As Double 'Moment at x 271 | Dim sx As Double 'Cross section Rotation/Slope at x 272 | Dim dx As Double 'Deflection at x 273 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 274 | Dim femR As Double 'Right End Fixed End Moment - Clockwise Positive 275 | 276 | '''''''''''''''''''''''''''' 277 | '' Input Error Handling '' 278 | '''''''''''''''''''''''''''' 279 | If m = 0 Then 280 | 'Capture case where load may be a place holder with no value 281 | 'so return 0 instead of an error 282 | point_moment = 0 283 | 284 | Else 285 | 286 | If a > L Or a < 0 Then 287 | point_moment = " A , must be between 0 and L" 288 | 289 | Else 290 | '''''''''''''''''''''''''''' 291 | '' Common Calculations '' 292 | '''''''''''''''''''''''''''' 293 | 294 | b = L - a 295 | 296 | 'Support Reactions 297 | rr = m / L 298 | rl = -1 * rr 299 | 300 | 'Integration Constants 301 | c2 = (-1 / L) * ((m * a * a) - (0.5 * m * a * a) + (rl * ((L * L * L) / 6)) + (0.5 * m * L * L)) 302 | c1 = (m * a) + c2 303 | c3 = 0 304 | c4 = ((-1 * rl * L * L * L) / 6) - (0.5 * m * L * L) - (c2 * L) 305 | 306 | 307 | ''''''''''''''''''''''''''' 308 | '' Result Selection '' 309 | ''''''''''''''''''''''''''' 310 | 311 | If result = 0 Then 312 | 313 | 'Left Support Reaction 314 | point_moment = rl 315 | 316 | ElseIf result = 1 Then 317 | 318 | 'Right Support Reaction 319 | point_moment = rr 320 | 321 | ElseIf result = 2 Then 322 | 323 | 'Shear at x 324 | If 0 <= x And x <= L Then 325 | vx = rl 326 | 327 | Else 328 | vx = 0 329 | End If 330 | 331 | point_moment = vx 332 | 333 | ElseIf result = 3 Then 334 | 335 | 'Moment at x 336 | If 0 <= x And x <= a Then 337 | If x = 0 And a = 0 Then 338 | mx = m 339 | ElseIf x = L And a = L Then 340 | mx = -1 * m 341 | Else 342 | mx = rl * x 343 | End If 344 | 345 | ElseIf a < x And x <= L Then 346 | mx = (rl * x) + m 347 | Else 348 | mx = 0 349 | End If 350 | 351 | point_moment = mx 352 | 353 | ElseIf result = 4 Then 354 | 355 | 'Cross Section Rotation/Slope at x 356 | If 0 <= x And x <= a Then 357 | sx = (((rl * x * x) / 2) + c1) / (E * I) 358 | ElseIf a < x And x <= L Then 359 | sx = ((0.5 * rl * x * x) + (m * x) + c2) / (E * I) 360 | Else 361 | sx = 0 362 | End If 363 | 364 | point_moment = sx 365 | 366 | ElseIf result = 5 Then 367 | 368 | 'Deflection at x 369 | If 0 <= x And x <= a Then 370 | dx = (((1 / 6) * rl * x * x * x) + (c1 * x) + c3) / (E * I) 371 | ElseIf a < x And x <= L Then 372 | dx = (((1 / 6) * rl * x * x * x) + (0.5 * m * x * x) + (c2 * x) + c4) / (E * I) 373 | Else 374 | dx = 0 375 | End If 376 | 377 | point_moment = dx 378 | 379 | ElseIf result = 6 Then 380 | 381 | 'Fixed End Moment Left 382 | femL = ((-1 * m) / (L * L)) * ((L * L) - (4 * L * a) + (3 * a * a)) 383 | 384 | point_moment = femL 385 | 386 | ElseIf result = 7 Then 387 | 388 | 'Fixed End Moment Right 389 | femR = -1 * (m / (L * L)) * ((3 * a * a) - (2 * a * L)) 390 | 391 | point_moment = femR 392 | 393 | Else 394 | 395 | point_moment = CVErr(xlErrNA) 396 | 397 | End If 398 | End If 399 | End If 400 | 401 | End Function 402 | 403 | Function uniform_load(w As Double, a As Double, b As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 404 | 405 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 406 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 407 | ''' ''' 408 | ''' Function for a Uniform Distributed Load applied from a to b ''' 409 | ''' ''' 410 | ''' Important Note: ''' 411 | ''' All inputs must have consistent units ''' 412 | ''' ''' 413 | ''' Result key: ''' 414 | ''' 0 = Left Reaction ''' 415 | ''' 1 = Right Reaction ''' 416 | ''' 2 = Shear at x ''' 417 | ''' 3 = Moment at x ''' 418 | ''' 4 = Cross Section Rotation/Slope at x ''' 419 | ''' 5 = Deflection at x ''' 420 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 421 | ''' 7 = Fixed End Moment at Right Support (clockwise positive) ''' 422 | ''' ''' 423 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 424 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 425 | 426 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 427 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 428 | ''' ''' 429 | ''' Sign Convention: ''' 430 | ''' Loads applied in the (-)y direction are positive ''' 431 | ''' Clockwise moments are positive ''' 432 | ''' ''' 433 | ''' Reactions in the (+)y direction are positive ''' 434 | ''' ''' 435 | ''' Internal: ''' 436 | ''' Shear is positive in the (+)y direction ''' 437 | ''' Moment is positive clockwise ''' 438 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 439 | ''' Upward deflection is in the (+)y direction ''' 440 | ''' ''' 441 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 442 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 443 | 444 | '''''''''''''''''''''''''''''' 445 | '' Variable Definitions '' 446 | '''''''''''''''''''''''''''''' 447 | 448 | Dim c As Double 'Width of distributed load 449 | Dim rl As Double 'Left Reaction for a simple span beam 450 | Dim rr As Double 'Right Reaction foa smiple span beam 451 | Dim c1 As Double 'Integration constant - C1 452 | Dim c2 As Double 'Integration constant - C2 453 | Dim c3 As Double 'Integration constant - C3 454 | Dim c4 As Double 'Integration constant - C4 455 | Dim c5 As Double 'Integration constant - C5 456 | Dim c6 As Double 'Integration constant - C6 457 | Dim c7 As Double 'Integration constant - C7 458 | Dim c8 As Double 'Integration constant - C8 459 | Dim c9 As Double 'Integration constant - C9 460 | Dim vx As Double 'Shear at x 461 | Dim mx As Double 'Moment at x 462 | Dim sx As Double 'Cross section Rotation/Slope at x 463 | Dim dx As Double 'Deflection at x 464 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 465 | Dim femR As Double 'Right End Fixed End Moment - Clockwise Positive 466 | 467 | 468 | '''''''''''''''''''''''''''' 469 | '' Input Error Handling '' 470 | '''''''''''''''''''''''''''' 471 | If w = 0 Then 472 | 'Capture case where load may be a place holder with no value 473 | 'so return 0 instead of an error 474 | uniform_load = 0 475 | 476 | Else 477 | 478 | If a > L Or b > L Or a = b Or a < 0 Or b < 0 Then 479 | uniform_load = "A,B cannot be equal and must be between 0 and L" 480 | ElseIf b < a Then 481 | uniform_load = "B must be greater than A" 482 | Else 483 | '''''''''''''''''''''''''''' 484 | '' Common Calculations '' 485 | '''''''''''''''''''''''''''' 486 | 487 | c = b - a 488 | 489 | 'Support Reactions 490 | rl = (w * c) - (((w * c) * (a + (c / 2))) / L) 491 | rr = (((w * c) * (a + (c / 2))) / L) 492 | 493 | 'Integration Constants 494 | c1 = 0 495 | c2 = ((-1 * w * a * a) / 2) 496 | c3 = rr * L 497 | c7 = 0 498 | c8 = ((-1 * c1 * a * a) / 2) + ((c2 * a * a) / 2) + ((5 * w * a * a * a * a) / 24) + c7 499 | c9 = ((-1 * rl * b * b * b) / 3) - ((rr * b * b * b) / 3) + ((w * b * b * b * b) / 8) - ((w * a * b * b * b) / 3) - ((c2 * b * b) / 2) + ((c3 * b * b) / 2) + c8 500 | c6 = ((rr * L * L) / 6) - ((c3 * L) / 2) - (c9 / L) 501 | c5 = ((-1 * rl * b * b) / 2) + ((w * b * b * b) / 6) - ((w * a * b * b) / 2) - ((rr * b * b) / 2) + (c3 * b) - (c2 * b) + c6 502 | c4 = ((w * a * a * a) / 3) + (c2 * a) + c5 - (c1 * a) 503 | 504 | ''''''''''''''''''''''''''' 505 | '' Result Selection '' 506 | ''''''''''''''''''''''''''' 507 | 508 | If result = 0 Then 509 | 510 | 'Left Support Reaction 511 | uniform_load = rl 512 | 513 | ElseIf result = 1 Then 514 | 515 | 'Right Support Reaction 516 | uniform_load = rr 517 | 518 | ElseIf result = 2 Then 519 | 520 | 'Shear at x 521 | If 0 <= x And x <= a Then 522 | vx = rl 523 | 524 | ElseIf a < x And x <= b Then 525 | vx = rl - (w * (x - a)) 526 | 527 | ElseIf b < x And x <= L Then 528 | vx = -1 * rr 529 | 530 | Else 531 | vx = 0 532 | 533 | End If 534 | 535 | uniform_load = vx 536 | 537 | ElseIf result = 3 Then 538 | 539 | 'Moment at x 540 | If 0 <= x And x <= a Then 541 | mx = (rl * x) + c1 542 | 543 | ElseIf a < x And x <= b Then 544 | mx = (rl * x) - ((w * x * x) / 2) + (w * a * x) + c2 545 | 546 | ElseIf b < x And x <= L Then 547 | mx = (-1 * rr * x) + c3 548 | 549 | Else 550 | mx = 0 551 | 552 | End If 553 | 554 | uniform_load = mx 555 | 556 | ElseIf result = 4 Then 557 | 558 | 'Cross Section Rotation/Slope at x 559 | If 0 <= x And x <= a Then 560 | sx = (((rl * x * x) / 2) + (c1 * x) + c4) / (E * I) 561 | 562 | ElseIf a < x And x <= b Then 563 | sx = (((rl * x * x) / 2) - ((w * x * x * x) / 6) + ((w * a * x * x) / 2) + (c2 * x) + c5) / (E * I) 564 | 565 | ElseIf b < x And x <= L Then 566 | sx = (((-1 * rr * x * x) / 2) + (c3 * x) + c6) / (E * I) 567 | 568 | Else 569 | sx = 0 570 | 571 | End If 572 | 573 | uniform_load = sx 574 | 575 | ElseIf result = 5 Then 576 | 577 | 'Deflection at x 578 | If 0 <= x And x <= a Then 579 | dx = (((rl * x * x * x) / 6) + ((c1 * x * x) / 2) + (c4 * x) + c7) / (E * I) 580 | 581 | ElseIf a < x And x <= b Then 582 | dx = (((rl * x * x * x) / 6) - ((w * x * x * x * x) / 24) + ((w * a * x * x * x) / 6) + ((c2 * x * x) / 2) + (c5 * x) + c8) / (E * I) 583 | 584 | ElseIf b < x And x <= L Then 585 | dx = (((-1 * rr * x * x * x) / 6) + ((c3 * x * x) / 2) + (c6 * x) + c9) / (E * I) 586 | 587 | Else 588 | dx = 0 589 | 590 | End If 591 | 592 | uniform_load = dx 593 | 594 | ElseIf result = 6 Then 595 | 596 | 'Fixed End Moment Left 597 | femL = ((rr * L * L * 0.5) - (c3 * L) - c6 - (2 * c4)) / (-0.5 * L) 598 | 599 | uniform_load = femL 600 | 601 | ElseIf result = 7 Then 602 | 603 | 'Fixed End Moment Right 604 | femR = ((-1 * c4) + ((((rr * L * L * 0.5) - (c3 * L) - c6 - (2 * c4)) / (-0.5 * L)) * (L / 3))) * (6 / L) 605 | 606 | uniform_load = femR 607 | 608 | Else 609 | 610 | uniform_load = CVErr(xlErrNA) 611 | 612 | End If 613 | End If 614 | End If 615 | 616 | End Function 617 | 618 | Function variable_load(w1 As Double, w2 As Double, a As Double, b As Double, L As Double, E As Double, I As Double, x As Double, result As Integer) As Variant 619 | 620 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 621 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 622 | ''' ''' 623 | ''' Function for a Variable Distributed Load applied from a to b ''' 624 | ''' ''' 625 | ''' Important Note: ''' 626 | ''' All inputs must have consistent units ''' 627 | ''' ''' 628 | ''' Result key: ''' 629 | ''' 0 = Left Reaction ''' 630 | ''' 1 = Right Reaction ''' 631 | ''' 2 = Shear at x ''' 632 | ''' 3 = Moment at x ''' 633 | ''' 4 = Cross Section Rotation/Slope at x ''' 634 | ''' 5 = Deflection at x ''' 635 | ''' 6 = Fixed End Moment at Left Support (clockwise positive) ''' 636 | ''' 7 = Fixed End Moment at Right Support (clockwise positive) ''' 637 | ''' ''' 638 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 639 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 640 | 641 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 642 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 643 | ''' ''' 644 | ''' Sign Convention: ''' 645 | ''' Loads applied in the (-)y direction are positive ''' 646 | ''' Clockwise moments are positive ''' 647 | ''' ''' 648 | ''' Reactions in the (+)y direction are positive ''' 649 | ''' ''' 650 | ''' Internal: ''' 651 | ''' Shear is positive in the (+)y direction ''' 652 | ''' Moment is positive clockwise ''' 653 | ''' Cross Section Rotation/Slope is positive counter-clockwise ''' 654 | ''' Upward deflection is in the (+)y direction ''' 655 | ''' ''' 656 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 657 | ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 658 | 659 | '''''''''''''''''''''''''''''' 660 | '' Variable Definitions '' 661 | '''''''''''''''''''''''''''''' 662 | 663 | Dim c As Double 'Width of distributed load 664 | Dim s As Double 'Slope of load 665 | Dim xbar As Double 'Centroid of load 666 | Dim w As Double 'Area of Load or Equivalent Point Load 667 | Dim rl As Double 'Left Reaction for a simple span beam 668 | Dim rr As Double 'Right Reaction foa smiple span beam 669 | Dim c1 As Double 'Integration constant - C1 670 | Dim c2 As Double 'Integration constant - C2 671 | Dim c3 As Double 'Integration constant - C3 672 | Dim c4 As Double 'Integration constant - C4 673 | Dim c5 As Double 'Integration constant - C5 674 | Dim c6 As Double 'Integration constant - C6 675 | Dim c7 As Double 'Integration constant - C7 676 | Dim c8 As Double 'Integration constant - C8 677 | Dim c9 As Double 'Integration constant - C9 678 | Dim vx As Double 'Shear at x 679 | Dim mx As Double 'Moment at x 680 | Dim sx As Double 'Cross section Rotation/Slope at x 681 | Dim dx As Double 'Deflection at x 682 | Dim femL As Double 'Left End Fixed End Moment - Clockwise Positive 683 | Dim femR As Double 'Right End Fixed End Moment - Clockwise Positive 684 | 685 | 686 | '''''''''''''''''''''''''''' 687 | '' Input Error Handling '' 688 | '''''''''''''''''''''''''''' 689 | If w1 = 0 And w2 = 0 Then 690 | 'Capture case where load may be a place holder with no value 691 | 'so return 0 instead of an error 692 | variable_load = 0 693 | 694 | Else 695 | 696 | If a > L Or b > L Or a = b Or a < 0 Or b < 0 Then 697 | variable_load = "A,B cannot be equal and must be between 0 and L" 698 | ElseIf b < a Then 699 | variable_load = "B must be greater than A" 700 | ElseIf Sgn(w1) <> Sgn(w2) And w1 <> 0 And w2 <> 0 Then 701 | variable_load = "W1,W2 must have the same sign" 702 | Else 703 | '''''''''''''''''''''''''''' 704 | '' Common Calculations '' 705 | '''''''''''''''''''''''''''' 706 | 707 | c = b - a 708 | s = (w2 - w1) / c 709 | xbar = (c * ((2 * w2) + w1)) / (3 * (w2 + w1)) 710 | w = c * ((w1 + w2) / 2) 711 | 712 | 'Support Reactions 713 | rr = (w * (a + xbar)) / L 714 | rl = w - rr 715 | 716 | 'Integration Constants 717 | c1 = 0 718 | c2 = c1 + ((a * a * a * s) / 6) + ((a * a * (w1 - (s * a))) / 2) + ((((s * a) - (2 * w1)) * a * a) / 2) 719 | c3 = rr * L 720 | c7 = 0 721 | c8 = ((-1 * c1 * a * a) / 2) - ((a * a * a * a * a * s) / 30) - ((a * a * a * a * (w1 - (s * a))) / 8) - ((((s * a) - (2 * w1)) * a * a * a * a) / 6) + ((c2 * a * a) / 2) + c7 722 | c9 = ((-1 * rl * b * b * b) / 3) + ((b * b * b * b * b * s) / 30) + ((b * b * b * b * (w1 - (s * a))) / 8) + ((((s * a) - (2 * w1)) * a * b * b * b) / 6) - ((c2 * b * b) / 2) + c8 - ((rr * b * b * b) / 3) + ((c3 * b * b) / 2) 723 | c6 = (((rr * L * L * L) / 6) - ((c3 * L * L) / 2) - c9) / L 724 | c5 = ((-1 * rr * b * b) / 2) + (c3 * b) + c6 - ((rl * b * b) / 2) + ((b * b * b * b * s) / 24) + ((b * b * b * (w1 - (s * a))) / 6) + ((((s * a) - (2 * w1)) * a * b * b) / 4) - (c2 * b) 725 | c4 = ((-1 * a * a * a * a * s) / 24) - ((a * a * a * (w1 - (s * a))) / 6) - ((((s * a) - (2 * w1)) * a * a * a) / 4) + (c2 * a) + c5 - (c1 * a) 726 | 727 | ''''''''''''''''''''''''''' 728 | '' Result Selection '' 729 | ''''''''''''''''''''''''''' 730 | 731 | If result = 0 Then 732 | 733 | 'Left Support Reaction 734 | variable_load = rl 735 | 736 | ElseIf result = 1 Then 737 | 738 | 'Right Support Reaction 739 | variable_load = rr 740 | 741 | ElseIf result = 2 Then 742 | 743 | 'Shear at x 744 | If 0 <= x And x <= a Then 745 | vx = rl 746 | 747 | ElseIf a < x And x <= b Then 748 | vx = rl - ((x * x * s) / 2) - (x * (w1 - (s * a))) - ((((s * a) - (2 * w1)) * a) / 2) 749 | 750 | ElseIf b < x And x <= L Then 751 | vx = -1 * rr 752 | 753 | Else 754 | vx = 0 755 | 756 | End If 757 | 758 | variable_load = vx 759 | 760 | ElseIf result = 3 Then 761 | 762 | 'Moment at x 763 | If 0 <= x And x <= a Then 764 | mx = (rl * x) + c1 765 | 766 | ElseIf a < x And x <= b Then 767 | mx = (rl * x) - ((x * x * x * s) / 6) - ((x * x * (w1 - (s * a))) / 2) - ((((s * a) - (2 * w1)) * a * x) / 2) + c2 768 | 769 | ElseIf b < x And x <= L Then 770 | mx = (-1 * rr * x) + c3 771 | 772 | Else 773 | mx = 0 774 | 775 | End If 776 | 777 | variable_load = mx 778 | 779 | ElseIf result = 4 Then 780 | 781 | 'Cross Section Rotation/Slope at x 782 | If 0 <= x And x <= a Then 783 | sx = (((rl * x * x) / 2) + (c1 * x) + c4) / (E * I) 784 | 785 | ElseIf a < x And x <= b Then 786 | sx = (((rl * x * x) / 2) - ((x * x * x * x * s) / 24) - ((x * x * x * (w1 - (s * a))) / 6) - ((((s * a) - (2 * w1)) * a * x * x) / 4) + (c2 * x) + c5) / (E * I) 787 | 788 | ElseIf b < x And x <= L Then 789 | sx = (((-1 * rr * x * x) / 2) + (c3 * x) + c6) / (E * I) 790 | 791 | Else 792 | sx = 0 793 | 794 | End If 795 | 796 | variable_load = sx 797 | 798 | ElseIf result = 5 Then 799 | 800 | 'Deflection at x 801 | If 0 <= x And x <= a Then 802 | dx = (((rl * x * x * x) / 6) + ((c1 * x * x) / 2) + (c4 * x) + c7) / (E * I) 803 | 804 | ElseIf a < x And x <= b Then 805 | dx = (((rl * x * x * x) / 6) - ((x * x * x * x * x * s) / 120) - ((x * x * x * x * (w1 - (s * a))) / 24) - ((((s * a) - (2 * w1)) * a * x * x * x) / 12) + ((c2 * x * x) / 2) + (c5 * x) + c8) / (E * I) 806 | 807 | ElseIf b < x And x <= L Then 808 | dx = (((-1 * rr * x * x * x) / 6) + ((c3 * x * x) / 2) + (c6 * x) + c9) / (E * I) 809 | 810 | Else 811 | dx = 0 812 | 813 | End If 814 | 815 | variable_load = dx 816 | 817 | ElseIf result = 6 Then 818 | 819 | 'Fixed End Moment Left 820 | femL = ((rr * L * L * 0.5) - (c3 * L) - c6 - (2 * c4)) / (-0.5 * L) 821 | 822 | variable_load = femL 823 | 824 | ElseIf result = 7 Then 825 | 826 | 'Fixed End Moment Right 827 | femR = ((-1 * c4) + ((((rr * L * L * 0.5) - (c3 * L) - c6 - (2 * c4)) / (-0.5 * L)) * (L / 3))) * (6 / L) 828 | 829 | variable_load = femR 830 | 831 | Else 832 | 833 | variable_load = CVErr(xlErrNA) 834 | 835 | End If 836 | End If 837 | End If 838 | End Function 839 | -------------------------------------------------------------------------------- /01-General Analysis/esap_UserDocumentation.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/01-General Analysis/esap_UserDocumentation.docx -------------------------------------------------------------------------------- /01-General Analysis/esap_example_input.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/01-General Analysis/esap_example_input.xlsx -------------------------------------------------------------------------------- /01-General Analysis/esap_v0.99.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/01-General Analysis/esap_v0.99.xlsm -------------------------------------------------------------------------------- /03-Concrete/03 - Unit Width Strip Foundation-MR.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/03-Concrete/03 - Unit Width Strip Foundation-MR.xlsm -------------------------------------------------------------------------------- /03-Concrete/03_Circular_Section_Analysis_MR.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/03-Concrete/03_Circular_Section_Analysis_MR.xlsm -------------------------------------------------------------------------------- /03-Concrete/03_T_L_R_Beam Capacity_MR.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/03-Concrete/03_T_L_R_Beam Capacity_MR.xlsm -------------------------------------------------------------------------------- /03-Concrete/03_retain_wall.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/03-Concrete/03_retain_wall.xlsx -------------------------------------------------------------------------------- /04-Masonry/ini.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /05-Metals/05 - Elastic Weld Analysis_MR.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/05-Metals/05 - Elastic Weld Analysis_MR.xlsm -------------------------------------------------------------------------------- /05-Metals/05_Rigid Base Plate Analysis_MR.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/05-Metals/05_Rigid Base Plate Analysis_MR.xlsm -------------------------------------------------------------------------------- /05-Metals/Single_Angle.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/05-Metals/Single_Angle.xlsx -------------------------------------------------------------------------------- /05-Metals/rigid_plate_animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/05-Metals/rigid_plate_animation.gif -------------------------------------------------------------------------------- /06-Wood/03 - Wood Shear Wall Foundation - MR.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-struct-engineer/Excel/9df59bb8b913ea0e430f07a82b38eaa956cc6883/06-Wood/03 - Wood Shear Wall Foundation - MR.xlsm -------------------------------------------------------------------------------- /06-Wood/ini.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, open-struct-engineer 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Excel 2 | Open Source Excel Spreadsheets for Structural Engineers 3 | --------------------------------------------------------------------------------