George Chen, Benjamin Low, Casey Takahashi
bridgeplotlib is a library meant for the structural analysis of a simply supported beam bridge.
See design-0.py or design-final.py for examples
General process:
from bridgeplotlib import *to use all associated modules- Create geometry objects
- Use geometry objects to create geometry collections, i.e cross sections for bridge
- Create a cross sections object from the geometry collections
- Create a bridge object specifying length
- Solve for max forces at all train locations or a specific train location using
solve_maximum_forces(...) - Display graphs and print FOS and max loads using
display_graphs()
Contains all functions necessary to graph maximum force and find FOS
class Rect:
def __init__(self, x: float, y: float, x_length: float, y_length: float, tags=None, id=None, name=None, join_id=None, special_id=None) -> None:
"""create a geometry object, up is positive and right is positive
Args:
x (number): top left corner
y (number): top left corner
x_length (number): x length, right direction
y_length (number): y length, down direction
tags (str, optional): set a tag for use, format 'ARG1:VALUE1 ARG2:VALUE2 ...'. Defaults to None.
id (str, optional): set an id for use, does not need to be unique. Defaults to None.
name(str, optional): name of the object
join_id (str, optional): special join id, will attach all to all other geometry objects with same join id when a geometry collection is initialized. Only works if all geometry objects are collinear and vertically stacked Joints will be preserved for analysis and display, however the "joined" geometry objects will act as one rect (they are replaced by a new rect with combined dimensions). Defaults to None.
special_id (str, optional): special id, for further identification purposes
"""tags:
- display:True
- display:False
- joint-display:True
- joint-display:False
class GeometryCollection:
def __init__(self, geometry_objects: Iterable, geometry_object_groups=(), name=None, ignore_thin_plate=False, joint_override=None) -> None:
"""create a geometry collection object, only supports Rect() geometry objects
Args:
geometry_objects (Iterable): an array of geometry_object
geometry_object_groups (Iterable): (ID, ID, ...), (ID, ID, ...), ...
name (str, optional): name of the collection
ignore_thin_plates (bool, optional): True to disable thin plate identification, useful for diaphragms
joint_override (list, optional): Specify joints that should be used for calculations
"""class Bridge:
def __init__(self, length: int, cross_sections: object) -> None:
"""Initialize a bridge object
Args:
length (number): length of the bridge in millimeters
cross_sections (object): a cross sections object containing bridge cross sections
"""class CrossSections:
def __init__(self, cross_sections: Iterable, bounds: Iterable, types: Iterable) -> None:
"""create a cross sections object
Args:
cross_sections (Iterable): list of cross section
bounds (Iterable): list of bounds for each cross section
types (Iterable): list of types for each cross section (diaphragm, ...)
"""class Train:
def __init__(self, pos, weight) -> None:
"""Initialize a train object
Args:
pos (number): left-most position of the train in millimeters
weight (number): weight of train in newtons
"""


