Skip to main content

solarcell

Estimate IV- and PV-curves given photovoltaic cell datasheet parameters. Capable of generating combined curves for solar arrays with temperature and light intensity gradients. Assumes ideal bypass and blocking diodes for all cells.

Available for download on PyPI.

pip install solarcell

Requires Python 3.11 or newer. Supports NumPy 1.26 and 2.x; the test suite covers Python 3.11 through 3.15.

Usage

See the examples contained within this repository. Please also consider reading the related blog post, "How To Estimate Complex Solar Array Power Curves".

import numpy as np
from matplotlib import pyplot as plt
from solarcell import solarcell

# Azur Space 3G30A triple-junction solar cells in a 24s12p configuration.
# Isc/Imp are specified in (A, A/C), Voc/Vmp are specified in (V, V/C).
# Temperature is specified in C. Intensity is unitless and scales Isc/Imp.

azur3g30a = solarcell(
    isc=(0.5196, 0.00036),  # short-circuit current, temp coefficient
    voc=(2.690, -0.0062),  # open-circuit voltage, temp coefficient
    imp=(0.5029, 0.00024),  # max-power current, temp coefficient
    vmp=(2.409, -0.0067),  # max-power voltage, temp coefficient
    area=30.18,  # solar cell area in square centimeters
    t=28,  # temperature at which the above parameters are specified
)

array = azur3g30a.array(t=np.full((24, 12), 80), g=np.ones((24, 12)))

print(array)
# Isc = 6.460 A, Voc = 56.82 V
# Imp = 6.201 A, Vmp = 49.33 V, Pmp = 305.9 W

fig, (ax0, ax1) = plt.subplots(nrows=2, sharex=True)

v = np.linspace(0, array.voc, 1000)
ax0.plot(v, array.iv(v)), ax0.grid()
ax1.plot(v, array.pv(v)), ax1.grid()

solarcell example

Background

A numeric optimization procedure is used to best fit the classic photovoltaic cell single diode model equation to the datasheet parameters at the reference temperature. Curves at other temperatures are derived relative to this initial curve fit by way of a linear transformation (plus a sigmoid smoothing function) that maintains the characteristic shape of the curve. Combining cells in series/parallel with different IV-curves is done by linear interpolation.

When computing a curve, the provided temperatures and intensities are generally organized as follows: cell(t, g) accepts single values, string(t, g) accepts one-dimensional arrays, and array(t, g) accepts two-dimensional arrays (where strings make up the columns). A cache is implemented to increase speed for repeated computations; rounding by the user will yield better performance.

References

  1. Amit Jain, Avinashi Kapoor, Exact analytical solutions of the parameters of real solar cells using Lambert W-function, Solar Energy Materials and Solar Cells, Volume 81, Issue 2, 2004, Pages 269-277, ISSN 0927-0248, https://doi.org/10.1016/j.solmat.2003.11.018.

Metadata

Release files for solarcell 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solarcell 0.2.1
File Size Uploaded
solarcell-0.2.1.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for solarcell 0.2.1
File Interpreter ABI Platform
solarcell-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.0 kB

Release files / solarcell-0.2.1.tar.gz

Download URL solarcell-0.2.1.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
91a8e6b37091e6d2045c0f86f5a94bff4da868f5f2cb3e7307b9d3cf86303340
BLAKE2b-256 checksum
How to use checksums
f4a412e716fb4caeb06bac166b983b0a97946daaecfdae3fc5e42391689fa18c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.13.1 Windows/11

Release files / solarcell-0.2.1-py3-none-any.whl

Download URL solarcell-0.2.1-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44b3500b0240bfd36a80cde72e0b776894abe1f0954e6b4297fb9ff8163ff0fe
BLAKE2b-256 checksum
How to use checksums
664e136b17e3beea42a1a3a73aeacaa164bcbf64eec9db761bcfd0571b53dc9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.13.1 Windows/11

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page