File size: 1,100 Bytes
ffa812c
 
 
2184b09
ffa812c
2184b09
ffa812c
2184b09
 
ffa812c
2184b09
 
 
 
 
 
 
 
 
 
 
 
 
ffa812c
 
 
 
2184b09
 
 
 
ffa812c
2184b09
 
 
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
import streamlit as st
import math

st.set_page_config(page_title="Paper Size Helper", page_icon="πŸ“„", layout="centered")

# --- Header ---
st.title("πŸ“„ Paper Size Helper")
st.markdown("### πŸ” Find the Ideal Paper Tube Diameter")
st.write("Enter the flow rate and velocity to calculate the required diameter for paper rolls.")

# --- Input Section ---
st.markdown("#### ✏️ Input Parameters")
col1, col2 = st.columns(2)

with col1:
    flow_rate = st.number_input("Flow Rate (mΒ³/s)", min_value=1, step=1)

with col2:
    velocity = st.number_input("Velocity (m/s)", min_value=1, step=1)

# --- Calculation and Output ---
st.markdown("---")
st.markdown("#### πŸ“ Result")

if flow_rate > 0 and velocity > 0:
    area = flow_rate / velocity
    diameter = math.sqrt((4 * area) / math.pi)
    diameter_rounded = round(diameter)
    st.success(f"Recommended Diameter: **{diameter_rounded} meters**")
else:
    st.info("Please enter values greater than zero for both flow rate and velocity.")

# --- Footer ---
st.markdown("---")
st.caption("🧠 Formula used: D = sqrt((4 Γ— Q) / (Ο€ Γ— V))")