Portal Frame – Incremental Method#

../../../../../_images/nonlinear_stability_portal_frame.png

Running the incremental stability method on a published portal frame benchmark (Schneider, Bautabellen für Ingenieure) and reading the results of each load increment:

  • Model the benchmark portal frame with fixed bases and a 1/200 column imperfection

  • Activate the Structure Stability add-on and define incremental stability analysis settings that save all load increments

  • Read the critical load factor from the summary table

  • Read member forces and deformations of load increment 1 with load_increment_no and compare them with Schneider, Bautabellen für Ingenieure

  • Loop over all load increments to trace the load-deflection path up to the stability limit

Keywords:
nonlinear stability incremental method load increment critical load factor second-order analysis imperfection
"""
Nonlinear stability analysis of a portal frame (incremental method).

Benchmark: portal frame under second-order theory with the reference solution
from Schneider, Bautabellen fuer Ingenieure, 19th edition, Werner Verlag 2010.

A frame with fixed column bases carries a roof load q, two column loads F and a
horizontal load H. The columns lean by the initial sway imperfection
psi0 = 1/200 (25 mm at the top). Second-order theory gives the moments and the
sway that Schneider tabulates.

The incremental method starts at load factor 1.0, so load increment 1 is exactly
this design state and can be checked against the benchmark. The analysis then
increases the load until the frame becomes unstable.

The example reads the results with get_result_table():
  - the summary table, which states the critical load factor
  - member forces and nodal deformations of load increment 1 (load_increment_no),
    compared with the benchmark values
  - the same tables for every load increment, giving the load-deflection path

Reference values for the critical load factor:
  - closed form, sway buckling of a fixed-base frame (stability functions)  -> 2.89
  - RFEM eigenvalue method                                                    -> 2.89
  - RFEM incremental method (this example), with the sway imperfection        -> 2.82
The incremental limit lies slightly below the bifurcation load, because the
imperfect frame sways from the start and its stiffness drops before it.
"""
from math import inf

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

# --- Benchmark input -------------------------------------------------------
SPAN = 6.0                      # m
HEIGHT = 5.0                    # m
IMPERFECTION = HEIGHT / 200     # m, psi0 = 1/200 -> 25 mm at the column tops
ROOF_LOAD = 10_000.0            # N/m, q
COLUMN_LOAD = 400_000.0         # N, F at each column top
HORIZONTAL_LOAD = 20_000.0      # N, H at the left column top

# Bending stiffness of the benchmark: columns EI = 4000 kNm2, beam EI = 6000 kNm2.
# Solid rectangles in S235 (E = 210 GPa) give these values within 0.03 %.
COLUMN_SECTION = 'R_M1 100/131.73'
BEAM_SECTION = 'R_M1 100/150.80'

# Schneider, Bautabellen fuer Ingenieure: second-order moments [kNm] and sway [mm]
REFERENCE = {
    'M1 base left [kNm]': 38.2,
    'M2 top left [kNm]': 22.5,
    'M3 top right [kNm]': 58.1,
    'M4 base right [kNm]': 58.8,
    'sway [mm]': 65.3,
}


def define_structure() -> list:
    """Fixed-base frame in the XZ plane, column tops shifted by the imperfection."""

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

        # Global Z points down (RFEM default), so the column tops lie at Z = -HEIGHT
        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=IMPERFECTION, coordinate_3=-HEIGHT),
        rfem.structure_core.Node(no=4, coordinate_1=SPAN + IMPERFECTION, coordinate_3=-HEIGHT),

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

        rfem.structure_core.Member(no=1, line=1, cross_section_start=1),     # left column
        rfem.structure_core.Member(no=2, line=2, cross_section_start=2),     # beam
        rfem.structure_core.Member(no=3, line=3, cross_section_start=1),     # right column

        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 column tops out of plane
        rfem.types_for_nodes.NodalSupport(
            no=2,
            nodes=[3, 4],
            spring=common.Vector3d(x=0, y=inf, z=0),
            rotational_restraint=common.Vector3d(x=0, y=0, z=0),
        ),
    ]


def define_loading() -> list:
    """The benchmark load case, analysed with the incremental stability method."""

    return [
        rfem.loading.StaticAnalysisSettings(
            no=1,
            analysis_type=rfem.loading.StaticAnalysisSettings.ANALYSIS_TYPE_SECOND_ORDER_P_DELTA,
        ),
        rfem.loading.StabilityAnalysisSettings(
            no=1,
            analysis_type=rfem.loading.StabilityAnalysisSettings.ANALYSIS_TYPE_INCREMENTALY_METHOD_WITHOUT_EIGENVALUE,
            initial_load_factor=1.0,                # increment 1 = benchmark load level
            load_factor_increment=0.1,
            refinement_of_the_last_load_increment=5,
            maximum_number_of_load_increments=100,
            save_results_of_all_increments=True,    # required for load_increment_no
        ),
        rfem.loading.LoadCase(
            no=1,
            name='Benchmark | q + F + H',
            static_analysis_settings=1,
            stability_analysis_settings=1,
            calculate_critical_load=True,
            self_weight_active=False,
        ),
        rfem.loads.MemberLoad(
            no=1,
            load_case=1,
            members=[2],
            load_distribution=rfem.loads.MemberLoad.LOAD_DISTRIBUTION_UNIFORM,
            magnitude=ROOF_LOAD,
        ),
        rfem.loads.NodalLoad(
            no=1,
            load_case=1,
            nodes=[3, 4],
            load_direction=rfem.loads.NodalLoad.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE_LENGTH,
            force_magnitude=COLUMN_LOAD,
        ),
        rfem.loads.NodalLoad(
            no=2,
            load_case=1,
            nodes=[3],
            load_direction=rfem.loads.NodalLoad.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE_LENGTH,
            force_magnitude=HORIZONTAL_LOAD,
        ),
    ]


def moment_at(forces: pd.DataFrame, member_no: int, node_no: int) -> float:
    """Bending moment M_y [kNm] of a member at one of its end nodes."""
    row = forces[(forces['member_no'] == member_no) & (forces['node_no'] == node_no) & forces['tag'].isna()]
    return abs(row['m_y'].iloc[0]) / 1000


with rfem.Application() as rfem_app:

    # Step 1: Create a new model with the Structure Stability add-on
    rfem_app.close_all_models(save_changes=False)
    rfem_app.create_model(name='nonlinear_stability_portal_frame')

    base_data = rfem_app.get_base_data()
    base_data.addons.structure_stability_active = True
    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 incremental stability analysis
    calculation = rfem_app.calculate_all(skip_warnings=True)
    print(f"\nCalculation:\n{calculation}")

    lc1 = rfem.ObjectId(no=1, object_type=rfem.OBJECT_TYPE_LOAD_CASE)

    # Step 4: Summary - the critical load factor of the whole incremental run
    summary = rfem_app.get_result_table(
        table=rfem.results.ResultTable.NONLINEAR_STABILITY_ANALYSIS_SUMMARY_TABLE,
        loading=lc1,
    ).data
    critical_load_factor = float(summary.loc[summary['description'].str.lower() == 'critical load factor', 'value'].iloc[0])
    print(f"\nCritical load factor: {critical_load_factor:.2f}")

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

    # Step 5: Load increment 1 is the benchmark load level - compare with Schneider
    forces = rfem_app.get_result_table(
        table=rfem.results.ResultTable.NONLINEAR_STABILITY_ANALYSIS_MEMBERS_INTERNAL_FORCES_TABLE,
        loading=lc1,
        load_increment_no=1,
    ).data
    deformations = rfem_app.get_result_table(
        table=rfem.results.ResultTable.NONLINEAR_STABILITY_ANALYSIS_NODES_GLOBAL_DEFORMATIONS_TABLE,
        loading=lc1,
        load_increment_no=1,
    ).data

    rfem_values = {
        'M1 base left [kNm]': moment_at(forces, member_no=1, node_no=1),
        'M2 top left [kNm]': moment_at(forces, member_no=1, node_no=3),
        'M3 top right [kNm]': moment_at(forces, member_no=3, node_no=4),
        'M4 base right [kNm]': moment_at(forces, member_no=3, node_no=2),
        'sway [mm]': deformations.loc[deformations['node_no'] == 3, 'u_x'].iloc[0] * 1000,
    }
    comparison = pd.DataFrame({'Schneider': REFERENCE, 'RFEM': rfem_values})
    comparison['deviation [%]'] = (comparison['RFEM'] / comparison['Schneider'] - 1) * 100
    print(f"\nLoad increment 1 vs. benchmark:\n{comparison.to_string(float_format='{:.2f}'.format)}")

    # Step 6: Load-deflection path, 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.
    vertical_load = 2 * COLUMN_LOAD + ROOF_LOAD * SPAN
    path = []
    increment_no = 1
    while True:
        try:
            support_forces = rfem_app.get_result_table(
                table=rfem.results.ResultTable.NONLINEAR_STABILITY_ANALYSIS_NODES_SUPPORT_FORCES_TABLE,
                loading=lc1,
                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.NONLINEAR_STABILITY_ANALYSIS_NODES_GLOBAL_DEFORMATIONS_TABLE,
            loading=lc1,
            load_increment_no=increment_no,
        ).data
        forces = rfem_app.get_result_table(
            table=rfem.results.ResultTable.NONLINEAR_STABILITY_ANALYSIS_MEMBERS_INTERNAL_FORCES_TABLE,
            loading=lc1,
            load_increment_no=increment_no,
        ).data

        # The 'loads' row holds the load applied in this increment
        applied_load = support_forces.loc[support_forces['specification'].str.lower() == 'loads', 'p_z'].iloc[0]
        path.append({
            'increment': increment_no,
            'load factor': applied_load / vertical_load,
            'sway [mm]': deformations.loc[deformations['node_no'] == 3, 'u_x'].iloc[0] * 1000,
            'M4 base right [kNm]': moment_at(forces, member_no=3, node_no=2),
        })
        increment_no += 1

    path = pd.DataFrame(path)
    print(f"\nLoad-deflection path ({len(path)} increments):\n{path.to_string(index=False, float_format='{:.2f}'.format)}")