{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 18072 characters]",
      "text/plain": [
       "<Figure size 864x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import sympy as sym\n",
    "import matplotlib.pyplot as plt\n",
    "import stanpy as stp\n",
    "\n",
    "E = 210000000  # kN/m^2\n",
    "E = 21e7  # kN/m^2\n",
    "l1, l3 = 0.99, 0.99  # m\n",
    "l2 = 0.51  # m\n",
    "ha, hb, hd = 0.25, 0.25, 0.25  # m\n",
    "hc = 0.15  # m\n",
    "b = 0.2  # m\n",
    "t = 0.02  # m\n",
    "s = 0.015  # m\n",
    "q = 3.04  # kN/m\n",
    "P = 9.96  # kN\n",
    "Ag = b * t\n",
    "\n",
    "x_sym = sym.Symbol(\"x\")\n",
    "\n",
    "hx2 = hb - (hb - hc) / l2 * x_sym\n",
    "hx3 = hc + (hd - hc) / l3 * x_sym\n",
    "\n",
    "b_vec = np.array([b, s, b])\n",
    "h1_vec = np.array([t, ha - t, t])\n",
    "h2_vec = np.array([t, hx2 - t, t])\n",
    "h3_vec = np.array([t, hx3 - t, t])\n",
    "\n",
    "cs_props1 = stp.cs(b=b_vec, h=h1_vec)\n",
    "s1 = {\"E\": E, \"cs\": cs_props1, \"l\": l1, \"P\": (P, l1), \"bc_i\": {\"w\": 0, \"M\": 0, \"H\": 0}}\n",
    "\n",
    "cs_props2 = stp.cs(b=b_vec, h=h2_vec)\n",
    "s2 = {\"E\": E, \"cs\": cs_props2, \"q\": q, \"l\": l2}\n",
    "\n",
    "cs_props3 = stp.cs(b=b_vec, h=h3_vec)\n",
    "s3 = {\"E\": E, \"cs\": cs_props3, \"q\": q, \"l\": l3, \"bc_k\": {\"w\": 0, \"phi\": 0}}\n",
    "\n",
    "s = [s1, s2, s3]\n",
    "\n",
    "fig, ax = plt.subplots(figsize=(12, 5))\n",
    "stp.plot_system(ax, *s, render=True, facecolor=\"gray\", alpha=0.5, render_scale=0.3)\n",
    "stp.plot_load(ax, *s)\n",
    "ax.grid(linestyle=\":\")\n",
    "ax.set_axisbelow(True)\n",
    "ax.set_ylim(-0.75, 1.0)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "f5354a90490d57e8f54e2da6f5a8495dbad4b45dd4b1c233df3651b61c2b5d04"
  },
  "kernelspec": {
   "display_name": "Python 3.9.7 ('stanpy')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
