This project addresses the challenge of determining the optimal configuration of residential photovoltaic (PV) systems and battery storage to maximize long-term economic benefits. The model integrates high-resolution household demand data, weather conditions, and techno-economic parameters to compute the net present value (NPV) of different system configurations over a 20-year horizon.
Residential solar PV systems are becoming increasingly important for sustainable energy generation. However, their intermittent nature requires careful planning and integration with battery energy storage systems (BESS) to ensure reliability and maximize self-consumption.
The core question is:
What is the optimal PV capacity (
The PV power output at time
with
where
The battery power
The SOC is updated as:
with initial condition
The net power drawn from or fed into the grid is:
Total revenues include self-consumed PV energy and feed-in to the grid:
The 20-year NPV is computed as:
with investment and maintenance costs:
The problem is formulated as a constrained optimization task:
To solve this, the repository employs SciPy’s optimization routines (e.g., Nelder-Mead, Powell, L-BFGS-B). These allow efficient search over the continuous decision space without requiring closed-form derivatives.
👉 The repository provides a generic implementation of these models and optimization routines, which can be applied to different household load and weather datasets.
Contains hourly household electricity demand data
Contains system parameters
Contains weather data
Where:
Ta
: Ambient temperature (°C)G_Gk
: Global horizontal irradiance (W/m²)
The optimization includes:
- Solar PV Model: Calculates PV power output based on irradiance, temperature, and efficiency
- Battery Model: Tracks state of charge and power flow with round-trip efficiency
- Economic Model: Calculates NPV considering investment costs, revenues, and operation & maintenance