charagu-eric commited on
Commit
9c8eecc
·
1 Parent(s): 847dc60

actual battery values£

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -9,14 +9,14 @@ from typing import Dict
9
  ONE_BR_UNITS = 23
10
  TWO_BR_UNITS = 45
11
  SOLAR_PANEL_RATING = 625 # W
12
- BATTERY_CAPACITY = 200 # Ah
13
- BATTERY_VOLTAGE = 12 # V
14
  SYSTEM_LOSSES = 0.20
15
  FEED_IN_TARIFF = 12
16
 
17
  # Lighting specifications
18
  LIGHTS_1BR = 5
19
- LIGHTS_2BR = 8
20
  LIGHT_POWER = 6 # Watts per light
21
 
22
 
@@ -70,7 +70,7 @@ def financial_analysis(
70
  """Detailed financial calculations"""
71
  solar_used = min(production, consumption)
72
  surplus = max(0, production - consumption)
73
- feed_in_revenue = surplus * FEED_IN_TARIFF / 100 # Convert to Ksh from cents/kWh
74
 
75
  # Account for battery storage
76
  grid_purchased = max(0, consumption - solar_used)
@@ -80,10 +80,8 @@ def financial_analysis(
80
  grid_purchased -= grid_offset
81
 
82
  monthly_savings = (
83
- ((consumption - common_area) * st.session_state.grid_price / 100)
84
- - (grid_purchased * st.session_state.grid_price / 100)
85
- + feed_in_revenue
86
- )
87
 
88
  total_investment = (
89
  st.session_state.solar_panels * st.session_state.panel_price
@@ -487,7 +485,7 @@ def main():
487
 
488
  **Savings Calculation:**
489
  - Grid Price: {st.session_state.grid_price} Ksh/kWh
490
- - Monthly Savings = (Total Consumption - Common Areas× Grid Price)
491
  - Payback Period = Total Investment / Annual Savings
492
 
493
  **Filtered Scenario Data:**
 
9
  ONE_BR_UNITS = 23
10
  TWO_BR_UNITS = 45
11
  SOLAR_PANEL_RATING = 625 # W
12
+ BATTERY_CAPACITY = 400 # Ah
13
+ BATTERY_VOLTAGE = 96 # V
14
  SYSTEM_LOSSES = 0.20
15
  FEED_IN_TARIFF = 12
16
 
17
  # Lighting specifications
18
  LIGHTS_1BR = 5
19
+ LIGHTS_2BR = 12
20
  LIGHT_POWER = 6 # Watts per light
21
 
22
 
 
70
  """Detailed financial calculations"""
71
  solar_used = min(production, consumption)
72
  surplus = max(0, production - consumption)
73
+ # feed_in_revenue = surplus * FEED_IN_TARIFF / 100 # Convert to Ksh from cents/kWh
74
 
75
  # Account for battery storage
76
  grid_purchased = max(0, consumption - solar_used)
 
80
  grid_purchased -= grid_offset
81
 
82
  monthly_savings = (
83
+ (consumption - common_area) * st.session_state.grid_price / 100
84
+ ) - (grid_purchased * st.session_state.grid_price / 100)
 
 
85
 
86
  total_investment = (
87
  st.session_state.solar_panels * st.session_state.panel_price
 
485
 
486
  **Savings Calculation:**
487
  - Grid Price: {st.session_state.grid_price} Ksh/kWh
488
+ - Monthly Savings = (Total Consumption - Common Areas)× Grid Price)
489
  - Payback Period = Total Investment / Annual Savings
490
 
491
  **Filtered Scenario Data:**