Spaces:
Sleeping
Sleeping
| title: Cantilever Beam Calculator with AI Explanations | |
| emoji: 🏗️ | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: gradio | |
| sdk_version: 4.44.0 | |
| app_file: app.py | |
| pinned: false | |
| license: mit | |
| # 🏗️ Cantilever Beam Calculator with AI Explanations | |
| ## Overview | |
| An engineering analysis tool that calculates stress, deflection, and safety factors for cantilever beams, enhanced with AI-generated explanations to make results accessible to non-engineers. | |
| ## Features | |
| ### Engineering Calculations | |
| - **Stress Analysis**: Maximum bending stress at fixed support | |
| - **Deflection Analysis**: Maximum deflection at free end | |
| - **Safety Factors**: Both yield and serviceability checks | |
| - **Dynamic Properties**: First natural frequency calculation | |
| - **Mass Estimation**: Total beam mass based on geometry and material | |
| ### AI Integration | |
| - Natural language explanations of numerical results | |
| - Context-aware safety assessments | |
| - Plain-English interpretation of engineering metrics | |
| - Educational insights for non-technical users | |
| ## Technical Scope | |
| ### Beam Configuration | |
| - **Type**: Cantilever beam with fixed support | |
| - **Loading**: Concentrated force at free end | |
| - **Cross-section**: Rectangular (uniform) | |
| - **Analysis Method**: Linear elastic, small deflection theory | |
| ### Input Parameters | |
| 1. **Geometry**: | |
| - Length: 0.1 - 10 meters | |
| - Width: 5 - 1000 mm | |
| - Height: 5 - 1000 mm | |
| 2. **Loading**: | |
| - Force: 0.001 - 1000 kN (at free end) | |
| 3. **Material Properties**: | |
| - Young's Modulus: 1 - 500 GPa | |
| - Yield Strength: 10 - 2000 MPa | |
| - Density: 100 - 20000 kg/m³ | |
| ### Calculations | |
| #### Stress Analysis | |
| σ_max = Mc/I | |
| where: M = FL (moment at fixed end) | |
| c = h/2 (distance to neutral axis) | |
| I = wh³/12 (second moment of area) | |
| #### Deflection Analysis | |
| δ_max = FL³/(3EI) | |
| where: F = applied force | |
| L = beam length | |
| E = Young's modulus | |
| #### Safety Factors | |
| - **Yield**: FoS = Sy/σ_max (should be > 1.5) | |
| - **Deflection**: FoS = δ_allow/δ_max (where δ_allow = L/200) | |
| ## Validation & Assumptions | |
| ### Assumptions | |
| - Homogeneous, isotropic material | |
| - Linear elastic behavior (Hooke's Law) | |
| - No buckling considerations | |
| - Neglecting self-weight effects | |
| - Perfect fixity at support | |
| ### Valid Ranges | |
| - Aspect ratio (L/h): 5 to 50 | |
| - Deflection/Length: < 5% (small deflection theory) | |
| - Stress level: Below yield strength | |
| ## Example Use Cases | |
| 1. **Structural Design**: Preliminary sizing of cantilever structures | |
| 2. **Education**: Teaching beam theory and structural mechanics | |
| 3. **Quick Checks**: Rapid verification of beam adequacy | |
| 4. **Material Selection**: Comparing different materials for same geometry | |
| ## AI Model | |
| - **Model**: SmolLM2-135M-Instruct | |
| - **Purpose**: Generate accessible explanations of engineering results | |
| - **Temperature**: 0.7 for balanced creativity and accuracy | |
| ## Safety Notes | |
| ⚠️ **Important**: This tool is for educational and preliminary design purposes only. | |
| Professional structural analysis software and engineering judgment should be used for actual design work. | |
| ## Technical Stack | |
| - **Backend**: Python with engineering calculations | |
| - **Interface**: Gradio for web UI | |
| - **AI**: HuggingFace Transformers for natural language generation | |
| - **Deployment**: HuggingFace Spaces | |
| --- | |
| *Created for CMU 24-679 Course - Engineering Calculations with Natural Language Explanations* |