Ejemplo n.º 1
0
def da_options():
    from solcore.state import State

    options = State()
    wl = np.linspace(290, 700, 150) * 1e-9
    options.T = np.random.uniform(250, 350)
    options.wavelength = wl
    options.light_source = da_light_source()
    options.position = None
    options.internal_voltages = np.linspace(-6, 4, 20)
    options.da_mode = 'bvp'

    return options
import numpy as np
from scipy.interpolate import interp1d
from scipy.integrate import solve_bvp, quad_vec
from functools import partial

from solcore.constants import kb, q
from solcore.science_tracker import science_reference
from solcore.state import State
from solcore.light_source import LightSource

da_options = State()
da_options.da_mode = 'bvp'


def identify_layers(junction):
    # First we have to figure out if we are talking about a PN, NP, PIN or NIP junction
    # We search for the emitter and check if it is n-type or p-type
    idx = 0
    pn_or_np = 'pn'
    homojunction = True

    for layer in junction:
        if layer.role.lower() != 'emitter':
            idx += 1
        else:
            Na = 0
            Nd = 0
            if hasattr(layer.material, 'Na'): Na = layer.material.Na
            if hasattr(layer.material, 'Nd'): Nd = layer.material.Nd
            if Na < Nd:
                pn_or_np = "np"