File size: 1,712 Bytes
6b1660c
 
 
 
 
 
 
 
 
 
4d4b548
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6b1660c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
title: LLM Explanation
emoji: 馃摎
colorFrom: purple
colorTo: gray
sdk: gradio
sdk_version: 5.47.2
app_file: app.py
pinned: false
---
# Simply Supported Beam Calculator (with Natural Language Explanation)

This Gradio app demonstrates a **deterministic first-principles calculator** for a simply supported beam with a **centered point load**.  

## Features
- Deterministic backend formulas:  
  - Maximum bending moment: M = P路L / 4  
  - Maximum stress: 蟽 = M路c / I  
  - Midspan deflection: 未 = P路L鲁 / (48路E路I)  
- **Input validation** with clear ranges and units.  
- **Structured JSON record** showing all assumptions, inputs, formulas, and results.  
- **Natural language explanation**: results are contextualized by an LLM pipeline (Flan-T5) or fallback template.  
- User-facing Gradio interface with:  
  - Numerical results table  
  - Explanation panel  
  - JSON record panel  

## Inputs
- L (m): span length  
- P (kN): center point load  
- E (GPa): elastic modulus  
- I (cm^4): second moment of area  
- c (cm): extreme fiber distance  
- Optional: allowable stress (蟽_allow), yield strength (fy), safety factor (n)

## Outputs
- Numerical results: bending moment, stress, deflection, utilization, pass/fail  
- Explanation text  
- Structured JSON (for reproducibility and transparency)

## Limitations
- Only valid for simply supported beams with a single center load.  
- Small deflection theory, linear elastic, prismatic section.  
- Users must provide correct I and c (from section properties).

---

### How to run locally
```bash
pip install -r requirements.txt
python app.py

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference