Skip to content

Instantly share code, notes, and snippets.

@jsb2505
Last active October 3, 2023 10:03
Show Gist options
  • Save jsb2505/8099cad4f1bb6b5aa4a9560d6ca7a0ea to your computer and use it in GitHub Desktop.
Save jsb2505/8099cad4f1bb6b5aa4a9560d6ca7a0ea to your computer and use it in GitHub Desktop.
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),
combination, combination_1_or_2_as_number,
IF(
combination = 1,
// Factors for combination 1
IF(_favourability = "unfavourable",
// Factors for combination 1, unfavourable
IF(_action = "permanent", 1.35, 1.5), //variable
// Factors for combination 1, favourable
IF(_action = "permanent", 1, 0)
),
// Factors for combination 2
IF(_favourability = "unfavourable",
// Factors for combination 2, unfavourable
IF(_action = "permanent", 1, 1.3), //variable
// Factors for combination 2, favourable
IF(_action = "permanent", 1, 0)
)
)
)
);
/**Partial factor for shearing resistance DA1 C1 or C2.
Combination = 1 or 2.
*/
Get_γ_ϕ = LAMBDA(combination_1_or_2_as_number,
IF(combination_1_or_2_as_number = 1, 1, 1.25)
);
/**Factored internal friction angle to shearing.
Combination = 1 or 2.
*/
Get_ϕ = LAMBDA(ϕ_degs, combination_1_or_2_as_number,
LET(
γ_ϕ, IF(combination_1_or_2_as_number = 1, 1, 1.25),
DEGREES(ATAN(TAN(RADIANS(ϕ_degs)) / γ_ϕ))
)
);
/**Coefficient of passive lateral earth pressure using Coulomb theory.
*/
Get_Kp = LAMBDA(
internal_friction_angle_degs,
[friction_angle_of_soil_to_wall_degs],
[slope_of_backfill_degs],
[angle_of_back_of_wall_degs],
LET(
φ, RADIANS(internal_friction_angle_degs),
δ, RADIANS(IF(ISOMITTED(friction_angle_of_soil_to_wall_degs), (2/3)*internal_friction_angle_degs, friction_angle_of_soil_to_wall_degs)),
β, RADIANS(IF(ISOMITTED(slope_of_backfill_degs), 0, slope_of_backfill_degs)),
α, RADIANS(IF(ISOMITTED(angle_of_back_of_wall_degs), 90, angle_of_back_of_wall_degs)),
((SIN(α-φ))^2) / ((SIN(α))^2*SIN(α+δ)*(1-SQRT((SIN(φ+δ)*SIN(φ+β))/(SIN(α+δ)*SIN(α+β))))^2)
)
);
/**Coefficient of active lateral earth pressure using Coulomb theory.
*/
Get_Ka = LAMBDA(
internal_friction_angle_degs,
[friction_angle_of_soil_to_wall_degs],
[slope_of_backfill_degs],
[angle_of_back_of_wall_degs],
LET(
φ, RADIANS(internal_friction_angle_degs),
δ, RADIANS(IF(ISOMITTED(friction_angle_of_soil_to_wall_degs), (2/3)*internal_friction_angle_degs, friction_angle_of_soil_to_wall_degs)),
β, RADIANS(IF(ISOMITTED(slope_of_backfill_degs), 0, slope_of_backfill_degs)),
α, RADIANS(IF(ISOMITTED(angle_of_back_of_wall_degs), 90, angle_of_back_of_wall_degs)),
((SIN(α+φ))^2)/((SIN(α))^2* SIN(α-δ)*(1+SQRT((SIN(φ+δ)*SIN(φ-β))/(SIN(α-δ)*SIN(α+β))))^2)
)
);
/**Coefficient of lateral earth pressure at-rest using Coulomb theory.
*/
Get_k0 = LAMBDA(internal_friction_angle_degs, [OCR], [is_Full_Jaky_Formula],
LET(
_is_Full_Jaky_Formula, IF(ISOMITTED(is_Full_Jaky_Formula), FALSE, is_Full_Jaky_Formula),
_OCR, IF(ISOMITTED(OCR), 1, OCR),
φ, RADIANS(internal_friction_angle_degs),
k0_temp, 1 - SIN(φ),
K0_NC, k0_temp * IF(_is_Full_Jaky_Formula,
(1 + (2/3)*SIN(φ)) / (1 + SIN(φ)),
1
),
K0_NC * _OCR^(SIN(φ))
)
);
/**The lever arm above the point of rotation from combined soil and surcharge loading.
*/
Get_Lever_Arm_m = LAMBDA(height_of_retained_soil_mm, soil_line_load_hoz_kN_per_m, [surcharge_line_load_hoz_kN_per_m],
LET(
H, height_of_retained_soil_mm / 1000,
F_h_soil, soil_line_load_hoz_kN_per_m,
F_h_surcharge, IF(ISOMITTED(surcharge_line_load_hoz_kN_per_m), 0, surcharge_line_load_hoz_kN_per_m),
((F_h_soil * H / 3) + (F_h_surcharge * H / 2)) / SUM(F_h_surcharge, F_h_soil)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment