Skip to content

Instantly share code, notes, and snippets.

View joreilly86's full-sized avatar

James O'Reilly joreilly86

View GitHub Profile
@joreilly86
joreilly86 / simply_supported_beam.py
Created February 5, 2024 05:22
#23 - A Simply Supported Beam in Python, a simple code snippet for calculating and plotting the shear force and bending moment diagrams for a beam under a uniformly distributed load.
import numpy as np
import matplotlib.pyplot as plt
# Beam parameters
length = 10 # Length of the beam (m)
w = 10 # Uniformly distributed load in kN/m
# Functions
def shear_force(x):
return w * (length / 2 - x) # kN