Spaces:
Sleeping
Sleeping
File size: 841 Bytes
6b3df31 0ec10d6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
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")
|