Skip to content

Instantly share code, notes, and snippets.

@jsb2505
jsb2505 / concrete_bending.txt
Created November 23, 2023 15:54
Concrete Bending formulas
/**Design concrete moment of resistance in kNm from effective area, in kNm.
Ref: EC2 §Fig 3.5 Fig 6.1 (and first principles)
*/
Get_M_Rd_kNm = LAMBDA(f_ck, b_w_mm, d_mm,
// (2091/12500) is the more exact coefficient than 0.167
(2091/12500) * f_ck * b_w_mm * d_mm^2 / 10^6
);
/**The lever arm of the tensile steel or compression concrete about the neutral axis, in mm.
Ref: EC2 §Fig 3.5 Fig 6.1 (and first principles)
@jsb2505
jsb2505 / Ciria_C766.txt
Last active July 22, 2024 14:02
A gist for Ciria C766 lambda functions
calculate_temperature_rise_from_20_degs_over_time = LAMBDA(binder_content, total_heat, concrete_density, time_elapsed_hrs,
time_elapsed_hrs * binder_content / (total_heat * concrete_Density)
);
calculate_temperature = LAMBDA(temp_rise_from_20_deg, [test_mix_temp],
LET(
_test_mix_temp, IF(ISOMITTED(test_mix_temp), 20, test_mix_temp),
_test_mix_temp + temp_rise_from_20_deg
)
);
@jsb2505
jsb2505 / Formwork.txt
Created September 28, 2023 16:29
A gist of formwork formulas from CIRIA 108: Derivation of Concrete Pressure in Formwork
/**Temperature coefficient based on CIRIA 108 - Derivation of Concrete Pressure in Formwork
*/
Get_Temperature_Coefficient_K = LAMBDA(concrete_temp_at_placing,
LET(
T, concrete_temp_at_placing,
(36 / (T + 16))^2
)
);
/**Max design pressure of concrete in formwork based on CIRIA 108 - Derivation of Concrete Pressure in Formwork
@jsb2505
jsb2505 / Thermal.txt
Last active September 13, 2023 16:20
A gist containing thermal lambda functions to BS EN 1991-1-5
Get_probability_of_exceedance = LAMBDA(return_period_years, 1 / return_period_years);
/**Uniform bridge contraction temperature range.
Ref: EC1-1-5 §6.1.3.3(3)
*/
Get_T_N_con = LAMBDA(T_0_con, T_e_min,
T_0_con - T_e_min
);
/**Uniform bridge expansion temperature range.
@jsb2505
jsb2505 / Concrete.txt
Last active April 22, 2024 09:43
A gist of concrete lambda functions to BS EN 1992-1-1 and UK National Annex (Eurocode 2)
/**Poisson's ratio of concrete.
Ref: EC2 §3.1.3(4)
*/
Get_Poissons_Ratio = LAMBDA([isCracked],
LET(
_isCracked, IF(ISOMITTED(isCracked), FALSE, isCracked),
IF(_isCracked,
0, //for cracked concrete
0.2 //for uncracked concrete
)
@jsb2505
jsb2505 / Loading.txt
Created December 15, 2022 20:40
A module of loading functions for Excel's AFE
Get_Bending_Moment = LAMBDA(permanent_UDL, imposed_UDL, length_mm,
LET(
g_k, permanent_UDL,
q_k, imposed_UDL,
L, length_mm,
γ_g, 1.35,
γ_q, 1.5,
(γ_g * g_k + γ_q * q_k) * (L / 1000) ^ 2 / 8
)
);
@jsb2505
jsb2505 / Steel_Connection.txt
Last active August 7, 2023 16:20
A module of steel connection functions for Excel's AFE
/**
Calculates alpha as given by Appendix G in SCI P398.
Note: always omit last optional parameter
*/
Get_Alpha = LAMBDA(m, m_2, e, [alpha_DONT_INPUT],
LET(
lambda_1, m / (m + e),
lambda_2, m_2 / (m + e),
alpha, IF(ISOMITTED(alpha_DONT_INPUT), 4.45, alpha_DONT_INPUT),
lambda_1_temp, Get_Lambda_1(alpha, lambda_2),
@jsb2505
jsb2505 / Steel.txt
Last active September 28, 2023 10:31
A module of steel functions for excel AFE
UB_Table = {
//{"type","name",mass,height,breadth,web_thickness,flange_thickness,root radius}
"UB", "127 x 76 x 13", 13, 127, 76, 4, 7.6, 7.6;
"UB", "152 x 89 x 16", 16, 152.4, 88.7, 4.5, 7.7, 7.6;
"UB", "178 x 102 x 19", 19, 177.8, 101.2, 4.8, 7.9, 7.6;
"UB", "203 x 102 x 23", 23.1, 203.2, 101.8, 5.4, 9.3, 7.6;
"UB", "203 x 133 x 25", 25.1, 203.2, 133.2, 5.7, 7.8, 7.6;
"UB", "203 x 133 x 30", 30, 206.8, 133.9, 6.4, 9.6, 7.6;
"UB", "254 x 102 x 22", 22, 254, 101.6, 5.7, 6.8, 7.6;
"UB", "254 x 102 x 25", 25.2, 257.2, 101.9, 6, 8.4, 7.6;
@jsb2505
jsb2505 / Masonry.txt
Last active June 15, 2023 10:09
A module of masonry functions for excel AFE
Get_Shape_Factor = LAMBDA(height_of_unit, width_of_unit,
LET(
h, height_of_unit,
w, width_of_unit,
widths, {50, 100, 150, 200, 250},
heights, {40, 50, 65, 100, 150, 200, 250},
shape_factors,
{
0.80, 0.70, "", "", "";
0.85, 0.75, 0.70, "", "";
@jsb2505
jsb2505 / Geotech.txt
Last active October 3, 2023 10:03
A module of geotechnical related lambda functions.
/**Partial factor for action DA1 C1 or C2.
EXPECTED INPUTS:
Combination = 1 or 2.
Action = "permanent" or "variable".
Favourability = "unfavourable" or "favourable".
*/
Get_γ_action = LAMBDA(combination_1_or_2_as_number, action, [favourability],
LET(
_favourability, IF(ISOMITTED(favourability), "unfavourable", LOWER(favourability)),
_action, LOWER(action),