Skip to content

Solar Panel Calculation to Determine the Optimal Series and Parallel Configuration

License

panupong-develop/Solar-Panel-Calculation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solar Panel Optimizer

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.

Features

  • 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 Streamlit to 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.

Installation

Requirements

  • Python 3.8+
  • Streamlit

Install Dependencies

pip install streamlit

How to Run

To run the app locally, follow these steps:

  1. Clone the repository or copy the provided Python code.
  2. Install the required dependencies.
  3. Run the application:
make run

Usage

  1. make run
  2. 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.
  3. 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.

Example

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.

Code Overview

Functions

  • 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.

License

This project is open-source and available under the MIT License.

About

Solar Panel Calculation to Determine the Optimal Series and Parallel Configuration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •