Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from utils.beam_analysis import analyze_beam, plot_beam_diagrams | |
| # Main Streamlit app | |
| def main(): | |
| st.title("Beam Analysis for Roof Design") | |
| st.write(""" | |
| This app helps in analyzing two types of beam configurations for a basement roof design: | |
| 1. **Statically Indeterminate** (Continuous Steel Beams over Interior Columns) | |
| 2. **Statically Determinate** (Simply Supported Beams) | |
| """) | |
| # Input fields | |
| beam_type = st.selectbox("Select Beam Configuration", ["Simply Supported Beams", "Continuous Beams"]) | |
| length = 30 # Length of the beam in feet | |
| load = 1500 # Uniform load (in pounds) | |
| # Perform beam analysis based on selected configuration | |
| if beam_type == "Simply Supported Beams": | |
| st.subheader("Simply Supported Beam Analysis") | |
| results = analyze_beam(length, load, "simply_supported") | |
| st.write(f"Maximum Shear Force: {results['max_shear']} lb") | |
| st.write(f"Maximum Bending Moment: {results['max_bending_moment']} lb-ft") | |
| st.write(f"Deflection: {results['deflection']} inches") | |
| elif beam_type == "Continuous Beams": | |
| st.subheader("Continuous Beam Analysis") | |
| results = analyze_beam(length, load, "continuous") | |
| st.write(f"Maximum Shear Force: {results['max_shear']} lb") | |
| st.write(f"Maximum Bending Moment: {results['max_bending_moment']} lb-ft") | |
| st.write(f"Deflection: {results['deflection']} inches") | |
| # Plot the beam diagrams (Shear Force and Bending Moment Diagrams) | |
| st.subheader("Shear Force and Bending Moment Diagrams") | |
| plot_beam_diagrams(beam_type, length, load) | |
| if __name__ == "__main__": | |
| main() | |