Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Dec 30, 2024
1 parent c3a9aef commit 310bd92
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions docs/Library/Section/Code/Validation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,21 @@
"import matplotlib.pyplot as plt\n",
"\n",
"\n",
"fig = plt.figure(figsize=(100, 40), tight_layout=True)\n",
"\n",
"\n",
"hss_results = {k: v for k, v in all_results.items() if k.startswith(\"HSS\")}\n",
"i_results = {k: v for k, v in all_results.items() if not k.startswith(\"HSS\")}\n",
"fig = plt.figure(figsize=(100, 80), tight_layout=True)\n",
"\n",
"\n",
"rhs_results = {\n",
" k: v for k, v in all_results.items() if k.startswith(\"HSS\") and k.count(\"X\") == 2\n",
"}\n",
"chs_results = {\n",
" k: v for k, v in all_results.items() if k.startswith(\"HSS\") and k.count(\"X\") == 1\n",
"}\n",
"i_results = {\n",
" k: v for k, v in all_results.items() if not k.startswith(\"HSS\") and \"T\" not in k\n",
"}\n",
"t_results = {\n",
" k: v for k, v in all_results.items() if not k.startswith(\"HSS\") and \"T\" in k\n",
"}\n",
"\n",
"counter = 0\n",
"\n",
Expand All @@ -202,7 +212,7 @@
" colors = [\"red\" if abs(x - 1) > 0.05 else \"green\" for x in values]\n",
" global counter\n",
" counter += 1\n",
" ax = fig.add_subplot(610 + counter)\n",
" ax = fig.add_subplot(12, 1, counter)\n",
" ax.bar(results.keys(), values, color=colors)\n",
" ax.set_ylabel(\"Numerical/Analytical\")\n",
" ax.set_xlabel(\"Section\")\n",
Expand All @@ -220,12 +230,18 @@
" ax.set_xticklabels(ax.get_xticklabels(), rotation=90)\n",
"\n",
"\n",
"plot(\"Area\", 0, hss_results)\n",
"plot(\"Strong Axis Moment of Inertia\", 1, hss_results)\n",
"plot(\"Weak Axis Moment of Inertia\", 2, hss_results)\n",
"plot(\"Area\", 0, i_results)\n",
"plot(\"Strong Axis Moment of Inertia\", 1, i_results)\n",
"plot(\"Weak Axis Moment of Inertia\", 2, i_results)"
"plot(\"HSS (Rectangle) Area\", 0, rhs_results)\n",
"plot(\"HSS (Rectangle) Strong Axis Moment of Inertia\", 1, rhs_results)\n",
"plot(\"HSS (Rectangle) Weak Axis Moment of Inertia\", 2, rhs_results)\n",
"plot(\"HSS (Circle) Area\", 0, chs_results)\n",
"plot(\"HSS (Circle) Strong Axis Moment of Inertia\", 1, chs_results)\n",
"plot(\"HSS (Circle) Weak Axis Moment of Inertia\", 2, chs_results)\n",
"plot(\"I-Section Area\", 0, i_results)\n",
"plot(\"I-Section Strong Axis Moment of Inertia\", 1, i_results)\n",
"plot(\"I-Section Weak Axis Moment of Inertia\", 2, i_results)\n",
"plot(\"T-Section Area\", 0, t_results)\n",
"plot(\"T-Section Strong Axis Moment of Inertia\", 1, t_results)\n",
"plot(\"T-Section Weak Axis Moment of Inertia\", 2, t_results)"
]
},
{
Expand Down Expand Up @@ -279,7 +295,6 @@
"outputs": [],
"source": [
"us_section = {}\n",
"key: str\n",
"for key, value in all_results.items():\n",
" num_ip = 10 if \"HSS\" in key and key.count(\"X\") == 1 else 6\n",
"\n",
Expand Down

0 comments on commit 310bd92

Please sign in to comment.