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))")