Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,7 @@ st.markdown("- Real Power (kW)")
|
|
| 10 |
st.markdown("- Power Factor")
|
| 11 |
st.markdown("- Reactive Power (kVAR)")
|
| 12 |
st.markdown("- Capacitor Rating Recommendation to Compensate Reactive Power")
|
|
|
|
| 13 |
|
| 14 |
# Inputs
|
| 15 |
voltage = st.number_input("Enter Voltage (V)", min_value=0.0, step=0.1)
|
|
@@ -43,6 +44,12 @@ if st.button("Calculate"):
|
|
| 43 |
else:
|
| 44 |
required_capacitance_uF = 0.0
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
# Display results
|
| 47 |
st.subheader("Results (Single-Phase):")
|
| 48 |
st.write(f"🔌 Apparent Power: **{round(apparent_power, 2)} VA**")
|
|
@@ -55,6 +62,12 @@ if st.button("Calculate"):
|
|
| 55 |
st.subheader("Recommended Capacitor Size:")
|
| 56 |
st.write(f"To compensate the **{round(reactive_power, 2)} kVAR** of reactive power:")
|
| 57 |
st.write(f"💡 Required Capacitor Size: **{round(required_capacitance_uF, 2)} µF**")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
else:
|
| 59 |
st.write("No compensation needed as reactive power is zero or negative.")
|
| 60 |
|
|
@@ -64,3 +77,4 @@ if st.button("Calculate"):
|
|
| 64 |
|
| 65 |
|
| 66 |
|
|
|
|
|
|
| 10 |
st.markdown("- Power Factor")
|
| 11 |
st.markdown("- Reactive Power (kVAR)")
|
| 12 |
st.markdown("- Capacitor Rating Recommendation to Compensate Reactive Power")
|
| 13 |
+
st.markdown("- Capacitor kVAR Contribution")
|
| 14 |
|
| 15 |
# Inputs
|
| 16 |
voltage = st.number_input("Enter Voltage (V)", min_value=0.0, step=0.1)
|
|
|
|
| 44 |
else:
|
| 45 |
required_capacitance_uF = 0.0
|
| 46 |
|
| 47 |
+
# Capacitor Reactive Power (kVAR) from the capacitance
|
| 48 |
+
if required_capacitance_uF > 0:
|
| 49 |
+
capacitor_reactive_power = (voltage**2 * 2 * math.pi * frequency * required_capacitance) / 1000000
|
| 50 |
+
else:
|
| 51 |
+
capacitor_reactive_power = 0.0
|
| 52 |
+
|
| 53 |
# Display results
|
| 54 |
st.subheader("Results (Single-Phase):")
|
| 55 |
st.write(f"🔌 Apparent Power: **{round(apparent_power, 2)} VA**")
|
|
|
|
| 62 |
st.subheader("Recommended Capacitor Size:")
|
| 63 |
st.write(f"To compensate the **{round(reactive_power, 2)} kVAR** of reactive power:")
|
| 64 |
st.write(f"💡 Required Capacitor Size: **{round(required_capacitance_uF, 2)} µF**")
|
| 65 |
+
|
| 66 |
+
# Display Capacitor Reactive Power (kVAR)
|
| 67 |
+
if required_capacitance_uF > 0:
|
| 68 |
+
st.subheader("Capacitor Reactive Power Contribution:")
|
| 69 |
+
st.write(f"With a **{round(required_capacitance_uF, 2)} µF** capacitor at {voltage} V and {frequency} Hz,")
|
| 70 |
+
st.write(f"the capacitor will provide **{round(capacitor_reactive_power, 2)} kVAR** of reactive power.")
|
| 71 |
else:
|
| 72 |
st.write("No compensation needed as reactive power is zero or negative.")
|
| 73 |
|
|
|
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
+
|