Portal Frame – Eigenvalue Method#
|
Running the eigenvalue method on a published steel benchmark frame (Ziemian & Ziemian, Frame 1) and reading critical load factors and effective lengths:
Keywords:
stability analysis eigenvalue method critical load factor effective length direct analysis method AISC 360-16 |
"""
Linear stability (eigenvalue) analysis of a steel portal frame.
Benchmark: Frame 1 "Single story portal frame" of the steel benchmark frames by
R.D. Ziemian and C.W. Ziemian, Benchmark Frames for Structural Analysis,
Mendeley Data, V1 (2021), doi:10.17632/39sjhchwtx.1 (CC BY 4.0). The frames
accompany C.W. Ziemian, R.D. Ziemian, Efficient geometric nonlinear elastic
analysis for design of steel structures: Benchmark studies, Journal of
Constructional Steel Research 186 (2021) 106870.
A fixed-base frame (span 30 ft, height 15 ft, W14x68 columns, W18x35 beam) carries
the LRFD combination 1.2D + 1.6Lr + 0.5W as point loads at the column tops. The
Structure Stability add-on computes the critical load factors with the eigenvalue
method twice:
- load case 1 with the nominal stiffness EI
- load case 2 with the stiffness reduction of the AISC 360-16 direct analysis
method (0.8 tau_b EI), which is the stiffness the benchmark uses for its
critical buckling load ratio
The example reads the results with get_result_table():
- the critical load factors of both load cases, and the benchmark comparison
- the effective lengths and critical loads of the members in the governing mode
Reference values for the critical load factor of load case 2:
- Ziemian & Ziemian, linear buckling analysis -> 7.857
- RFEM eigenvalue method (this example) -> 7.855
"""
from math import inf
import pandas as pd
from dlubal.api import rfem, common
# --- Benchmark input (US customary units, converted to SI) ----------------
INCH = 0.0254 # m
KIP = 4448.2216152605 # N
SPAN = 360 * INCH # 30 ft
HEIGHT = 180 * INCH # 15 ft
GRAVITY_LOAD = 348.49 * KIP # 1.2D + 1.6Lr at each column top
WIND_LOAD = 34.849 * KIP # 0.5W at the left column top
# The benchmark uses A36. Its elastic modulus E = 29,000 ksi is the only material
# property an eigenvalue analysis needs, and A992 from the RFEM library has the same E.
MATERIAL = 'A992 | ASTM A992/A992M-20'
COLUMN_SECTION = 'W 14x68' # A = 20.0 in2, I = 722 in4
BEAM_SECTION = 'W 18x35' # A = 10.3 in2, I = 510 in4
# Ziemian & Ziemian, critical buckling load ratio of Frame 1 (linear buckling analysis)
REFERENCE_CRITICAL_LOAD_FACTOR = 7.857
def define_structure() -> list:
"""Fixed-base portal frame in the XZ plane of a 2D model."""
return [
rfem.structure_core.Material(no=1, name=MATERIAL),
# The benchmark neglects shear deformation
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=0.0, coordinate_3=-HEIGHT),
rfem.structure_core.Node(no=4, coordinate_1=SPAN, 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),
),
]
def define_stiffness_reduction() -> list:
"""AISC 360-16 direct analysis method stiffness reduction for all members."""
return [
rfem.types_for_members.MemberStiffnessModification(
no=1,
type=rfem.types_for_members.MemberStiffnessModification.TYPE_STEEL_STRUCTURES_AISC_360_16,
structure_design_method=rfem.types_for_members.MemberStiffnessModification.STRUCTURE_DESIGN_METHOD_LRFD,
structure_determine_tau_b=rfem.types_for_members.MemberStiffnessModification.STRUCTURE_DETERMINE_TAU_B_ITERATIVE,
),
rfem.structure_advanced.StructureModification(
no=1,
user_defined_name_enabled=True,
name='AISC 360-16 | 0.8 tau_b EI',
modify_stiffnesses_members=True,
modify_stiffnesses_member_table=rfem.structure_advanced.StructureModification.ModifyStiffnessesMemberTable(
rows=[
rfem.structure_advanced.StructureModification.ModifyStiffnessesMemberTableRow(
no=1,
member_modification=1,
members=[1, 2, 3],
),
]
),
),
]
def define_loading() -> list:
"""The benchmark loads in two load cases: nominal and reduced stiffness."""
loading = [
rfem.loading.StaticAnalysisSettings(
no=1,
analysis_type=rfem.loading.StaticAnalysisSettings.ANALYSIS_TYPE_GEOMETRICALLY_LINEAR,
),
rfem.loading.StabilityAnalysisSettings(
no=1,
analysis_type=rfem.loading.StabilityAnalysisSettings.ANALYSIS_TYPE_EIGENVALUE_METHOD,
number_of_lowest_eigenvalues=4,
),
rfem.loading.LoadCase(
no=1,
name='1.2D + 1.6Lr + 0.5W | nominal EI',
static_analysis_settings=1,
stability_analysis_settings=1,
calculate_critical_load=True,
self_weight_active=False,
),
rfem.loading.LoadCase(
no=2,
name='1.2D + 1.6Lr + 0.5W | AISC 360-16 reduced EI',
static_analysis_settings=1,
stability_analysis_settings=1,
calculate_critical_load=True,
self_weight_active=False,
structure_modification_enabled=True,
structure_modification=1,
),
]
for lc in (1, 2):
loading += [
rfem.loads.NodalLoad(
no=1,
load_case=lc,
nodes=[3, 4],
load_direction=rfem.loads.NodalLoad.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE_LENGTH,
force_magnitude=GRAVITY_LOAD,
),
rfem.loads.NodalLoad(
no=2,
load_case=lc,
nodes=[3],
load_direction=rfem.loads.NodalLoad.LOAD_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE_LENGTH,
force_magnitude=WIND_LOAD,
),
]
return loading
with rfem.Application() as rfem_app:
# Step 1: Create a new 2D model with the Structure Stability add-on.
# The benchmark frame is planar and braced out of plane, so a 2D model in the
# XZ plane excludes out-of-plane buckling of the members.
rfem_app.close_all_models(save_changes=False)
rfem_app.create_model(name='linear_stability_portal_frame')
base_data = rfem_app.get_base_data()
base_data.main.model_type = rfem.BaseData.Main.MODEL_TYPE_2D_XZ_PLANE_STRESS
base_data.main.surfaces_active = False
base_data.main.solids_active = False # solids are not available in 2D models
base_data.addons.structure_stability_active = True
rfem_app.set_base_data(base_data=base_data)
# Step 2: Create the structure, the stiffness reduction and the loading
rfem_app.delete_all_objects()
rfem_app.create_object_list(define_structure() + define_stiffness_reduction() + define_loading())
# Step 3: Run the eigenvalue analysis
calculation = rfem_app.calculate_all(skip_warnings=True)
print(f"\nCalculation:\n{calculation}")
# Step 4: Critical load factors of both load cases
critical_load_factors = {}
for lc in (1, 2):
factors = rfem_app.get_result_table(
table=rfem.results.ResultTable.STABILITY_ANALYSIS_CRITICAL_LOAD_FACTORS_TABLE,
loading=rfem.ObjectId(no=lc, object_type=rfem.OBJECT_TYPE_LOAD_CASE),
).data
print(f"\nCritical load factors | LC{lc}:\n{factors.to_string(index=False)}")
critical_load_factors[lc] = float(factors.loc[pd.to_numeric(factors['mode_no']) == 1, 'f'].iloc[0])
# 'f' is the critical load factor alpha_cr; 'alpha' is the amplification
# factor 1 / (1 - 1 / alpha_cr) that second-order effects add to the forces.
ratio = critical_load_factors[2] / critical_load_factors[1]
deviation = (critical_load_factors[2] / REFERENCE_CRITICAL_LOAD_FACTOR - 1) * 100
print(f"\nalpha_cr nominal EI: {critical_load_factors[1]:.3f}")
print(f"alpha_cr AISC 360-16 EI: {critical_load_factors[2]:.3f} (ratio {ratio:.3f})")
print(f"Ziemian & Ziemian, Frame 1: {REFERENCE_CRITICAL_LOAD_FACTOR:.3f} (deviation {deviation:+.2f} %)")
# Step 5: Effective lengths and critical loads of the columns in mode 1 (sway).
# The beam carries almost no axial force, so its values have no physical meaning.
effective_lengths = rfem_app.get_result_table(
table=rfem.results.ResultTable.STABILITY_ANALYSIS_EFFECTIVE_LENGTHS_AND_CRITICAL_LOADS_BY_MEMBER_TABLE,
loading=rfem.ObjectId(no=2, object_type=rfem.OBJECT_TYPE_LOAD_CASE),
).data
columns = effective_lengths[(pd.to_numeric(effective_lengths['mode_no']) == 1) & effective_lengths['member_no'].isin([1, 3])].copy()
columns['L [ft]'] = columns['length'] / (12 * INCH)
columns['L_cr [ft]'] = columns['effective_length_y'] / (12 * INCH)
columns['K [-]'] = columns['effective_length_factor_y']
columns['N_cr [kip]'] = columns['critical_load'] / KIP
print("\nEffective lengths and critical loads of the columns | LC2, mode 1:")
print(columns[['member_no', 'L [ft]', 'L_cr [ft]', 'K [-]', 'N_cr [kip]']].to_string(index=False, float_format='{:.2f}'.format))
using System.Globalization;
using Google.Protobuf;
using Common = Dlubal.Api.Common;
using Rfem = Dlubal.Api.Rfem;
// -------------------------------------------------------
// Linear stability (eigenvalue) analysis of a steel portal frame.
//
// Benchmark: Frame 1 "Single story portal frame" of the steel benchmark frames by
// R.D. Ziemian and C.W. Ziemian, Benchmark Frames for Structural Analysis,
// Mendeley Data, V1 (2021), doi:10.17632/39sjhchwtx.1 (CC BY 4.0). The frames
// accompany C.W. Ziemian, R.D. Ziemian, Efficient geometric nonlinear elastic
// analysis for design of steel structures: Benchmark studies, Journal of
// Constructional Steel Research 186 (2021) 106870.
//
// A fixed-base frame (span 30 ft, height 15 ft, W14x68 columns, W18x35 beam) carries
// the LRFD combination 1.2D + 1.6Lr + 0.5W as point loads at the column tops. The
// Structure Stability add-on computes the critical load factors with the eigenvalue
// method twice:
// - load case 1 with the nominal stiffness EI
// - load case 2 with the stiffness reduction of the AISC 360-16 direct analysis
// method (0.8 tau_b EI), which is the stiffness the benchmark uses for its
// critical buckling load ratio
//
// The example reads the results with get_result_table():
// - the critical load factors of both load cases, and the benchmark comparison
// - the effective lengths and critical loads of the members in the governing mode
//
// Reference values for the critical load factor of load case 2:
// - Ziemian & Ziemian, linear buckling analysis -> 7.857
// - RFEM eigenvalue method (this example) -> 7.855
// -------------------------------------------------------
// --- Benchmark input (US customary units, converted to SI) ---
const double Inch = 0.0254; // m
const double Kip = 4448.2216152605; // N
const double Span = 360 * Inch; // 30 ft
const double Height = 180 * Inch; // 15 ft
const double GravityLoad = 348.49 * Kip; // 1.2D + 1.6Lr at each column top
const double WindLoad = 34.849 * Kip; // 0.5W at the left column top
// The benchmark uses A36. Its elastic modulus E = 29,000 ksi is the only material
// property an eigenvalue analysis needs, and A992 from the RFEM library has the same E.
const string Material = "A992 | ASTM A992/A992M-20";
const string ColumnSection = "W 14x68"; // A = 20.0 in2, I = 722 in4
const string BeamSection = "W 18x35"; // A = 10.3 in2, I = 510 in4
// Ziemian & Ziemian, critical buckling load ratio of Frame 1 (linear buckling analysis)
const double ReferenceCriticalLoadFactor = 7.857;
static List<IMessage> DefineStructure()
{
// Fixed-base portal frame in the XZ plane of a 2D model.
// Global Z points down (RFEM default), so the column tops lie at Z = -Height.
return new List<IMessage>
{
new Rfem.StructureCore.Material { No = 1, Name = Material },
// The benchmark neglects shear deformation
new Rfem.StructureCore.CrossSection { No = 1, Name = ColumnSection, Material = 1, ShearStiffnessDeactivated = true },
new Rfem.StructureCore.CrossSection { No = 2, Name = BeamSection, 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 = -Height },
new Rfem.StructureCore.Node { No = 4, Coordinate1 = Span, Coordinate3 = -Height },
new Rfem.StructureCore.Line { No = 1, DefinitionNodes = { 1, 3 } },
new Rfem.StructureCore.Line { No = 2, DefinitionNodes = { 3, 4 } },
new Rfem.StructureCore.Line { No = 3, DefinitionNodes = { 2, 4 } },
new Rfem.StructureCore.Member { No = 1, Line = 1, CrossSectionStart = 1 }, // left column
new Rfem.StructureCore.Member { No = 2, Line = 2, CrossSectionStart = 2 }, // beam
new Rfem.StructureCore.Member { No = 3, Line = 3, CrossSectionStart = 1 }, // right column
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 },
},
};
}
static List<IMessage> DefineStiffnessReduction()
{
// AISC 360-16 direct analysis method stiffness reduction for all members.
return new List<IMessage>
{
new Rfem.TypesForMembers.MemberStiffnessModification
{
No = 1,
Type = Rfem.TypesForMembers.MemberStiffnessModification.Types.Type.SteelStructuresAisc36016,
StructureDesignMethod = Rfem.TypesForMembers.MemberStiffnessModification.Types.StructureDesignMethod.Lrfd,
StructureDetermineTauB = Rfem.TypesForMembers.MemberStiffnessModification.Types.StructureDetermineTauB.Iterative,
},
new Rfem.StructureAdvanced.StructureModification
{
No = 1,
UserDefinedNameEnabled = true,
Name = "AISC 360-16 | 0.8 tau_b EI",
ModifyStiffnessesMembers = true,
ModifyStiffnessesMemberTable = new Rfem.StructureAdvanced.StructureModification.Types.ModifyStiffnessesMemberTable
{
Rows =
{
new Rfem.StructureAdvanced.StructureModification.Types.ModifyStiffnessesMemberTableRow
{
No = 1,
MemberModification = 1,
Members = { 1, 2, 3 },
},
},
},
},
};
}
static List<IMessage> DefineLoading()
{
// The benchmark loads in two load cases: nominal and reduced stiffness.
var loading = new List<IMessage>
{
new Rfem.Loading.StaticAnalysisSettings
{
No = 1,
AnalysisType = Rfem.Loading.StaticAnalysisSettings.Types.AnalysisType.GeometricallyLinear,
},
new Rfem.Loading.StabilityAnalysisSettings
{
No = 1,
AnalysisType = Rfem.Loading.StabilityAnalysisSettings.Types.AnalysisType.EigenvalueMethod,
NumberOfLowestEigenvalues = 4,
},
new Rfem.Loading.LoadCase
{
No = 1,
Name = "1.2D + 1.6Lr + 0.5W | nominal EI",
StaticAnalysisSettings = 1,
StabilityAnalysisSettings = 1,
CalculateCriticalLoad = true,
SelfWeightActive = false,
},
new Rfem.Loading.LoadCase
{
No = 2,
Name = "1.2D + 1.6Lr + 0.5W | AISC 360-16 reduced EI",
StaticAnalysisSettings = 1,
StabilityAnalysisSettings = 1,
CalculateCriticalLoad = true,
SelfWeightActive = false,
StructureModificationEnabled = true,
StructureModification = 1,
},
};
foreach (var lc in new[] { 1, 2 })
{
loading.Add(new Rfem.Loads.NodalLoad
{
No = 1,
LoadCase = lc,
Nodes = { 3, 4 },
LoadDirection = Rfem.Loads.NodalLoad.Types.LoadDirection.GlobalZOrUserDefinedWTrueLength,
ForceMagnitude = GravityLoad,
});
loading.Add(new Rfem.Loads.NodalLoad
{
No = 2,
LoadCase = lc,
Nodes = { 3 },
LoadDirection = Rfem.Loads.NodalLoad.Types.LoadDirection.GlobalXOrUserDefinedUTrueLength,
ForceMagnitude = WindLoad,
});
}
return loading;
}
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;
}
// -------------------------------------------------------
// MAIN SCRIPT
// -------------------------------------------------------
ApplicationRfem? rfemApp = null;
try
{
// Step 1: Create a new 2D model with the Structure Stability add-on.
// The benchmark frame is planar and braced out of plane, so a 2D model in the
// XZ plane excludes out-of-plane buckling of the members.
rfemApp = new ApplicationRfem();
rfemApp.close_all_models(saveChanges: false);
rfemApp.create_model(name: "linear_stability_portal_frame");
var baseData = rfemApp.get_base_data();
baseData.Main.ModelType = Rfem.BaseData.Types.Main.Types.ModelType._2DXzPlaneStress;
baseData.Main.SurfacesActive = false;
baseData.Main.SolidsActive = false; // solids are not available in 2D models
baseData.Addons.StructureStabilityActive = true;
rfemApp.set_base_data(baseData: baseData);
// Step 2: Create the structure, the stiffness reduction and the loading
rfemApp.delete_all_objects();
var objects = DefineStructure();
objects.AddRange(DefineStiffnessReduction());
objects.AddRange(DefineLoading());
rfemApp.create_object_list(objects);
// Step 3: Run the eigenvalue analysis
var calculation = rfemApp.calculate_all(skipWarnings: true);
Console.WriteLine($"\nCalculation:\n{calculation}");
// Step 4: Critical load factors of both load cases
var criticalLoadFactors = new Dictionary<int, double>();
foreach (var lc in new[] { 1, 2 })
{
var factors = rfemApp.get_result_table(
table: Rfem.Results.ResultTable.StabilityAnalysisCriticalLoadFactorsTable,
loading: new Rfem.ObjectId { No = lc, ObjectType = Rfem.ObjectType.LoadCase });
Console.WriteLine($"\nCritical load factors | LC{lc}:");
factors.Print();
var mode1 = factors.Data.Rows.FirstOrDefault(row => ParseDouble(row["mode_no"]) == 1);
if (mode1 is null) { Console.WriteLine($"Mode 1 not found for LC{lc}."); return; }
criticalLoadFactors[lc] = ParseDouble(mode1["f"]);
}
// 'f' is the critical load factor alpha_cr; 'alpha' is the amplification
// factor 1 / (1 - 1 / alpha_cr) that second-order effects add to the forces.
var ratio = criticalLoadFactors[2] / criticalLoadFactors[1];
var deviation = (criticalLoadFactors[2] / ReferenceCriticalLoadFactor - 1) * 100;
Console.WriteLine($"\nalpha_cr nominal EI: {criticalLoadFactors[1]:F3}");
Console.WriteLine($"alpha_cr AISC 360-16 EI: {criticalLoadFactors[2]:F3} (ratio {ratio:F3})");
Console.WriteLine($"Ziemian & Ziemian, Frame 1: {ReferenceCriticalLoadFactor:F3} (deviation {deviation:+0.00;-0.00} %)");
// Step 5: Effective lengths and critical loads of the columns in mode 1 (sway).
// The beam carries almost no axial force, so its values have no physical meaning.
var effectiveLengths = rfemApp.get_result_table(
table: Rfem.Results.ResultTable.StabilityAnalysisEffectiveLengthsAndCriticalLoadsByMemberTable,
loading: new Rfem.ObjectId { No = 2, ObjectType = Rfem.ObjectType.LoadCase });
Console.WriteLine("\nEffective lengths and critical loads of the columns | LC2, mode 1:");
Console.WriteLine($"{"member_no",10}{"L [ft]",9}{"L_cr [ft]",11}{"K [-]",8}{"N_cr [kip]",12}");
foreach (var row in effectiveLengths.Data.Rows.Where(row => ParseDouble(row["mode_no"]) == 1))
{
var memberNo = (int)ParseDouble(row["member_no"]);
if (memberNo != 1 && memberNo != 3) continue;
Console.WriteLine(
$"{memberNo,10}" +
$"{ParseDouble(row["length"]) / (12 * Inch),9:F2}" +
$"{ParseDouble(row["effective_length_y"]) / (12 * Inch),11:F2}" +
$"{ParseDouble(row["effective_length_factor_y"]),8:F2}" +
$"{ParseDouble(row["critical_load"]) / Kip,12:F2}");
}
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
finally
{
if (rfemApp != null) rfemApp.close_connection();
}