This project provides a tool for optimizing the configuration of solar panels in series and parallel combinations to meet system constraints, such as maximum voltage, current, and power. It utilizes Streamlit to offer an interactive UI for entering panel specifications and system constraints.
- Panel configuration optimization: Finds the best series-parallel combination to maximize power output while staying within the user-defined system constraints.
- Interactive UI: A user-friendly interface using
Streamlitto input panel and system specifications. - Panel grouping: Automatically groups panels for parallel or series configurations.
- Power calculation: Calculates the total power generated by panels based on their voltage and current ratings.
- Python 3.8+
- Streamlit
pip install streamlitTo run the app locally, follow these steps:
- Clone the repository or copy the provided Python code.
- Install the required dependencies.
- Run the application:
make runmake run- Enter the following details:
- Max System Voltage (V): The maximum allowable voltage for the system.
- Max System Current (A): The maximum allowable current for the system.
- Max System Power (W): The maximum allowable power for the system.
- Panel Voltage (V): The voltage rating of each solar panel.
- Panel Current (A): The current rating of each solar panel.
- Total Number of Panels: The total number of solar panels available.
- Click Optimize Configuration to find the best configuration.
The app will display the optimal configuration or inform you if no valid configuration is found within the constraints.
Play on website: https://panupong-develop-solar-panel.streamlit.app
Let's assume the following inputs:
- Max Voltage: 50V
- Max Current: 30A
- Max Power: 500W
- Panel Voltage: 18V
- Panel Current: 8A
- Total Number of Panels: 6
After clicking the Optimize Configuration button, the tool will calculate and display the optimal configuration of series and parallel connections that maximize power output while staying within the system constraints.
Best Configuration Found:
Series: 2/group -> Parellel: 3
Total Voltage: 36 V
Total Current: 24 A
Total Power: 864 W
Loss Power: -364 W
Which mean you should series two panels for each group You will get independent three panel groups Then you will parallel them to the output.
group_panels(): Groups panels into smaller chunks based on the specified chunk size.series_panels(): Combines panels in series by summing their voltages while keeping current constant.parallel_panels(): Combines panels in parallel by summing their currents while keeping voltage constant.evaluate(): Evaluates the configuration based on panel grouping size (series-parallel).optimize(): Finds the optimal configuration that maximizes power while staying within the constraints of voltage, current, and power.
This project is open-source and available under the MIT License.