hamzaherry's picture
Update app.py
c3713aa verified
raw
history blame
959 Bytes
import streamlit as st
# Title of the app
st.title('Solar Panel Calculator')
# Input fields for user to enter data
avg_monthly_usage = st.number_input('Average Monthly Usage (kWh)', min_value=0.0, step=1.0)
peak_demand = st.number_input('Peak Demand (kW)', min_value=0.0, step=0.1)
solar_panel_efficiency = st.number_input('Solar Panel Efficiency (%)', min_value=0.0, max_value=100.0, step=1.0)
# Calculations
annual_energy_consumption = avg_monthly_usage * 12
daily_energy_requirement = annual_energy_consumption / 365
solar_panel_output = daily_energy_requirement / solar_panel_efficiency
# Display results
st.write('### Calculated Results:')
st.write(f'- Annual Energy Consumption: {annual_energy_consumption} kWh')
st.write(f'- Daily Energy Requirement: {daily_energy_requirement} kWh')
st.write(f'- Solar Panel Output: {solar_panel_output} kWh')
# Cost calculations and payback period can be added here based on the specific formula you have in mind