{"id":23147598,"url":"https://github.com/harrytwigg/aero-calculators","last_synced_at":"2025-04-04T13:42:19.263Z","repository":{"id":162176652,"uuid":"384913939","full_name":"harrytwigg/aero-calculators","owner":"harrytwigg","description":"Calculators for the SESA2025 and FEEG2005 modules at the University of Southampton. Includes cross-section, beams, and pin-jointed truss analysis","archived":false,"fork":false,"pushed_at":"2021-07-11T10:10:37.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T23:26:53.253Z","etag":null,"topics":["aero-calculator","engineering-calculator","feeg2005","sesa2025","statics","structural-engineering"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harrytwigg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-11T10:01:36.000Z","updated_at":"2021-07-11T10:26:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c58e791-1e14-4751-b8c5-3a4ce46af964","html_url":"https://github.com/harrytwigg/aero-calculators","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrytwigg%2Faero-calculators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrytwigg%2Faero-calculators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrytwigg%2Faero-calculators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrytwigg%2Faero-calculators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harrytwigg","download_url":"https://codeload.github.com/harrytwigg/aero-calculators/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247188450,"owners_count":20898514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aero-calculator","engineering-calculator","feeg2005","sesa2025","statics","structural-engineering"],"created_at":"2024-12-17T16:52:51.388Z","updated_at":"2025-04-04T13:42:19.247Z","avatar_url":"https://github.com/harrytwigg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aero Calculators\n\nCalculators for the SESA2025 and FEEG2005 modules at the University of Southampton. Includes cross-section, beams, and pin-jointed truss analysis among other things.\n\nI coded these myself, example how to use functions based of lecture questions can be seen in the individual files.\n\nI have tried to include docstrings wherever possible\n\n## FEEG2005 - Materials and Structures\n\n### section.py\n\nCalculate properties on 2D cross-sections\n\n#### Cross section area\n\n```{python}\narea(points)\n```\n\nArea of cross-section using greens theorem\n\npoints - an array of (y, z) point pairs\n\n#### Cross section centroid\n\n```{python}\ncentroid(points)\n```\n\nLocation of the centroid\n\npoints - an array of (y, z) point pairs\n\n#### Moments of inertia around the centroid\n\n```{python}\ninertia(points)\n```\n\nMoments and product of inertia about centroid\n\npoints - an array of (y, z) point pairs\n\n#### Principal moments of inertia and orientation\n\n```{python}\nprincipal(Iyy, Izz, Iyz)\n```\n\nPrincipal moments of inertia and orientation\n\npoints - an arraz of (y, z) point pairs\n\n### beam.py\n\nCalculate various properties such as bending stress and moments of a beam\n\nSupports custom point and distributed loads through the use of heaviside functions, bending stress and moments can then be graphed.\n\n```{python}\ndef bending_shear_force_lecture_1():\n    \"\"\"Example shear force from lecture 1\"\"\"\n    beam = Beam(1, 24.2 * 10**(-6))\n    beam.add_distributed_load(10000, 0, 1)\n    beam.add_point_load(5000, 0.5)\n    print(\"R_a\", beam.get_R_a())\n    print(\"M_a\", beam.get_M_a())\n\n    bending_stress = beam.bending_stress(0, -0.01, -0.1, 6.6 * 10 **-6, 7.2 * 10 **-6, x_value=0)\n    print(\"bending_stress\", bending_stress)\n\n    bending_moment = beam.bending_moment()\n    shear_force = beam.shear_force()\n    x_points = []\n    bending_moment_points = []\n    shear_force_points = []\n\n    # Enables floating point increments in loops\n    def drange(start, stop, step):\n        while start \u003c stop:\n            yield start\n            start += step\n\n    for i in drange(0, 1, 0.01):\n        x_points.append(i)\n        bending_moment_points.append(bending_moment.subs(x, i))\n        shear_force_points.append(shear_force.subs(x, i))\n\n    plt.plot(x_points, bending_moment_points)\n    plt.plot(x_points, shear_force_points)\n\n    plt.legend([\"Bending Moment\", \"Shear Force\"])\n    plt.show()\n```\n\nExample Output\n\n```{console}\nR_a 15000\nM_a -7500.0\nbending_stress -50514460.5116797\n```\n\n\u003cimg src=\"beam_analysis.png\" /\u003e\n\n### pin_trusses.py\n\nCan solve pin-jointed trusses using real or virtual energy methods\n\nForce can be appleid at any of the joints\n\nGenerates equations using the method of joints and resolves them automatically\n\nGenerates truss from an input set of points data and can sketch the truss\n\n```{python}\ndef virtual_forces_lecture_16():\n    \"\"\"Example question lecture 16, uses a virtual external force\"\"\"\n\n    points = [(\"B\", 0, 2, \"W\"), (\"C\", 2, 2), (\"D\", 4, 2),\n              (\"F\", 0, 0, \"W\"), (\"G\", 2, 0)]\n    members = [(\"B\", \"C\"), (\"C\", \"D\"), (\"D\", \"G\"),\n               (\"F\", \"G\"), (\"F\", \"C\"), (\"C\", \"G\")]\n\n    A = 1000 * 10**-6\n    E = 200 * 10**9\n\n    N = CoordSys3D('N')\n    real_force = - 10000 * N.j\n    real_point = \"D\"\n\n    virtual_force = - 1 * N.j\n    virtual_point = \"G\"\n\n    print(\"\"\"\n=====================\n    Real Truss\n=====================\n    \"\"\")\n\n    # Apply analysis on real truss in same way as before\n    real_truss = Truss(points, members)\n    real_truss.add_force_at_point(real_point, real_force)\n    real_truss.print_all_eqns()\n    real_truss.solve_equation_system()\n    real_truss.print_resolved_forces()\n    real_elements, headers = real_truss.find_truss_elements(A, E)\n    real_truss.plot()\n    print(\"\"\"\nReal Truss Elements:\n    \"\"\")\n\n    print(tabulate(real_elements, headers=headers, disable_numparse=True))\n\n    print(\"\"\"\n=====================\n    Virtual Truss\n=====================\n    \"\"\")\n\n    # Make new truss and apply virtual force at point G and solve\n    virtual_truss = Truss(points, members)\n    virtual_truss.add_force_at_point(virtual_point, virtual_force)\n    virtual_truss.print_all_eqns()\n    virtual_truss.solve_equation_system()\n    virtual_truss.print_resolved_forces()\n    virtual_elements = virtual_truss.find_truss_elements(A, E)[0]\n\n    print(\"\"\"\nVirtual Truss Elements:\n    \"\"\")\n\n    print(tabulate(virtual_elements, headers=headers, disable_numparse=True))\n\n    u = Truss.displacement_arbitrary_point(\n        real_elements, virtual_elements, virtual_force)\n    print(\"\")\n    print(\"Displacement u at the point G is\", u, \"as float\", u.evalf())\n```\n\n\u003cimg src=\"pin_truss.png\" /\u003e\n\nExample output\n\n```{console}\n=====================\n    Real Truss\n=====================\n    \n\nEquations:\n        \nB i: 0 = F_BC + Rx_B\nB j: 0 = Ry_B\nC i: 0 = -F_BC + F_CD - sqrt(2)*F_CF/2\nC j: 0 = -sqrt(2)*F_CF/2 - F_CG\nD i: 0 = -F_CD - sqrt(2)*F_DG/2\nD j: 0 = -sqrt(2)*F_DG/2 - 10000\nF i: 0 = sqrt(2)*F_CF/2 + F_FG + Rx_F\nF j: 0 = sqrt(2)*F_CF/2 + Ry_F\nG i: 0 = sqrt(2)*F_DG/2 - F_FG\nG j: 0 = F_CG + sqrt(2)*F_DG/2\n\nResolving Forces:\n        \nB j: 0 = Ry_B  |  resolving Ry_B ==\u003e 0\nD j: 0 = -sqrt(2)*F_DG/2 - 10000  |  resolving F_DG ==\u003e -10000*sqrt(2)\nG i: 0 = -F_FG - 10000  |  resolving F_FG ==\u003e -10000\nG j: 0 = F_CG - 10000  |  resolving F_CG ==\u003e 10000\nC j: 0 = -sqrt(2)*F_CF/2 - 10000  |  resolving F_CF ==\u003e -10000*sqrt(2)\nD i: 0 = 10000 - F_CD  |  resolving F_CD ==\u003e 10000\nF i: 0 = Rx_F - 20000  |  resolving Rx_F ==\u003e 20000\nF j: 0 = Ry_F - 10000  |  resolving Ry_F ==\u003e 10000\nC i: 0 = 20000 - F_BC  |  resolving F_BC ==\u003e 20000\nB i: 0 = Rx_B + 20000  |  resolving Rx_B ==\u003e -20000\n\nResolved Forces:\n        \nRy_B = 0\nF_DG = -10000*sqrt(2)\nF_FG = -10000\nF_CG = 10000\nF_CF = -10000*sqrt(2)\nF_CD = 10000\nRx_F = 20000\nRy_F = 10000\nF_BC = 20000\nRx_B = -20000\n\nReal Truss Elements:\n    \nMember    Force [N]       Length [m]    δ [m]\n--------  --------------  ------------  -------\nBC        20000           2             0.0002\nCD        10000           2             0.0001\nCF        -10000*sqrt(2)  2*sqrt(2)     -0.0002\nCG        10000           2             0.0001\nDG        -10000*sqrt(2)  2*sqrt(2)     -0.0002\nFG        -10000          2             -0.0001\n\n\n=====================\n    Virtual Truss\n=====================\n    \n\nEquations:\n        \nB i: 0 = F_BC + Rx_B\nB j: 0 = Ry_B\nC i: 0 = -F_BC + F_CD - sqrt(2)*F_CF/2\nC j: 0 = -sqrt(2)*F_CF/2 - F_CG\nD i: 0 = -F_CD - sqrt(2)*F_DG/2\nD j: 0 = -sqrt(2)*F_DG/2\nF i: 0 = sqrt(2)*F_CF/2 + F_FG + Rx_F\nF j: 0 = sqrt(2)*F_CF/2 + Ry_F\nG i: 0 = sqrt(2)*F_DG/2 - F_FG\nG j: 0 = F_CG + sqrt(2)*F_DG/2 - 1\n\nResolving Forces:\n        \nB j: 0 = Ry_B  |  resolving Ry_B ==\u003e 0\nD j: 0 = -sqrt(2)*F_DG/2  |  resolving F_DG ==\u003e 0\nG i: 0 = -F_FG  |  resolving F_FG ==\u003e 0\nG j: 0 = F_CG - 1  |  resolving F_CG ==\u003e 1\nC j: 0 = -sqrt(2)*F_CF/2 - 1  |  resolving F_CF ==\u003e -sqrt(2)\nD i: 0 = -F_CD  |  resolving F_CD ==\u003e 0\nF i: 0 = Rx_F - 1  |  resolving Rx_F ==\u003e 1\nF j: 0 = Ry_F - 1  |  resolving Ry_F ==\u003e 1\nC i: 0 = 1 - F_BC  |  resolving F_BC ==\u003e 1\nB i: 0 = Rx_B + 1  |  resolving Rx_B ==\u003e -1\n\nResolved Forces:\n        \nRy_B = 0\nF_DG = 0\nF_FG = 0\nF_CG = 1\nF_CF = -sqrt(2)\nF_CD = 0\nRx_F = 1\nRy_F = 1\nF_BC = 1\nRx_B = -1\n\nVirtual Truss Elements:\n    \nMember    Force [N]    Length [m]    δ [m]\n--------  -----------  ------------  -------\nBC        1            2             1e-08\nCD        0            2             0\nCF        -sqrt(2)     2*sqrt(2)     -2e-08\nCG        1            2             1e-08\nDG        0            2*sqrt(2)     0\nFG        0            2             0\n\nMerged Truss Data:\n        \nMember    δ Actual[m]    F* Virtual [N]    F* x δ Actual\n--------  -------------  ----------------  --------------------\nBC        0.0002         1                 0.000200000000000000\nCD        0.0001         0                 0\nCF        -0.0002        -sqrt(2)          0.0002*sqrt(2)\nCG        0.0001         1                 0.000100000000000000\nDG        -0.0002        0                 0\nFG        -0.0001        0                 0\n\nDisplacement u at the point G is 0.0002*sqrt(2) + 0.0003 as float 0.000582842712474619\n```\n\n### materials_eqns.py\n\nMaterials exam useful sympy equations\n\n## SESA025 - Flight Mechanics\n\nFormula sheet equations as auto-rearrangeable Sympy equations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrytwigg%2Faero-calculators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharrytwigg%2Faero-calculators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrytwigg%2Faero-calculators/lists"}