MoonSteel

    A toolkit for civil engineering and steel structure design.

    civil engineering
    structural design
    steel structures
    utils
    engineering tools
    Download zip
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    10 months ago
    Downloads
    45

    No dependencies

    #MoonSteel - Steel Structure Design Calculation Library

    MoonSteel is a comprehensive steel structure design and calculation library written in Moonbit, implementing structural analysis functions for civil engineering applications according to Chinese steel structure design standards (GB 50017).


    #Features

    #Core Structural Calculations

    • Axial Tension Members: Strength verification for tension-loaded members (σ = N/A ≤ f)
    • Axial Compression Members: Strength and stability verification for compression-loaded members
    • Bending Members: Stress verification for beams under bending moments (σ = M/W ≤ f)
    • Beam-Columns: Combined axial and bending load analysis
    • Stability Analysis: Overall and local stability checks for structural members


    #Connection Design

    • Welded Connections: Butt weld and fillet weld strength calculations
    • Bolted Connections: Ordinary and high-strength bolt capacity calculations
    • Connection Verification: Stress checks for various connection types


    #Material Properties and Constants

    • Steel Material Properties: Elastic modulus (E), shear modulus (G), Poisson's ratio (ν), density (ρ)
    • Steel Grades: Q235, Q345, Q390, Q420 design strength values
    • Weld Strength: Weld metal strength design values for different steel grades
    • Bolt Strength: Ordinary and high-strength bolt strength design values


    #Auxiliary Functions

    • Load Combinations: Basic and standard load combinations per building codes
    • Section Classification: Steel section classification based on width-thickness ratios
    • Fatigue Analysis: Fatigue strength verification and allowable stress ranges
    • Fire Protection: Fire resistance calculations and protection layer thickness
    • Geometric Verification: Minimum thickness, bolt spacing, and edge distance checks


    #Usage

    #Basic Axial Member Calculations

    test "axial member design" {
    // Axial tension member: N=1000kN, A=0.01m², Q235 steel
    // σ = N/A = 1000×10³/0.01 = 100MPa < 215MPa (Q235 design strength)
    let sigma = axial_tension_strength(1000.0 * KN_TO_N, 0.01, F_Q235 * MPA_TO_PA)
    assert_eq(approx_equal(sigma / MPA_TO_PA, 100.0, 1.0), true)

    // Check if design is satisfied
    let check = axial_tension_check(1000.0 * KN_TO_N, 0.01, F_Q235 * MPA_TO_PA)
    assert_eq(check, true)

    // Axial compression with stability: N=2000kN, A=0.02m², φ=0.8, Q235
    let sigma_comp = axial_compression_stability(
    2000.0 * KN_TO_N, 0.8, 0.02, F_Q235 * MPA_TO_PA
    )
    assert_eq(approx_equal(sigma_comp / MPA_TO_PA, 125.0, 1.0), true)
    }


    #Beam Design and Analysis

    test "beam design" {
    // Bending stress: M=500kN·m, W=0.005m³, Q235 steel
    // σ = M/W = 500×10³/0.005 = 100MPa < 215MPa
    let sigma = bending_stress(500.0 * KN_TO_N, 0.005, F_Q235 * MPA_TO_PA)
    assert_eq(approx_equal(sigma / MPA_TO_PA, 100.0, 1.0), true)

    // Check bending stress
    let check = bending_stress_check(500.0 * KN_TO_N, 0.005, F_Q235 * MPA_TO_PA)
    assert_eq(check, true)

    // Shear stress in beam: V=300kN, S=0.001m³, I=0.0001m⁴, t_w=0.01m
    let tau = shear_stress_beam(
    300.0 * KN_TO_N, 0.001, 0.0001, 0.01, FV_Q235 * MPA_TO_PA
    )
    assert_eq(tau > 0.0, true)
    }


    #Beam-Column Analysis

    test "beam column analysis" {
    // Beam-column: N=1000kN, A=0.01m², M=200kN·m, W=0.002m³, Q235
    // σ = N/A + M/W = 100 + 100 = 200MPa < 215MPa
    let sigma = beam_column_strength(
    1000.0 * KN_TO_N, 0.01, 200.0 * KN_TO_N, 0.002, F_Q235 * MPA_TO_PA
    )
    assert_eq(approx_equal(sigma / MPA_TO_PA, 200.0, 5.0), true)

    // In-plane stability check
    let stability_check = beam_column_in_plane_stability_check(
    1000.0 * KN_TO_N, 0.9, 0.01, 200.0 * KN_TO_N, 0.85, 0.002, F_Q235 * MPA_TO_PA
    )
    assert_eq(stability_check, false)
    }


    #Connection Design

    test "connection design" {
    // Butt weld tension: N=500kN, l_w=0.5m, t=0.01m, Q235 weld
    let sigma_weld = butt_weld_tension(
    500.0 * KN_TO_N, 0.5, 0.01, FTW_Q235 * MPA_TO_PA
    )
    assert_eq(approx_equal(sigma_weld / MPA_TO_PA, 100.0, 1.0), true)

    // Fillet weld strength: σ_f=50MPa, τ_f=50MPa, Q235 weld
    // √(50² + 50²) = 70.7MPa < 160MPa (Q235 fillet weld strength)
    let weld_stress = fillet_weld_strength(
    50.0 * MPA_TO_PA, 50.0 * MPA_TO_PA, FFW_Q235 * MPA_TO_PA
    )
    assert_eq(approx_equal(weld_stress / MPA_TO_PA, 70.7, 1.0), true)

    // Effective fillet weld thickness: h_f=0.01m, h_e=0.7×h_f=0.007m
    let he = fillet_weld_effective_thickness(0.01)
    assert_eq(approx_equal(he, 0.007, 0.0001), true)
    }


    #Bolted Connections

    test "bolted connections" {
    // Ordinary bolt shear capacity: n_v=2, d=0.02m, f_v^b=140MPa (4.6级)
    let n_v_bolt = bolt_shear_capacity(2, 0.02, FVB_46 * MPA_TO_PA)
    assert_eq(n_v_bolt > 0.0, true)

    // Ordinary bolt bearing capacity: d=0.02m, Σt=0.04m, f_c^b=305MPa
    let n_c_bolt = bolt_bearing_capacity(0.02, 0.04, FCB_46 * MPA_TO_PA)
    assert_eq(n_c_bolt > 0.0, true)

    // High-strength bolt friction capacity: n_f=2, μ=0.4, P=100kN
    let n_hsb = hsb_friction_shear_capacity(2, 0.4, 100.0 * KN_TO_N)
    assert_eq(n_hsb > 0.0, true)

    // High-strength bolt preload: A_s=π×d²/4, f_u=400MPa
    let area_s = PI * 0.02 * 0.02 / 4.0 // 螺纹有效面积
    let preload = hsb_preload(area_s, FTB_88 * MPA_TO_PA)
    assert_eq(preload > 0.0, true)
    }


    #Parameter Ranges

    #Valid Input Ranges

    • Forces: 0–10,000 kN (axial forces, shear forces, bending moments)
    • Areas: 10⁻⁴–10 m² (cross-sectional areas)
    • Lengths: 10⁻³–100 m (dimensions, weld lengths)
    • Thicknesses: 10⁻³–0.1 m (plate thicknesses, weld sizes)
    • Material Strengths: 100–500 MPa (steel design strengths)
    • Stability Factors: 0.1–1.0 (φ coefficients)
    • Load Factors: 1.0–2.0 (γ_G, γ_Q factors)


    #Typical Steel Design Values

    • Q235 Steel: f = 215 MPa, f_v = 125 MPa
    • Q345 Steel: f = 310 MPa, f_v = 180 MPa
    • Q390 Steel: f = 350 MPa, f_v = 205 MPa
    • Q420 Steel: f = 380 MPa, f_v = 220 MPa
    • Steel Density: ρ = 7,850 kg/m³
    • Elastic Modulus: E = 206 GPa


    #Testing

    The project includes a comprehensive test suite covering all major functionalities:

    moon test

    #Test Coverage

    • Mathematical utility functions and constants
    • Axial member strength and stability calculations
    • Beam bending and shear stress analysis
    • Beam-column combined loading scenarios
    • Welded and bolted connection design
    • Geometric and construction requirements
    • Boundary conditions and edge cases
    • Load combination calculations
    • Fatigue and fire protection analysis


    #Technical Details

    #Standards Implemented

    • GB 50017-2017: Code for Design of Steel Structures
    • GB 50018-2017: Code for Design of Steel-Concrete Composite Structures
    • JGJ 82-2011: Technical Specification for High Strength Bolt Connections
    • GB/T 19879-2005: Stainless Steel Wires for Welding


    #Mathematical Methods

    • Structural Analysis: Force equilibrium, stress-strain relationships
    • Stability Theory: Euler buckling, effective length method
    • Connection Mechanics: Elastic method for fastener groups
    • Fatigue Analysis: S-N curves, Miner’s rule (simplified)
    • Load Combinations: Linear superposition of load effects


    #Unit System

    All calculations use the International System of Units (SI):
    • Length: meters (m)
    • Force: newtons (N)
    • Stress: pascals (Pa)
    • Mass: kilograms (kg)
    • Time: seconds (s)


    #Notes

    1. Design Standards: Calculations follow Chinese steel structure design codes
    2. Safety Factors: All calculations include appropriate safety factors as per codes
    3. Material Properties: Default values for common structural steels (Q235, Q345, etc.)
    4. Geometric Requirements: Functions check minimum thickness and spacing requirements
    5. Load Factors: Default load factors (γ_G=1.35, γ_Q=1.5) can be modified for specific projects
    6. Temperature Effects: Standard calculations assume normal temperature conditions
    7. Dynamic Loads: Library focuses on static load analysis; dynamic analysis requires additional considerations
    8. Software Validation: Results should be verified against commercial structural analysis software


    #Application Scenarios

    • Structural Engineering: Steel frame buildings, bridges, industrial structures
    • Civil Engineering Design: Building design offices, structural consulting firms
    • Construction Quality Control: Construction supervision and inspection
    • Educational Use: Structural engineering education and training
    • Research Applications: Structural analysis research and development
    • Preliminary Design: Conceptual design and feasibility studies
    • Code Compliance: Verification of design code requirements
    • Construction Documentation: Calculation reports and design documentation


    #Version Information

    The current version (0.1.0) implements core steel structure design functions including:

    • Axial member analysis (tension, compression with stability)
    • Beam analysis (bending, shear, deflection)
    • Beam-column analysis (combined axial and bending)
    • Connection design (welding, bolting)
    • Material properties and design constants
    • Geometric verification functions
    • Load combination calculations

    The library is actively developed and aims to provide comprehensive coverage of steel structure design while being optimized for MoonBit.

    ALPHA_STEEL

    let ALPHA_STEEL : Double

    钢材线膨胀系数 (1/°C)

    BOLT_EDGE_MIN

    let BOLT_EDGE_MIN : Double

    最小螺栓边距 (mm)

    BOLT_SPACING_MIN

    let BOLT_SPACING_MIN : Double

    最小螺栓间距 (mm)

    B_T_LIMIT_FLANGE

    let B_T_LIMIT_FLANGE : Double

    截面宽厚比限值 - 工字钢翼缘 (b/t)

    C_STEEL

    let C_STEEL : Double

    钢材比热容 (J/(kg·K))

    DEG_TO_RAD

    let DEG_TO_RAD : Double

    度转弧度

    EPSILON

    let EPSILON : Double

    浮点数比较精度

    E_STEEL

    let E_STEEL : Double

    钢材弹性模量 (GPa)

    FCB_46

    let FCB_46 : Double

    普通螺栓承压强度设计值 (4.6级)

    FCB_88

    let FCB_88 : Double

    高强度螺栓承压强度设计值 (8.8级)

    FCW_Q235

    let FCW_Q235 : Double

    对接焊缝抗压强度设计值 (Q235)

    FCW_Q345

    let FCW_Q345 : Double

    对接焊缝抗压强度设计值 (Q345)

    FFW_Q235

    let FFW_Q235 : Double

    角焊缝抗拉、抗压、抗剪强度设计值 (Q235)

    FFW_Q345

    let FFW_Q345 : Double

    角焊缝抗拉、抗压、抗剪强度设计值 (Q345)

    FTB_46

    let FTB_46 : Double

    普通螺栓抗拉强度设计值 (4.6级)

    FTB_88

    let FTB_88 : Double

    高强度螺栓抗拉强度设计值 (8.8级)

    FTW_Q235

    let FTW_Q235 : Double

    对接焊缝抗拉强度设计值 (Q235)

    FTW_Q345

    let FTW_Q345 : Double

    对接焊缝抗拉强度设计值 (Q345)

    FVB_46

    let FVB_46 : Double

    普通螺栓抗剪强度设计值 (4.6级)

    FVB_88

    let FVB_88 : Double

    高强度螺栓抗剪强度设计值 (8.8级)

    FVW_Q235

    let FVW_Q235 : Double

    对接焊缝抗剪强度设计值 (Q235)

    FVW_Q345

    let FVW_Q345 : Double

    对接焊缝抗剪强度设计值 (Q345)

    FV_Q235

    let FV_Q235 : Double

    Q235 钢材抗剪强度设计值

    FV_Q345

    let FV_Q345 : Double

    Q345 钢材抗剪强度设计值

    FV_Q390

    let FV_Q390 : Double

    Q390 钢材抗剪强度设计值

    FV_Q420

    let FV_Q420 : Double

    Q420 钢材抗剪强度设计值

    F_Q235

    let F_Q235 : Double

    Q235 钢材抗拉、抗压、抗弯强度设计值

    F_Q345

    let F_Q345 : Double

    Q345 钢材抗拉、抗压、抗弯强度设计值

    F_Q390

    let F_Q390 : Double

    Q390 钢材抗拉、抗压、抗弯强度设计值

    F_Q420

    let F_Q420 : Double

    Q420 钢材抗拉、抗压、抗弯强度设计值

    GAMMA_0

    let GAMMA_0 : Double

    结构重要性系数 (一般结构)

    GAMMA_F

    let GAMMA_F : Double

    疲劳强度修正系数 (一般情况)

    GAMMA_G

    let GAMMA_G : Double

    永久荷载分项系数

    GAMMA_Q

    let GAMMA_Q : Double

    可变荷载分项系数

    GAMMA_STEEL

    let GAMMA_STEEL : Double

    钢材容重 (kN/m³)

    GPA_TO_PA

    let GPA_TO_PA : Double

    GPa 转 Pa

    G_STEEL

    let G_STEEL : Double

    钢材剪切模量 (GPa)

    H_T_LIMIT_WEB

    let H_T_LIMIT_WEB : Double

    截面宽厚比限值 - 工字钢腹板 (h_w/t_w)

    KN_TO_N

    let KN_TO_N : Double

    kN 转 N

    LAMBDA_C

    let LAMBDA_C : Double

    长细比修正系数 (用于计算稳定系数)

    LAMBDA_STEEL

    let LAMBDA_STEEL : Double

    钢材热传导系数 (W/(m·K))

    MM_TO_M

    let MM_TO_M : Double

    mm 转 m

    MPA_TO_PA

    let MPA_TO_PA : Double

    MPa 转 Pa

    M_TO_MM

    let M_TO_MM : Double

    m 转 mm

    NU_STEEL

    let NU_STEEL : Double

    钢材泊松比

    N_BASE

    let N_BASE : Double

    疲劳计算循环次数基准值
    let PI : Double

    圆周率

    RAD_TO_DEG

    let RAD_TO_DEG : Double

    弧度转度

    RHO_STEEL

    let RHO_STEEL : Double

    钢材密度 (kg/m³)

    T_CRITICAL

    let T_CRITICAL : Double

    临界温度 (℃) - 一般取 540℃

    T_MAX_WELD

    let T_MAX_WELD : Double

    最大板厚 (mm) - 焊接限制

    T_MIN

    let T_MIN : Double

    最小板厚 (mm) - 一般要求

    abs

    fn abs(x : Double) -> Double

    计算绝对值

    approx_equal

    fn approx_equal(a : Double, b : Double, tolerance : Double) -> Bool

    判断两个浮点数是否近似相等

    atan2

    fn atan2(y : Double, x : Double) -> Double

    反正切函数 (返回弧度)

    axial_compression_capacity

    fn axial_compression_capacity(phi : Double, a : Double, f : Double) -> Double

    轴心受压构件承载力 N_u = φ * A * f

    axial_compression_stability

    fn axial_compression_stability(n : Double, phi : Double, a : Double, f : Double) -> Double

    轴心受压构件稳定验算 N / (φ * A) ≤ f 参数: n - 轴力 (N), phi - 稳定系数, a - 毛截面积 (m²), f - 强度设计值 (Pa)

    axial_compression_stability_check

    fn axial_compression_stability_check(n : Double, phi : Double, a : Double, f : Double) -> Bool

    轴心受压构件稳定验算 (返回是否满足)

    axial_compression_strength

    fn axial_compression_strength(n : Double, a : Double, f : Double) -> Double

    轴心受压构件强度验算 σ = N / A ≤ f

    axial_tension_check

    fn axial_tension_check(n : Double, a : Double, f : Double) -> Bool

    轴心受拉构件强度验算 (返回是否满足)

    axial_tension_strength

    fn axial_tension_strength(n : Double, a : Double, f : Double) -> Double

    轴心受拉构件强度验算 σ = N / A ≤ f 参数: n - 轴力 (N), a - 净截面积 (m²), f - 强度设计值 (Pa)

    beam_column_in_plane_stability

    fn beam_column_in_plane_stability(n : Double, phi_x : Double, a : Double, mx : Double, gamma_x : Double, wx : Double, f : Double) -> Double

    压弯构件平面内稳定验算 N/(φ_xA) + M_x/(γ_xW_x) ≤ f 参数: n - 轴力, phi_x - 轴心受压稳定系数, a - 面积, mx - 弯矩, gamma_x - 塑性发展系数, wx - 截面模量, f - 强度设计值

    beam_column_in_plane_stability_check

    fn beam_column_in_plane_stability_check(n : Double, phi_x : Double, a : Double, mx : Double, gamma_x : Double, wx : Double, f : Double) -> Bool

    压弯构件平面内稳定验算 (返回是否满足)

    beam_column_out_plane_stability

    fn beam_column_out_plane_stability(n : Double, phi_y : Double, a : Double, mx : Double, phi_b : Double, wx : Double, f : Double) -> Double

    压弯构件平面外稳定验算 N/(φ_yA) + M_x/(φ_bW_x) ≤ f

    beam_column_out_plane_stability_check

    fn beam_column_out_plane_stability_check(n : Double, phi_y : Double, a : Double, mx : Double, phi_b : Double, wx : Double, f : Double) -> Bool

    压弯构件平面外稳定验算 (返回是否满足)

    beam_column_strength

    fn beam_column_strength(n : Double, a : Double, m : Double, w : Double, f : Double) -> Double

    压弯构件强度验算 (单向弯曲) N/A + M/W ≤ f

    beam_column_strength_check

    fn beam_column_strength_check(n : Double, a : Double, m : Double, w : Double, f : Double) -> Bool

    压弯构件强度验算 (返回是否满足)

    bending_overall_stability

    fn bending_overall_stability(m : Double, phi_b : Double, w : Double, f : Double) -> Double

    受弯构件整体稳定验算 M / (φ_b * W) ≤ f 参数: m - 弯矩, phi_b - 整体稳定系数, w - 截面模量, f - 强度设计值

    bending_overall_stability_check

    fn bending_overall_stability_check(m : Double, phi_b : Double, w : Double, f : Double) -> Bool

    受弯构件整体稳定验算 (返回是否满足)

    bending_stress

    fn bending_stress(m : Double, w : Double, f : Double) -> Double

    受弯构件正应力强度验算 σ = M / W ≤ f 参数: m - 弯矩 (N·m), w - 截面模量 (m³), f - 强度设计值 (Pa)

    bending_stress_check

    fn bending_stress_check(m : Double, w : Double, f : Double) -> Bool

    受弯构件正应力强度验算 (返回是否满足)

    bolt_bearing_capacity

    fn bolt_bearing_capacity(d : Double, sum_t : Double, fcb : Double) -> Double

    普通螺栓承压承载力 N_c^b = d * Σt * f_c^b 参数: d - 螺栓直径 (m), sum_t - 同一方向承压构件总厚度 (m), fcb - 承压强度设计值 (Pa)

    bolt_connection_capacity

    fn bolt_connection_capacity(nv : Double, nc : Double) -> Double

    螺栓连接承载力 (取较小值) N = min(N_v^b, N_c^b)

    bolt_edge_distance_check

    fn bolt_edge_distance_check(e : Double, d : Double, t : Double) -> Bool

    螺栓边距验算 1.5d ≤ e ≤ min(4t, 8d)

    bolt_shear_capacity

    fn bolt_shear_capacity(nv : Int, d : Double, fvb : Double) -> Double

    普通螺栓抗剪承载力 N_v^b = n_v * (π*d²/4) * f_v^b 参数: nv - 受剪面数, d - 螺栓直径 (m), fvb - 抗剪强度设计值 (Pa)

    bolt_spacing_check

    fn bolt_spacing_check(s : Double, d : Double, t : Double) -> Bool

    螺栓间距验算 3d ≤ s ≤ min(15t, 200mm)

    bolt_tension_capacity

    fn bolt_tension_capacity(de : Double, ftb : Double) -> Double

    普通螺栓抗拉承载力 N_t^b = (π*d_e²/4) * f_t^b 参数: de - 有效直径 (m), ftb - 抗拉强度设计值 (Pa)

    butt_weld_shear

    fn butt_weld_shear(v : Double, lw : Double, t : Double, fvw : Double) -> Double

    对接焊缝抗剪强度验算 τ = V / (l_w * t) ≤ f_v^w

    butt_weld_shear_check

    fn butt_weld_shear_check(v : Double, lw : Double, t : Double, fvw : Double) -> Bool

    对接焊缝抗剪强度验算 (返回是否满足)

    butt_weld_tension

    fn butt_weld_tension(n : Double, lw : Double, t : Double, ftw : Double) -> Double

    对接焊缝抗拉强度验算 σ = N / (l_w * t) ≤ f_t^w 参数: n - 轴力 (N), lw - 焊缝长度 (m), t - 板厚 (m), ftw - 抗拉强度设计值 (Pa)

    butt_weld_tension_check

    fn butt_weld_tension_check(n : Double, lw : Double, t : Double, ftw : Double) -> Bool

    对接焊缝抗拉强度验算 (返回是否满足)

    circle_area

    fn circle_area(d : Double) -> Double

    圆形截面面积

    circle_inertia

    fn circle_inertia(d : Double) -> Double

    圆形截面惯性矩 I = π * d⁴ / 64

    circle_section_modulus

    fn circle_section_modulus(d : Double) -> Double

    圆形截面抗弯模量 W = π * d³ / 32

    clamp

    fn clamp(value : Double, min_val : Double, max_val : Double) -> Double

    限制值在范围内

    cos

    fn cos(x : Double) -> Double

    余弦函数

    cube

    fn cube(x : Double) -> Double

    计算立方

    deflection_check

    fn deflection_check(f_actual : Double, f_limit : Double) -> Bool

    受弯构件挠度验算 f ≤ [f] 参数: f_actual - 实际挠度 (m), f_limit - 允许挠度 (m)

    deg_to_rad

    fn deg_to_rad(deg : Double) -> Double

    角度转弧度

    effective_width

    fn effective_width(b : Double, rho : Double) -> Double

    板件有效宽度 (局部稳定) b_e = ρ * b

    effective_width_coefficient

    fn effective_width_coefficient(b_t_ratio : Double, limit : Double) -> Double

    板件有效宽度系数 (简化) ρ = 1.0 (当宽厚比满足要求时)

    equivalent_slenderness_ratio

    fn equivalent_slenderness_ratio(lambda : Double, lambda1 : Double) -> Double

    换算长细比 (双角钢等) λₑ = √(λ² + λ₁²)

    fatigue_allowable_stress_amplitude

    fn fatigue_allowable_stress_amplitude(c : Double, n : Double, beta : Double) -> Double

    疲劳容许应力幅 (简化) [Δσ] = C / n^(1/β) 参数: c - 常数, n - 循环次数, beta - 指数 注意: 简化计算,当 beta=3 时使用近似公式

    fatigue_strength_check

    fn fatigue_strength_check(delta_sigma : Double, delta_sigma_limit : Double) -> Bool

    疲劳强度验算 Δσ ≤ [Δσ] 参数: delta_sigma - 应力幅 (Pa), delta_sigma_limit - 容许应力幅 (Pa)

    fillet_weld_effective_length

    fn fillet_weld_effective_length(l : Double, hf : Double) -> Double

    角焊缝有效长度 l_w = l - 2*h_f (实际长度减去起弧落弧)

    fillet_weld_effective_thickness

    fn fillet_weld_effective_thickness(hf : Double) -> Double

    角焊缝有效厚度 h_e = 0.7 * h_f 参数: hf - 焊脚尺寸 (m)

    fillet_weld_strength

    fn fillet_weld_strength(sigma_f : Double, tau_f : Double, ffw : Double) -> Double

    角焊缝强度验算 √(σ_f² + τ_f²) ≤ f_f^w 参数: sigma_f - 正应力, tau_f - 剪应力, ffw - 角焊缝强度设计值

    fillet_weld_strength_check

    fn fillet_weld_strength_check(sigma_f : Double, tau_f : Double, ffw : Double) -> Bool

    角焊缝强度验算 (返回是否满足)

    fire_protection_thickness

    fn fire_protection_thickness(fire_resistance_time : Double, steel_section_factor : Double) -> Double

    防火保护层厚度 (简化) 根据耐火极限要求确定

    fire_resistance_check

    fn fire_resistance_check(t : Double, t_critical : Double) -> Bool

    防火验算 T ≤ T_critical

    hsb_friction_shear_capacity

    fn hsb_friction_shear_capacity(nf : Int, mu : Double, p : Double) -> Double

    高强度螺栓摩擦型抗剪承载力 N_v^b = 0.9 * n_f * μ * P 参数: nf - 传力摩擦面数, mu - 摩擦系数, p - 预拉力 (N)

    hsb_preload

    fn hsb_preload(area_s : Double, fu : Double) -> Double

    高强度螺栓预拉力 P = 0.75 * A_s * f_u 参数: area_s - 螺纹有效面积 (m²), fu - 螺栓抗拉强度 (Pa)

    i_section_area

    fn i_section_area(b : Double, tf : Double, hw : Double, tw : Double) -> Double

    工字钢截面面积 (简化) A = 2bt_f + h_w*t_w

    i_section_inertia_x

    fn i_section_inertia_x(b : Double, h : Double, tf : Double, tw : Double) -> Double

    工字钢截面惯性矩 (简化,忽略圆角) I_x = bh³/12 - (b-t_w)(h-2*t_f)³/12

    i_section_modulus

    fn i_section_modulus(i : Double, h : Double) -> Double

    工字钢截面抗弯模量 W = I / (h/2)

    load_combination_basic

    fn load_combination_basic(g : Double, q : Double, gamma_g : Double, gamma_q : Double) -> Double

    荷载组合 (基本组合) S = γ_G * G + γ_Q * Q

    load_combination_standard

    fn load_combination_standard(g : Double, q : Double) -> Double

    荷载组合 (标准组合) S = G + Q

    local_stability_check

    fn local_stability_check(b_t_ratio : Double, limit : Double) -> Bool

    局部稳定 (板件宽厚比) 判断是否满足局部稳定要求

    local_stability_flange

    fn local_stability_flange(b_t_ratio : Double, limit : Double) -> Bool

    受弯构件局部稳定验算 (翼缘) b/t ≤ [b/t]

    local_stability_web

    fn local_stability_web(h_t_ratio : Double, limit : Double) -> Bool

    受弯构件局部稳定验算 (腹板) h_w/t_w ≤ [h_w/t_w]

    max

    fn max(a : Double, b : Double) -> Double

    计算最大值

    min

    fn min(a : Double, b : Double) -> Double

    计算最小值

    min_thickness_check

    fn min_thickness_check(t : Double, t_min : Double) -> Bool

    最小板厚验算

    overall_stability_coefficient_beam

    fn overall_stability_coefficient_beam(lambda_y : Double, eta_b : Double) -> Double

    整体稳定系数 (受弯构件,简化) φ_b = 1.0 (当满足构造要求时)

    plastic_development_coefficient

    fn plastic_development_coefficient(section_class : String) -> Double

    塑性发展系数 γ_x = 1.0 (弹性), 1.05 (部分塑性)

    pow4

    fn pow4(x : Double) -> Double

    计算四次方

    rad_to_deg

    fn rad_to_deg(rad : Double) -> Double

    弧度转角度

    radius_of_gyration

    fn radius_of_gyration(i : Double, a : Double) -> Double

    回转半径 i = √(I/A)

    rect_area

    fn rect_area(b : Double, h : Double) -> Double

    矩形截面面积

    rect_inertia

    fn rect_inertia(b : Double, h : Double) -> Double

    矩形截面惯性矩 I = b * h³ / 12

    rect_section_modulus

    fn rect_section_modulus(b : Double, h : Double) -> Double

    矩形截面抗弯模量 W = b * h² / 6

    safe_div

    fn safe_div(num : Double, den : Double, fallback : Double) -> Double

    安全除法,分母为零时返回默认值

    section_classification

    fn section_classification(b_t_ratio : Double, limit_s3 : Double, limit_s4 : Double) -> String

    截面分类判断 (根据宽厚比)

    shear_stress_beam

    fn shear_stress_beam(v : Double, s : Double, i : Double, tw : Double, fv : Double) -> Double

    受弯构件剪应力强度验算 τ = V * S / (I * t_w) ≤ f_v 参数: v - 剪力 (N), s - 面积矩 (m³), i - 惯性矩 (m⁴), tw - 腹板厚度 (m), fv - 抗剪强度设计值 (Pa)

    shear_stress_beam_check

    fn shear_stress_beam_check(v : Double, s : Double, i : Double, tw : Double, fv : Double) -> Bool

    受弯构件剪应力强度验算 (返回是否满足)

    sin

    fn sin(x : Double) -> Double

    正弦函数

    slenderness_ratio

    fn slenderness_ratio(l0 : Double, i : Double) -> Double

    长细比 λ = l₀ / i

    square

    fn square(x : Double) -> Double

    计算平方

    stability_coefficient_approx

    fn stability_coefficient_approx(lambda : Double) -> Double

    轴心受压构件稳定系数 (简化公式) 实际应查表,这里用近似公式 φ ≈ 1 - 0.65 * (λ/100)² (当 λ < 100)

    steel_temperature

    fn steel_temperature(t0 : Double, q : Double, rho : Double, c : Double, v : Double) -> Double

    钢材温度计算 (简化) T = T_0 + (Q / (ρ * c * V)) 参数: t0 - 初始温度 (℃), q - 热量 (J), rho - 密度 (kg/m³), c - 比热容 (J/(kg·K)), v - 体积 (m³)

    stiffener_required

    fn stiffener_required(h_t_ratio : Double, limit : Double) -> Bool

    局部稳定 (加劲肋设置) 判断是否需要设置加劲肋

    stress_amplitude

    fn stress_amplitude(sigma_max : Double, sigma_min : Double) -> Double

    应力幅 Δσ = σ_max - σ_min

    tan

    fn tan(x : Double) -> Double

    正切函数