Two-Storey Frame – N2 Method#

../../../../../_images/pushover_two_storey_frame.png

Running a pushover analysis on a two-storey steel frame with the first mode shape as load pattern and checking the results against a hand calculation from EN 1998-1 Annex B (N2 method):

  • Model a two-storey shear frame with HEB 200 columns, rigid floors and plastic hinges that yield at M_pl

  • Activate the Modal Analysis and Pushover Analysis add-ons and define the vertical loads case, the modal analysis, the EN 1998-1 elastic spectrum and the pushover load combination

  • Push the frame with the automatic modal load pattern and check it against m_i·Φ_i of the first mode

  • Loop over all load increments with load_increment_no to trace the capacity curve up to the sway mechanism

  • Read the target displacement table and compare Γ, m*, F*_y, T* and d_t with EN 1998-1 Annex B (T* ≥ T_C, equal displacement rule)

  • Read the master increment, the load increment at the target displacement, and check its member forces against the storey shears

Keywords:
pushover N2 method EN 1998-1 Annex B target displacement capacity curve load increment modal load pattern plastic hinge
"""
Pushover analysis of a two-storey steel frame (N2 method, EN 1998-1 Annex B).

Benchmark: a two-storey shear frame, HEB 200 columns with rigid floor beams and
30 t per floor, pushed with the first mode shape as load pattern. Plastic hinges
at the column ends yield at M_pl. Every value RFEM reports can be checked by hand:

  - two degrees of freedom, so the transformation factor Gamma differs from 1
  - modal load pattern (automatic mode shape)
  - long period, T* >= T_C: equal displacement rule, Annex B (B.9)
  - the frame stays elastic at the target displacement, inside the capacity curve,
    which ends when the ground storey forms the sway mechanism

Hand calculation:
  - Frame theory: storey stiffness k = 24 E I / h^3 (rigid floor beams)
  - Two-mass system: first mode omega_1, Phi = (Phi_1, 1), normalised at the roof
  - Plastic theory: the ground storey forms the mechanism, F_b = 4 M_pl / h
  - EN 1998-1:2004, 3.2.2.2: elastic response spectrum Type 1, ground type B
  - EN 1998-1:2004, Annex B: m* = sum m_i Phi_i, Gamma = m* / sum m_i Phi_i^2,
    F*_y = F_b / Gamma, d*_y = F*_y / (m* omega_1^2), T* = 2 pi sqrt(m* d*_y / F*_y)

With the load pattern proportional to M Phi, the frame deforms in the mode shape,
so T* equals the first natural period. At the target the frame is elastic, so the
base shear there is Gamma m* S_e(T*), the first-mode base shear of a response
spectrum analysis.

The example reads the results with get_result_table():
  - the normalized lateral forces, compared with m_i Phi_i
  - support forces and nodal deformations of every load increment (load_increment_no),
    giving the capacity curve, read at the target displacement
  - the target displacement table, compared with Annex B; it does not depend on the
    load increment, so asking for one returns an empty table and a warning
  - support forces, deformations and member forces of the master increment
    (load_increment_no not set): the load increment at the target displacement,
    the performance point. Here the frame is still elastic; if the target lies
    beyond the end of the capacity curve, the master increment is the last one.

Reference vs. RFEM (the deviations stay below 1 %):
  - Phi_1 = 0.618, Gamma = 1.171, m* = 48.5 t, F*_y = 129.0 kN, T* = 0.831 s
  - T* >= T_C: d*_t = d*_et = 31.0 mm and d_t = 36.3 mm (RFEM 36.5 mm), below the
    mechanism at 54.9 mm, so no warning; the base shear at d_t is 100.6 kN
  - The hand calculation neglects the axial strain of the columns. With it the
    frame gives T_1 = 0.835 s and Phi_1 = 0.614, as RFEM does.

In the target displacement table, 'mass' is m* = sum m_i Phi_i and 'modal_mass'
is sum m_i Phi_i^2, the denominator of Gamma.
"""
from math import inf, pi, sqrt

import grpc
import numpy as np
import pandas as pd
from dlubal.api import rfem, common

# --- Benchmark input -------------------------------------------------------
SPAN = 6.0                      # m
STOREY_HEIGHT = 4.0             # m, h
FLOOR_MASS = 30_000.0           # kg per floor (15 t at each column)
GRAVITY = 9.81                  # m/s2

# HEB 200 in S235 (EN 10365): I_y = 5696 cm4, W_pl,y = 642.5 cm3
COLUMN_SECTION = 'HEB 200'
E = 210e9                       # Pa
I_Y = 5696e-8                   # m4
W_PL_Y = 642.5e-6               # m3
F_Y = 235e6                     # Pa
M_PL = W_PL_Y * F_Y             # Nm, 151.0 kNm
HINGE_SPRING = 1e12             # Nm/rad, rigid until the hinge yields at M_pl

# EN 1998-1, Table 3.2: elastic spectrum Type 1, ground type B
A_G = 0.10 * GRAVITY            # m/s2, low seismicity
S, T_B, T_C, T_D = 1.20, 0.15, 0.50, 2.00
ETA = 1.0                       # 5 % viscous damping


def elastic_spectrum(period: float) -> float:
    """S_e(T) [m/s2], EN 1998-1 expressions (3.2) to (3.5)."""
    if period <= T_B:
        return A_G * S * (1 + period / T_B * (ETA * 2.5 - 1))
    if period <= T_C:
        return A_G * S * ETA * 2.5
    if period <= T_D:
        return A_G * S * ETA * 2.5 * T_C / period
    return A_G * S * ETA * 2.5 * T_C * T_D / period**2


def first_mode() -> tuple[float, float]:
    """omega_1^2 [1/s2] and Phi_1 (roof = 1) of the two-mass shear frame."""
    k = 24 * E * I_Y / STOREY_HEIGHT**3                     # both storeys alike
    m = FLOOR_MASS
    # det(K - omega^2 M) = 0 with K = [[2k, -k], [-k, k]], M = diag(m, m)
    a, b, c = m * m, -3 * k * m, k * k
    omega2 = (-b - sqrt(b * b - 4 * a * c)) / (2 * a)
    phi_1 = k / (2 * k - omega2 * m)
    return omega2, phi_1


def annex_b_reference() -> dict:
    """Hand calculation of the benchmark, EN 1998-1 Annex B."""
    omega2, phi_1 = first_mode()
    m_star = FLOOR_MASS * phi_1 + FLOOR_MASS                # (B.2)
    modal_mass = FLOOR_MASS * phi_1**2 + FLOOR_MASS         # sum m_i Phi_i^2
    gamma = m_star / modal_mass                             # (B.3)
    f_y_star = 4 * M_PL / STOREY_HEIGHT / gamma             # (B.4), ground-storey mechanism
    d_y_star = f_y_star / (m_star * omega2)                 # elastic branch along the mode
    t_star = 2 * pi * sqrt(m_star * d_y_star / f_y_star)    # (B.7)
    s_e = elastic_spectrum(t_star)
    d_et_star = s_e * (t_star / (2 * pi))**2                # (B.8)

    if t_star >= T_C or f_y_star / m_star >= s_e:           # (B.9), (B.10)
        d_t_star = d_et_star
    else:                                                   # (B.11)
        q_u = s_e * m_star / f_y_star
        d_t_star = max(d_et_star, d_et_star / q_u * (1 + (q_u - 1) * T_C / t_star))

    return {
        'Phi_1 [-]': phi_1,
        'Gamma [-]': gamma,
        'm* [t]': m_star / 1000,
        'sum m_i Phi_i^2 [t]': modal_mass / 1000,
        'F*_y [kN]': f_y_star / 1000,
        'd*_y [mm]': d_y_star * 1000,
        'T* [s]': t_star,
        'S_e(T*) [m/s2]': s_e,
        'd*_et [mm]': d_et_star * 1000,
        'd*_t [mm]': d_t_star * 1000,
        'd_t [mm]': gamma * d_t_star * 1000,
        'F_b at d_t [kN]': gamma * m_star * s_e / 1000,
    }


def define_structure() -> list:
    """Two-storey frame in the XZ plane, plastic hinges at all column ends."""

    plastic_hinge = rfem.types_for_members.MemberHinge(
        no=1,
        user_defined_name_enabled=True,
        name='Plastic hinge | M_pl,y',
        axial_release_n=inf,
        axial_release_vy=inf,
        axial_release_vz=inf,
        moment_release_mt=inf,
        # Yielding needs a finite spring: with inf the calculation fails without a listed error
        moment_release_my=HINGE_SPRING,
        moment_release_mz=inf,
        moment_release_my_nonlinearity=rfem.types_for_members.MemberHinge.MOMENT_RELEASE_MY_NONLINEARITY_PARTIAL_ACTIVITY,
        partial_activity_around_y_negative_type=rfem.types_for_members.MemberHinge.PARTIAL_ACTIVITY_AROUND_Y_NEGATIVE_TYPE_YIELDING_FROM_FORCE_OR_MOMENT,
        partial_activity_around_y_negative_moment=M_PL,
        partial_activity_around_y_positive_type=rfem.types_for_members.MemberHinge.PARTIAL_ACTIVITY_AROUND_Y_POSITIVE_TYPE_YIELDING_FROM_FORCE_OR_MOMENT,
        partial_activity_around_y_positive_moment=M_PL,
    )

    def column(no: int, line: int) -> rfem.structure_core.Member:
        return rfem.structure_core.Member(no=no, line=line, cross_section_start=1, member_hinge_start=1, member_hinge_end=1)

    return [
        rfem.structure_core.Material(no=1, name='S235'),
        rfem.structure_core.CrossSection(no=1, name=COLUMN_SECTION, material=1, shear_stiffness_deactivated=True),

        # Global Z points down (RFEM default): floor 1 at Z = -h, roof at Z = -2h
        rfem.structure_core.Node(no=1, coordinate_1=0.0),
        rfem.structure_core.Node(no=2, coordinate_1=SPAN),
        rfem.structure_core.Node(no=3, coordinate_1=0.0, coordinate_3=-STOREY_HEIGHT),
        rfem.structure_core.Node(no=4, coordinate_1=SPAN, coordinate_3=-STOREY_HEIGHT),
        rfem.structure_core.Node(no=5, coordinate_1=0.0, coordinate_3=-2 * STOREY_HEIGHT),
        rfem.structure_core.Node(no=6, coordinate_1=SPAN, coordinate_3=-2 * STOREY_HEIGHT),

        rfem.structure_core.Line(no=1, definition_nodes=[1, 3]),
        rfem.structure_core.Line(no=2, definition_nodes=[3, 5]),
        rfem.structure_core.Line(no=3, definition_nodes=[2, 4]),
        rfem.structure_core.Line(no=4, definition_nodes=[4, 6]),
        rfem.structure_core.Line(no=5, definition_nodes=[3, 4]),
        rfem.structure_core.Line(no=6, definition_nodes=[5, 6]),

        plastic_hinge,
        column(no=1, line=1),
        column(no=2, line=2),
        column(no=3, line=3),
        column(no=4, line=4),
        rfem.structure_core.Member(no=5, line=5, type=rfem.structure_core.Member.TYPE_RIGID),
        rfem.structure_core.Member(no=6, line=6, type=rfem.structure_core.Member.TYPE_RIGID),

        rfem.types_for_nodes.NodalSupport(
            no=1,
            nodes=[1, 2],
            spring=common.Vector3d(x=inf, y=inf, z=inf),
            rotational_restraint=common.Vector3d(x=inf, y=inf, z=inf),
        ),
        # The benchmark is a plane frame: hold the floors out of plane
        rfem.types_for_nodes.NodalSupport(
            no=2,
            nodes=[3, 4, 5, 6],
            spring=common.Vector3d(x=0, y=inf, z=0),
            rotational_restraint=common.Vector3d(x=0, y=0, z=0),
        ),
    ]


def define_loading() -> list:
    """Floor weights (= floor masses), modal analysis, EC8 spectrum and the pushover combination."""

    spectrum_rows = [
        rfem.dynamic_loads.ResponseSpectrum.UserDefinedResponseSpectrumRow(
            period=period, acceleration=elastic_spectrum(period),
        )
        for period in [0.0, T_B, T_C] + [round(0.05 * i, 2) for i in range(11, 81)]
    ]

    return [
        rfem.loading.StaticAnalysisSettings(
            no=1,
            analysis_type=rfem.loading.StaticAnalysisSettings.ANALYSIS_TYPE_GEOMETRICALLY_LINEAR,
            mass_conversion_enabled=True,
        ),
        # The floor masses act in X only: two floors give exactly two sway modes
        rfem.loading.ModalAnalysisSettings(
            no=1,
            number_of_modes=2,
            solution_method=rfem.loading.ModalAnalysisSettings.SOLUTION_METHOD_LANCZOS,
            acting_masses_in_direction_x_enabled=True,
            acting_masses_in_direction_y_enabled=False,
            acting_masses_in_direction_z_enabled=False,
            acting_masses_about_axis_x_enabled=False,
            acting_masses_about_axis_y_enabled=False,
            acting_masses_about_axis_z_enabled=False,
        ),
        rfem.loading.PushoverAnalysisSettings(
            no=1,
            considering_iterative_procedure=False,              # Annex B.5 iteration off
            end_of_capacity_curve=rfem.loading.PushoverAnalysisSettings.END_OF_CAPACITY_CURVE_COLAPS,
            automatic_selection_of_the_highest_node=True,
            initial_load_factor=0.1,
            load_factor_increment=0.1,
            refinement_of_the_last_load_increment=10,
            maximum_number_of_load_increments=200,
        ),
        rfem.dynamic_loads.ResponseSpectrum(
            no=1,
            user_defined_name_enabled=True,
            name='EN 1998-1 | Type 1 | ground B | a_g = 0.10 g',
            definition_type=rfem.dynamic_loads.ResponseSpectrum.DEFINITION_TYPE_USER_DEFINED,
            user_defined_response_spectrum_step_enabled=False,
            is_g_factor_mode=False,
            user_defined_spectrum_sorted=True,
            user_defined_response_spectrum=rfem.dynamic_loads.ResponseSpectrum.UserDefinedResponseSpectrumTable(
                rows=spectrum_rows,
            ),
        ),

        # LC1: floor weights, converted into the floor masses
        rfem.loading.LoadCase(
            no=1,
            name='Vertical loads | floor masses',
            static_analysis_settings=1,
            self_weight_active=False,
        ),
        rfem.loads.NodalLoad(
            no=1,
            load_case=1,
            nodes=[3, 4, 5, 6],
            load_direction=rfem.loads.NodalLoad.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE_LENGTH,
            force_magnitude=FLOOR_MASS / 2 * GRAVITY,
        ),

        # LC2: modal analysis with the masses of LC1
        rfem.loading.LoadCase(
            no=2,
            name='Modal analysis',
            analysis_type=rfem.loading.LoadCase.ANALYSIS_TYPE_MODAL_ANALYSIS,
            modal_analysis_settings=1,
            import_masses_from=rfem.ObjectId(no=1, object_type=rfem.OBJECT_TYPE_LOAD_CASE),
        ),

        # CO1: pushover in +X, load pattern from the first mode shape
        rfem.loading.LoadCombination(
            no=1,
            name='Pushover | +X | mode 1',
            user_defined_name_enabled=True,
            analysis_type=rfem.loading.LoadCombination.ANALYSIS_TYPE_PUSHOVER,
            static_analysis_settings=1,
            pushover_analysis_settings=1,
            pushover_vertical_loads_case=rfem.ObjectId(no=1, object_type=rfem.OBJECT_TYPE_LOAD_CASE),
            pushover_modal_analysis_from_load_case=2,
            pushover_direction=rfem.loading.LoadCombination.PUSHOVER_DIRECTION_X,
            pushover_normalized_displacements=rfem.loading.LoadCombination.PUSHOVER_NORMALIZED_DISPLACEMENTS_MODAL_AUTOMATIC_MODAL_SHAPE,
            pushover_response_spectrum=1,
            pushover_response_spectrum_scale_factor=1.0,
        ),
    ]


def base_shear(support_forces: pd.DataFrame) -> float:
    """Sum of the horizontal support forces [N]."""
    return support_forces.loc[support_forces['specification'].str.lower() == 'support forces', 'p_x'].iloc[0]


with rfem.Application() as rfem_app:

    # Step 1: Create a new model with the Modal and Pushover Analysis add-ons
    rfem_app.close_all_models(save_changes=False)
    rfem_app.create_model(name='pushover_two_storey_frame')

    base_data = rfem_app.get_base_data()
    base_data.addons.modal_analysis_active = True
    base_data.addons.pushover_analysis_active = True
    base_data.general_settings.gravitational_acceleration = GRAVITY
    rfem_app.set_base_data(base_data=base_data)

    # Step 2: Create the structure and the loading
    rfem_app.delete_all_objects()
    rfem_app.create_object_list(define_structure() + define_loading())

    # Step 3: Run the pushover analysis
    calculation = rfem_app.calculate_all(skip_warnings=True)
    print(f"\nCalculation:\n{calculation}")

    co1 = rfem.ObjectId(no=1, object_type=rfem.OBJECT_TYPE_LOAD_COMBINATION)
    reference = annex_b_reference()

    # Step 4: Load pattern - the normalized lateral forces are m_i * Phi_i
    lateral_forces = rfem_app.get_result_table(
        table=rfem.results.ResultTable.PUSHOVER_ANALYSIS_NORMALIZED_LATERAL_FORCES_TABLE,
        loading=co1,
    ).data
    floor_1 = lateral_forces.loc[lateral_forces['position_z'] == -STOREY_HEIGHT, 'force_x'].sum()
    roof = lateral_forces.loc[lateral_forces['position_z'] == -2 * STOREY_HEIGHT, 'force_x'].sum()
    print(f"\nLoad pattern: floor 1 / roof = {floor_1 / roof:.3f} (Phi_1 = {reference['Phi_1 [-]']:.3f})")

    # Step 5: Capacity curve, one load increment at a time.
    # load_increment_no starts at 1; a number past the last increment is rejected
    # with INVALID_ARGUMENT, which ends the loop.
    curve = []
    increment_no = 1
    while True:
        try:
            support_forces = rfem_app.get_result_table(
                table=rfem.results.ResultTable.PUSHOVER_ANALYSIS_NODES_SUPPORT_FORCES_TABLE,
                loading=co1,
                load_increment_no=increment_no,
            ).data
        except grpc.RpcError as error:
            if error.code() == grpc.StatusCode.INVALID_ARGUMENT:
                break
            raise

        deformations = rfem_app.get_result_table(
            table=rfem.results.ResultTable.PUSHOVER_ANALYSIS_NODES_GLOBAL_DEFORMATIONS_TABLE,
            loading=co1,
            load_increment_no=increment_no,
        ).data

        curve.append({
            'increment': increment_no,
            'base shear [kN]': base_shear(support_forces) / 1000,
            'roof displacement [mm]': deformations.loc[deformations['node_no'] == 5, 'u_x'].iloc[0] * 1000,
            'floor 1 displacement [mm]': deformations.loc[deformations['node_no'] == 3, 'u_x'].iloc[0] * 1000,
        })
        increment_no += 1

    curve = pd.DataFrame(curve)
    print(f"\nCapacity curve ({len(curve)} increments, every 10th and the last):")
    print(curve.iloc[list(range(0, len(curve), 10)) + [len(curve) - 1]].to_string(index=False, float_format='{:.2f}'.format))

    # Step 6: Target displacement (N2 method) - compare with the Annex B hand calculation
    target = rfem_app.get_result_table(
        table=rfem.results.ResultTable.PUSHOVER_ANALYSIS_TARGET_DISPLACEMENT_TABLE,
        loading=co1,
    ).data.iloc[-1]     # last iteration; with the iterative procedure off there is one

    d_t = target['target_displacement_mdof'] * 1000
    rfem_values = {
        'Phi_1 [-]': floor_1 / roof,
        'Gamma [-]': target['transformation_factor'],
        'm* [t]': target['mass'] / 1000,
        'sum m_i Phi_i^2 [t]': target['modal_mass'] / 1000,
        'F*_y [kN]': target['force_equivalent'] / 1000,
        'd*_y [mm]': target['yield_displacement'] * 1000,
        'T* [s]': target['period_equivalent'],
        'S_e(T*) [m/s2]': target['elastic_acceleration'],
        'd*_et [mm]': target['displacement_elastic'] * 1000,
        'd*_t [mm]': target['target_displacement_sdof'] * 1000,
        'd_t [mm]': d_t,
        # The capacity curve read at the target displacement
        'F_b at d_t [kN]': np.interp(d_t, curve['roof displacement [mm]'], curve['base shear [kN]']),
    }
    comparison = pd.DataFrame({'EN 1998-1 Annex B': reference, 'RFEM': rfem_values})
    comparison['deviation [%]'] = (comparison['RFEM'] / comparison['EN 1998-1 Annex B'] - 1) * 100
    print(f"\nTarget displacement vs. benchmark:\n{comparison.to_string(float_format='{:.3f}'.format)}")

    yield_displacement = curve['roof displacement [mm]'].iloc[-1]
    print(f"\nd_t = {d_t:.1f} mm lies inside the capacity curve, which ends at the mechanism, "
          f"{yield_displacement:.1f} mm: the frame stays elastic.")

    # The target displacement does not depend on the load increment. Asking for one
    # returns an empty table and a warning instead of an error.
    target_for_increment = rfem_app.get_result_table(
        table=rfem.results.ResultTable.PUSHOVER_ANALYSIS_TARGET_DISPLACEMENT_TABLE,
        loading=co1,
        load_increment_no=2,
    )
    print(f"Target displacement for increment 2: {len(target_for_increment.data)} rows, warning: {target_for_increment.warning}")

    # Step 7: Master increment (load_increment_no not set) - the load increment at
    # the target displacement, i.e. the performance point. The frame is elastic
    # there, so each column end carries the storey shear x h / 4: the ground storey
    # takes the base shear F_b, the upper storey the roof force F_b / (1 + Phi_1).
    master_support_forces = rfem_app.get_result_table(
        table=rfem.results.ResultTable.PUSHOVER_ANALYSIS_NODES_SUPPORT_FORCES_TABLE,
        loading=co1,
    ).data
    master_deformations = rfem_app.get_result_table(
        table=rfem.results.ResultTable.PUSHOVER_ANALYSIS_NODES_GLOBAL_DEFORMATIONS_TABLE,
        loading=co1,
    ).data
    forces = rfem_app.get_result_table(
        table=rfem.results.ResultTable.PUSHOVER_ANALYSIS_MEMBERS_INTERNAL_FORCES_TABLE,
        loading=co1,
    ).data

    master_shear = base_shear(master_support_forces) / 1000
    master_roof = master_deformations.loc[master_deformations['node_no'] == 5, 'u_x'].iloc[0] * 1000
    master_no = curve.loc[(curve['roof displacement [mm]'] - master_roof).abs().idxmin(), 'increment']
    print(f"\nMaster increment = increment {master_no} of {len(curve)}: roof {master_roof:.1f} mm "
          f"(d_t = {d_t:.1f} mm), base shear {master_shear:.1f} kN")

    storey_shear = {1: master_shear, 3: master_shear,                          # ground storey columns
                    2: master_shear * roof / (floor_1 + roof), 4: master_shear * roof / (floor_1 + roof)}
    ends = forces[forces['tag'].isna() & forces['node_no'].notna()].drop_duplicates(['member_no', 'node_no'])
    ends = ends.assign(**{
        '|M_y| [kNm]': ends['m_y'].abs() / 1000,
        'V h / 4 [kNm]': ends['member_no'].map(storey_shear) * STOREY_HEIGHT / 4,
        'M_pl [kNm]': M_PL / 1000,
    })
    print("Column end moments (members 1, 3: ground storey; 2, 4: upper storey):")
    print(ends[['member_no', 'node_no', '|M_y| [kNm]', 'V h / 4 [kNm]', 'M_pl [kNm]']].to_string(index=False, float_format='{:.1f}'.format))