Euler buckling of a column

The model before it is solved: its parts, supports (red) and loads (blue).
Open in 3D turn it, cut it, hide parts: in xfea's viewer, in your browser
Verification
Section titled “Verification”In the latest verification run, on 2026-11-21, through the conversion service as users solve, 1 of 1 checks pass.
| Quantity / reference from | xfea | Reference | Deviation | Tolerance | |
|---|---|---|---|---|---|
| First critical load [N] Euler, pinned-pinned: pi^2 E I / L^2 | 8737.9 | 8743.9 | 0.07 % | 2 % |
The script
Section titled “The script”examples/scripts/04_reference_cases/euler_buckling.py. Run it from the repository with uv run python examples/scripts/04_reference_cases/euler_buckling.py, or, with xfea-examples installed, xfea-examples run 04_reference_cases/euler_buckling.py.
import math
from xfea.model import GeneralBCfrom xfea.model.fields import MechanicalBCFieldfrom xfea.problem import BucklingAnalysisfrom xfea.problem import Problemfrom xfea.problem import StaticStepfrom xfea_examples import out_dirfrom xfea_examples.models import cantilever_beam_modelfrom xfea_examples.verify import check
beam_width = 15 # [mm] square cross-section widthbeam_height = 15 # [mm] square cross-section heightmesh_target = 50 # [mm] target element sizereference_load = -1_000 # [N] axial compressive preload
model, part, tip_nodes, material, section, length = cantilever_beam_model( name="reference_euler_buckling", width=beam_width, height=beam_height, target=mesh_target, fix_start=False,)
start_nodes = part.nodes.subgroup(lambda node: abs(node.x - 0.0) <= 1e-6)end_nodes = tip_nodeshinge = GeneralBC(x=False, y=True, z=True, xx=True, yy=False, zz=False)model.add_pin_bc(nodes=start_nodes)model.add_bcs(MechanicalBCField(distribution=end_nodes, condition=hinge))
problem = model.add_problem(Problem(name="buckling_reference_problem"))preload = problem.add_step(StaticStep(name="preload"))preload.add_uniform_forcefield(nodes=end_nodes, x=reference_load, load_case="service")
buckling = BucklingAnalysis(modes=3, algorithm="SUBSPACE")problem.add_step(buckling)
problem.analyse_and_extract(path=out_dir(model.name), verbose=True)
critical_load = (math.pi**2) * material.E * section.Iyy / (length**2)print("Euler buckling")print(f"- Reference critical load: {critical_load}")print(f"- First buckling factor: {buckling.mode_factor(1)}")check("First critical load [N]", buckling.mode_factor(1) * abs(reference_load), critical_load, tol_pct=2.0, unit="N", source="Euler, pinned-pinned: pi^2 E I / L^2")© 2026 Francesco Ranaudo · Text and pictures CC BY 4.0 · Code Elastic License 2.0 · how to reuse them