コード例 #1
0
    def test_parallel_connected_mj_cells_2(self):
        """
        Try connecting two strings of cells. All are Eg=1.42 SQCell.
        Each string has five cells. One string has a cell has only 0.5 sun.

        :return:
        """

        normal_cell = SQCell(eg=1.42, cell_T=300, plug_in_term=rev_diode)
        normal_cell.set_input_spectrum(load_astm("AM1.5d"))

        low_current_cell = SQCell(eg=1.42, cell_T=300, plug_in_term=rev_diode)
        low_current_cell.set_input_spectrum(load_astm("AM1.5d") * 0.5)

        # A trick is used here to configure MJCell. The MJCell is not illuminated.
        # But each of the subcell is illuminated individually.
        tj_cell_1 = MJCell([copy.deepcopy(normal_cell) for i in range(4)] + [copy.deepcopy(low_current_cell)])

        tj_cell_2 = MJCell([copy.deepcopy(normal_cell) for i in range(5)])

        iv_funcs = [tj_cell_1.get_j_from_v, tj_cell_2.get_j_from_v]

        parallel_v, parallel_i = solve_parallel_connected_ivs(iv_funcs, vmin=-2, vmax=6, vnum=30)
        volt = np.linspace(-2, 6, num=30)
        curr_1 = tj_cell_1.get_j_from_v(volt)
        curr_2 = tj_cell_2.get_j_from_v(volt)

        plt.plot(volt, curr_1, '.-', label="string 1")
        plt.plot(volt, curr_2, '.-', label="string 2")
        plt.plot(parallel_v, parallel_i, '.-', label="parallel-connected string")
        plt.ylim([-600, 0])
        plt.legend()
        plt.show()
コード例 #2
0
    def test_mj_j_from_v(self):
        """
        Test MJCell.get_j_from_v()

        :return:
        """
        sq1_cell = SQCell(eg=1.87, cell_T=300, plug_in_term=rev_diode)

        sq2_cell = SQCell(eg=1.42, cell_T=300, plug_in_term=rev_diode)

        sq3_cell = SQCell(eg=1.0, cell_T=300, plug_in_term=rev_diode)

        tj_cell = MJCell([sq1_cell, sq2_cell, sq3_cell])
        tj_cell.set_input_spectrum(load_astm(("AM1.5d")))

        solved_mj_v, solved_mj_i = tj_cell.get_iv()

        volt = np.linspace(2.5, 5, num=300)
        solved_current = tj_cell.get_j_from_v(volt, max_iter=3)
        interped_i = np.interp(volt, solved_mj_v, solved_mj_i)

        print(solved_current - interped_i)

        plt.plot(volt, interped_i, '.-')
        plt.plot(solved_mj_v, solved_mj_i, '.-')
        plt.plot(volt, solved_current, '.-', label='get_j_from_v', alpha=0.3)

        plt.ylim([-200, 0])
        plt.legend()
        plt.show()