Skip to content

Commit

Permalink
comment out unused analytical depletion approximation code
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebe-p committed Jul 20, 2023
1 parent 19db66c commit 03cb8a9
Showing 1 changed file with 94 additions and 94 deletions.
188 changes: 94 additions & 94 deletions solcore/analytic_solar_cells/depletion_approximation.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,97 +973,97 @@ def get_depletion_widths(junction, es_n, es_p, Vbi, V, Na, Nd, xi):
return wn, wp


def iv_depletion_analytical(junction, options):
"""Calculates the IV curve of a junction object using the analytical solutions to
the depletion approximation with Beer-Lambert absorption as described in e.g. J.
Nelson, “The Physics of Solar Cells”, Imperial College Press (2003). Note that the
equations used here are not exactly those from the book, as they contain typos.
The junction is then updated with an "iv" function that calculates the IV curve at
any voltage.
:param junction: A junction object.
:param options: Solver options.
:return: None.
"""

pass


def minority_carrier_top_analytical(x, L, alpha, xa, D, S, n0, A):
aL = alpha * L
a1 = -aL * np.exp(2 * alpha * (x + xa) + (2 * x / L)) + aL * np.exp(
2 * alpha * (x + xa) + (2 * xa / L)
)

a2 = np.exp(2 * alpha * x + alpha * xa + (xa / L)) - np.exp(
alpha * x + 2 * alpha * xa + (x / L)
)

a3 = np.exp(((aL + 1) * (2 * x + xa)) / L) - np.exp(((aL + 1) * (x + 2 * xa)) / L)

b1 = np.exp(((aL + 1) * (2 * x + xa)) / L) - np.exp(((aL + 1) * (x + 2 * xa)) / L)

b2 = np.exp(alpha * x + 2 * alpha * xa + (x / L)) - np.exp(
2 * alpha * x + alpha * xa + (xa / L)
)

b3 = -np.exp(2 * alpha * (x + xa) + (2 * x / L)) + np.exp(
2 * alpha * (x + xa) + (2 * xa / L)
)

numerator = (
A
* L**2
* np.exp(-2 * alpha * (x + xa) - (x / L))
* (D * (a1 + a2 + a3) + L * S * (b1 + b2 + b3))
)
denominator = (
D
* (alpha**2 * L**2 - 1)
* (D * (np.exp(2 * xa / L) + 1) + L * S * (np.exp(2 * xa / L) - 1))
)
result = numerator / denominator + n0

return result


def minority_carrier_bottom_analytical(x, L, alpha, xb, D, S, p0, A):
aL = alpha * L
denominator = (
D
* (-1 + alpha**2 * L**2)
* (D * (1 + np.exp((2 * xb) / L)) + (-1 + np.exp((2 * xb) / L)) * L * S)
)

a1 = np.exp((2 * xb) / L + 2 * alpha * (x + xb)) - np.exp(
(((1 + aL) * (x + 2 * xb)) / L)
)

a2 = np.exp((2 * x) / L + 2 * alpha * (x + xb)) - np.exp(
alpha * x + x / L + 2 * alpha * xb
)

a3 = (
alpha * np.exp(2 * alpha * x + alpha * xb + xb / L) * L
- alpha * np.exp(((1 + aL) * (2 * x + xb)) / L) * L
)

b1 = np.exp(((1 + aL) * (2 * x + xb)) / L) - np.exp(((1 + aL) * (x + 2 * xb)) / L)

b2 = +np.exp(alpha * x + x / L + 2 * alpha * xb) - np.exp(
2 * alpha * x + alpha * xb + xb / L
)

b3 = np.exp((2 * xb) / L + 2 * alpha * (x + xb)) - np.exp(
(2 * x) / L + 2 * alpha * (x + xb)
)

numerator = (
A
* np.exp(-(x / L) - 2 * alpha * (x + xb))
* L**2
* (D * (a1 + a2 + a3) + (b1 + b2 + b3) * L * S)
)

p = p0 + numerator / denominator
return p
# def iv_depletion_analytical(junction, options):
# """Calculates the IV curve of a junction object using the analytical solutions to
# the depletion approximation with Beer-Lambert absorption as described in e.g. J.
# Nelson, “The Physics of Solar Cells”, Imperial College Press (2003). Note that the
# equations used here are not exactly those from the book, as they contain typos.
# The junction is then updated with an "iv" function that calculates the IV curve at
# any voltage.
#
# :param junction: A junction object.
# :param options: Solver options.
# :return: None.
# """
#
# pass


# def minority_carrier_top_analytical(x, L, alpha, xa, D, S, n0, A):
# aL = alpha * L
# a1 = -aL * np.exp(2 * alpha * (x + xa) + (2 * x / L)) + aL * np.exp(
# 2 * alpha * (x + xa) + (2 * xa / L)
# )
#
# a2 = np.exp(2 * alpha * x + alpha * xa + (xa / L)) - np.exp(
# alpha * x + 2 * alpha * xa + (x / L)
# )
#
# a3 = np.exp(((aL + 1) * (2 * x + xa)) / L) - np.exp(((aL + 1) * (x + 2 * xa)) / L)
#
# b1 = np.exp(((aL + 1) * (2 * x + xa)) / L) - np.exp(((aL + 1) * (x + 2 * xa)) / L)
#
# b2 = np.exp(alpha * x + 2 * alpha * xa + (x / L)) - np.exp(
# 2 * alpha * x + alpha * xa + (xa / L)
# )
#
# b3 = -np.exp(2 * alpha * (x + xa) + (2 * x / L)) + np.exp(
# 2 * alpha * (x + xa) + (2 * xa / L)
# )
#
# numerator = (
# A
# * L**2
# * np.exp(-2 * alpha * (x + xa) - (x / L))
# * (D * (a1 + a2 + a3) + L * S * (b1 + b2 + b3))
# )
# denominator = (
# D
# * (alpha**2 * L**2 - 1)
# * (D * (np.exp(2 * xa / L) + 1) + L * S * (np.exp(2 * xa / L) - 1))
# )
# result = numerator / denominator + n0
#
# return result


# def minority_carrier_bottom_analytical(x, L, alpha, xb, D, S, p0, A):
# aL = alpha * L
# denominator = (
# D
# * (-1 + alpha**2 * L**2)
# * (D * (1 + np.exp((2 * xb) / L)) + (-1 + np.exp((2 * xb) / L)) * L * S)
# )
#
# a1 = np.exp((2 * xb) / L + 2 * alpha * (x + xb)) - np.exp(
# (((1 + aL) * (x + 2 * xb)) / L)
# )
#
# a2 = np.exp((2 * x) / L + 2 * alpha * (x + xb)) - np.exp(
# alpha * x + x / L + 2 * alpha * xb
# )
#
# a3 = (
# alpha * np.exp(2 * alpha * x + alpha * xb + xb / L) * L
# - alpha * np.exp(((1 + aL) * (2 * x + xb)) / L) * L
# )
#
# b1 = np.exp(((1 + aL) * (2 * x + xb)) / L) - np.exp(((1 + aL) * (x + 2 * xb)) / L)
#
# b2 = +np.exp(alpha * x + x / L + 2 * alpha * xb) - np.exp(
# 2 * alpha * x + alpha * xb + xb / L
# )
#
# b3 = np.exp((2 * xb) / L + 2 * alpha * (x + xb)) - np.exp(
# (2 * x) / L + 2 * alpha * (x + xb)
# )
#
# numerator = (
# A
# * np.exp(-(x / L) - 2 * alpha * (x + xb))
# * L**2
# * (D * (a1 + a2 + a3) + (b1 + b2 + b3) * L * S)
# )
#
# p = p0 + numerator / denominator
# return p

0 comments on commit 03cb8a9

Please sign in to comment.