MLDeveloper commited on
Commit
14479f3
·
verified ·
1 Parent(s): 99714c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -26
app.py CHANGED
@@ -33,8 +33,7 @@ df = load_data()
33
  def build_prompt(location, project_type, roof_size=None, desired_kwh=None, electricity_bill=None, ghi=None, solar_cost_per_kw=None):
34
  if project_type == "Rooftop Solar":
35
  prompt = f"""
36
- You are a solar project estimator tool. Based on the following details, calculate and return only the values without any extra description:
37
-
38
  Project Type: Rooftop Solar
39
  Location: {location}
40
  Roof size: {roof_size} sq meters
@@ -42,17 +41,12 @@ Monthly electricity bill: ₹{electricity_bill}
42
  Average GHI: {ghi} kWh/m²/day
43
  Solar system cost per kW: ₹{solar_cost_per_kw}
44
 
45
- Formulas to be used:
46
- 1. Estimated Solar System Size in kW:
47
- System Size (kW) = Electricity Bill (₹) / Solar Cost per kW (₹)
48
- 2. Estimated Daily Solar Output in kWh:
49
- Daily Output (kWh) = System Size (kW) * Average GHI (kWh/m²/day)
50
- 3. Total System Cost in ₹:
51
- Total Cost (₹) = System Size (kW) * Solar Cost per kW (₹)
52
- 4. Monthly Savings in ₹:
53
- Monthly Savings (₹) = (System Output (kWh) / Monthly Consumption (kWh)) * Electricity Bill (₹)
54
- 5. Payback Period in Years:
55
- Payback Period (Years) = Total System Cost (₹) / Annual Savings (₹), where Annual Savings (₹) = Monthly Savings (₹) * 12
56
 
57
  Respond strictly in this format (do not add anything extra):
58
  Estimated solar system size in kW: <value>
@@ -63,8 +57,7 @@ Payback period in years: <value>
63
  """
64
  else: # Ground Mount Solar
65
  prompt = f"""
66
- You are a solar project estimator tool. Based on the following details, calculate and return only the values without any extra description:
67
-
68
  Project Type: Ground Mount Solar
69
  Location: {location}
70
  Desired monthly solar production: {desired_kwh} kWh
@@ -72,17 +65,12 @@ Monthly electricity bill: ₹{electricity_bill}
72
  Average GHI: {ghi} kWh/m²/day
73
  Solar system cost per kW: ₹{solar_cost_per_kw}
74
 
75
- Formulas to be used:
76
- 1. Required Solar System Size in kW:
77
- Required System Size (kW) = Desired Monthly Production (kWh) / (30 * Average Solar Output per Day (kWh/m²/day))
78
- 2. Estimated Daily Solar Output in kWh:
79
- Daily Output (kWh) = System Size (kW) * Average GHI (kWh/m²/day)
80
- 3. Total System Cost in ₹:
81
- Total Cost (₹) = System Size (kW) * Solar Cost per kW (₹)
82
- 4. Monthly Savings in ₹:
83
- Monthly Savings (₹) = (System Output (kWh) / Monthly Consumption (kWh)) * Electricity Bill (₹)
84
- 5. Payback Period in Years:
85
- Payback Period (Years) = Total System Cost (₹) / Annual Savings (₹), where Annual Savings (₹) = Monthly Savings (₹) * 12
86
 
87
  Respond strictly in this format (do not add anything extra):
88
  Required solar system size in kW: <value>
 
33
  def build_prompt(location, project_type, roof_size=None, desired_kwh=None, electricity_bill=None, ghi=None, solar_cost_per_kw=None):
34
  if project_type == "Rooftop Solar":
35
  prompt = f"""
36
+ You are a solar project estimator tool. Based on the following details, calculate and return only the values and formulas used, without any extra description:
 
37
  Project Type: Rooftop Solar
38
  Location: {location}
39
  Roof size: {roof_size} sq meters
 
41
  Average GHI: {ghi} kWh/m²/day
42
  Solar system cost per kW: ₹{solar_cost_per_kw}
43
 
44
+ Formulas:
45
+ 1. Estimated solar system size in kW = (Desired monthly production in kWh) / (GHI * Roof Area)
46
+ 2. Estimated daily solar output in kWh = System size (kW) * GHI
47
+ 3. Total system cost in ₹ = System size (kW) * Solar cost per kW (₹)
48
+ 4. Monthly savings in ₹ = Monthly bill * (Solar output in kWh / Monthly consumption)
49
+ 5. Payback period in years = Total system cost / (Monthly savings * 12)
 
 
 
 
 
50
 
51
  Respond strictly in this format (do not add anything extra):
52
  Estimated solar system size in kW: <value>
 
57
  """
58
  else: # Ground Mount Solar
59
  prompt = f"""
60
+ You are a solar project estimator tool. Based on the following details, calculate and return only the values and formulas used, without any extra description:
 
61
  Project Type: Ground Mount Solar
62
  Location: {location}
63
  Desired monthly solar production: {desired_kwh} kWh
 
65
  Average GHI: {ghi} kWh/m²/day
66
  Solar system cost per kW: ₹{solar_cost_per_kw}
67
 
68
+ Formulas:
69
+ 1. Required solar system size in kW = Desired monthly production (kWh) / GHI
70
+ 2. Estimated daily solar output in kWh = System size (kW) * GHI
71
+ 3. Total system cost in ₹ = System size (kW) * Solar cost per kW (₹)
72
+ 4. Monthly savings in ₹ = Monthly bill * (Solar output in kWh / Monthly consumption)
73
+ 5. Payback period in years = Total system cost / (Monthly savings * 12)
 
 
 
 
 
74
 
75
  Respond strictly in this format (do not add anything extra):
76
  Required solar system size in kW: <value>