Skip to content

Instantly share code, notes, and snippets.

View ronkok's full-sized avatar

Ron Kok ronkok

  • Lynden, WA, USA
View GitHub Profile
@ronkok
ronkok / csMacros.md
Last active December 6, 2023 16:12
Guide to Hurmet macros for civil and structural engineers

Guide to Hurmet macros for civil and structural engineers

To have these macros available in Hurmet.app, copy this text into a Hurmet calculation zone

macros = import("https://gist.githubusercontent.com/ronkok/317f8ce0f706608fa9b3e3258ecea138/raw/csMacros.txt") = !

Then, write a macro name, place the selection point after the name, and hit Alt-E.

ab

Mnemonic: Area of Bolt\

@ronkok
ronkok / csMacros.txt
Last active December 6, 2023 16:12
Hurmet macros for civil and structural engineers
# Hurmet macros for civil and structural engineers
ab = """¢` A_b = (π d_b^2) / 4 = ?? in² `, bolt area"""
asc = """Find required reinforcing steel, ¢` A_sMin `
¢` x_c = (0.85 f_c′ b d) / f_yr = ?? in² `, parameter for next line of calculation
¢` A_1 = x_c - √(x_c² - (2 x_c M_u) / (0.9 d f_yr)) = ?? in² `, from CRSI Report 22
@ronkok
ronkok / rootFinding.txt
Created September 20, 2023 15:08
Hurmet functions for numerically finding roots to equations
# Three Hurmet functions for numerically finding roots of equations.
# First, bisection. The first argument is the function, f.
# Select a and b such that f(a) and f(b) have opposite signs.
# The optional argument ε enables you to define a desired precision.
function bisection(f, a, b; ε = 1e-15)
fa = f(a)
fb = f(b)
if fa × fb > 0 throw "Error. Invalid starting bracket."
@ronkok
ronkok / concreteColumnInteraction.txt
Last active July 2, 2024 22:28
Hurmet module to create a Concrete Column Interaction Diagram
# ConcreteColumnInteraction
#
# By Ron Kok. Copyright 2023.
# Released under terms of the MIT license, https://mit-license.org/
#
# This is a Hurmet module that draws a concrete column interaction diagram
# for recangular columns per ACI 318.
# The first input, `column`, must be a single-row dataframe, like this example:
#
# column =
#name weight mass A d bf tw tf kdes Ix Zx Sx rx Iy Zy Sy ry x eo J Cw rts WGi metricName
unit lbf/ft lbm/ft in² in in in in in in⁴ in³ in³ in in⁴ in³ in³ in in in in⁴ in⁶ in in
C15X50 50 50 14.7 15 3.72 0.716 0.65 1.44 404 68.5 53.8 5.24 11 8.14 3.77 0.865 0.799 0.583 2.65 492 1.17 2.25 C380X74
C15X40 40 40 11.8 15 3.52 0.52 0.65 1.44 348 57.5 46.5 5.43 9.17 6.84 3.34 0.883 0.778 0.767 1.45 410 1.15 2 C380X60
C15X33.9 33.9 33.9 10 15 3.4 0.4 0.65 1.44 315 50.8 42 5.61 8.07 6.19 3.09 0.901 0.788 0.896 1.01 358 1.13 2 C380X50.4
C12X30 30 30 8.81 12 3.17 0.51 0.501 1.13 162 33.8 27 4.29 5.12 4.32 2.05 0.762 0.674 0.618 0.861 151 1.01 1.75 C310X45
C12X25 25 25 7.34 12 3.05 0.387 0.501 1.13 144 29.4 24 4.43 4.45 3.82 1.87 0.779 0.674 0.746 0.538 130 1.00 1.75 C310X37
C12X20.7 20.7 20.7 6.08 12 2.94 0.282 0.501 1.13 129 25.6 21.5 4.61 3.86 3.47 1.72 0.797 0.698 0.87 0.369 112 0.983 1.75 C310X30.8
C10X30 30 30 8.81 10 3.03 0.673 0.436 1.00 103 26.7 20.7 3.43 3.93 3.78 1.65 0.668 0.649 0.368 1.22 79.5 0.924 1.75 C25
#name weight mass A OD tnom tdes I Z S r J
lbf/ft lbm/ft in² in in in in⁴ in³ in³ in in⁴
HSS20X.500 104 104 28.5 20 0.5 0.465 1360 177 136 6.91 2720
HSS20X.375 78.67 78.67 21.5 20 0.375 0.349 1040 135 104 6.95 2080
HSS18X.500 93.54 93.54 25.6 18 0.5 0.465 985 143 109 6.2 1970
HSS18X.375 70.66 70.66 19.4 18 0.375 0.349 754 109 83.8 6.24 1510
HSS16X.625 103 103 28.1 16 0.625 0.581 838 138 105 5.46 1680
HSS16X.500 82.85 82.85 22.7 16 0.5 0.465 685 112 85.7 5.49 1370
HSS16X.438 72.87 72.87 19.9 16 0.438 0.407 606 99 75.8 5.51 1210
HSS16X.375 62.64 62.64 17.2 16 0.375 0.349 526 85.5 65.7 5.53 1050
#name weight mass A Ht h B b tnom tdes Ix Zx Sx rx Iy Zy Sy ry J C
lbf/ft lbm/ft in² in in in in in in in⁴ in³ in³ in in⁴ in³ in³ in in⁴ in³
HSS24X12X3/4 171.16 171.16 47.1 24.0 21.9 12.0 9.91 0.750 0.698 3440 359 287 8.55 1170 221 195 4.98 2850 366
HSS24X12X5/8 144.39 144.39 39.6 24.0 22.3 12.0 10.3 0.625 0.581 2940 304 245 8.62 1000 188 167 5.03 2430 310
HSS24X12X1/2 116.91 116.91 32.1 24.0 22.6 12.0 10.6 0.500 0.465 2420 248 202 8.68 829 154 138 5.08 1980 252
HSS22X22X7/8 244.88 244.88 67.3 22.0 19.6 22.0 19.6 0.875 0.814 4970 530 452 8.59 4970 530 452 8.59 7890 729
HSS22X22X3/4 212.00 212.00 58.2 22.0 19.9 22.0 19.9 0.750 0.698 4350 462 395 8.65 4350 462 395 8.65 6860 632
HSS20X20X7/8 221.06 221.06 60.8 20.0 17.6 20.0 17.6 0.875 0.814 3670 433 367 7.77 3670 433 367 7.77 5870 597
HSS20X20X3/4 191.58 191.58 52.6 20.0 17.9 20.0 17.9 0.750 0.698 3230 378 323 7.84 3230 378 323 7.84 5110 519
HSS20X20X5/8 161.40 161.40 44.3 20.0 18.3 20.0 18.3 0.625 0.581 2750 320 275 7.88 2750 320 275 7.88 4320 437
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 24 columns, instead of 3. in line 9.
#name weight mass A d bf tw tf kdes y yp Ix Zx Sx rx Iy Zy Sy ry J Cw ro H WGi
lbf/ft lbm/ft in² in in in in in in in in⁴ in³ in³ in in⁴ in³ in³ in in⁴ in⁶ in in
WT22X167.5 167.5 167.5 49.2 22 15.9 1.03 1.77 2.56 5.53 1.54 2170 234 131 6.63 600 118 75.2 3.49 37.2 438 8.82 0.723 5.5
WT22X145 145 145 42.6 21.8 15.8 0.865 1.58 2.36 5.26 1.35 1830 196 111 6.54 521 102 65.9 3.49 25.4 275 8.66 0.733 5.5
WT22X131 131 131 38.5 21.7 15.8 0.785 1.42 2.2 5.19 1.22 1640 176 99.4 6.53 462 90.9 58.6 3.47 18.6 200 8.64 0.731 5.5
WT22X115 115 115 33.9 21.5 15.8 0.71 1.22 2.01 5.17 1.07 1440 157 88.6 6.53 398 78.3 50.5 3.43 12.4 139 8.67 0.723 5.5
WT20X327.5 327.5 327.5 96.4 21.8 16.9 1.97 3.54 4.72 5.85 2.85 3730 426 234 6.22 1440 271 170 3.86 293 3190 8.38 0.763 7.5
WT20X296.5 296.5 296.5 87.2 21.5 16.7 1.79 3.23 4.41 5.66 2.61 3310 379 209 6.16 1260 240 151 3.8 221 2340 8.29 0.762 7.5
WT20X251.5 251.5 251.5 74 21 16.4 1.54 2.76 3.94 5.38 2.25 2730 314 174 6.07 1020 197 124 3.72 138 1400 8.17 0.76 7.5
WT20X215.5 215.5 2
#name weight mass A d b t y yp Ix Zx Sx rx Iy Zy Sy ry ro H
lbf/ft lbm/ft in² in in in in in in⁴ in³ in³ in in⁴ in³ in³ in in
2L12X12X1-3/8 210 210 62.2 12.0 12.0 1.38 3.50 1.30 826 176 97.2 3.64 1590 218 133 5.06 6.84 0.831
2L12X12X1-3/8X3/4 210 210 62.2 12.0 12.0 1.38 3.50 1.30 826 176 97.2 3.64 1760 241 142 5.32 7.03 0.840
2L12X12X1-3/8X1-1/2 210 210 62.2 12.0 12.0 1.38 3.50 1.30 826 176 97.2 3.64 1950 264 153 5.60 7.25 0.850
2L12X12X1-1/4 193 193 56.8 12.0 12.0 1.25 3.45 1.18 762 161 89.2 3.66 1440 196 120 5.04 6.84 0.829
2L12X12X1-1/4X3/4 193 193 56.8 12.0 12.0 1.25 3.45 1.18 762 161 89.2 3.66 1590 217 128 5.29 7.03 0.839
2L12X12X1-1/4X1-1/2 193 193 56.8 12.0 12.0 1.25 3.45 1.18 762 161 89.2 3.66 1760 239 138 5.57 7.24 0.848
2L12X12X1-1/8 174 174 51.6 12.0 12.0 1.13 3.41 1.08 700 147 81.4 3.68 1300 176 108 5.02 6.85 0.827
2L12X12X1-1/8X3/4 174 174 51.6 12.0 12.0 1.13 3.41 1.08 700 147 81.4 3.68 1440 195 116 5.28 7.04 0.837
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 26 columns, instead of 21. in line 8.
#name weight mass A d bf tw tf kdes Ix Zx Sx rx Iy Zy Sy ry J Cw Wno Sw1 Qf Qw rts T WGi
lbf/ft lbm/ft in² in in in in in in⁴ in³ in³ in in⁴ in³ in³ in in⁴ in⁶ in² in⁴ in³ in³ in in in
HP18X204 204 204 60.2 18.3 18.1 1.13 1.13 2.31 3480 433 380 7.6 1120 191 124 4.31 29.5 82500 77.7 397 82.3 212 5.03 13.5 7.5
HP18X181 181 181 53.2 18 18 1 1 2.18 3020 379 336 7.53 974 167 108 4.28 20.7 70400 76.5 344 72.3 185 4.96 13.5 7.5
HP18X157 157 157 46.2 17.7 17.9 0.87 0.87 2.05 2570 327 290 7.46 833 143 93.1 4.25 13.9 59000 75.3 293 62.3 159 4.92 13.5 7.5
HP18X135 135 135 39.9 17.5 17.8 0.75 0.75 1.93 2200 281 251 7.43 706 122 79.3 4.21 9.12 49500 74.5 249 53.5 136 4.85 13.5 7.5
HP16X183 183 183 54.1 16.5 16.3 1.13 1.13 2.31 2510 349 304 6.81 818 156 100 3.89 26.9 48300 62.2 285 65.4 169 4.55 11.75 5.5
HP16X162 162 162 47.7 16.3 16.1 1 1 2.18 2190 306 269 6.78 697 134 86.6 3.82 18.8 40800 61.6 248 57.8 149 4.45 11.75 5.5
HP16X141 141 141 41.7 16 16 0.875 0.875 2.06 1870 264 234 6.7 599 116 74.9 3.79 12.9 34300 60.5 21