Spaces:
Sleeping
Sleeping
Commit
·
a8ba20a
1
Parent(s):
54b8ad8
lowered daily epected consumption
Browse files
app.py
CHANGED
|
@@ -19,9 +19,6 @@ LIGHTS_1BR = 5
|
|
| 19 |
LIGHTS_2BR = 12
|
| 20 |
LIGHT_POWER = 6 # Watts per light
|
| 21 |
|
| 22 |
-
# Non-kitchen appliance consumption
|
| 23 |
-
APPLIANCES = (300 * 24 * 30) + (300 * 6 * 30) # kWh/month
|
| 24 |
-
|
| 25 |
|
| 26 |
def initialize_session_state():
|
| 27 |
"""Initialize session state variables"""
|
|
@@ -45,14 +42,17 @@ def calculate_lighting_consumption(occupancy_1br: float, occupancy_2br: float) -
|
|
| 45 |
) * 6 # 6 hours per day
|
| 46 |
|
| 47 |
|
|
|
|
|
|
|
|
|
|
| 48 |
def calculate_appliance_consumption(
|
| 49 |
occupancy_1br: float, occupancy_2br: float
|
| 50 |
) -> float:
|
| 51 |
-
"""Calculate daily appliance consumption"""
|
| 52 |
return (
|
| 53 |
-
occupancy_1br * ONE_BR_UNITS * (
|
| 54 |
) + (
|
| 55 |
-
occupancy_2br * TWO_BR_UNITS * (
|
| 56 |
) # Daily kWh
|
| 57 |
|
| 58 |
|
|
@@ -504,7 +504,7 @@ def main():
|
|
| 504 |
|
| 505 |
**Savings Calculation:**
|
| 506 |
- Grid Price: {st.session_state.grid_price} Ksh/kWh
|
| 507 |
-
- Monthly Savings =
|
| 508 |
- Payback Period = Total Investment / Annual Savings
|
| 509 |
|
| 510 |
**Filtered Scenario Data:**
|
|
|
|
| 19 |
LIGHTS_2BR = 12
|
| 20 |
LIGHT_POWER = 6 # Watts per light
|
| 21 |
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
def initialize_session_state():
|
| 24 |
"""Initialize session state variables"""
|
|
|
|
| 42 |
) * 6 # 6 hours per day
|
| 43 |
|
| 44 |
|
| 45 |
+
# assuming that 1br average usage is 250wh and for a 2br is 400wh
|
| 46 |
+
|
| 47 |
+
|
| 48 |
def calculate_appliance_consumption(
|
| 49 |
occupancy_1br: float, occupancy_2br: float
|
| 50 |
) -> float:
|
| 51 |
+
"""Calculate daily appliance consumption by subtracting the lighting usage from the average total consumption for each house type"""
|
| 52 |
return (
|
| 53 |
+
occupancy_1br * ONE_BR_UNITS * (1.7 - (LIGHTS_1BR * LIGHT_POWER * 6 / 1000))
|
| 54 |
) + (
|
| 55 |
+
occupancy_2br * TWO_BR_UNITS * (3 - (LIGHTS_2BR * LIGHT_POWER * 6 / 1000))
|
| 56 |
) # Daily kWh
|
| 57 |
|
| 58 |
|
|
|
|
| 504 |
|
| 505 |
**Savings Calculation:**
|
| 506 |
- Grid Price: {st.session_state.grid_price} Ksh/kWh
|
| 507 |
+
- Monthly Savings =(Total Consumption - Common Area) × Grid Price
|
| 508 |
- Payback Period = Total Investment / Annual Savings
|
| 509 |
|
| 510 |
**Filtered Scenario Data:**
|