Two-Storey Frame – N2 Method#
|
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):
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))
using System.Globalization;
using Google.Protobuf;
using Grpc.Core;
using Common = Dlubal.Api.Common;
using Rfem = Dlubal.Api.Rfem;
// -------------------------------------------------------
// 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 (loadIncrementNo),
// 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
// - support forces, deformations and member forces of the master increment
// (loadIncrementNo 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.
// -------------------------------------------------------
// --- Benchmark input -----------------------------------
const double Span = 6.0; // m
const double StoreyHeight = 4.0; // m, h
const double FloorMass = 30_000.0; // kg per floor (15 t at each column)
const double Gravity = 9.81; // m/s2
// HEB 200 in S235 (EN 10365): I_y = 5696 cm4, W_pl,y = 642.5 cm3
const string ColumnSection = "HEB 200";
const double E = 210e9; // Pa
const double IY = 5696e-8; // m4
const double WPlY = 642.5e-6; // m3
const double FY = 235e6; // Pa
const double MPl = WPlY * FY; // Nm, 151.0 kNm
const double HingeSpring = 1e12; // Nm/rad, rigid until the hinge yields at M_pl
// EN 1998-1, Table 3.2: elastic spectrum Type 1, ground type B
const double AG = 0.10 * Gravity; // m/s2, low seismicity
const double S = 1.20, TB = 0.15, TC = 0.50, TD = 2.00;
const double Eta = 1.0; // 5 % viscous damping
static double ElasticSpectrum(double period)
{
// S_e(T) [m/s2], EN 1998-1 expressions (3.2) to (3.5)
if (period <= TB) return AG * S * (1 + period / TB * (Eta * 2.5 - 1));
if (period <= TC) return AG * S * Eta * 2.5;
if (period <= TD) return AG * S * Eta * 2.5 * TC / period;
return AG * S * Eta * 2.5 * TC * TD / (period * period);
}
static (double Omega2, double Phi1) FirstMode()
{
// omega_1^2 [1/s2] and Phi_1 (roof = 1) of the two-mass shear frame
var k = 24 * E * IY / Math.Pow(StoreyHeight, 3); // both storeys alike
var m = FloorMass;
// det(K - omega^2 M) = 0 with K = [[2k, -k], [-k, k]], M = diag(m, m)
double a = m * m, b = -3 * k * m, c = k * k;
var omega2 = (-b - Math.Sqrt(b * b - 4 * a * c)) / (2 * a);
return (omega2, k / (2 * k - omega2 * m));
}
static Dictionary<string, double> AnnexBReference()
{
// Hand calculation of the benchmark, EN 1998-1 Annex B
var (omega2, phi1) = FirstMode();
var mStar = FloorMass * phi1 + FloorMass; // (B.2)
var modalMass = FloorMass * phi1 * phi1 + FloorMass; // sum m_i Phi_i^2
var gamma = mStar / modalMass; // (B.3)
var fYStar = 4 * MPl / StoreyHeight / gamma; // (B.4), ground-storey mechanism
var dYStar = fYStar / (mStar * omega2); // elastic branch along the mode
var tStar = 2 * Math.PI * Math.Sqrt(mStar * dYStar / fYStar); // (B.7)
var sE = ElasticSpectrum(tStar);
var dEtStar = sE * Math.Pow(tStar / (2 * Math.PI), 2); // (B.8)
double dTStar;
if (tStar >= TC || fYStar / mStar >= sE) // (B.9), (B.10)
{
dTStar = dEtStar;
}
else // (B.11)
{
var qU = sE * mStar / fYStar;
dTStar = Math.Max(dEtStar, dEtStar / qU * (1 + (qU - 1) * TC / tStar));
}
return new Dictionary<string, double>
{
["Phi_1 [-]"] = phi1,
["Gamma [-]"] = gamma,
["m* [t]"] = mStar / 1000,
["sum m_i Phi_i^2 [t]"] = modalMass / 1000,
["F*_y [kN]"] = fYStar / 1000,
["d*_y [mm]"] = dYStar * 1000,
["T* [s]"] = tStar,
["S_e(T*) [m/s2]"] = sE,
["d*_et [mm]"] = dEtStar * 1000,
["d*_t [mm]"] = dTStar * 1000,
["d_t [mm]"] = gamma * dTStar * 1000,
["F_b at d_t [kN]"] = gamma * mStar * sE / 1000,
};
}
static List<IMessage> DefineStructure()
{
// Two-storey frame in the XZ plane, plastic hinges at all column ends.
// Global Z points down (RFEM default): floor 1 at Z = -h, roof at Z = -2h.
Rfem.StructureCore.Member Column(int no, int line) =>
new Rfem.StructureCore.Member { No = no, Line = line, CrossSectionStart = 1, MemberHingeStart = 1, MemberHingeEnd = 1 };
return new List<IMessage>
{
new Rfem.StructureCore.Material { No = 1, Name = "S235" },
new Rfem.StructureCore.CrossSection { No = 1, Name = ColumnSection, Material = 1, ShearStiffnessDeactivated = true },
new Rfem.StructureCore.Node { No = 1, Coordinate1 = 0.0 },
new Rfem.StructureCore.Node { No = 2, Coordinate1 = Span },
new Rfem.StructureCore.Node { No = 3, Coordinate1 = 0.0, Coordinate3 = -StoreyHeight },
new Rfem.StructureCore.Node { No = 4, Coordinate1 = Span, Coordinate3 = -StoreyHeight },
new Rfem.StructureCore.Node { No = 5, Coordinate1 = 0.0, Coordinate3 = -2 * StoreyHeight },
new Rfem.StructureCore.Node { No = 6, Coordinate1 = Span, Coordinate3 = -2 * StoreyHeight },
new Rfem.StructureCore.Line { No = 1, DefinitionNodes = { 1, 3 } },
new Rfem.StructureCore.Line { No = 2, DefinitionNodes = { 3, 5 } },
new Rfem.StructureCore.Line { No = 3, DefinitionNodes = { 2, 4 } },
new Rfem.StructureCore.Line { No = 4, DefinitionNodes = { 4, 6 } },
new Rfem.StructureCore.Line { No = 5, DefinitionNodes = { 3, 4 } },
new Rfem.StructureCore.Line { No = 6, DefinitionNodes = { 5, 6 } },
new Rfem.TypesForMembers.MemberHinge
{
No = 1,
UserDefinedNameEnabled = true,
Name = "Plastic hinge | M_pl,y",
AxialReleaseN = double.PositiveInfinity,
AxialReleaseVy = double.PositiveInfinity,
AxialReleaseVz = double.PositiveInfinity,
MomentReleaseMt = double.PositiveInfinity,
// Yielding needs a finite spring: with infinity the calculation fails without a listed error
MomentReleaseMy = HingeSpring,
MomentReleaseMz = double.PositiveInfinity,
MomentReleaseMyNonlinearity = Rfem.TypesForMembers.MemberHinge.Types.MomentReleaseMyNonlinearity.PartialActivity,
PartialActivityAroundYNegativeType = Rfem.TypesForMembers.MemberHinge.Types.PartialActivityAroundYNegativeType.YieldingFromForceOrMoment,
PartialActivityAroundYNegativeMoment = MPl,
PartialActivityAroundYPositiveType = Rfem.TypesForMembers.MemberHinge.Types.PartialActivityAroundYPositiveType.YieldingFromForceOrMoment,
PartialActivityAroundYPositiveMoment = MPl,
},
Column(no: 1, line: 1),
Column(no: 2, line: 2),
Column(no: 3, line: 3),
Column(no: 4, line: 4),
new Rfem.StructureCore.Member { No = 5, Line = 5, Type = Rfem.StructureCore.Member.Types.Type.Rigid },
new Rfem.StructureCore.Member { No = 6, Line = 6, Type = Rfem.StructureCore.Member.Types.Type.Rigid },
new Rfem.TypesForNodes.NodalSupport
{
No = 1,
Nodes = { 1, 2 },
Spring = new Common.Vector3d { X = double.PositiveInfinity, Y = double.PositiveInfinity, Z = double.PositiveInfinity },
RotationalRestraint = new Common.Vector3d { X = double.PositiveInfinity, Y = double.PositiveInfinity, Z = double.PositiveInfinity },
},
// The benchmark is a plane frame: hold the floors out of plane
new Rfem.TypesForNodes.NodalSupport
{
No = 2,
Nodes = { 3, 4, 5, 6 },
Spring = new Common.Vector3d { X = 0, Y = double.PositiveInfinity, Z = 0 },
RotationalRestraint = new Common.Vector3d { X = 0, Y = 0, Z = 0 },
},
};
}
static List<IMessage> DefineLoading()
{
// Floor weights (= floor masses), modal analysis, EC8 spectrum and the pushover combination.
var spectrum = new Rfem.DynamicLoads.ResponseSpectrum.Types.UserDefinedResponseSpectrumTable();
var periods = new List<double> { 0.0, TB, TC };
for (var i = 11; i <= 80; i++) periods.Add(Math.Round(0.05 * i, 2));
foreach (var period in periods)
{
spectrum.Rows.Add(new Rfem.DynamicLoads.ResponseSpectrum.Types.UserDefinedResponseSpectrumRow
{
Period = period,
Acceleration = ElasticSpectrum(period),
});
}
return new List<IMessage>
{
new Rfem.Loading.StaticAnalysisSettings
{
No = 1,
AnalysisType = Rfem.Loading.StaticAnalysisSettings.Types.AnalysisType.GeometricallyLinear,
MassConversionEnabled = true,
},
// The floor masses act in X only: two floors give exactly two sway modes
new Rfem.Loading.ModalAnalysisSettings
{
No = 1,
NumberOfModes = 2,
SolutionMethod = Rfem.Loading.ModalAnalysisSettings.Types.SolutionMethod.Lanczos,
ActingMassesInDirectionXEnabled = true,
ActingMassesInDirectionYEnabled = false,
ActingMassesInDirectionZEnabled = false,
ActingMassesAboutAxisXEnabled = false,
ActingMassesAboutAxisYEnabled = false,
ActingMassesAboutAxisZEnabled = false,
},
new Rfem.Loading.PushoverAnalysisSettings
{
No = 1,
ConsideringIterativeProcedure = false, // Annex B.5 iteration off
EndOfCapacityCurve = Rfem.Loading.PushoverAnalysisSettings.Types.EndOfCapacityCurve.Colaps,
AutomaticSelectionOfTheHighestNode = true,
InitialLoadFactor = 0.1,
LoadFactorIncrement = 0.1,
RefinementOfTheLastLoadIncrement = 10,
MaximumNumberOfLoadIncrements = 200,
},
new Rfem.DynamicLoads.ResponseSpectrum
{
No = 1,
UserDefinedNameEnabled = true,
Name = "EN 1998-1 | Type 1 | ground B | a_g = 0.10 g",
DefinitionType = Rfem.DynamicLoads.ResponseSpectrum.Types.DefinitionType.UserDefined,
UserDefinedResponseSpectrumStepEnabled = false,
IsGFactorMode = false,
UserDefinedSpectrumSorted = true,
UserDefinedResponseSpectrum = spectrum,
},
// LC1: floor weights, converted into the floor masses
new Rfem.Loading.LoadCase
{
No = 1,
Name = "Vertical loads | floor masses",
StaticAnalysisSettings = 1,
SelfWeightActive = false,
},
new Rfem.Loads.NodalLoad
{
No = 1,
LoadCase = 1,
Nodes = { 3, 4, 5, 6 },
LoadDirection = Rfem.Loads.NodalLoad.Types.LoadDirection.GlobalZOrUserDefinedWTrueLength,
ForceMagnitude = FloorMass / 2 * Gravity,
},
// LC2: modal analysis with the masses of LC1
new Rfem.Loading.LoadCase
{
No = 2,
Name = "Modal analysis",
AnalysisType = Rfem.Loading.LoadCase.Types.AnalysisType.ModalAnalysis,
ModalAnalysisSettings = 1,
ImportMassesFrom = new Rfem.ObjectId { No = 1, ObjectType = Rfem.ObjectType.LoadCase },
},
// CO1: pushover in +X, load pattern from the first mode shape
new Rfem.Loading.LoadCombination
{
No = 1,
Name = "Pushover | +X | mode 1",
UserDefinedNameEnabled = true,
AnalysisType = Rfem.Loading.LoadCombination.Types.AnalysisType.Pushover,
StaticAnalysisSettings = 1,
PushoverAnalysisSettings = 1,
PushoverVerticalLoadsCase = new Rfem.ObjectId { No = 1, ObjectType = Rfem.ObjectType.LoadCase },
PushoverModalAnalysisFromLoadCase = 2,
PushoverDirection = Rfem.Loading.LoadCombination.Types.PushoverDirection.X,
PushoverNormalizedDisplacements = Rfem.Loading.LoadCombination.Types.PushoverNormalizedDisplacements.ModalAutomaticModalShape,
PushoverResponseSpectrum = 1,
PushoverResponseSpectrumScaleFactor = 1.0,
},
};
}
static string Text(object? value) => Convert.ToString(value, CultureInfo.InvariantCulture) ?? "";
static double ParseDouble(object? value)
{
// Table cells are strings formatted with the current culture; fall back to the invariant one.
var text = Text(value);
if (double.TryParse(text, NumberStyles.Float, CultureInfo.CurrentCulture, out var parsed)) return parsed;
return double.TryParse(text, NumberStyles.Float, CultureInfo.InvariantCulture, out parsed) ? parsed : double.NaN;
}
static IEnumerable<Microsoft.Data.Analysis.DataFrameRow> RowsWhere(Common.Table table, string columnId, string value)
{
return table.Data.Rows.Where(row => string.Equals(Text(row[columnId]), value, StringComparison.OrdinalIgnoreCase));
}
static double BaseShear(Common.Table supportForces)
{
// Sum of the horizontal support forces [kN]
var row = RowsWhere(supportForces, "specification", "support forces").FirstOrDefault();
return row is null ? double.NaN : ParseDouble(row["p_x"]) / 1000;
}
static double SwayAt(Common.Table deformations, int nodeNo)
{
// Horizontal displacement u_x [mm] of a node
var row = RowsWhere(deformations, "node_no", nodeNo.ToString(CultureInfo.InvariantCulture)).FirstOrDefault();
return row is null ? double.NaN : ParseDouble(row["u_x"]) * 1000;
}
static double LateralForceAt(Common.Table lateralForces, double z)
{
// Sum of the normalized lateral forces at the floor with global Z = z
return lateralForces.Data.Rows
.Where(row => Math.Abs(ParseDouble(row["position_z"]) - z) < 1e-6)
.Sum(row => ParseDouble(row["force_x"]));
}
static double Interpolate(double x, IReadOnlyList<double> xs, IReadOnlyList<double> ys)
{
// Linear interpolation in a rising table (the capacity curve)
for (var i = 1; i < xs.Count; i++)
{
if (x <= xs[i]) return ys[i - 1] + (ys[i] - ys[i - 1]) * (x - xs[i - 1]) / (xs[i] - xs[i - 1]);
}
return double.NaN;
}
// -------------------------------------------------------
// MAIN SCRIPT
// -------------------------------------------------------
ApplicationRfem? rfemApp = null;
try
{
// Step 1: Create a new model with the Modal and Pushover Analysis add-ons
rfemApp = new ApplicationRfem();
rfemApp.close_all_models(saveChanges: false);
rfemApp.create_model(name: "pushover_two_storey_frame");
var baseData = rfemApp.get_base_data();
baseData.Addons.ModalAnalysisActive = true;
baseData.Addons.PushoverAnalysisActive = true;
baseData.GeneralSettings.GravitationalAcceleration = Gravity;
rfemApp.set_base_data(baseData: baseData);
// Step 2: Create the structure and the loading
rfemApp.delete_all_objects();
var objects = DefineStructure();
objects.AddRange(DefineLoading());
rfemApp.create_object_list(objects);
// Step 3: Run the pushover analysis
var calculation = rfemApp.calculate_all(skipWarnings: true);
Console.WriteLine($"\nCalculation:\n{calculation}");
var co1 = new Rfem.ObjectId { No = 1, ObjectType = Rfem.ObjectType.LoadCombination };
var reference = AnnexBReference();
// Step 4: Load pattern - the normalized lateral forces are m_i * Phi_i
var lateralForces = rfemApp.get_result_table(
table: Rfem.Results.ResultTable.PushoverAnalysisNormalizedLateralForcesTable,
loading: co1);
var floor1 = LateralForceAt(lateralForces, -StoreyHeight);
var roof = LateralForceAt(lateralForces, -2 * StoreyHeight);
Console.WriteLine($"\nLoad pattern: floor 1 / roof = {floor1 / roof:F3} (Phi_1 = {reference["Phi_1 [-]"]:F3})");
// Step 5: Capacity curve, one load increment at a time.
// loadIncrementNo starts at 1; a number past the last increment is rejected
// with INVALID_ARGUMENT, which ends the loop.
var curve = new List<(int Increment, double BaseShear, double Roof, double Floor1)>();
for (var incrementNo = 1; ; incrementNo++)
{
Common.Table supportForces;
try
{
supportForces = rfemApp.get_result_table(
table: Rfem.Results.ResultTable.PushoverAnalysisNodesSupportForcesTable,
loading: co1,
loadIncrementNo: incrementNo);
}
catch (RpcException ex) when (ex.StatusCode == StatusCode.InvalidArgument)
{
break;
}
var deformations = rfemApp.get_result_table(
table: Rfem.Results.ResultTable.PushoverAnalysisNodesGlobalDeformationsTable,
loading: co1,
loadIncrementNo: incrementNo);
curve.Add((incrementNo, BaseShear(supportForces), SwayAt(deformations, nodeNo: 5), SwayAt(deformations, nodeNo: 3)));
}
Console.WriteLine($"\nCapacity curve ({curve.Count} increments, every 10th and the last):");
Console.WriteLine($"{"increment",10}{"base shear [kN]",17}{"roof displacement [mm]",24}{"floor 1 displacement [mm]",27}");
for (var i = 0; i < curve.Count; i++)
{
if (i % 10 != 0 && i != curve.Count - 1) continue;
Console.WriteLine($"{curve[i].Increment,10}{curve[i].BaseShear,17:F2}{curve[i].Roof,24:F2}{curve[i].Floor1,27:F2}");
}
// Step 6: Target displacement (N2 method) - compare with the Annex B hand calculation
var targetTable = rfemApp.get_result_table(
table: Rfem.Results.ResultTable.PushoverAnalysisTargetDisplacementTable,
loading: co1);
var target = targetTable.Data.Rows.Last(); // last iteration; with the iterative procedure off there is one
var dT = ParseDouble(target["target_displacement_mdof"]) * 1000;
var rfemValues = new Dictionary<string, double>
{
["Phi_1 [-]"] = floor1 / roof,
["Gamma [-]"] = ParseDouble(target["transformation_factor"]),
["m* [t]"] = ParseDouble(target["mass"]) / 1000,
["sum m_i Phi_i^2 [t]"] = ParseDouble(target["modal_mass"]) / 1000,
["F*_y [kN]"] = ParseDouble(target["force_equivalent"]) / 1000,
["d*_y [mm]"] = ParseDouble(target["yield_displacement"]) * 1000,
["T* [s]"] = ParseDouble(target["period_equivalent"]),
["S_e(T*) [m/s2]"] = ParseDouble(target["elastic_acceleration"]),
["d*_et [mm]"] = ParseDouble(target["displacement_elastic"]) * 1000,
["d*_t [mm]"] = ParseDouble(target["target_displacement_sdof"]) * 1000,
["d_t [mm]"] = dT,
// The capacity curve read at the target displacement
["F_b at d_t [kN]"] = Interpolate(dT, curve.Select(p => p.Roof).ToList(), curve.Select(p => p.BaseShear).ToList()),
};
Console.WriteLine("\nTarget displacement vs. benchmark:");
Console.WriteLine($"{"",-21}{"EN 1998-1 Annex B",19}{"RFEM",10}{"deviation [%]",15}");
foreach (var (name, referenceValue) in reference)
{
var rfemValue = rfemValues[name];
Console.WriteLine($"{name,-21}{referenceValue,19:F3}{rfemValue,10:F3}{(rfemValue / referenceValue - 1) * 100,15:F3}");
}
Console.WriteLine($"\nd_t = {dT:F1} mm lies inside the capacity curve, which ends at the mechanism, "
+ $"{curve[^1].Roof:F1} mm: the frame stays elastic.");
// The target displacement does not depend on the load increment. Asking for one
// returns an empty table instead of an error.
var targetForIncrement = rfemApp.get_result_table(
table: Rfem.Results.ResultTable.PushoverAnalysisTargetDisplacementTable,
loading: co1,
loadIncrementNo: 2);
Console.WriteLine($"Target displacement for increment 2: {targetForIncrement.Data.Rows.Count} rows");
// Step 7: Master increment (loadIncrementNo 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).
var masterSupportForces = rfemApp.get_result_table(
table: Rfem.Results.ResultTable.PushoverAnalysisNodesSupportForcesTable,
loading: co1);
var masterDeformations = rfemApp.get_result_table(
table: Rfem.Results.ResultTable.PushoverAnalysisNodesGlobalDeformationsTable,
loading: co1);
var forces = rfemApp.get_result_table(
table: Rfem.Results.ResultTable.PushoverAnalysisMembersInternalForcesTable,
loading: co1);
var masterShear = BaseShear(masterSupportForces);
var masterRoof = SwayAt(masterDeformations, nodeNo: 5);
var masterNo = curve.MinBy(p => Math.Abs(p.Roof - masterRoof)).Increment;
Console.WriteLine($"\nMaster increment = increment {masterNo} of {curve.Count}: roof {masterRoof:F1} mm "
+ $"(d_t = {dT:F1} mm), base shear {masterShear:F1} kN");
var upperShear = masterShear * roof / (floor1 + roof);
var storeyShear = new Dictionary<string, double> { ["1"] = masterShear, ["3"] = masterShear, ["2"] = upperShear, ["4"] = upperShear };
Console.WriteLine("Column end moments (members 1, 3: ground storey; 2, 4: upper storey):");
Console.WriteLine($"{"member_no",10}{"node_no",9}{"|M_y| [kNm]",13}{"V h / 4 [kNm]",15}{"M_pl [kNm]",12}");
var ends = forces.Data.Rows
.Where(row => Text(row["tag"]) == "" && Text(row["node_no"]) != "")
.GroupBy(row => (Text(row["member_no"]), Text(row["node_no"])))
.Select(group => group.First());
foreach (var row in ends)
{
var memberNo = Text(row["member_no"]);
Console.WriteLine($"{memberNo,10}{Text(row["node_no"]),9}{Math.Abs(ParseDouble(row["m_y"])) / 1000,13:F1}"
+ $"{storeyShear[memberNo] * StoreyHeight / 4,15:F1}{MPl / 1000,12:F1}");
}
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (rfemApp != null) rfemApp.close_connection();
}