Spaces:
Sleeping
Sleeping
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))") | |