Validation EU Designation¶
All HEA, HEB, HEM, IPE section designations are supported.
The reference values are obtained from Beam Dimensions.
In [1]:
Copied!
from io import StringIO
from pandas import read_csv
section_table = read_csv(
StringIO("""
designation,h,b,tw,tf,hi,A,Iy,Iz
HEA100,96,100,5,8,80,21.2,349.2,133.8
HEA120,114,120,5,8,98,25.3,606.2,230.9
HEA140,133,140,5.5,8.5,116,31.4,1033,389.3
HEA160,152,160,6,9,134,38.8,1673,615.6
HEA180,171,180,6,9.5,152,45.3,2510,924.6
HEA200,190,200,6.5,10,170,53.8,3692,1336
HEA220,210,220,7,11,188,64.3,5410,1955
HEA240,230,240,7.5,12,206,76.8,7763,2769
HEA260,250,260,7.5,12.5,225,86.8,10450,3668
HEA280,270,280,8,13,244,97.3,13670,4763
HEA300,290,300,8.5,14,262,112.5,18260,6310
HEA320,310,300,9,15.5,279,124.4,22930,6985
HEA340,330,300,9.5,16.5,297,133.5,27690,7436
HEA360,350,300,10,17.5,315,142.8,33090,7887
HEA400,390,300,11,19,352,159,45070,8564
HEA450,440,300,11.5,21,398,178,63720,9465
HEA500,490,300,12,23,444,197.5,86970,10370
HEA550,540,300,12.5,24,492,211.8,111900,10820
HEA600,590,300,13,25,540,226.5,141200,11270
HEA650,640,300,13.5,26,588,241.6,175200,11720
HEA700,690,300,14.5,27,636,260.5,215300,12180
HEA800,790,300,15,28,734,285.8,303400,12640
HEA900,890,300,16,30,830,320.5,422100,13550
HEA1000,990,300,16.5,31,928,346.8,553800,14000
HEB100,100,100,6,10,80,26,449.5,167.3
HEB120,120,120,6.5,11,98,34,864.4,317.5
HEB140,140,140,7,12,116,43,1509,549.7
HEB160,160,160,8,13,134,54.3,2492,889.2
HEB180,180,180,8.5,14,152,65.3,3831,1363
HEB200,200,200,9,15,170,78.1,5696,2003
HEB220,220,220,9.5,16,188,91,8091,2843
HEB240,240,240,10,17,206,106,11260,3923
HEB260,260,260,10,17.5,225,118.4,14920,5135
HEB280,280,280,10.5,18,244,131.4,19270,6595
HEB300,300,300,11,19,262,149.1,25170,8563
HEB320,320,300,11.5,20.5,279,161.3,30820,9239
HEB340,340,300,12,21.5,297,170.9,36660,9690
HEB360,360,300,12.5,22.5,315,180.6,43190,10140
HEB400,400,300,13.5,24,352,197.8,57680,10820
HEB450,450,300,14,26,398,218,79890,11720
HEB500,500,300,14.5,28,444,238.6,107200,12620
HEB550,550,300,15,29,492,254.1,136700,13080
HEB600,600,300,15.5,30,540,270,171000,13530
HEB650,650,300,16,31,588,286.3,210600,13980
HEB700,700,300,17,32,636,306.4,256900,14440
HEB800,800,300,17.5,33,734,334.2,359100,14900
HEB900,900,300,18.5,35,830,371.3,494100,15820
HEB1000,1000,300,19,36,928,400,644700,16280
HEM100,120,106,12,20,80,53.2,1143,399.2
HEM120,140,126,12.5,21,98,66.4,2018,702.8
HEM140,160,146,13,22,116,80.6,3291,1144
HEM160,180,166,14,23,134,97.1,5098,1759
HEM180,200,186,14.5,24,152,113.3,7483,2580
HEM200,220,206,15,25,170,131.3,10640,3651
HEM220,240,226,15.5,26,188,149.4,14600,5012
HEM240,270,248,18,32,206,199.6,24290,8153
HEM260,290,268,18,33,225,219.6,31310,10450
HEM280,310,288,18.5,33,244,240.2,39550,13160
HEM300,340,310,21,39,262,303.1,59200,19400
HEM320,359,309,21,40,279,312,68130,19710
HEM340,377,309,21,40,297,315.8,76370,19710
HEM360,395,308,21,40,315,318.8,84870,19520
HEM400,432,307,21,40,352,325.8,104100,19340
HEM450,478,307,21,40,398,335.4,131500,19340
HEM500,524,306,21,40,444,344.3,161900,19150
HEM550,572,306,21,40,492,354.4,198000,19160
HEM600,620,305,21,40,540,363.7,237400,18980
HEM650,668,305,21,40,588,373.7,281700,18980
HEM700,716,304,21,40,636,383,329300,18800
HEM800,814,303,21,40,734,404.3,442600,18630
HEM900,910,302,21,40,830,423.6,570400,18450
HEM1000,1008,302,21,40,928,444.2,722300,18460
IPE80,80,46,3.8,5.2,69.6,7.6,80,8.5
IPE100,100,55,4.1,5.7,88.6,10.3,171,15.9
IPE120,120,64,4.4,6.3,107.4,13.2,318,27.7
IPE140,140,73,4.7,6.9,126.2,16.4,541,44.9
IPE160,160,82,5,7.4,145.2,20.1,869,68.3
IPE180,180,91,5.3,8,164,23.9,1317,101
IPE200,200,100,5.6,8.5,183,28.5,1943,142
IPE220,220,110,5.9,9.2,201.6,33.4,2772,205
IPE240,240,120,6.2,9.8,220.4,39.1,3892,284
IPE270,270,135,6.6,10.2,249.6,45.9,5790,420
IPE300,300,150,7.1,10.7,278.6,53.8,8356,604
IPE330,330,160,7.5,11.5,307,62.6,11770,788
IPE360,360,170,8,12.7,334.6,72.7,16270,1043
IPE400,400,180,8.6,13.5,373,84.5,23130,1318
IPE450,450,190,9.4,14.6,420.8,98.8,33740,1676
IPE500,500,200,10.2,16,468,115.5,48200,2142
IPE550,550,210,11.1,17.2,515.6,134.4,67120,2668
IPE600,600,220,12,19,562,156,92080,3387
""")
)
def get_properties(designation: str):
section = section_table[section_table["designation"] == designation]
return (
1e2 * section["A"].values[0],
1e4 * section["Iy"].values[0],
1e4 * section["Iz"].values[0],
)
from io import StringIO from pandas import read_csv section_table = read_csv( StringIO(""" designation,h,b,tw,tf,hi,A,Iy,Iz HEA100,96,100,5,8,80,21.2,349.2,133.8 HEA120,114,120,5,8,98,25.3,606.2,230.9 HEA140,133,140,5.5,8.5,116,31.4,1033,389.3 HEA160,152,160,6,9,134,38.8,1673,615.6 HEA180,171,180,6,9.5,152,45.3,2510,924.6 HEA200,190,200,6.5,10,170,53.8,3692,1336 HEA220,210,220,7,11,188,64.3,5410,1955 HEA240,230,240,7.5,12,206,76.8,7763,2769 HEA260,250,260,7.5,12.5,225,86.8,10450,3668 HEA280,270,280,8,13,244,97.3,13670,4763 HEA300,290,300,8.5,14,262,112.5,18260,6310 HEA320,310,300,9,15.5,279,124.4,22930,6985 HEA340,330,300,9.5,16.5,297,133.5,27690,7436 HEA360,350,300,10,17.5,315,142.8,33090,7887 HEA400,390,300,11,19,352,159,45070,8564 HEA450,440,300,11.5,21,398,178,63720,9465 HEA500,490,300,12,23,444,197.5,86970,10370 HEA550,540,300,12.5,24,492,211.8,111900,10820 HEA600,590,300,13,25,540,226.5,141200,11270 HEA650,640,300,13.5,26,588,241.6,175200,11720 HEA700,690,300,14.5,27,636,260.5,215300,12180 HEA800,790,300,15,28,734,285.8,303400,12640 HEA900,890,300,16,30,830,320.5,422100,13550 HEA1000,990,300,16.5,31,928,346.8,553800,14000 HEB100,100,100,6,10,80,26,449.5,167.3 HEB120,120,120,6.5,11,98,34,864.4,317.5 HEB140,140,140,7,12,116,43,1509,549.7 HEB160,160,160,8,13,134,54.3,2492,889.2 HEB180,180,180,8.5,14,152,65.3,3831,1363 HEB200,200,200,9,15,170,78.1,5696,2003 HEB220,220,220,9.5,16,188,91,8091,2843 HEB240,240,240,10,17,206,106,11260,3923 HEB260,260,260,10,17.5,225,118.4,14920,5135 HEB280,280,280,10.5,18,244,131.4,19270,6595 HEB300,300,300,11,19,262,149.1,25170,8563 HEB320,320,300,11.5,20.5,279,161.3,30820,9239 HEB340,340,300,12,21.5,297,170.9,36660,9690 HEB360,360,300,12.5,22.5,315,180.6,43190,10140 HEB400,400,300,13.5,24,352,197.8,57680,10820 HEB450,450,300,14,26,398,218,79890,11720 HEB500,500,300,14.5,28,444,238.6,107200,12620 HEB550,550,300,15,29,492,254.1,136700,13080 HEB600,600,300,15.5,30,540,270,171000,13530 HEB650,650,300,16,31,588,286.3,210600,13980 HEB700,700,300,17,32,636,306.4,256900,14440 HEB800,800,300,17.5,33,734,334.2,359100,14900 HEB900,900,300,18.5,35,830,371.3,494100,15820 HEB1000,1000,300,19,36,928,400,644700,16280 HEM100,120,106,12,20,80,53.2,1143,399.2 HEM120,140,126,12.5,21,98,66.4,2018,702.8 HEM140,160,146,13,22,116,80.6,3291,1144 HEM160,180,166,14,23,134,97.1,5098,1759 HEM180,200,186,14.5,24,152,113.3,7483,2580 HEM200,220,206,15,25,170,131.3,10640,3651 HEM220,240,226,15.5,26,188,149.4,14600,5012 HEM240,270,248,18,32,206,199.6,24290,8153 HEM260,290,268,18,33,225,219.6,31310,10450 HEM280,310,288,18.5,33,244,240.2,39550,13160 HEM300,340,310,21,39,262,303.1,59200,19400 HEM320,359,309,21,40,279,312,68130,19710 HEM340,377,309,21,40,297,315.8,76370,19710 HEM360,395,308,21,40,315,318.8,84870,19520 HEM400,432,307,21,40,352,325.8,104100,19340 HEM450,478,307,21,40,398,335.4,131500,19340 HEM500,524,306,21,40,444,344.3,161900,19150 HEM550,572,306,21,40,492,354.4,198000,19160 HEM600,620,305,21,40,540,363.7,237400,18980 HEM650,668,305,21,40,588,373.7,281700,18980 HEM700,716,304,21,40,636,383,329300,18800 HEM800,814,303,21,40,734,404.3,442600,18630 HEM900,910,302,21,40,830,423.6,570400,18450 HEM1000,1008,302,21,40,928,444.2,722300,18460 IPE80,80,46,3.8,5.2,69.6,7.6,80,8.5 IPE100,100,55,4.1,5.7,88.6,10.3,171,15.9 IPE120,120,64,4.4,6.3,107.4,13.2,318,27.7 IPE140,140,73,4.7,6.9,126.2,16.4,541,44.9 IPE160,160,82,5,7.4,145.2,20.1,869,68.3 IPE180,180,91,5.3,8,164,23.9,1317,101 IPE200,200,100,5.6,8.5,183,28.5,1943,142 IPE220,220,110,5.9,9.2,201.6,33.4,2772,205 IPE240,240,120,6.2,9.8,220.4,39.1,3892,284 IPE270,270,135,6.6,10.2,249.6,45.9,5790,420 IPE300,300,150,7.1,10.7,278.6,53.8,8356,604 IPE330,330,160,7.5,11.5,307,62.6,11770,788 IPE360,360,170,8,12.7,334.6,72.7,16270,1043 IPE400,400,180,8.6,13.5,373,84.5,23130,1318 IPE450,450,190,9.4,14.6,420.8,98.8,33740,1676 IPE500,500,200,10.2,16,468,115.5,48200,2142 IPE550,550,210,11.1,17.2,515.6,134.4,67120,2668 IPE600,600,220,12,19,562,156,92080,3387 """) ) def get_properties(designation: str): section = section_table[section_table["designation"] == designation] return ( 1e2 * section["A"].values[0], 1e4 * section["Iy"].values[0], 1e4 * section["Iz"].values[0], )
In [2]:
Copied!
import subprocess
import tempfile
import matplotlib.pyplot as plt
template = """
node 1 0 0 0
material Elastic1D 1 1
section EU3D $designation$ 1 1 1
element SingleSection3D 1 1 1
displacement 1 0 1 axial 1
displacement 2 0 1 rs 1
displacement 3 0 1 rw 1
step static 1 1
set ini_step_size 1
analyze
peek node 1
exit
"""
all_results = {}
def validate(designation: str):
def run_analysis():
with tempfile.NamedTemporaryFile() as fp:
with open(fp.name, "w") as f:
f.write(template.replace("$designation$", designation))
result = (
subprocess.check_output(["suanpan", "-nu", "-nc", "-f", fp.name])
.decode("utf-8")
.splitlines()
)
for i, line in enumerate(result):
if line.startswith("Resistance"):
return [float(x) for x in result[i + 1].split()]
if result := run_analysis():
all_results[designation] = [
x / y for x, y in zip(result, get_properties(designation))
]
for _, row in section_table.iterrows():
validate(row["designation"])
import subprocess import tempfile import matplotlib.pyplot as plt template = """ node 1 0 0 0 material Elastic1D 1 1 section EU3D $designation$ 1 1 1 element SingleSection3D 1 1 1 displacement 1 0 1 axial 1 displacement 2 0 1 rs 1 displacement 3 0 1 rw 1 step static 1 1 set ini_step_size 1 analyze peek node 1 exit """ all_results = {} def validate(designation: str): def run_analysis(): with tempfile.NamedTemporaryFile() as fp: with open(fp.name, "w") as f: f.write(template.replace("$designation$", designation)) result = ( subprocess.check_output(["suanpan", "-nu", "-nc", "-f", fp.name]) .decode("utf-8") .splitlines() ) for i, line in enumerate(result): if line.startswith("Resistance"): return [float(x) for x in result[i + 1].split()] if result := run_analysis(): all_results[designation] = [ x / y for x, y in zip(result, get_properties(designation)) ] for _, row in section_table.iterrows(): validate(row["designation"])
In [3]:
Copied!
fig = plt.figure(figsize=(15, 10), tight_layout=True)
def plot(title, index):
values = [x[index] for x in all_results.values()]
min_value = min(values)
max_value = max(values)
colors = ["red" if abs(x - 1) > 0.05 else "green" for x in values]
ax = fig.add_subplot(3, 1, index + 1)
ax.bar(all_results.keys(), values, color=colors)
ax.set_ylabel("Numerical/Analytical")
ax.set_xlabel("Section")
ax.set_ybound(min_value - 0.02, max_value + 0.01)
ax.set_xlim(-1, len(all_results))
ax.grid()
for i, v in enumerate(values):
ax.text(
i, min_value - 0.01, f"{v:.3f}", horizontalalignment="center", rotation=90
)
ax.set_title(title)
ax.set_xticks(ax.get_xticks())
ax.set_xticklabels(ax.get_xticklabels(), rotation=90)
plot("EU Area", 0)
plot("EU Strong Axis Moment of Inertia", 1)
plot("EU Weak Axis Moment of Inertia", 2)
fig.savefig("EU.pdf")
fig = plt.figure(figsize=(15, 10), tight_layout=True) def plot(title, index): values = [x[index] for x in all_results.values()] min_value = min(values) max_value = max(values) colors = ["red" if abs(x - 1) > 0.05 else "green" for x in values] ax = fig.add_subplot(3, 1, index + 1) ax.bar(all_results.keys(), values, color=colors) ax.set_ylabel("Numerical/Analytical") ax.set_xlabel("Section") ax.set_ybound(min_value - 0.02, max_value + 0.01) ax.set_xlim(-1, len(all_results)) ax.grid() for i, v in enumerate(values): ax.text( i, min_value - 0.01, f"{v:.3f}", horizontalalignment="center", rotation=90 ) ax.set_title(title) ax.set_xticks(ax.get_xticks()) ax.set_xticklabels(ax.get_xticklabels(), rotation=90) plot("EU Area", 0) plot("EU Strong Axis Moment of Inertia", 1) plot("EU Weak Axis Moment of Inertia", 2) fig.savefig("EU.pdf")
In [4]:
Copied!
import json
eu_section = {}
for key, value in all_results.items():
num_ip = 6
eu_section[f"{key}-2D"] = {
"prefix": key,
"description": f"EU 2D section {key}, accuracy: {value[0]:.2f}/{value[1]:.2f}",
"body": [
f"section EU2D {key} " + "${1:(1)} ${2:(2)} ${3:[3]} ${4:[4]} ${5:[5]}",
"# (1) int, unique tag",
"# (2) int, material tag",
"# [3] double, scale, default: 1.0",
f"# [4] int, number of integration points, default: {num_ip}",
"# [5] double, eccentricity, default: 0.0",
"",
],
}
eu_section[f"{key}-3D"] = {
"prefix": key,
"description": f"EU 3D section {key}, accuracy: {value[0]:.2f}/{value[1]:.2f}/{value[2]:.2f}",
"body": [
f"section EU3D {key} "
+ "${1:(1)} ${2:(2)} ${3:[3]} ${4:[4]} ${5:[5]} ${6:[6]}",
"# (1) int, unique tag",
"# (2) int, material tag",
"# [3] double, scale, default: 1.0",
f"# [4] int, number of integration points, default: {num_ip}",
"# [5] double, eccentricity of y axis, default: 0.0",
"# [6] double, eccentricity of z axis, default: 0.0",
"",
],
}
with open("eu_sections_completion.json", "w") as f:
json.dump({k: v for k, v in sorted(eu_section.items())}, f, indent=4)
highlighting = []
for key in sorted(all_results.keys()):
highlighting.append(
{
"name": "support.constant.section",
"match": "\\b(?i)" + key.replace(".", "\\.") + "\\b",
},
)
with open("eu_sections_highlight.json", "w") as f:
json.dump(highlighting, f, indent=4)
print(
r"\b(?i)("
+ "|".join([x.replace(".", r"\.") for x in sorted(all_results.keys())])
+ r")\b"
)
import json eu_section = {} for key, value in all_results.items(): num_ip = 6 eu_section[f"{key}-2D"] = { "prefix": key, "description": f"EU 2D section {key}, accuracy: {value[0]:.2f}/{value[1]:.2f}", "body": [ f"section EU2D {key} " + "${1:(1)} ${2:(2)} ${3:[3]} ${4:[4]} ${5:[5]}", "# (1) int, unique tag", "# (2) int, material tag", "# [3] double, scale, default: 1.0", f"# [4] int, number of integration points, default: {num_ip}", "# [5] double, eccentricity, default: 0.0", "", ], } eu_section[f"{key}-3D"] = { "prefix": key, "description": f"EU 3D section {key}, accuracy: {value[0]:.2f}/{value[1]:.2f}/{value[2]:.2f}", "body": [ f"section EU3D {key} " + "${1:(1)} ${2:(2)} ${3:[3]} ${4:[4]} ${5:[5]} ${6:[6]}", "# (1) int, unique tag", "# (2) int, material tag", "# [3] double, scale, default: 1.0", f"# [4] int, number of integration points, default: {num_ip}", "# [5] double, eccentricity of y axis, default: 0.0", "# [6] double, eccentricity of z axis, default: 0.0", "", ], } with open("eu_sections_completion.json", "w") as f: json.dump({k: v for k, v in sorted(eu_section.items())}, f, indent=4) highlighting = [] for key in sorted(all_results.keys()): highlighting.append( { "name": "support.constant.section", "match": "\\b(?i)" + key.replace(".", "\\.") + "\\b", }, ) with open("eu_sections_highlight.json", "w") as f: json.dump(highlighting, f, indent=4) print( r"\b(?i)(" + "|".join([x.replace(".", r"\.") for x in sorted(all_results.keys())]) + r")\b" )
\b(?i)(HEA100|HEA1000|HEA120|HEA140|HEA160|HEA180|HEA200|HEA220|HEA240|HEA260|HEA280|HEA300|HEA320|HEA340|HEA360|HEA400|HEA450|HEA500|HEA550|HEA600|HEA650|HEA700|HEA800|HEA900|HEB100|HEB1000|HEB120|HEB140|HEB160|HEB180|HEB200|HEB220|HEB240|HEB260|HEB280|HEB300|HEB320|HEB340|HEB360|HEB400|HEB450|HEB500|HEB550|HEB600|HEB650|HEB700|HEB800|HEB900|HEM100|HEM1000|HEM120|HEM140|HEM160|HEM180|HEM200|HEM220|HEM240|HEM260|HEM280|HEM300|HEM320|HEM340|HEM360|HEM400|HEM450|HEM500|HEM550|HEM600|HEM650|HEM700|HEM800|HEM900|IPE100|IPE120|IPE140|IPE160|IPE180|IPE200|IPE220|IPE240|IPE270|IPE300|IPE330|IPE360|IPE400|IPE450|IPE500|IPE550|IPE600|IPE80)\b