Schaub.win Logo

Detailed Breakdown: Composite Beam Deflection Calculation Logic

This document explains the step-by-step process used by the "Composite Beam Deflection Calculator" to determine the deflection of a composite beam. The explanation refers to the JavaScript functions within the provided HTML file.

1. User Input and Initial Processing

When you click the "Calculate Deflection" button:

  1. Event Trigger: An event listener attached to the form (beamForm) captures the submit event.
  2. Input Collection: Values from all input fields in the HTML form are read. These include:
    • Beam and support dimensions (Total Length, Support A Location, Support B Location) - Input in feet (ft).
    • Loading properties (Surface Load at Start, Surface Load at End, Tributary Width, Load Mode Toggle, Number of Data Points, Deflection Limit Denominator).
      • Surface Loads - Input in lbf/ft² (psf).
      • Tributary Width - Input in feet (ft).
    • Material 1 properties (E, A, I_cg, ycg, h, Start X, End X).
      • Material 1 Start/End X - Input in feet (ft).
      • Other Material 1 properties - Input in inch/psi based units (psi, in², in⁴, inches).
    • Material 2 properties (E, A, I_cg, ycg, h) - Input in inch/psi based units.
  3. Unit Conversion to Internal Standards (Inches, lbf/in):
    • Lengths: Total beam length, support locations, and Material 1 start/end x-positions (initially in feet) are converted to inches by multiplying by 12.
      • Example (using testvalues.png defaults): Total Beam Length: 8 ft * 12 = 96 inches.
    • Line Loads:
      1. The surface loads (psf) are first multiplied by the tributary width (ft) to get a line load in lbf/ft.
        • Example: Surface Load at Start = 106 psf, Tributary Width = 2 ft => Initial Line Load at Start = 106 * 2 = 212 lbf/ft.
      2. These line loads (lbf/ft) are then converted to lbf/in by dividing by 12.
        • Example: Line Load at Start = 212 lbf/ft / 12 = 17.667 lbf/in.
    • All other material properties (E, A, I_cg, ycg, h) are assumed to be already in the consistent internal units (psi, in², in⁴, inches).
  4. Parameter Packaging: All these processed and converted values are packaged into an object (params_inch_based) which is then passed to the main calculation function, calculateBeamDeflection. This object also includes the state of the isPointLoadMode toggle.

2. Core Calculation: calculateBeamDeflection Function

This function is the heart of the analysis. It takes the params_inch_based object.

2.1. Discretization (X-Coordinates)

2.2. Local Beam Properties (EI_eff, y_NA, I_transformed)

2.3. Support Reactions (R_a_reaction, R_b_reaction)

The method depends on isPointLoadMode:

2.4. Bending Moment (M_vals)

For each point xi in the x array, the bending moment is calculated using singularity functions (eval_s(value, power) which returns value^power if value > 0, else 0).

2.5. Curvature (kappa_vals)

2.6. Numerical Integration for Slope and Raw Deflection

The cumtrapz(x_array, y_array) function performs cumulative numerical integration using the trapezoidal rule.

  1. Slope (slope_raw): slope_raw = ∫ κ dx = cumtrapz(x, kappa_vals). This gives the slope at each point relative to an unknown integration constant.
  2. Raw Deflection (deflection_raw): deflection_raw = ∫ slope_raw dx = cumtrapz(x, slope_raw). This gives a deflection profile that satisfies the curvature but doesn't yet meet the boundary conditions (zero deflection at supports). It's off by C1*x + C2.

2.7. Applying Boundary Conditions (Solving for Integration Constants)

The beam is supported, so deflection at the support locations (a_support, b_support) must be zero.

  1. Interpolate Raw Deflection: The interp1(x, deflection_raw, target_x) function (linear interpolation) is used to find the raw deflection values at a_support and b_support:
    • val_def_raw_at_a = interp1(x, deflection_raw, a_support)
    • val_def_raw_at_b = interp1(x, deflection_raw, b_support)
  2. Solve for Constants C1_num and C2_num:
    We have two equations based on y(support) = 0:
    • deflection_raw(a_support) + C1_num * a_support + C2_num = 0
    • deflection_raw(b_support) + C1_num * b_support + C2_num = 0
    This 2x2 system is solved for C1_num and C2_num.

2.8. Final Deflection

2.9. Maximum Deflection and Location

2.10. Deflection Limit Checks

  1. Segment Lengths: Lengths of the left overhang (L_oh_left_in), span between supports (L_span_in), and right overhang (L_oh_right_in) are calculated.
  2. Allowable Limits:
    • Overhangs: limit = (2 * L_overhang) / deflectionLimitDenominator
    • Span: limit = L_span / deflectionLimitDenominator
    • (The deflectionLimitDenominator is taken from user input, defaulting to 180).
  3. Segment Max Deflections: The code iterates through the deflection array again to find the maximum absolute deflection (and its signed value and location) specifically within each of these three segments.
  4. Status: For each segment, the calculated maximum absolute deflection is compared to its allowable limit to determine a "Pass," "Fail," or "N/A" (if the segment doesn't exist or has no finite deflection) status.

3. Output

The function returns an object containing:

This data is then used by the JavaScript in the HTML file to populate the results tables.