Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| def calculate_load(current, voltage, phase_type): | |
| if phase_type == "Single Phase": | |
| power = current * voltage | |
| elif phase_type == "Three Phase": | |
| power = current * voltage * (3 ** 0.5) | |
| else: | |
| power = 0 | |
| return power | |
| # Streamlit App | |
| st.title("Electrical Load Calculator") | |
| st.markdown("This app calculates the electrical load based on the given input parameters.") | |
| # Input Fields | |
| phase_type = st.selectbox("Select Phase Type:", ["Single Phase", "Three Phase"]) | |
| current = st.number_input("Enter Current (in Amperes):", min_value=0.0, format="%.2f") | |
| voltage = st.number_input("Enter Voltage (in Volts):", min_value=0.0, format="%.2f") | |
| if st.button("Calculate Load"): | |
| load = calculate_load(current, voltage, phase_type) | |
| st.success(f"The calculated load is: {load:.2f} Watts") | |