{ "cells": [ { "cell_type": "markdown", "id": "0d27a81e", "metadata": {}, "source": [ "# Advanced Plotting of Beam Results\n", "\n", "In this notebook we perform linear static analysis of a simply-supported Euler-Bernoulli beam and we plot the results with `Matplotlib`." ] }, { "cell_type": "markdown", "id": "6691645a", "metadata": {}, "source": [ "## Inputs" ] }, { "cell_type": "code", "execution_count": 15, "id": "39404ef1", "metadata": {}, "outputs": [], "source": [ "a = 1.5 # m\n", "b = 1.5 # m\n", "c = 4.0 # m\n", "d = 1.5 # m\n", "e = 1.5 # m\n", "\n", "number_of_modes = 200 # The number of Fourier modes to consider\n", "F = 1.0 # The value of the concentrated load in kN\n", "M = 3.0 # The value of the constant moment in kN.m\n", "q = 0.5 # The value of the uniformly distributed load in kN/m\n", "\n", "E = 210000.0 # The modulus of elasticity in kN/m^2\n", "I = 8.333e-4 # The moment of inertia of the beam cross-section in m^4" ] }, { "cell_type": "markdown", "id": "60f9a60b", "metadata": {}, "source": [ "## Define the Beam and the Loads" ] }, { "cell_type": "code", "execution_count": 16, "id": "43460109", "metadata": {}, "outputs": [], "source": [ "from sigmaepsilon.solid.fourier import NavierBeam\n", "\n", "beam_length = a + b + c + d + e # The length of the beam in m\n", "beam = NavierBeam(beam_length, number_of_modes, EI=E * I)" ] }, { "cell_type": "code", "execution_count": 17, "id": "a3c57480", "metadata": {}, "outputs": [], "source": [ "from sigmaepsilon.solid.fourier import LoadGroup, PointLoad, LineLoad\n", "\n", "loads = LoadGroup(\n", " concentrated=LoadGroup(\n", " LC1=PointLoad(a, [-F, 0.0]),\n", " LC2=PointLoad(a + b + c + d, [0.0, M]),\n", " ),\n", " distributed=LoadGroup(\n", " LC3=LineLoad([a + b, a + b + c], [-q, 0.0]),\n", " ),\n", ")" ] }, { "cell_type": "markdown", "id": "e55f7667", "metadata": {}, "source": [ "## Calculate Response and Inspect Results" ] }, { "cell_type": "code", "execution_count": 18, "id": "afb00252", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Execution time: 0.0080 seconds\n" ] } ], "source": [ "import numpy as np\n", "import time\n", "\n", "# the locations of the points where the solution is calculated\n", "# 500 points along the beam length\n", "points = np.linspace(0, beam_length, 500)\n", "\n", "start_time = time.time()\n", "solution = beam.linear_static_analysis(points, loads)\n", "end_time = time.time()\n", "print(f\"Execution time: {end_time - start_time:.4f} seconds\")" ] }, { "cell_type": "markdown", "id": "547a04af", "metadata": {}, "source": [ "Collect all results for all load cases and stack them on top of each other into one Pandas DataFrame." ] }, { "cell_type": "code", "execution_count": 19, "id": "8aee78dd", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Processing load case: ['concentrated', 'LC1']\n", "Processing load case: ['concentrated', 'LC2']\n", "Processing load case: ['distributed', 'LC3']\n", "Result components: ['UY', 'ROTZ', 'CZ', 'EXY', 'MZ', 'SY']\n" ] }, { "data": { "text/html": [ "
| \n", " | UY | \n", "ROTZ | \n", "CZ | \n", "EXY | \n", "MZ | \n", "SY | \n", "
|---|---|---|---|---|---|---|
| load_index | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
| 0 | \n", "0.000000e+00 | \n", "-0.063443 | \n", "0.000000e+00 | \n", "0.0 | \n", "0.000000e+00 | \n", "-1.843372 | \n", "
| 1 | \n", "-1.271398e-03 | \n", "-0.063441 | \n", "2.028609e-04 | \n", "0.0 | \n", "3.549925e-02 | \n", "-1.847969 | \n", "
| 2 | \n", "-2.542715e-03 | \n", "-0.063436 | \n", "3.703951e-04 | \n", "0.0 | \n", "6.481655e-02 | \n", "-1.855388 | \n", "
| 3 | \n", "-3.813884e-03 | \n", "-0.063427 | \n", "5.164938e-04 | \n", "0.0 | \n", "9.038279e-02 | \n", "-1.855338 | \n", "
| 4 | \n", "-5.084846e-03 | \n", "-0.063415 | \n", "6.849132e-04 | \n", "0.0 | \n", "1.198550e-01 | \n", "-1.847876 | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 495 | \n", "-3.865275e-03 | \n", "0.048201 | \n", "6.868998e-04 | \n", "0.0 | \n", "1.202027e-01 | \n", "1.149879 | \n", "
| 496 | \n", "-2.899191e-03 | \n", "0.048213 | \n", "5.174448e-04 | \n", "0.0 | \n", "9.054921e-02 | \n", "1.150308 | \n", "
| 497 | \n", "-1.932899e-03 | \n", "0.048222 | \n", "3.194507e-04 | \n", "0.0 | \n", "5.590163e-02 | \n", "1.150310 | \n", "
| 498 | \n", "-9.664785e-04 | \n", "0.048226 | \n", "1.407576e-04 | \n", "0.0 | \n", "2.463159e-02 | \n", "1.149883 | \n", "
| 499 | \n", "-1.878492e-17 | \n", "0.048228 | \n", "-2.796748e-18 | \n", "0.0 | \n", "-4.894114e-16 | \n", "1.149618 | \n", "
500 rows × 6 columns
\n", "