Update app.py
Browse files
app.py
CHANGED
|
@@ -34,30 +34,54 @@ df = load_data()
|
|
| 34 |
def build_prompt(location, project_type, roof_size=None, desired_kwh=None, electricity_bill=None, ghi=None, solar_cost_per_kw=None):
|
| 35 |
if project_type == "Rooftop Solar":
|
| 36 |
prompt = f"""
|
| 37 |
-
You are
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
Average GHI
|
| 43 |
-
Solar system cost per kW
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
Estimated solar system size in kW: <value>
|
| 46 |
Estimated daily solar output in kWh: <value>
|
| 47 |
Total system cost in ₹: <value>
|
| 48 |
Monthly savings in ₹: <value>
|
| 49 |
Payback period in years: <value>
|
| 50 |
"""
|
| 51 |
-
else:
|
| 52 |
prompt = f"""
|
| 53 |
-
You are
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
Average GHI
|
| 59 |
-
Solar system cost per kW
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
Required solar system size in kW: <value>
|
| 62 |
Estimated daily solar output in kWh: <value>
|
| 63 |
Total system cost in ₹: <value>
|
|
@@ -66,6 +90,7 @@ Payback period in years: <value>
|
|
| 66 |
"""
|
| 67 |
return prompt
|
| 68 |
|
|
|
|
| 69 |
# UI - Form for user input
|
| 70 |
st.title("☀️AI-Based Solar Project Estimation Tool")
|
| 71 |
st.write("### Enter Your Details Below:")
|
|
|
|
| 34 |
def build_prompt(location, project_type, roof_size=None, desired_kwh=None, electricity_bill=None, ghi=None, solar_cost_per_kw=None):
|
| 35 |
if project_type == "Rooftop Solar":
|
| 36 |
prompt = f"""
|
| 37 |
+
You are an AI-based solar project estimator.
|
| 38 |
+
|
| 39 |
+
Use the following calculation methods:
|
| 40 |
+
|
| 41 |
+
- Estimated system size (kW) = Roof size (sq meters) × 0.15
|
| 42 |
+
- Estimated daily solar output (kWh) = System size (kW) × Average GHI (kWh/m²/day)
|
| 43 |
+
- Total system cost (₹) = System size (kW) × Solar system cost per kW
|
| 44 |
+
- Assume tariff rate = ₹7/kWh
|
| 45 |
+
- Monthly savings (₹) = Estimated daily output × 30 × 7
|
| 46 |
+
- Payback period (years) = Total system cost ÷ (Monthly savings × 12)
|
| 47 |
+
|
| 48 |
+
Inputs:
|
| 49 |
+
- Project Type: Rooftop Solar
|
| 50 |
+
- Location: {location}
|
| 51 |
+
- Roof Size: {roof_size} sq meters
|
| 52 |
+
- Monthly Electricity Bill: ₹{electricity_bill}
|
| 53 |
+
- Average GHI: {ghi} kWh/m²/day
|
| 54 |
+
- Solar System Cost per kW: ₹{solar_cost_per_kw}
|
| 55 |
+
|
| 56 |
+
Now, calculate and return strictly in this format:
|
| 57 |
Estimated solar system size in kW: <value>
|
| 58 |
Estimated daily solar output in kWh: <value>
|
| 59 |
Total system cost in ₹: <value>
|
| 60 |
Monthly savings in ₹: <value>
|
| 61 |
Payback period in years: <value>
|
| 62 |
"""
|
| 63 |
+
else:
|
| 64 |
prompt = f"""
|
| 65 |
+
You are an AI-based solar project estimator.
|
| 66 |
+
|
| 67 |
+
Use the following calculation methods:
|
| 68 |
+
|
| 69 |
+
- Required system size (kW) = Desired monthly solar production ÷ (30 × Average GHI)
|
| 70 |
+
- Estimated daily solar output (kWh) = System size (kW) × Average GHI (kWh/m²/day)
|
| 71 |
+
- Total system cost (₹) = System size (kW) × Solar system cost per kW
|
| 72 |
+
- Assume tariff rate = ₹7/kWh
|
| 73 |
+
- Monthly savings (₹) = Estimated daily output × 30 × 7
|
| 74 |
+
- Payback period (years) = Total system cost ÷ (Monthly savings × 12)
|
| 75 |
+
|
| 76 |
+
Inputs:
|
| 77 |
+
- Project Type: Ground Mount Solar
|
| 78 |
+
- Location: {location}
|
| 79 |
+
- Desired Monthly Solar Production: {desired_kwh} kWh
|
| 80 |
+
- Monthly Electricity Bill: ₹{electricity_bill}
|
| 81 |
+
- Average GHI: {ghi} kWh/m²/day
|
| 82 |
+
- Solar System Cost per kW: ₹{solar_cost_per_kw}
|
| 83 |
+
|
| 84 |
+
Now, calculate and return strictly in this format:
|
| 85 |
Required solar system size in kW: <value>
|
| 86 |
Estimated daily solar output in kWh: <value>
|
| 87 |
Total system cost in ₹: <value>
|
|
|
|
| 90 |
"""
|
| 91 |
return prompt
|
| 92 |
|
| 93 |
+
|
| 94 |
# UI - Form for user input
|
| 95 |
st.title("☀️AI-Based Solar Project Estimation Tool")
|
| 96 |
st.write("### Enter Your Details Below:")
|