├── .nojekyll ├── docs ├── .nojekyll ├── styles.css ├── site_libs │ ├── bootstrap │ │ └── bootstrap-icons.woff │ ├── quarto-html │ │ ├── tippy.css │ │ ├── quarto-syntax-highlighting.css │ │ └── anchor.min.js │ ├── quarto-nav │ │ ├── headroom.min.js │ │ └── quarto-nav.js │ └── clipboard │ │ └── clipboard.min.js ├── solar-cell-simulation │ └── notebooks │ │ ├── 1a-simple_cell_files │ │ └── figure-html │ │ │ ├── cell-12-output-1.png │ │ │ ├── cell-19-output-1.png │ │ │ ├── cell-20-output-1.png │ │ │ ├── cell-22-output-1.png │ │ │ └── cell-23-output-1.png │ │ ├── 1b-simple_cell_files │ │ └── figure-html │ │ │ ├── cell-10-output-1.png │ │ │ ├── cell-8-output-1.png │ │ │ └── cell-9-output-1.png │ │ ├── 1c-simple_cell_files │ │ └── figure-html │ │ │ ├── cell-11-output-1.png │ │ │ ├── cell-16-output-1.png │ │ │ └── cell-17-output-1.png │ │ ├── 7a-optimization_files │ │ └── figure-html │ │ │ ├── cell-4-output-1.png │ │ │ ├── cell-6-output-1.png │ │ │ ├── cell-7-output-1.png │ │ │ └── cell-10-output-1.png │ │ ├── 7b-optimization_files │ │ └── figure-html │ │ │ ├── cell-9-output-2.png │ │ │ ├── cell-10-output-1.png │ │ │ ├── cell-14-output-2.png │ │ │ ├── cell-14-output-5.png │ │ │ └── cell-15-output-1.png │ │ ├── 2a-optical_constants_files │ │ └── figure-html │ │ │ ├── cell-5-output-1.png │ │ │ ├── cell-10-output-1.png │ │ │ └── cell-14-output-1.png │ │ ├── 2b-optical_constants_files │ │ └── figure-html │ │ │ ├── cell-7-output-1.png │ │ │ └── cell-13-output-1.png │ │ ├── 3a-triple_junction_files │ │ └── figure-html │ │ │ ├── cell-11-output-5.png │ │ │ ├── cell-12-output-2.png │ │ │ └── cell-16-output-1.png │ │ ├── 4a-textured_Si_cell_files │ │ └── figure-html │ │ │ ├── cell-11-output-1.png │ │ │ ├── cell-16-output-1.png │ │ │ └── cell-17-output-2.png │ │ ├── 5a-ultrathin_GaAs_cell_files │ │ └── figure-html │ │ │ ├── cell-11-output-1.png │ │ │ └── cell-12-output-1.png │ │ ├── 6a-multiscale_models_files │ │ └── figure-html │ │ │ ├── cell-11-output-1.png │ │ │ ├── cell-12-output-1.png │ │ │ ├── cell-15-output-1.png │ │ │ └── cell-16-output-1.png │ │ └── 6b-multiscale_models_files │ │ └── figure-html │ │ ├── cell-10-output-1.png │ │ └── cell-17-output-1.png ├── about.html └── index.html ├── solar-cells └── example_1.py ├── about.qmd ├── binder ├── postBuild ├── apt.txt └── requirements.txt ├── README.md ├── solar-cell-simulation ├── data │ ├── SiGeSn_params.txt │ ├── Palik_GaAs_Eps1.csv │ ├── Palik_GaAs_Eps2.csv │ ├── RAT_data_300um_2um_55.csv │ ├── model_i_a_silicon_n.txt │ └── model_i_a_silicon_k.txt ├── notebooks │ └── data │ │ ├── SiGeSn_params.txt │ │ ├── Palik_GaAs_Eps1.csv │ │ ├── Palik_GaAs_Eps2.csv │ │ ├── RAT_data_300um_2um_55.csv │ │ ├── model_i_a_silicon_n.txt │ │ └── model_i_a_silicon_k.txt ├── additional-plots │ └── two_diode_model.py ├── 2b-optical_constants.py ├── 7a-optimization.py ├── 1c-simple_cell.py ├── 1b-simple_cell.py ├── 2a-optical_constants.py ├── 4a-textured_Si_cell.py ├── 3a-triple_junction.py ├── 5a-ultrathin_GaAs_cell.py └── 1a-simple_cell.py ├── _quarto.yml ├── index.qmd └── .gitignore /.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /solar-cells/example_1.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/styles.css: -------------------------------------------------------------------------------- 1 | /* css styles */ 2 | -------------------------------------------------------------------------------- /about.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "About" 3 | --- 4 | 5 | Welcome to the solcore-education website. -------------------------------------------------------------------------------- /binder/postBuild: -------------------------------------------------------------------------------- 1 | set -ex 2 | 3 | git clone https://github.com/phoebe-p/S4 4 | cd S4 5 | make S4_pyext 6 | cd .. 7 | rm -rf S4 -------------------------------------------------------------------------------- /binder/apt.txt: -------------------------------------------------------------------------------- 1 | gfortran 2 | ngspice 3 | make 4 | git 5 | gcc 6 | g++ 7 | libopenblas-dev 8 | libfftw3-dev 9 | libsuitesparse-dev 10 | libboost-all-dev -------------------------------------------------------------------------------- /docs/site_libs/bootstrap/bootstrap-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/site_libs/bootstrap/bootstrap-icons.woff -------------------------------------------------------------------------------- /binder/requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | matplotlib 3 | scipy 4 | tmm 5 | natsort 6 | regex 7 | cycler 8 | pyyaml 9 | yabox 10 | joblib 11 | seaborn 12 | rayflare 13 | -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1a-simple_cell_files/figure-html/cell-12-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1a-simple_cell_files/figure-html/cell-12-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1a-simple_cell_files/figure-html/cell-19-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1a-simple_cell_files/figure-html/cell-19-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1a-simple_cell_files/figure-html/cell-20-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1a-simple_cell_files/figure-html/cell-20-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1a-simple_cell_files/figure-html/cell-22-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1a-simple_cell_files/figure-html/cell-22-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1a-simple_cell_files/figure-html/cell-23-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1a-simple_cell_files/figure-html/cell-23-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1b-simple_cell_files/figure-html/cell-10-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1b-simple_cell_files/figure-html/cell-10-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1b-simple_cell_files/figure-html/cell-8-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1b-simple_cell_files/figure-html/cell-8-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1b-simple_cell_files/figure-html/cell-9-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1b-simple_cell_files/figure-html/cell-9-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1c-simple_cell_files/figure-html/cell-11-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1c-simple_cell_files/figure-html/cell-11-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1c-simple_cell_files/figure-html/cell-16-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1c-simple_cell_files/figure-html/cell-16-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/1c-simple_cell_files/figure-html/cell-17-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/1c-simple_cell_files/figure-html/cell-17-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/7a-optimization_files/figure-html/cell-4-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/7a-optimization_files/figure-html/cell-4-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/7a-optimization_files/figure-html/cell-6-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/7a-optimization_files/figure-html/cell-6-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/7a-optimization_files/figure-html/cell-7-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/7a-optimization_files/figure-html/cell-7-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/7b-optimization_files/figure-html/cell-9-output-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/7b-optimization_files/figure-html/cell-9-output-2.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/7a-optimization_files/figure-html/cell-10-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/7a-optimization_files/figure-html/cell-10-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/7b-optimization_files/figure-html/cell-10-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/7b-optimization_files/figure-html/cell-10-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/7b-optimization_files/figure-html/cell-14-output-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/7b-optimization_files/figure-html/cell-14-output-2.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/7b-optimization_files/figure-html/cell-14-output-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/7b-optimization_files/figure-html/cell-14-output-5.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/7b-optimization_files/figure-html/cell-15-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/7b-optimization_files/figure-html/cell-15-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/2a-optical_constants_files/figure-html/cell-5-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/2a-optical_constants_files/figure-html/cell-5-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/2b-optical_constants_files/figure-html/cell-7-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/2b-optical_constants_files/figure-html/cell-7-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/3a-triple_junction_files/figure-html/cell-11-output-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/3a-triple_junction_files/figure-html/cell-11-output-5.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/3a-triple_junction_files/figure-html/cell-12-output-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/3a-triple_junction_files/figure-html/cell-12-output-2.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/3a-triple_junction_files/figure-html/cell-16-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/3a-triple_junction_files/figure-html/cell-16-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/4a-textured_Si_cell_files/figure-html/cell-11-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/4a-textured_Si_cell_files/figure-html/cell-11-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/4a-textured_Si_cell_files/figure-html/cell-16-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/4a-textured_Si_cell_files/figure-html/cell-16-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/4a-textured_Si_cell_files/figure-html/cell-17-output-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/4a-textured_Si_cell_files/figure-html/cell-17-output-2.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/2a-optical_constants_files/figure-html/cell-10-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/2a-optical_constants_files/figure-html/cell-10-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/2a-optical_constants_files/figure-html/cell-14-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/2a-optical_constants_files/figure-html/cell-14-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/2b-optical_constants_files/figure-html/cell-13-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/2b-optical_constants_files/figure-html/cell-13-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/5a-ultrathin_GaAs_cell_files/figure-html/cell-11-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/5a-ultrathin_GaAs_cell_files/figure-html/cell-11-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/5a-ultrathin_GaAs_cell_files/figure-html/cell-12-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/5a-ultrathin_GaAs_cell_files/figure-html/cell-12-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/6a-multiscale_models_files/figure-html/cell-11-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/6a-multiscale_models_files/figure-html/cell-11-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/6a-multiscale_models_files/figure-html/cell-12-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/6a-multiscale_models_files/figure-html/cell-12-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/6a-multiscale_models_files/figure-html/cell-15-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/6a-multiscale_models_files/figure-html/cell-15-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/6a-multiscale_models_files/figure-html/cell-16-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/6a-multiscale_models_files/figure-html/cell-16-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/6b-multiscale_models_files/figure-html/cell-10-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/6b-multiscale_models_files/figure-html/cell-10-output-1.png -------------------------------------------------------------------------------- /docs/solar-cell-simulation/notebooks/6b-multiscale_models_files/figure-html/cell-17-output-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qpv-research-group/solcore-education/main/docs/solar-cell-simulation/notebooks/6b-multiscale_models_files/figure-html/cell-17-output-1.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # solcore-education 2 | Collection of teaching materials and scripts to help students and users learn about solar cells, 3 | Solcore, RayFlare. 4 | 5 | View/run the examples on Binder: 6 | 7 | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/qpv-research-group/solcore-education/main) 8 | 9 | [Click here](https://qpv-research-group.github.io/solcore-education/) to view the examples on GitHub Pages. 10 | 11 | [comment]: # (Command to convert .ipynb to .py: jupyter nbconvert --output-dir='./solar-cell-simulation' ./solar-cell-simulation/notebooks/*.ipynb --to script 12 | ) -------------------------------------------------------------------------------- /solar-cell-simulation/data/SiGeSn_params.txt: -------------------------------------------------------------------------------- 1 | [SiGeSn] 2 | lattice_constant=5.658 Angstrom 3 | Eg0_Gamma=0.89 eV 4 | alpha_Gamma=0.582 meV K-1 5 | beta_Gamma=296 K 6 | Eg0_L=0.742 eV 7 | alpha_L=0.48 meV K-1 8 | beta_L=235 K 9 | spin_orbit_splitting=0.29 eV 10 | eff_mass_DOS_L=0.22 11 | eff_mass_DOS_X=0.22 12 | gamma1=13.35 13 | gamma2=4.25 14 | gamma3=5.69 15 | eff_mass_split_off=0.084 16 | eff_mass_electron=0.12 17 | eff_mass_hh_z=0.33 18 | eff_mass_lh_z=0.043 19 | interband_matrix_element=26.3 eV 20 | c11=126 GPa 21 | c12=44 GPa 22 | c44=67.7 GPa 23 | relative_dielectric_constant=16.2 24 | electron_affinity=4.0 eV 25 | electron_auger_recombination=1e-42 26 | hole_auger_recombination=1e-42 27 | radiative_recombination=6.4e-20 -------------------------------------------------------------------------------- /solar-cell-simulation/notebooks/data/SiGeSn_params.txt: -------------------------------------------------------------------------------- 1 | [SiGeSn] 2 | lattice_constant=5.658 Angstrom 3 | Eg0_Gamma=0.89 eV 4 | alpha_Gamma=0.582 meV K-1 5 | beta_Gamma=296 K 6 | Eg0_L=0.742 eV 7 | alpha_L=0.48 meV K-1 8 | beta_L=235 K 9 | spin_orbit_splitting=0.29 eV 10 | eff_mass_DOS_L=0.22 11 | eff_mass_DOS_X=0.22 12 | gamma1=13.35 13 | gamma2=4.25 14 | gamma3=5.69 15 | eff_mass_split_off=0.084 16 | eff_mass_electron=0.12 17 | eff_mass_hh_z=0.33 18 | eff_mass_lh_z=0.043 19 | interband_matrix_element=26.3 eV 20 | c11=126 GPa 21 | c12=44 GPa 22 | c44=67.7 GPa 23 | relative_dielectric_constant=16.2 24 | electron_affinity=4.0 eV 25 | electron_auger_recombination=1e-42 26 | hole_auger_recombination=1e-42 27 | radiative_recombination=6.4e-20 -------------------------------------------------------------------------------- /solar-cell-simulation/data/Palik_GaAs_Eps1.csv: -------------------------------------------------------------------------------- 1 | 0.291910734,10.94926657 2 | 0.468615345,11.0932519 3 | 0.645323215,11.25620083 4 | 0.822041196,11.47796057 5 | 0.998771961,11.77408129 6 | 1.175524953,12.19949347 7 | 1.352318625,12.8615393 8 | 1.529114384,13.53571773 9 | 1.705884045,14.05809565 10 | 1.882657468,14.60235103 11 | 2.066415092,15.34474157 12 | 2.232485016,16.30129041 13 | 2.400597258,17.62832151 14 | 2.561415074,19.16106373 15 | 2.639106701,20.72574113 16 | 2.758282405,22.5747439 17 | 2.855084127,23.49500185 18 | 2.912213329,20.57445793 19 | 2.928358435,18.35782719 20 | 2.993532145,16.43799671 21 | 3.073208384,14.98167271 22 | 3.111361934,13.19374078 23 | 3.155331121,11.44324465 24 | 3.228347978,9.702416776 25 | 3.404455128,8.701498101 26 | 3.581073068,8.341333359 27 | 3.757778809,8.491895714 28 | 3.934548116,9.012211895 29 | 4.111363234,9.799000929 30 | 4.288104274,10.15489233 31 | 4.418613277,8.868505386 32 | 4.450337418,7.685628436 33 | 4.510738689,6.076341534 34 | 4.571271184,4.659976741 35 | 4.627366063,2.997350847 36 | 4.711313555,0.477358021 37 | 4.755732661,-0.52037397 38 | 4.788262642,-2.859811574 39 | 4.838781114,-5.103297205 40 | 4.89959537,-8.163205476 41 | 4.953480394,-10.10714966 42 | 5.000038453,-11.71332317 -------------------------------------------------------------------------------- /solar-cell-simulation/notebooks/data/Palik_GaAs_Eps1.csv: -------------------------------------------------------------------------------- 1 | 0.291910734,10.94926657 2 | 0.468615345,11.0932519 3 | 0.645323215,11.25620083 4 | 0.822041196,11.47796057 5 | 0.998771961,11.77408129 6 | 1.175524953,12.19949347 7 | 1.352318625,12.8615393 8 | 1.529114384,13.53571773 9 | 1.705884045,14.05809565 10 | 1.882657468,14.60235103 11 | 2.066415092,15.34474157 12 | 2.232485016,16.30129041 13 | 2.400597258,17.62832151 14 | 2.561415074,19.16106373 15 | 2.639106701,20.72574113 16 | 2.758282405,22.5747439 17 | 2.855084127,23.49500185 18 | 2.912213329,20.57445793 19 | 2.928358435,18.35782719 20 | 2.993532145,16.43799671 21 | 3.073208384,14.98167271 22 | 3.111361934,13.19374078 23 | 3.155331121,11.44324465 24 | 3.228347978,9.702416776 25 | 3.404455128,8.701498101 26 | 3.581073068,8.341333359 27 | 3.757778809,8.491895714 28 | 3.934548116,9.012211895 29 | 4.111363234,9.799000929 30 | 4.288104274,10.15489233 31 | 4.418613277,8.868505386 32 | 4.450337418,7.685628436 33 | 4.510738689,6.076341534 34 | 4.571271184,4.659976741 35 | 4.627366063,2.997350847 36 | 4.711313555,0.477358021 37 | 4.755732661,-0.52037397 38 | 4.788262642,-2.859811574 39 | 4.838781114,-5.103297205 40 | 4.89959537,-8.163205476 41 | 4.953480394,-10.10714966 42 | 5.000038453,-11.71332317 -------------------------------------------------------------------------------- /_quarto.yml: -------------------------------------------------------------------------------- 1 | project: 2 | type: website 3 | output-dir: docs 4 | 5 | website: 6 | title: "solcore-education" 7 | navbar: 8 | left: 9 | - href: index.qmd 10 | text: Home 11 | 12 | sidebar: 13 | style: "floating" 14 | search: true 15 | contents: 16 | - section: "Examples" 17 | contents: 18 | - solar-cell-simulation/notebooks/1a-simple_cell.ipynb 19 | - solar-cell-simulation/notebooks/1b-simple_cell.ipynb 20 | - solar-cell-simulation/notebooks/1c-simple_cell.ipynb 21 | - solar-cell-simulation/notebooks/2a-optical_constants.ipynb 22 | - solar-cell-simulation/notebooks/2b-optical_constants.ipynb 23 | - solar-cell-simulation/notebooks/3a-triple_junction.ipynb 24 | - solar-cell-simulation/notebooks/4a-textured_Si_cell.ipynb 25 | - solar-cell-simulation/notebooks/5a-ultrathin_GaAs_cell.ipynb 26 | - solar-cell-simulation/notebooks/6a-multiscale_models.ipynb 27 | - solar-cell-simulation/notebooks/6b-multiscale_models.ipynb 28 | - solar-cell-simulation/notebooks/7a-optimization.ipynb 29 | - solar-cell-simulation/notebooks/7b-optimization.ipynb 30 | 31 | format: 32 | html: 33 | theme: flatly 34 | css: styles.css 35 | toc: true 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /index.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "solcore-education" 3 | --- 4 | 5 | This is the website for the solcore-education GitHub, where we host readable versions of Solcore and RayFlare examples, 6 | which are linked on the left. Note that this is not an introductory Python course, or a course about the fundamentals of 7 | solar cells. 8 | 9 | The examples on this website are hosted in Jupyter Notebook (.ipynb) format for readability. To run the examples yourself, 10 | you can find standard .py versions on the GitHub [here](https://github.com/qpv-research-group/solcore-education/tree/main/solar-cell-simulation). 11 | We recommend using these rather than the Notebook versions. 12 | 13 | **Package requirements** 14 | 15 | To use these examples, you will need to install [Solcore](http://docs.solcore.solar/en/master/Installation/installation.html) 16 | and [RayFlare](https://rayflare.readthedocs.io/en/latest/Installation/installation.html) (the links take you to installation 17 | instructions for each package). In the simplest case, you can install them with: 18 | 19 | ``` 20 | pip install solcore rayflare 21 | ``` 22 | 23 | But this will not install all functionality, as detailed in the documentation for both packages. 24 | 25 | The only other dependency, which is used for plotting, is `seaborn`, which you can install simply with: 26 | 27 | ``` 28 | pip install seaborn 29 | ``` -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/tippy.css: -------------------------------------------------------------------------------- 1 | .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} -------------------------------------------------------------------------------- /solar-cell-simulation/data/Palik_GaAs_Eps2.csv: -------------------------------------------------------------------------------- 1 | 0.255611605,0.039731623 2 | 0.420850348,0.045923952 3 | 0.578429018,0.040202739 4 | 0.736007687,0.052938224 5 | 0.897963541,0.029735557 6 | 1.051165025,0.008688652 7 | 1.208743694,0.037606329 8 | 1.379453919,0.045155144 9 | 1.516240959,0.569304685 10 | 1.681479702,0.923189253 11 | 1.839058371,1.313057087 12 | 1.990774739,1.55697827 13 | 2.15421571,2.08652413 14 | 2.322090713,2.595519776 15 | 2.449675715,3.264489268 16 | 2.533389383,4.17065252 17 | 2.600360317,4.951623627 18 | 2.656118923,5.832537151 19 | 2.709434302,6.804801294 20 | 2.736928497,7.838646866 21 | 2.775502442,8.888906057 22 | 2.787484987,9.81816176 23 | 2.808394464,10.90235546 24 | 2.832132276,12.26636169 25 | 2.85182961,13.79536917 26 | 2.864961166,15.60583656 27 | 2.918830389,17.46894786 28 | 2.925225627,18.41209343 29 | 2.858395388,14.66900616 30 | 2.887941388,16.45961164 31 | 3.049996724,17.7417586 32 | 3.093356439,18.33868802 33 | 3.143350148,18.9273773 34 | 3.199405477,17.74475069 35 | 3.232644727,16.93663639 36 | 3.276516061,16.05801876 37 | 3.345904396,15.21835277 38 | 3.434542397,14.39379515 39 | 3.592121067,13.73484316 40 | 3.749699736,13.37321862 41 | 3.907278405,13.50232435 42 | 4.048925407,14.04490409 43 | 4.124396742,14.85137396 44 | 4.184682521,15.71541575 45 | 4.237208744,16.52943389 46 | 4.281527744,17.76870708 47 | 4.324205301,18.82863861 48 | 4.386251902,20.4489992 49 | 4.355392746,19.71417514 50 | 4.41940908,21.68947307 51 | 4.499839859,22.83993201 52 | 4.602768083,23.90779105 53 | 4.705020418,24.80168502 54 | 4.823652087,24.71292354 55 | 4.877372087,23.32649404 56 | 4.920049644,21.73284186 57 | 4.897069421,22.51683635 58 | 4.936464088,20.47758361 59 | 4.977373935,18.52162593 60 | 4.951237089,19.73328324 61 | 5.018283782,16.23364916 62 | 4.995556089,17.44996383 63 | 5.044799423,15.33600782 64 | 5.080911202,13.56888239 65 | 5.059572424,14.57759033 66 | 5.124901914,12.32706588 67 | 5.187057944,11.00163986 68 | 5.26540956,9.950556541 69 | 5.350108095,8.946410019 70 | 5.474857875,8.104340216 71 | 5.550911469,7.648754833 -------------------------------------------------------------------------------- /solar-cell-simulation/notebooks/data/Palik_GaAs_Eps2.csv: -------------------------------------------------------------------------------- 1 | 0.255611605,0.039731623 2 | 0.420850348,0.045923952 3 | 0.578429018,0.040202739 4 | 0.736007687,0.052938224 5 | 0.897963541,0.029735557 6 | 1.051165025,0.008688652 7 | 1.208743694,0.037606329 8 | 1.379453919,0.045155144 9 | 1.516240959,0.569304685 10 | 1.681479702,0.923189253 11 | 1.839058371,1.313057087 12 | 1.990774739,1.55697827 13 | 2.15421571,2.08652413 14 | 2.322090713,2.595519776 15 | 2.449675715,3.264489268 16 | 2.533389383,4.17065252 17 | 2.600360317,4.951623627 18 | 2.656118923,5.832537151 19 | 2.709434302,6.804801294 20 | 2.736928497,7.838646866 21 | 2.775502442,8.888906057 22 | 2.787484987,9.81816176 23 | 2.808394464,10.90235546 24 | 2.832132276,12.26636169 25 | 2.85182961,13.79536917 26 | 2.864961166,15.60583656 27 | 2.918830389,17.46894786 28 | 2.925225627,18.41209343 29 | 2.858395388,14.66900616 30 | 2.887941388,16.45961164 31 | 3.049996724,17.7417586 32 | 3.093356439,18.33868802 33 | 3.143350148,18.9273773 34 | 3.199405477,17.74475069 35 | 3.232644727,16.93663639 36 | 3.276516061,16.05801876 37 | 3.345904396,15.21835277 38 | 3.434542397,14.39379515 39 | 3.592121067,13.73484316 40 | 3.749699736,13.37321862 41 | 3.907278405,13.50232435 42 | 4.048925407,14.04490409 43 | 4.124396742,14.85137396 44 | 4.184682521,15.71541575 45 | 4.237208744,16.52943389 46 | 4.281527744,17.76870708 47 | 4.324205301,18.82863861 48 | 4.386251902,20.4489992 49 | 4.355392746,19.71417514 50 | 4.41940908,21.68947307 51 | 4.499839859,22.83993201 52 | 4.602768083,23.90779105 53 | 4.705020418,24.80168502 54 | 4.823652087,24.71292354 55 | 4.877372087,23.32649404 56 | 4.920049644,21.73284186 57 | 4.897069421,22.51683635 58 | 4.936464088,20.47758361 59 | 4.977373935,18.52162593 60 | 4.951237089,19.73328324 61 | 5.018283782,16.23364916 62 | 4.995556089,17.44996383 63 | 5.044799423,15.33600782 64 | 5.080911202,13.56888239 65 | 5.059572424,14.57759033 66 | 5.124901914,12.32706588 67 | 5.187057944,11.00163986 68 | 5.26540956,9.950556541 69 | 5.350108095,8.946410019 70 | 5.474857875,8.104340216 71 | 5.550911469,7.648754833 -------------------------------------------------------------------------------- /solar-cell-simulation/additional-plots/two_diode_model.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | 4 | from solcore.solar_cell import SolarCell, Layer, Junction 5 | from solcore.solar_cell_solver import solar_cell_solver 6 | from solcore.absorption_calculator import OptiStack, calculate_rat 7 | 8 | from solcore import material, si 9 | 10 | from solcore.interpolate import interp1d 11 | 12 | import seaborn as sns 13 | 14 | GaAs = material("GaAs")() 15 | Al2O3 = material("Al2O3")() 16 | Ag = material("Ag")() 17 | 18 | wavelengths = si(np.linspace(300, 950, 200), "nm") 19 | 20 | OS = OptiStack([Layer(si("3um"), GaAs)], substrate=Ag) 21 | 22 | RAT = calculate_rat(OS, wavelength=wavelengths*1e9, no_back_reflection=False) 23 | 24 | eqe_func = interp1d(wavelengths, RAT["A"]) 25 | 26 | V = np.linspace(0, 1.4, 200) 27 | 28 | N_R = 6 29 | R_series = np.insert(10 ** np.linspace(-6, -2, N_R - 1), 0, 0) 30 | R_shunt = 10 ** np.linspace(-4, 1, N_R) 31 | 32 | cols = sns.cubehelix_palette(N_R) 33 | 34 | for light_iv, title in zip([False, True], ['Dark IV', 'Light IV']): 35 | 36 | opts = {'voltages': V, 'wavelength': wavelengths, 'light_iv': light_iv} 37 | 38 | plt.figure(figsize=(10,4)) 39 | plt.subplot(121) 40 | 41 | for i1, Rs in enumerate(R_series): 42 | twod_junction = Junction(kind='2D', n1=1, n2=2, j01=1e-8, j02=1e-6, 43 | R_series=Rs, R_shunt=R_shunt[-1], eqe=eqe_func) 44 | solar_cell_2d = SolarCell([twod_junction]) 45 | solar_cell_solver(solar_cell_2d, 'iv', user_options=opts) 46 | plt.semilogy(*np.abs(solar_cell_2d.iv["IV"]), color=cols[i1], label='%.2E' % Rs) 47 | 48 | plt.xlim(0, 1.5) 49 | plt.xlabel("V (V)") 50 | plt.ylabel("|J| (A/m$^2$)") 51 | plt.legend(title='R$_{series}$') 52 | plt.autoscale(enable=True, axis='both', tight=True) 53 | plt.title(title, loc='left') 54 | 55 | plt.subplot(122) 56 | 57 | for i1, Rsh in enumerate(R_shunt): 58 | twod_junction = Junction(kind='2D', n1=1, n2=2, j01=1e-8, j02=1e-6, 59 | R_series=R_series[1], R_shunt=Rsh, eqe=eqe_func) 60 | solar_cell_2d = SolarCell([twod_junction]) 61 | solar_cell_solver(solar_cell_2d, 'iv', user_options=opts) 62 | plt.semilogy(*np.abs(solar_cell_2d.iv["IV"]), color=cols[i1], label='%.2E' % Rsh) 63 | 64 | plt.xlim(0, 1.5) 65 | plt.xlabel("V (V)") 66 | plt.ylabel("|J| (A/m$^2$)") 67 | plt.legend(title='R$_{shunt}$') 68 | plt.autoscale(enable=True, axis='both', tight=True) 69 | plt.tight_layout() 70 | plt.show() 71 | 72 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | 131 | # PyCharm 132 | .idea/ 133 | .Rproj.user 134 | 135 | .DS_Store 136 | 137 | /.quarto/ 138 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/quarto-syntax-highlighting.css: -------------------------------------------------------------------------------- 1 | /* quarto syntax highlight colors */ 2 | :root { 3 | --quarto-hl-ot-color: #003B4F; 4 | --quarto-hl-at-color: #657422; 5 | --quarto-hl-ss-color: #20794D; 6 | --quarto-hl-an-color: #5E5E5E; 7 | --quarto-hl-fu-color: #4758AB; 8 | --quarto-hl-st-color: #20794D; 9 | --quarto-hl-cf-color: #003B4F; 10 | --quarto-hl-op-color: #5E5E5E; 11 | --quarto-hl-er-color: #AD0000; 12 | --quarto-hl-bn-color: #AD0000; 13 | --quarto-hl-al-color: #AD0000; 14 | --quarto-hl-va-color: #111111; 15 | --quarto-hl-bu-color: inherit; 16 | --quarto-hl-ex-color: inherit; 17 | --quarto-hl-pp-color: #AD0000; 18 | --quarto-hl-in-color: #5E5E5E; 19 | --quarto-hl-vs-color: #20794D; 20 | --quarto-hl-wa-color: #5E5E5E; 21 | --quarto-hl-do-color: #5E5E5E; 22 | --quarto-hl-im-color: #00769E; 23 | --quarto-hl-ch-color: #20794D; 24 | --quarto-hl-dt-color: #AD0000; 25 | --quarto-hl-fl-color: #AD0000; 26 | --quarto-hl-co-color: #5E5E5E; 27 | --quarto-hl-cv-color: #5E5E5E; 28 | --quarto-hl-cn-color: #8f5902; 29 | --quarto-hl-sc-color: #5E5E5E; 30 | --quarto-hl-dv-color: #AD0000; 31 | --quarto-hl-kw-color: #003B4F; 32 | } 33 | 34 | /* other quarto variables */ 35 | :root { 36 | --quarto-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 37 | } 38 | 39 | code span { 40 | color: #003B4F; 41 | } 42 | 43 | code.sourceCode > span { 44 | color: #003B4F; 45 | } 46 | 47 | div.sourceCode, 48 | div.sourceCode pre.sourceCode { 49 | color: #003B4F; 50 | } 51 | 52 | code span.ot { 53 | color: #003B4F; 54 | } 55 | 56 | code span.at { 57 | color: #657422; 58 | } 59 | 60 | code span.ss { 61 | color: #20794D; 62 | } 63 | 64 | code span.an { 65 | color: #5E5E5E; 66 | } 67 | 68 | code span.fu { 69 | color: #4758AB; 70 | } 71 | 72 | code span.st { 73 | color: #20794D; 74 | } 75 | 76 | code span.cf { 77 | color: #003B4F; 78 | } 79 | 80 | code span.op { 81 | color: #5E5E5E; 82 | } 83 | 84 | code span.er { 85 | color: #AD0000; 86 | } 87 | 88 | code span.bn { 89 | color: #AD0000; 90 | } 91 | 92 | code span.al { 93 | color: #AD0000; 94 | } 95 | 96 | code span.va { 97 | color: #111111; 98 | } 99 | 100 | code span.pp { 101 | color: #AD0000; 102 | } 103 | 104 | code span.in { 105 | color: #5E5E5E; 106 | } 107 | 108 | code span.vs { 109 | color: #20794D; 110 | } 111 | 112 | code span.wa { 113 | color: #5E5E5E; 114 | font-style: italic; 115 | } 116 | 117 | code span.do { 118 | color: #5E5E5E; 119 | font-style: italic; 120 | } 121 | 122 | code span.im { 123 | color: #00769E; 124 | } 125 | 126 | code span.ch { 127 | color: #20794D; 128 | } 129 | 130 | code span.dt { 131 | color: #AD0000; 132 | } 133 | 134 | code span.fl { 135 | color: #AD0000; 136 | } 137 | 138 | code span.co { 139 | color: #5E5E5E; 140 | } 141 | 142 | code span.cv { 143 | color: #5E5E5E; 144 | font-style: italic; 145 | } 146 | 147 | code span.cn { 148 | color: #8f5902; 149 | } 150 | 151 | code span.sc { 152 | color: #5E5E5E; 153 | } 154 | 155 | code span.dv { 156 | color: #AD0000; 157 | } 158 | 159 | code span.kw { 160 | color: #003B4F; 161 | } 162 | 163 | .prevent-inlining { 164 | content: "s.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t){return t===Object(t)?t:{down:t,up:t}}function s(t,n){n=n||{},Object.assign(this,s.options,n),this.classes=Object.assign({},s.options.classes,n.classes),this.elem=t,this.tolerance=o(this.tolerance),this.offset=o(this.offset),this.initialised=!1,this.frozen=!1}return s.prototype={constructor:s,init:function(){return s.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},s.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},s.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),s}); 8 | -------------------------------------------------------------------------------- /solar-cell-simulation/data/RAT_data_300um_2um_55.csv: -------------------------------------------------------------------------------- 1 | Wavelength(nm),Spectral intensity (W m-2 nm-1),Reflection (Total),Reflection (External),Reflection (Escape),Absorption (Substrate),Absorption (Front films),Absorption (Rear films),Absorption (Detached reflector),Transmission,Pathlength enhancement factor (z) 2 | 300,0.009493777667499998,0.32709213476911786,0.32709213476911786,0,0.6710099018556835,0,0,0,0,1 3 | 320,0.22390000000000004,0.25547495545077437,0.25547495545077437,0,0.7425027701188404,0,0,0,0,1 4 | 340,0.45332499999999987,0.24306007784731354,0.24306007784731354,0,0.7558931136511331,0,0,0,0,1 5 | 360,0.5822124999999999,0.2506782662654115,0.2506782662654115,0,0.7492455936298492,0,0,0,0,1 6 | 380,0.6549250000000002,0.22538985307297912,0.22538985307297912,0,0.7743783815724273,0,0,0,0,1 7 | 400,0.9512625000000001,0.16001912607475827,0.16001912607475827,0,0.8385454894497061,0,0,0,0,1 8 | 420,1.19005,0.1414202977430253,0.1414202977430253,0,0.857566903586189,0,0,0,0,1 9 | 440,1.3134,0.13676109804474948,0.13676109804474948,0,0.8601169235162732,0,0,0,0,1 10 | 460,1.5464999999999998,0.1293805478137819,0.1293805478137819,0,0.8697861188528847,0,0,0,0,1 11 | 480,1.5505,0.11778485430117673,0.11778485430117673,0,0.8814399519003736,0,0,0,0,1 12 | 500,1.55,0.11914812838914235,0.11914812838914235,0,0.8808518716108574,0,0,0,0,1 13 | 520,1.506,0.09910481833489662,0.09910481833489662,0,0.8999860907560124,0,0,0,0,1 14 | 540,1.5329999999999997,0.0994264077279921,0.0994264077279921,0,0.8996390128327556,0,0,0,0,1 15 | 560,1.5130000000000001,0.09903616918820031,0.09903616918820031,0,0.9009638308117998,0,0,0,0,1 16 | 580,1.4837500000000001,0.08599902728332909,0.08599902728332909,0,0.914000972716671,0,0,0,0,1 17 | 600,1.4597499999999999,0.08718360949317244,0.08718360949317244,0,0.9118163905068275,0,0,0,0,1 18 | 620,1.4337499999999996,0.0910375479281624,0.0910375479281624,0,0.9089624520718378,0,0,0,0,1 19 | 640,1.42175,0.08688143798116807,0.08688143798116807,0,0.9113794315840493,0,0,0,0,1 20 | 660,1.3815000000000004,0.08116948526342646,0.08116948526342646,0,0.9188305147365735,0,0,0,0,1 21 | 680,1.33675,0.09123166330198182,0.09123166330198182,0,0.9087683366980182,0,0,0,0,1 22 | 700,1.2822499999999997,0.06400941665696507,0.06400941665696507,0,0.9352093333430348,0,0,0,0,1 23 | 720,1.1386999999999998,0.08092801977466305,0.08092801977466305,0,0.917080698275664,0,0,0,0,1.0218080018848148 24 | 740,1.2085000000000001,0.08263515851556083,0.08263515851556083,0,0.9173648414844365,0,0,0,0,1.184949438610127 25 | 760,0.9461000000000002,0.0850487246424215,0.0850487246424215,0,0.9140253494313282,0,0,0,0,1.193341758839509 26 | 780,1.1582500000000004,0.07852052617633631,0.07852052617633631,0,0.9214794738118355,0,0,0,0,1.2221395577898444 27 | 800,1.08,0.07585482151509465,0.07585482151509465,0,0.9232756125874003,0,0,0,0,1.2161790535889507 28 | 820,0.915875,0.08763811385619244,0.08763811385619244,0,0.9123618265772706,0,0,0,0,1.2409905021962317 29 | 840,0.9781000000000002,0.07333025092595578,0.07333025092595578,0,0.9257171544706125,0,0,0,0,1.2659857205914564 30 | 860,0.95415,0.07322665870180929,0.07322665870180929,0,0.9267699671054291,0,0,0,0,1.308476834922262 31 | 880,0.9348999999999996,0.08268461695432565,0.08268461695432565,0,0.915366922508918,0,0,0,0,1.2539896791811984 32 | 900,0.7464500000000002,0.07037853628677053,0.07037853628677053,0,0.928370409863812,0,0,0,0,1.3005058749180027 33 | 920,0.6726,0.07609476352147085,0.07609476352147085,0,0.9205394358380226,0,0,0,0,1.2799989260577536 34 | 940,0.3032500000000001,0.0788547103085426,0.0788547103085426,0,0.9162983989080189,0,1.3359033466394713e-20,0,0.00008932426548473949,1.4337407103470903 35 | 960,0.43975,0.08502491737553969,0.08502491737553969,0,0.9133193559260759,0,3.3288633595252535e-18,0,0.0002217981815197355,2.3635834400535707 36 | 980,0.668025,0.08093643629074079,0.08092378266068691,0.000012653630053885423,0.9145006063093891,0,1.0155193963114625e-17,0,0.000879271140280375,2.773155436331217 37 | 1000,0.7315749999999998,0.07491930279430047,0.06554972401626695,0.009369578778033516,0.9203666249942885,0,1.561989604508577e-17,0,0.002127376368870557,3.27910297329111 38 | 1020,0.7007500000000001,0.1210498287099803,0.08174904344501961,0.03930078526496068,0.867699262827399,0,2.7509589424189137e-17,0,0.009267219453714018,3.643002809058794 39 | 1040,0.6695500000000001,0.16301656901878184,0.06777048876225679,0.09524608025652505,0.8090508207141553,0,1.270111178666208e-17,0,0.024026485817102393,4.483212220071495 40 | 1060,0.63045,0.2605164738393767,0.08781843587730556,0.17269803796207114,0.697747897972541,0,6.838023404720743e-17,0,0.03806490811067709,6.541889579866347 41 | 1080,0.5928249999999998,0.32522213188787286,0.07931480706955679,0.24590732481831606,0.6073276886940365,0,1.4197653683672365e-16,0,0.06257714886954037,8.715748298307302 42 | 1100,0.49625000000000014,0.4136552621896237,0.06477478655380378,0.3488804756358199,0.4790277382943756,0,7.704164903957759e-17,0,0.10274305837968115,10.27344922162429 43 | 1120,0.18226500000000004,0.4615457272344252,0.07802650396917739,0.38351922326524784,0.3837968352182802,0,2.7723188999180943e-16,0,0.15186140935752113,13.46260847857053 44 | 1140,0.184785,0.5745123017808702,0.06949337243160406,0.5050189293492662,0.22826147775170263,0,2.1407344063522834e-16,0,0.1950613860459374,14.07194589537317 45 | 1160,0.32659999999999995,0.5843710640241582,0.06604497455875943,0.5183260894653987,0.11785353698691672,0,1.9458261259892214e-16,0,0.2950541433422873,16.05739710457517 46 | 1180,0.42725,0.636259652543073,0.0825876664379165,0.5536719861051566,0.02225144437403119,0,3.223584120633779e-16,0,0.34077000909519234,18.873636562285988 47 | 1200,0.4373250000000001,0.6852954602259409,0.06787696940013081,0.6174184908258101,0.010481914177412864,0,4.236722964861178e-16,0,0.3008303659513323,25.70080981198297 -------------------------------------------------------------------------------- /solar-cell-simulation/notebooks/data/RAT_data_300um_2um_55.csv: -------------------------------------------------------------------------------- 1 | Wavelength(nm),Spectral intensity (W m-2 nm-1),Reflection (Total),Reflection (External),Reflection (Escape),Absorption (Substrate),Absorption (Front films),Absorption (Rear films),Absorption (Detached reflector),Transmission,Pathlength enhancement factor (z) 2 | 300,0.009493777667499998,0.32709213476911786,0.32709213476911786,0,0.6710099018556835,0,0,0,0,1 3 | 320,0.22390000000000004,0.25547495545077437,0.25547495545077437,0,0.7425027701188404,0,0,0,0,1 4 | 340,0.45332499999999987,0.24306007784731354,0.24306007784731354,0,0.7558931136511331,0,0,0,0,1 5 | 360,0.5822124999999999,0.2506782662654115,0.2506782662654115,0,0.7492455936298492,0,0,0,0,1 6 | 380,0.6549250000000002,0.22538985307297912,0.22538985307297912,0,0.7743783815724273,0,0,0,0,1 7 | 400,0.9512625000000001,0.16001912607475827,0.16001912607475827,0,0.8385454894497061,0,0,0,0,1 8 | 420,1.19005,0.1414202977430253,0.1414202977430253,0,0.857566903586189,0,0,0,0,1 9 | 440,1.3134,0.13676109804474948,0.13676109804474948,0,0.8601169235162732,0,0,0,0,1 10 | 460,1.5464999999999998,0.1293805478137819,0.1293805478137819,0,0.8697861188528847,0,0,0,0,1 11 | 480,1.5505,0.11778485430117673,0.11778485430117673,0,0.8814399519003736,0,0,0,0,1 12 | 500,1.55,0.11914812838914235,0.11914812838914235,0,0.8808518716108574,0,0,0,0,1 13 | 520,1.506,0.09910481833489662,0.09910481833489662,0,0.8999860907560124,0,0,0,0,1 14 | 540,1.5329999999999997,0.0994264077279921,0.0994264077279921,0,0.8996390128327556,0,0,0,0,1 15 | 560,1.5130000000000001,0.09903616918820031,0.09903616918820031,0,0.9009638308117998,0,0,0,0,1 16 | 580,1.4837500000000001,0.08599902728332909,0.08599902728332909,0,0.914000972716671,0,0,0,0,1 17 | 600,1.4597499999999999,0.08718360949317244,0.08718360949317244,0,0.9118163905068275,0,0,0,0,1 18 | 620,1.4337499999999996,0.0910375479281624,0.0910375479281624,0,0.9089624520718378,0,0,0,0,1 19 | 640,1.42175,0.08688143798116807,0.08688143798116807,0,0.9113794315840493,0,0,0,0,1 20 | 660,1.3815000000000004,0.08116948526342646,0.08116948526342646,0,0.9188305147365735,0,0,0,0,1 21 | 680,1.33675,0.09123166330198182,0.09123166330198182,0,0.9087683366980182,0,0,0,0,1 22 | 700,1.2822499999999997,0.06400941665696507,0.06400941665696507,0,0.9352093333430348,0,0,0,0,1 23 | 720,1.1386999999999998,0.08092801977466305,0.08092801977466305,0,0.917080698275664,0,0,0,0,1.0218080018848148 24 | 740,1.2085000000000001,0.08263515851556083,0.08263515851556083,0,0.9173648414844365,0,0,0,0,1.184949438610127 25 | 760,0.9461000000000002,0.0850487246424215,0.0850487246424215,0,0.9140253494313282,0,0,0,0,1.193341758839509 26 | 780,1.1582500000000004,0.07852052617633631,0.07852052617633631,0,0.9214794738118355,0,0,0,0,1.2221395577898444 27 | 800,1.08,0.07585482151509465,0.07585482151509465,0,0.9232756125874003,0,0,0,0,1.2161790535889507 28 | 820,0.915875,0.08763811385619244,0.08763811385619244,0,0.9123618265772706,0,0,0,0,1.2409905021962317 29 | 840,0.9781000000000002,0.07333025092595578,0.07333025092595578,0,0.9257171544706125,0,0,0,0,1.2659857205914564 30 | 860,0.95415,0.07322665870180929,0.07322665870180929,0,0.9267699671054291,0,0,0,0,1.308476834922262 31 | 880,0.9348999999999996,0.08268461695432565,0.08268461695432565,0,0.915366922508918,0,0,0,0,1.2539896791811984 32 | 900,0.7464500000000002,0.07037853628677053,0.07037853628677053,0,0.928370409863812,0,0,0,0,1.3005058749180027 33 | 920,0.6726,0.07609476352147085,0.07609476352147085,0,0.9205394358380226,0,0,0,0,1.2799989260577536 34 | 940,0.3032500000000001,0.0788547103085426,0.0788547103085426,0,0.9162983989080189,0,1.3359033466394713e-20,0,0.00008932426548473949,1.4337407103470903 35 | 960,0.43975,0.08502491737553969,0.08502491737553969,0,0.9133193559260759,0,3.3288633595252535e-18,0,0.0002217981815197355,2.3635834400535707 36 | 980,0.668025,0.08093643629074079,0.08092378266068691,0.000012653630053885423,0.9145006063093891,0,1.0155193963114625e-17,0,0.000879271140280375,2.773155436331217 37 | 1000,0.7315749999999998,0.07491930279430047,0.06554972401626695,0.009369578778033516,0.9203666249942885,0,1.561989604508577e-17,0,0.002127376368870557,3.27910297329111 38 | 1020,0.7007500000000001,0.1210498287099803,0.08174904344501961,0.03930078526496068,0.867699262827399,0,2.7509589424189137e-17,0,0.009267219453714018,3.643002809058794 39 | 1040,0.6695500000000001,0.16301656901878184,0.06777048876225679,0.09524608025652505,0.8090508207141553,0,1.270111178666208e-17,0,0.024026485817102393,4.483212220071495 40 | 1060,0.63045,0.2605164738393767,0.08781843587730556,0.17269803796207114,0.697747897972541,0,6.838023404720743e-17,0,0.03806490811067709,6.541889579866347 41 | 1080,0.5928249999999998,0.32522213188787286,0.07931480706955679,0.24590732481831606,0.6073276886940365,0,1.4197653683672365e-16,0,0.06257714886954037,8.715748298307302 42 | 1100,0.49625000000000014,0.4136552621896237,0.06477478655380378,0.3488804756358199,0.4790277382943756,0,7.704164903957759e-17,0,0.10274305837968115,10.27344922162429 43 | 1120,0.18226500000000004,0.4615457272344252,0.07802650396917739,0.38351922326524784,0.3837968352182802,0,2.7723188999180943e-16,0,0.15186140935752113,13.46260847857053 44 | 1140,0.184785,0.5745123017808702,0.06949337243160406,0.5050189293492662,0.22826147775170263,0,2.1407344063522834e-16,0,0.1950613860459374,14.07194589537317 45 | 1160,0.32659999999999995,0.5843710640241582,0.06604497455875943,0.5183260894653987,0.11785353698691672,0,1.9458261259892214e-16,0,0.2950541433422873,16.05739710457517 46 | 1180,0.42725,0.636259652543073,0.0825876664379165,0.5536719861051566,0.02225144437403119,0,3.223584120633779e-16,0,0.34077000909519234,18.873636562285988 47 | 1200,0.4373250000000001,0.6852954602259409,0.06787696940013081,0.6174184908258101,0.010481914177412864,0,4.236722964861178e-16,0,0.3008303659513323,25.70080981198297 -------------------------------------------------------------------------------- /docs/site_libs/quarto-html/anchor.min.js: -------------------------------------------------------------------------------- 1 | // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat 2 | // 3 | // AnchorJS - v4.3.1 - 2021-04-17 4 | // https://www.bryanbraun.com/anchorjs/ 5 | // Copyright (c) 2021 Bryan Braun; Licensed MIT 6 | // 7 | // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat 8 | !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function d(A){A.icon=Object.prototype.hasOwnProperty.call(A,"icon")?A.icon:"",A.visible=Object.prototype.hasOwnProperty.call(A,"visible")?A.visible:"hover",A.placement=Object.prototype.hasOwnProperty.call(A,"placement")?A.placement:"right",A.ariaLabel=Object.prototype.hasOwnProperty.call(A,"ariaLabel")?A.ariaLabel:"Anchor",A.class=Object.prototype.hasOwnProperty.call(A,"class")?A.class:"",A.base=Object.prototype.hasOwnProperty.call(A,"base")?A.base:"",A.truncate=Object.prototype.hasOwnProperty.call(A,"truncate")?Math.floor(A.truncate):64,A.titleText=Object.prototype.hasOwnProperty.call(A,"titleText")?A.titleText:""}function w(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new TypeError("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],d(this.options),this.isTouchDevice=function(){return Boolean("ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,o,i,n,s,a,c,r,l,h,u,p=[];if(d(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),0===(e=w(A=A||"h2, h3, h4, h5, h6")).length)return this;for(null===document.head.querySelector("style.anchorjs")&&((u=document.createElement("style")).className="anchorjs",u.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(u):document.head.insertBefore(u,A),u.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",u.sheet.cssRules.length),u.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",u.sheet.cssRules.length),u.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",u.sheet.cssRules.length),u.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',u.sheet.cssRules.length)),u=document.querySelectorAll("[id]"),t=[].map.call(u,function(A){return A.id}),i=0;i\]./()*\\\n\t\b\v\u00A0]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),A=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||A||!1}}}); 9 | // @license-end -------------------------------------------------------------------------------- /solar-cell-simulation/data/model_i_a_silicon_n.txt: -------------------------------------------------------------------------------- 1 | 0.0000003 3.0027 2 | 0.00000031 3.2641 3 | 0.00000032 3.5101 4 | 0.00000033 3.7324 5 | 0.00000034 3.9247 6 | 0.00000035 4.0839 7 | 0.00000036 4.2096 8 | 0.00000037 4.3038 9 | 0.00000038 4.3701 10 | 0.00000039 4.4128 11 | 0.0000004 4.4362 12 | 0.00000041 4.4444 13 | 0.00000042 4.4407 14 | 0.00000043 4.4282 15 | 0.00000044 4.4091 16 | 0.00000045 4.3853 17 | 0.00000046 4.3583 18 | 0.00000047 4.3291 19 | 0.00000048 4.2985 20 | 0.00000049 4.2672 21 | 0.0000005 4.2358 22 | 0.00000051 4.2044 23 | 0.00000052 4.1735 24 | 0.00000053 4.143 25 | 0.00000054 4.1133 26 | 0.00000055 4.0844 27 | 0.00000056 4.0563 28 | 0.00000057 4.0291 29 | 0.00000058 4.0028 30 | 0.00000059 3.9773 31 | 0.0000006 3.9528 32 | 0.00000061 3.9291 33 | 0.00000062 3.9063 34 | 0.00000063 3.8843 35 | 0.00000064 3.8631 36 | 0.00000065 3.8427 37 | 0.00000066 3.8231 38 | 0.00000067 3.8042 39 | 0.00000068 3.786 40 | 0.00000069 3.7684 41 | 0.0000007 3.7515 42 | 0.00000071 3.7352 43 | 0.00000072 3.7195 44 | 0.00000073 3.7044 45 | 0.00000074 3.6898 46 | 0.00000075 3.6757 47 | 0.00000076 3.6622 48 | 0.00000077 3.6491 49 | 0.00000078 3.6364 50 | 0.00000079 3.6242 51 | 0.0000008 3.6124 52 | 0.00000081 3.601 53 | 0.00000082 3.5899 54 | 0.00000083 3.5793 55 | 0.00000084 3.5689 56 | 0.00000085 3.5589 57 | 0.00000086 3.5491 58 | 0.00000087 3.5397 59 | 0.00000088 3.5305 60 | 0.00000089 3.5215 61 | 0.0000009 3.5126 62 | 0.00000091 3.504 63 | 0.00000092 3.4952 64 | 0.00000093 3.4859 65 | 0.00000094 3.4776 66 | 0.00000095 3.4702 67 | 0.00000096 3.4633 68 | 0.00000097 3.4568 69 | 0.00000098 3.4507 70 | 0.00000099 3.4449 71 | 0.000001 3.4393 72 | 0.00000101 3.434 73 | 0.00000102 3.429 74 | 0.00000103 3.4241 75 | 0.00000104 3.4195 76 | 0.00000105 3.415 77 | 0.00000106 3.4108 78 | 0.00000107 3.4066 79 | 0.00000108 3.4027 80 | 0.00000109 3.3988 81 | 0.0000011 3.3951 82 | 0.00000111 3.3916 83 | 0.00000112 3.3881 84 | 0.00000113 3.3848 85 | 0.00000114 3.3816 86 | 0.00000115 3.3785 87 | 0.00000116 3.3755 88 | 0.00000117 3.3725 89 | 0.00000118 3.3697 90 | 0.00000119 3.367 91 | 0.0000012 3.3643 92 | 0.00000121 3.3617 93 | 0.00000122 3.3592 94 | 0.00000123 3.3568 95 | 0.00000124 3.3544 96 | 0.00000125 3.3521 97 | 0.00000126 3.3499 98 | 0.00000127 3.3477 99 | 0.00000128 3.3456 100 | 0.00000129 3.3436 101 | 0.0000013 3.3416 102 | 0.00000131 3.3396 103 | 0.00000132 3.3377 104 | 0.00000133 3.3359 105 | 1.3391E-06 3.3343 106 | 0.00000134 3.3341 107 | 0.00000135 3.3323 108 | 1.3559E-06 3.3313 109 | 0.000001379 3.3275 110 | 1.3968E-06 3.3247 111 | 1.4151E-06 3.3219 112 | 0.00000143 3.3198 113 | 1.4339E-06 3.3192 114 | 0.00000144 3.3184 115 | 0.00000145 3.317 116 | 1.4597E-06 3.3157 117 | 0.00000146 3.3157 118 | 0.00000147 3.3144 119 | 1.4797E-06 3.3131 120 | 0.00000148 3.3131 121 | 0.00000149 3.3118 122 | 1.4933E-06 3.3114 123 | 0.0000015 3.3106 124 | 0.00000151 3.3094 125 | 1.5143E-06 3.3089 126 | 0.00000152 3.3082 127 | 0.00000153 3.3071 128 | 1.5358E-06 3.3064 129 | 0.00000154 3.306 130 | 0.00000155 3.3049 131 | 0.000001558 3.304 132 | 0.00000156 3.3038 133 | 0.00000157 3.3028 134 | 1.5731E-06 3.3024 135 | 0.00000158 3.3017 136 | 0.00000159 3.3007 137 | 1.5963E-06 3.3001 138 | 0.0000016 3.2997 139 | 0.00000161 3.2988 140 | 1.6122E-06 3.2985 141 | 0.00000162 3.2978 142 | 0.00000163 3.2969 143 | 1.6367E-06 3.2963 144 | 0.00000164 3.296 145 | 0.00000165 3.2951 146 | 1.6534E-06 3.2948 147 | 0.00000166 3.2942 148 | 0.00000167 3.2934 149 | 1.6791E-06 3.2926 150 | 0.00000168 3.2925 151 | 0.00000169 3.2917 152 | 1.6966E-06 3.2912 153 | 0.0000017 3.2909 154 | 1.7146E-06 3.2897 155 | 1.7329E-06 3.2883 156 | 1.7517E-06 3.2869 157 | 1.7708E-06 3.2856 158 | 1.7904E-06 3.2842 159 | 1.8104E-06 3.2829 160 | 1.8308E-06 3.2816 161 | 1.8518E-06 3.2803 162 | 1.8732E-06 3.279 163 | 1.8951E-06 3.2778 164 | 1.9175E-06 3.2765 165 | 1.9289E-06 3.2759 166 | 1.9521E-06 3.2747 167 | 0.000001976 3.2735 168 | 1.9881E-06 3.2729 169 | 2.0128E-06 3.2718 170 | 2.0381E-06 3.2706 171 | 0.000002051 3.2701 172 | 2.0773E-06 3.2689 173 | 2.0907E-06 3.2684 174 | 0.000002118 3.2673 175 | 0.000002132 3.2668 176 | 2.1461E-06 3.2662 177 | 2.1749E-06 3.2652 178 | 2.1896E-06 3.2646 179 | 2.2196E-06 3.2636 180 | 2.2349E-06 3.2631 181 | 2.2504E-06 3.2626 182 | 2.2661E-06 3.2621 183 | 2.2983E-06 3.2611 184 | 2.3147E-06 3.2606 185 | 2.3313E-06 3.2601 186 | 2.3482E-06 3.2596 187 | 2.3654E-06 3.2592 188 | 2.3828E-06 3.2587 189 | 2.4183E-06 3.2578 190 | 2.4365E-06 3.2573 191 | 0.000002455 3.2568 192 | 2.4737E-06 3.2564 193 | 2.4927E-06 3.2559 194 | 2.5121E-06 3.2555 195 | 2.5317E-06 3.2551 196 | 2.5516E-06 3.2546 197 | 2.5719E-06 3.2542 198 | 2.5925E-06 3.2538 199 | 2.6134E-06 3.2533 200 | 2.6346E-06 3.2529 201 | 2.6562E-06 3.2525 202 | 2.6782E-06 3.2521 203 | 2.7005E-06 3.2517 204 | 2.7232E-06 3.2513 205 | 2.7462E-06 3.2509 206 | 2.7697E-06 3.2505 207 | 2.7936E-06 3.2501 208 | 2.8179E-06 3.2497 209 | 2.8426E-06 3.2493 210 | 2.8678E-06 3.249 211 | 2.8934E-06 3.2486 212 | 2.9194E-06 3.2482 213 | 0.000002946 3.2479 214 | 0.000002973 3.2475 215 | 3.0005E-06 3.2472 216 | 3.0286E-06 3.2468 217 | 3.0571E-06 3.2465 218 | 3.0863E-06 3.2461 219 | 3.1159E-06 3.2458 220 | 3.1462E-06 3.2454 221 | 0.000003177 3.2451 222 | 3.2085E-06 3.2448 223 | 3.2406E-06 3.2445 224 | 3.2733E-06 3.2441 225 | 3.3067E-06 3.2438 226 | 3.3408E-06 3.2435 227 | 3.3756E-06 3.2432 228 | 3.4111E-06 3.2429 229 | 3.4474E-06 3.2426 230 | 3.4845E-06 3.2423 231 | 3.5224E-06 3.242 232 | 3.5611E-06 3.2417 233 | 3.6006E-06 3.2415 234 | 3.6411E-06 3.2412 235 | 3.6825E-06 3.2409 236 | 3.7248E-06 3.2406 237 | 3.7681E-06 3.2404 238 | 3.8124E-06 3.2401 239 | 3.8578E-06 3.2399 240 | 3.9043E-06 3.2396 241 | 3.9519E-06 3.2394 242 | 4.0007E-06 3.2391 243 | 4.0507E-06 3.2389 244 | 0.000004102 3.2387 245 | 4.1546E-06 3.2384 246 | 4.2085E-06 3.2382 247 | 4.2639E-06 3.238 248 | 4.3208E-06 3.2378 249 | 4.3791E-06 3.2375 250 | 4.4391E-06 3.2373 251 | 4.5008E-06 3.2371 252 | 4.5642E-06 3.2369 253 | 4.6294E-06 3.2367 254 | 4.6965E-06 3.2366 255 | 4.7655E-06 3.2364 256 | 4.8367E-06 3.2362 257 | 0.00000491 3.236 258 | 4.9855E-06 3.2358 259 | 5.0634E-06 3.2357 260 | 5.1438E-06 3.2355 261 | 5.2267E-06 3.2354 262 | 5.3124E-06 3.2352 263 | 5.4009E-06 3.235 264 | 5.4925E-06 3.2349 265 | 5.5872E-06 3.2348 266 | 5.6852E-06 3.2346 267 | 5.7867E-06 3.2345 268 | 5.8919E-06 3.2344 269 | 6.0011E-06 3.2343 270 | 6.1143E-06 3.2341 271 | 6.2319E-06 3.234 272 | 6.3541E-06 3.2339 273 | 6.4811E-06 3.2338 274 | 6.6134E-06 3.2337 275 | 6.7512E-06 3.2337 276 | 6.8948E-06 3.2336 277 | 7.0447E-06 3.2335 278 | 7.2013E-06 3.2334 279 | 7.3649E-06 3.2334 280 | 7.5362E-06 3.2333 281 | 7.7156E-06 3.2332 282 | 7.9038E-06 3.2332 283 | 8.1014E-06 3.2332 284 | 8.3091E-06 3.2331 285 | 8.5278E-06 3.2331 286 | 8.7583E-06 3.2331 287 | 9.0016E-06 3.2331 288 | 9.2588E-06 3.2331 289 | 9.5311E-06 3.2331 290 | 9.8199E-06 3.2331 291 | 0.000010127 3.2331 292 | 0.000010453 3.2331 293 | 0.000010802 3.2331 294 | 0.000011174 3.2332 295 | 0.000011573 3.2332 296 | 0.000012002 3.2333 297 | 0.000012464 3.2334 298 | 0.000012962 3.2334 299 | 0.000013502 3.2335 300 | 0.000014089 3.2336 301 | 0.00001473 3.2338 302 | 0.000015431 3.2339 303 | 0.000016203 3.2341 304 | 0.000017056 3.2342 305 | 0.000018003 3.2344 306 | 0.000019062 3.2346 307 | 0.000020254 3.2349 308 | 0.000021604 3.2351 309 | 0.000023147 3.2355 310 | 0.000024927 3.2358 311 | 0.000027005 3.2362 312 | 0.00002946 3.2367 313 | 0.000032406 3.2372 314 | 0.000036006 3.2379 315 | -------------------------------------------------------------------------------- /solar-cell-simulation/notebooks/data/model_i_a_silicon_n.txt: -------------------------------------------------------------------------------- 1 | 0.0000003 3.0027 2 | 0.00000031 3.2641 3 | 0.00000032 3.5101 4 | 0.00000033 3.7324 5 | 0.00000034 3.9247 6 | 0.00000035 4.0839 7 | 0.00000036 4.2096 8 | 0.00000037 4.3038 9 | 0.00000038 4.3701 10 | 0.00000039 4.4128 11 | 0.0000004 4.4362 12 | 0.00000041 4.4444 13 | 0.00000042 4.4407 14 | 0.00000043 4.4282 15 | 0.00000044 4.4091 16 | 0.00000045 4.3853 17 | 0.00000046 4.3583 18 | 0.00000047 4.3291 19 | 0.00000048 4.2985 20 | 0.00000049 4.2672 21 | 0.0000005 4.2358 22 | 0.00000051 4.2044 23 | 0.00000052 4.1735 24 | 0.00000053 4.143 25 | 0.00000054 4.1133 26 | 0.00000055 4.0844 27 | 0.00000056 4.0563 28 | 0.00000057 4.0291 29 | 0.00000058 4.0028 30 | 0.00000059 3.9773 31 | 0.0000006 3.9528 32 | 0.00000061 3.9291 33 | 0.00000062 3.9063 34 | 0.00000063 3.8843 35 | 0.00000064 3.8631 36 | 0.00000065 3.8427 37 | 0.00000066 3.8231 38 | 0.00000067 3.8042 39 | 0.00000068 3.786 40 | 0.00000069 3.7684 41 | 0.0000007 3.7515 42 | 0.00000071 3.7352 43 | 0.00000072 3.7195 44 | 0.00000073 3.7044 45 | 0.00000074 3.6898 46 | 0.00000075 3.6757 47 | 0.00000076 3.6622 48 | 0.00000077 3.6491 49 | 0.00000078 3.6364 50 | 0.00000079 3.6242 51 | 0.0000008 3.6124 52 | 0.00000081 3.601 53 | 0.00000082 3.5899 54 | 0.00000083 3.5793 55 | 0.00000084 3.5689 56 | 0.00000085 3.5589 57 | 0.00000086 3.5491 58 | 0.00000087 3.5397 59 | 0.00000088 3.5305 60 | 0.00000089 3.5215 61 | 0.0000009 3.5126 62 | 0.00000091 3.504 63 | 0.00000092 3.4952 64 | 0.00000093 3.4859 65 | 0.00000094 3.4776 66 | 0.00000095 3.4702 67 | 0.00000096 3.4633 68 | 0.00000097 3.4568 69 | 0.00000098 3.4507 70 | 0.00000099 3.4449 71 | 0.000001 3.4393 72 | 0.00000101 3.434 73 | 0.00000102 3.429 74 | 0.00000103 3.4241 75 | 0.00000104 3.4195 76 | 0.00000105 3.415 77 | 0.00000106 3.4108 78 | 0.00000107 3.4066 79 | 0.00000108 3.4027 80 | 0.00000109 3.3988 81 | 0.0000011 3.3951 82 | 0.00000111 3.3916 83 | 0.00000112 3.3881 84 | 0.00000113 3.3848 85 | 0.00000114 3.3816 86 | 0.00000115 3.3785 87 | 0.00000116 3.3755 88 | 0.00000117 3.3725 89 | 0.00000118 3.3697 90 | 0.00000119 3.367 91 | 0.0000012 3.3643 92 | 0.00000121 3.3617 93 | 0.00000122 3.3592 94 | 0.00000123 3.3568 95 | 0.00000124 3.3544 96 | 0.00000125 3.3521 97 | 0.00000126 3.3499 98 | 0.00000127 3.3477 99 | 0.00000128 3.3456 100 | 0.00000129 3.3436 101 | 0.0000013 3.3416 102 | 0.00000131 3.3396 103 | 0.00000132 3.3377 104 | 0.00000133 3.3359 105 | 1.3391E-06 3.3343 106 | 0.00000134 3.3341 107 | 0.00000135 3.3323 108 | 1.3559E-06 3.3313 109 | 0.000001379 3.3275 110 | 1.3968E-06 3.3247 111 | 1.4151E-06 3.3219 112 | 0.00000143 3.3198 113 | 1.4339E-06 3.3192 114 | 0.00000144 3.3184 115 | 0.00000145 3.317 116 | 1.4597E-06 3.3157 117 | 0.00000146 3.3157 118 | 0.00000147 3.3144 119 | 1.4797E-06 3.3131 120 | 0.00000148 3.3131 121 | 0.00000149 3.3118 122 | 1.4933E-06 3.3114 123 | 0.0000015 3.3106 124 | 0.00000151 3.3094 125 | 1.5143E-06 3.3089 126 | 0.00000152 3.3082 127 | 0.00000153 3.3071 128 | 1.5358E-06 3.3064 129 | 0.00000154 3.306 130 | 0.00000155 3.3049 131 | 0.000001558 3.304 132 | 0.00000156 3.3038 133 | 0.00000157 3.3028 134 | 1.5731E-06 3.3024 135 | 0.00000158 3.3017 136 | 0.00000159 3.3007 137 | 1.5963E-06 3.3001 138 | 0.0000016 3.2997 139 | 0.00000161 3.2988 140 | 1.6122E-06 3.2985 141 | 0.00000162 3.2978 142 | 0.00000163 3.2969 143 | 1.6367E-06 3.2963 144 | 0.00000164 3.296 145 | 0.00000165 3.2951 146 | 1.6534E-06 3.2948 147 | 0.00000166 3.2942 148 | 0.00000167 3.2934 149 | 1.6791E-06 3.2926 150 | 0.00000168 3.2925 151 | 0.00000169 3.2917 152 | 1.6966E-06 3.2912 153 | 0.0000017 3.2909 154 | 1.7146E-06 3.2897 155 | 1.7329E-06 3.2883 156 | 1.7517E-06 3.2869 157 | 1.7708E-06 3.2856 158 | 1.7904E-06 3.2842 159 | 1.8104E-06 3.2829 160 | 1.8308E-06 3.2816 161 | 1.8518E-06 3.2803 162 | 1.8732E-06 3.279 163 | 1.8951E-06 3.2778 164 | 1.9175E-06 3.2765 165 | 1.9289E-06 3.2759 166 | 1.9521E-06 3.2747 167 | 0.000001976 3.2735 168 | 1.9881E-06 3.2729 169 | 2.0128E-06 3.2718 170 | 2.0381E-06 3.2706 171 | 0.000002051 3.2701 172 | 2.0773E-06 3.2689 173 | 2.0907E-06 3.2684 174 | 0.000002118 3.2673 175 | 0.000002132 3.2668 176 | 2.1461E-06 3.2662 177 | 2.1749E-06 3.2652 178 | 2.1896E-06 3.2646 179 | 2.2196E-06 3.2636 180 | 2.2349E-06 3.2631 181 | 2.2504E-06 3.2626 182 | 2.2661E-06 3.2621 183 | 2.2983E-06 3.2611 184 | 2.3147E-06 3.2606 185 | 2.3313E-06 3.2601 186 | 2.3482E-06 3.2596 187 | 2.3654E-06 3.2592 188 | 2.3828E-06 3.2587 189 | 2.4183E-06 3.2578 190 | 2.4365E-06 3.2573 191 | 0.000002455 3.2568 192 | 2.4737E-06 3.2564 193 | 2.4927E-06 3.2559 194 | 2.5121E-06 3.2555 195 | 2.5317E-06 3.2551 196 | 2.5516E-06 3.2546 197 | 2.5719E-06 3.2542 198 | 2.5925E-06 3.2538 199 | 2.6134E-06 3.2533 200 | 2.6346E-06 3.2529 201 | 2.6562E-06 3.2525 202 | 2.6782E-06 3.2521 203 | 2.7005E-06 3.2517 204 | 2.7232E-06 3.2513 205 | 2.7462E-06 3.2509 206 | 2.7697E-06 3.2505 207 | 2.7936E-06 3.2501 208 | 2.8179E-06 3.2497 209 | 2.8426E-06 3.2493 210 | 2.8678E-06 3.249 211 | 2.8934E-06 3.2486 212 | 2.9194E-06 3.2482 213 | 0.000002946 3.2479 214 | 0.000002973 3.2475 215 | 3.0005E-06 3.2472 216 | 3.0286E-06 3.2468 217 | 3.0571E-06 3.2465 218 | 3.0863E-06 3.2461 219 | 3.1159E-06 3.2458 220 | 3.1462E-06 3.2454 221 | 0.000003177 3.2451 222 | 3.2085E-06 3.2448 223 | 3.2406E-06 3.2445 224 | 3.2733E-06 3.2441 225 | 3.3067E-06 3.2438 226 | 3.3408E-06 3.2435 227 | 3.3756E-06 3.2432 228 | 3.4111E-06 3.2429 229 | 3.4474E-06 3.2426 230 | 3.4845E-06 3.2423 231 | 3.5224E-06 3.242 232 | 3.5611E-06 3.2417 233 | 3.6006E-06 3.2415 234 | 3.6411E-06 3.2412 235 | 3.6825E-06 3.2409 236 | 3.7248E-06 3.2406 237 | 3.7681E-06 3.2404 238 | 3.8124E-06 3.2401 239 | 3.8578E-06 3.2399 240 | 3.9043E-06 3.2396 241 | 3.9519E-06 3.2394 242 | 4.0007E-06 3.2391 243 | 4.0507E-06 3.2389 244 | 0.000004102 3.2387 245 | 4.1546E-06 3.2384 246 | 4.2085E-06 3.2382 247 | 4.2639E-06 3.238 248 | 4.3208E-06 3.2378 249 | 4.3791E-06 3.2375 250 | 4.4391E-06 3.2373 251 | 4.5008E-06 3.2371 252 | 4.5642E-06 3.2369 253 | 4.6294E-06 3.2367 254 | 4.6965E-06 3.2366 255 | 4.7655E-06 3.2364 256 | 4.8367E-06 3.2362 257 | 0.00000491 3.236 258 | 4.9855E-06 3.2358 259 | 5.0634E-06 3.2357 260 | 5.1438E-06 3.2355 261 | 5.2267E-06 3.2354 262 | 5.3124E-06 3.2352 263 | 5.4009E-06 3.235 264 | 5.4925E-06 3.2349 265 | 5.5872E-06 3.2348 266 | 5.6852E-06 3.2346 267 | 5.7867E-06 3.2345 268 | 5.8919E-06 3.2344 269 | 6.0011E-06 3.2343 270 | 6.1143E-06 3.2341 271 | 6.2319E-06 3.234 272 | 6.3541E-06 3.2339 273 | 6.4811E-06 3.2338 274 | 6.6134E-06 3.2337 275 | 6.7512E-06 3.2337 276 | 6.8948E-06 3.2336 277 | 7.0447E-06 3.2335 278 | 7.2013E-06 3.2334 279 | 7.3649E-06 3.2334 280 | 7.5362E-06 3.2333 281 | 7.7156E-06 3.2332 282 | 7.9038E-06 3.2332 283 | 8.1014E-06 3.2332 284 | 8.3091E-06 3.2331 285 | 8.5278E-06 3.2331 286 | 8.7583E-06 3.2331 287 | 9.0016E-06 3.2331 288 | 9.2588E-06 3.2331 289 | 9.5311E-06 3.2331 290 | 9.8199E-06 3.2331 291 | 0.000010127 3.2331 292 | 0.000010453 3.2331 293 | 0.000010802 3.2331 294 | 0.000011174 3.2332 295 | 0.000011573 3.2332 296 | 0.000012002 3.2333 297 | 0.000012464 3.2334 298 | 0.000012962 3.2334 299 | 0.000013502 3.2335 300 | 0.000014089 3.2336 301 | 0.00001473 3.2338 302 | 0.000015431 3.2339 303 | 0.000016203 3.2341 304 | 0.000017056 3.2342 305 | 0.000018003 3.2344 306 | 0.000019062 3.2346 307 | 0.000020254 3.2349 308 | 0.000021604 3.2351 309 | 0.000023147 3.2355 310 | 0.000024927 3.2358 311 | 0.000027005 3.2362 312 | 0.00002946 3.2367 313 | 0.000032406 3.2372 314 | 0.000036006 3.2379 315 | -------------------------------------------------------------------------------- /solar-cell-simulation/2b-optical_constants.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # # Example 2b: Optical constant models 5 | # 6 | # We may want to model the optical constants of a material using analytic expressions, rather than just take data from a 7 | # table; this can be useful when e.g. fitting ellipsometry data for a material with unknown optical constants, or if you 8 | # do not have refractive index data for a material but have some information about where critical points in the band 9 | # structure occur. In this example we will consider a simple model for a dielectric material, and a more complex model for 10 | # GaAs, a semiconductor. 11 | 12 | # In[1]: 13 | 14 | 15 | import matplotlib.pyplot as plt 16 | import numpy as np 17 | 18 | from solcore.absorption_calculator import search_db 19 | from solcore.absorption_calculator.cppm import Custom_CPPB 20 | from solcore.absorption_calculator.dielectric_constant_models import Oscillator 21 | from solcore.absorption_calculator.dielectric_constant_models import DielectricConstantModel, Cauchy 22 | from solcore.structure import Structure 23 | from solcore import material 24 | 25 | wl = np.linspace(300, 950, 200)*1e-9 26 | 27 | 28 | # We search the database for BK7 (borosilicate crown glass) and select the second entry, "Ohara" (index 1). 29 | # We then select the first item in that list, which is the pageid of the entry - this is what we need to tell Solcore 30 | # what item to access in the database. 31 | 32 | # In[2]: 33 | 34 | 35 | pageid = search_db("BK7")[1][0]; 36 | BK7 = material(str(pageid), nk_db=True)() 37 | 38 | 39 | # Next, we define a Cauchy oscillator model. We put this into the DielectricConstantModel class; in theory, we could add 40 | # as many oscillators as we want here. 41 | # 42 | # The parameters for the Cauchy model for BK7 are from Wikipedia: https://en.wikipedia.org/wiki/Cauchy%27s_equation 43 | 44 | # In[3]: 45 | 46 | 47 | cauchy = Cauchy(An=1.5046, Bn=0.00420, Cn=0, Ak=0, Bk=0, Ck=0) 48 | model = DielectricConstantModel(e_inf=0, oscillators=[cauchy]) 49 | 50 | 51 | # Calculate the dielectric function which result from the Cauchy model, then get the $n$ and $\kappa$ data from the database BK7 material for the complex refractive index: 52 | 53 | # In[4]: 54 | 55 | 56 | eps = model.dielectric_constants(wl*1e9) 57 | nk = BK7.n(wl) + 1j*BK7.k(wl) 58 | 59 | 60 | # Calculate the dielectric function by squaring the refractive index: 61 | 62 | # In[5]: 63 | 64 | 65 | eps_db = nk**2 66 | 67 | 68 | # **PLOT 1**: Plot the database values of e_1 (real part of the dielectric function) against the Cauchy model values: 69 | 70 | # In[6]: 71 | 72 | 73 | plt.figure() 74 | plt.plot(wl*1e9, np.real(eps), label='Cauchy model') 75 | plt.plot(wl*1e9, np.real(eps_db), '--', label='Database values') 76 | plt.legend() 77 | plt.ylabel(r'$\epsilon_1$') 78 | plt.xlabel('Wavelength (nm)') 79 | plt.title("(1) Dielectric function for BK7 glass") 80 | plt.show() 81 | 82 | 83 | # Here, we have just looked at the real part of the dielectric function, but you can include absorption (non-zero 84 | # e_2) in the dielectric constant models too. 85 | # 86 | # Now let's look at a more complicated CPPB (Critical Point Parabolic Band) model for GaAs. First, read in experimental data for GaAs dielectric function (from Palik)... 87 | 88 | # In[7]: 89 | 90 | 91 | Palik_Eps1 = np.loadtxt("data/Palik_GaAs_Eps1.csv", delimiter=',', unpack=False) 92 | Palik_Eps2 = np.loadtxt("data/Palik_GaAs_Eps2.csv", delimiter=',', unpack=False) 93 | 94 | 95 | # Generate a list of energies over which to calculate the model dielectric function and create the CPPB_model Class object: 96 | 97 | # In[8]: 98 | 99 | 100 | E = np.linspace(0.2, 5, 1000) 101 | CPPB_Model = Custom_CPPB() 102 | 103 | 104 | # The Material_Params method loads in the desired material parameters as a dictionary (for some common materials): 105 | 106 | # In[9]: 107 | 108 | 109 | MatParams = CPPB_Model.Material_Params("GaAs") 110 | 111 | 112 | # Parameters can be customised by assigning to the correct dictionary key: 113 | 114 | # In[10]: 115 | 116 | 117 | MatParams["B1"] = 5.8 118 | MatParams["B1s"] = 1.0 119 | MatParams["Gamma_Eg_ID"] = 0.3 120 | MatParams["Alpha_Eg_ID"] = 0.0 121 | MatParams["E1"] = 2.8 122 | MatParams["E1_d1"] = 2.9 123 | MatParams["Gamma_E1"] = 0.1 124 | MatParams["E2"] = 4.72 125 | MatParams["C"] = 3.0 126 | MatParams["Alpha_E2"] = 0.04 127 | MatParams["Gamma_E2"] = 0.19 128 | 129 | 130 | # Must define a structure object containing the required oscillator functions. The oscillator type and material parameters are both passed to individual 'Oscillators' in the structure: 131 | 132 | # In[11]: 133 | 134 | 135 | Adachi_GaAs = Structure([ 136 | Oscillator(oscillator_type="E0andE0_d0", material_parameters=MatParams), 137 | Oscillator(oscillator_type="E1andE1_d1", material_parameters=MatParams), 138 | Oscillator(oscillator_type="E_ID", material_parameters=MatParams), 139 | Oscillator(oscillator_type="E2", material_parameters=MatParams) 140 | ]) 141 | 142 | Output = CPPB_Model.eps_calc(Adachi_GaAs, E) 143 | 144 | 145 | # **PLOT 2**: real and imaginary part of the dielectric constant, showing the individual contributions of the critical points. 146 | 147 | # In[12]: 148 | 149 | 150 | fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, figsize=(9, 4.5)) 151 | 152 | # Subplot I :: Real part of the dielectric function. 153 | ax1.set_xlim(0, 5.3) 154 | ax1.set_ylim(-14, 27) 155 | 156 | ax1.plot(Palik_Eps1[:, 0], Palik_Eps1[:, 1], label="Exp. Data (Palik)", 157 | marker='o', ls='none', markerfacecolor='none', markeredgecolor="red") 158 | 159 | ax1.plot(E, Output["eps"].real, color="navy", label="Total") 160 | ax1.plot(E, Output["components"][0].real, color="orangered", ls='--', label="$E_0$ and $E_0+\Delta_0$") 161 | ax1.plot(E, Output["components"][1].real, color="dodgerblue", ls='--', label="$E_1$ and $E_1+\Delta_1$") 162 | ax1.plot(E, Output["components"][2].real, color="limegreen", ls='--', label="$E_{ID}$ (Indirect)") 163 | ax1.plot(E, Output["components"][3].real, color="gold", ls='--', label="$E_2$") 164 | 165 | ax1.set_xlabel("Energy (eV)") 166 | ax1.set_ylabel("$\epsilon_1 (\omega)$") 167 | ax1.set_title("(2) CPPB model for GaAs compared with experimental data") 168 | ax1.text(0.05, 0.05, '(a)', transform=ax1.transAxes, fontsize=12) 169 | 170 | # Subplot II :: Imaginary part of the dielectric function. 171 | 172 | ax2.plot(Palik_Eps2[:, 0], Palik_Eps2[:, 1], label="Exp. Data (Palik)", 173 | marker='o', ls='none', markerfacecolor='none', markeredgecolor="red") 174 | 175 | ax2.plot(E, Output["eps"].imag, color="Navy", label="Total") 176 | ax2.plot(E, Output["components"][0].imag, color="orangered", ls='--', label="$E_0$ and $E_0+\Delta_0$") 177 | ax2.plot(E, Output["components"][1].imag, color="dodgerblue", ls='--', label="$E_1$ and $E_1+\Delta_1$") 178 | ax2.plot(E, Output["components"][2].imag, color="limegreen", ls='--', label="$E_{ID}$ (Indirect)") 179 | ax2.plot(E, Output["components"][3].imag, color="gold", ls='--', label="$E_2$") 180 | ax2.set_xlim(0, 5.3) 181 | ax2.set_ylim(0, 27) 182 | 183 | ax2.set_xlabel("Energy (eV)") 184 | ax2.set_ylabel("$\epsilon_2 (\omega)$") 185 | ax2.text(0.05, 0.05, '(b)', transform=ax2.transAxes, fontsize=12) 186 | ax2.legend(loc="upper left", frameon=False) 187 | plt.tight_layout() 188 | plt.show() 189 | 190 | -------------------------------------------------------------------------------- /solar-cell-simulation/data/model_i_a_silicon_k.txt: -------------------------------------------------------------------------------- 1 | 0.0000003 3.2014 2 | 0.00000031 3.1371 3 | 0.00000032 3.0356 4 | 0.00000033 2.9018 5 | 0.00000034 2.743 6 | 0.00000035 2.5676 7 | 0.00000036 2.3843 8 | 0.00000037 2.2002 9 | 0.00000038 2.021 10 | 0.00000039 1.8508 11 | 0.0000004 1.6916 12 | 0.00000041 1.5448 13 | 0.00000042 1.4104 14 | 0.00000043 1.2882 15 | 0.00000044 1.1774 16 | 0.00000045 1.0772 17 | 0.00000046 0.98653 18 | 0.00000047 0.90461 19 | 0.00000048 0.83051 20 | 0.00000049 0.76342 21 | 0.0000005 0.70259 22 | 0.00000051 0.64735 23 | 0.00000052 0.59712 24 | 0.00000053 0.55137 25 | 0.00000054 0.50963 26 | 0.00000055 0.47149 27 | 0.00000056 0.43658 28 | 0.00000057 0.40458 29 | 0.00000058 0.37521 30 | 0.00000059 0.34822 31 | 0.0000006 0.32338 32 | 0.00000061 0.30049 33 | 0.00000062 0.27937 34 | 0.00000063 0.25986 35 | 0.00000064 0.24183 36 | 0.00000065 0.22514 37 | 0.00000066 0.20969 38 | 0.00000067 0.19536 39 | 0.00000068 0.18206 40 | 0.00000069 0.16972 41 | 0.0000007 0.15825 42 | 0.00000071 0.14758 43 | 0.00000072 0.13766 44 | 0.00000073 0.12842 45 | 0.00000074 0.11982 46 | 0.00000075 0.1118 47 | 0.00000076 0.10432 48 | 0.00000077 0.097347 49 | 0.00000078 0.090839 50 | 0.00000079 0.084764 51 | 0.0000008 0.079091 52 | 0.00000081 0.073791 53 | 0.00000082 0.068839 54 | 0.00000083 0.06421 55 | 0.00000084 0.059882 56 | 0.00000085 0.055835 57 | 0.00000086 0.05205 58 | 0.00000087 0.04851 59 | 0.00000088 0.045197 60 | 0.00000089 0.042098 61 | 0.0000009 0.039199 62 | 0.00000091 0.036486 63 | 0.00000092 0.033949 64 | 0.00000093 0.032039 65 | 0.00000094 0.031553 66 | 0.00000095 0.031081 67 | 0.00000096 0.030627 68 | 0.00000097 0.030189 69 | 0.00000098 0.029768 70 | 0.00000099 0.029362 71 | 0.000001 0.028971 72 | 0.00000101 0.028595 73 | 0.00000102 0.028233 74 | 0.00000103 0.027884 75 | 0.00000104 0.027548 76 | 0.00000105 0.027224 77 | 0.00000106 0.026911 78 | 0.00000107 0.02661 79 | 0.00000108 0.026319 80 | 0.00000109 0.026038 81 | 0.0000011 0.025767 82 | 0.00000111 0.025505 83 | 0.00000112 0.025252 84 | 0.00000113 0.025008 85 | 0.00000114 0.024772 86 | 0.00000115 0.024543 87 | 0.00000116 0.024322 88 | 0.00000117 0.024109 89 | 0.00000118 0.023902 90 | 0.00000119 0.023702 91 | 0.0000012 0.023508 92 | 0.00000121 0.02332 93 | 0.00000122 0.023139 94 | 0.00000123 0.022963 95 | 0.00000124 0.022792 96 | 0.00000125 0.022627 97 | 0.00000126 0.022466 98 | 0.00000127 0.022311 99 | 0.00000128 0.02216 100 | 0.00000129 0.022014 101 | 0.0000013 0.021872 102 | 0.00000131 0.021734 103 | 0.00000132 0.0216 104 | 0.00000133 0.021471 105 | 1.34E-06 0.021356 106 | 0.00000134 0.021345 107 | 0.00000135 0.021222 108 | 1.36E-06 0.021152 109 | 0.000001379 0.020887 110 | 1.40E-06 0.020695 111 | 1.42E-06 0.020507 112 | 0.00000143 0.020361 113 | 1.43E-06 0.020324 114 | 0.00000144 0.020266 115 | 0.00000145 0.020175 116 | 1.46E-06 0.020088 117 | 0.00000146 0.020085 118 | 0.00000147 0.019998 119 | 1.48E-06 0.019916 120 | 0.00000148 0.019914 121 | 0.00000149 0.019832 122 | 1.49E-06 0.019805 123 | 0.0000015 0.019752 124 | 0.00000151 0.019674 125 | 1.51E-06 0.019641 126 | 0.00000152 0.019598 127 | 0.00000153 0.019525 128 | 1.54E-06 0.019483 129 | 0.00000154 0.019453 130 | 0.00000155 0.019384 131 | 0.000001558 0.01933 132 | 0.00000156 0.019316 133 | 0.00000157 0.01925 134 | 1.57E-06 0.01923 135 | 0.00000158 0.019186 136 | 0.00000159 0.019124 137 | 1.60E-06 0.019085 138 | 0.0000016 0.019063 139 | 0.00000161 0.019004 140 | 1.61E-06 0.018991 141 | 0.00000162 0.018946 142 | 0.00000163 0.01889 143 | 1.64E-06 0.018854 144 | 0.00000164 0.018836 145 | 0.00000165 0.018783 146 | 1.65E-06 0.018766 147 | 0.00000166 0.018731 148 | 0.00000167 0.018681 149 | 1.68E-06 0.018637 150 | 0.00000168 0.018633 151 | 0.00000169 0.018585 152 | 1.70E-06 0.018554 153 | 0.0000017 0.018539 154 | 1.71E-06 0.018474 155 | 1.73E-06 0.018396 156 | 1.75E-06 0.01832 157 | 1.77E-06 0.018246 158 | 1.79E-06 0.018175 159 | 1.81E-06 0.018106 160 | 1.83E-06 0.01804 161 | 1.85E-06 0.017976 162 | 1.87E-06 0.017915 163 | 1.90E-06 0.017856 164 | 1.92E-06 0.017799 165 | 1.93E-06 0.017772 166 | 1.95E-06 0.01772 167 | 0.000001976 0.01767 168 | 1.99E-06 0.017646 169 | 2.01E-06 0.0176 170 | 2.04E-06 0.017557 171 | 0.000002051 0.017536 172 | 2.08E-06 0.017497 173 | 2.09E-06 0.017479 174 | 0.000002118 0.017444 175 | 0.000002132 0.017428 176 | 2.15E-06 0.017412 177 | 2.17E-06 0.017384 178 | 2.19E-06 0.017371 179 | 2.22E-06 0.017347 180 | 2.23E-06 0.017336 181 | 2.25E-06 0.017326 182 | 2.27E-06 0.017317 183 | 2.30E-06 0.017301 184 | 2.31E-06 0.017294 185 | 2.33E-06 0.017288 186 | 2.35E-06 0.017283 187 | 2.37E-06 0.017279 188 | 2.38E-06 0.017276 189 | 2.42E-06 0.017273 190 | 2.44E-06 0.017272 191 | 0.000002455 0.017273 192 | 2.47E-06 0.017274 193 | 2.49E-06 0.017277 194 | 2.51E-06 0.01728 195 | 2.53E-06 0.017285 196 | 2.55E-06 0.017291 197 | 2.57E-06 0.017297 198 | 2.59E-06 0.017305 199 | 2.61E-06 0.017314 200 | 2.63E-06 0.017324 201 | 2.66E-06 0.017335 202 | 2.68E-06 0.017347 203 | 2.70E-06 0.01736 204 | 2.72E-06 0.017375 205 | 2.75E-06 0.017391 206 | 2.77E-06 0.017408 207 | 2.79E-06 0.017426 208 | 2.82E-06 0.017446 209 | 2.84E-06 0.017467 210 | 2.87E-06 0.017489 211 | 2.89E-06 0.017512 212 | 2.92E-06 0.017537 213 | 0.000002946 0.017564 214 | 0.000002973 0.017592 215 | 3.00E-06 0.017621 216 | 3.03E-06 0.017652 217 | 3.06E-06 0.017685 218 | 3.09E-06 0.017719 219 | 3.12E-06 0.017755 220 | 3.15E-06 0.017792 221 | 0.000003177 0.017832 222 | 3.21E-06 0.017873 223 | 3.24E-06 0.017916 224 | 3.27E-06 0.01796 225 | 3.31E-06 0.018007 226 | 3.34E-06 0.018056 227 | 3.38E-06 0.018107 228 | 3.41E-06 0.018159 229 | 3.45E-06 0.018214 230 | 3.48E-06 0.018271 231 | 3.52E-06 0.018331 232 | 3.56E-06 0.018393 233 | 3.60E-06 0.018457 234 | 3.64E-06 0.018523 235 | 3.68E-06 0.018593 236 | 3.72E-06 0.018665 237 | 3.77E-06 0.018739 238 | 3.81E-06 0.018817 239 | 3.86E-06 0.018897 240 | 3.90E-06 0.01898 241 | 3.95E-06 0.019067 242 | 4.00E-06 0.019156 243 | 4.05E-06 0.019249 244 | 0.000004102 0.019346 245 | 4.15E-06 0.019446 246 | 4.21E-06 0.01955 247 | 4.26E-06 0.019657 248 | 4.32E-06 0.019769 249 | 4.38E-06 0.019884 250 | 4.44E-06 0.020004 251 | 4.50E-06 0.020129 252 | 4.56E-06 0.020258 253 | 4.63E-06 0.020392 254 | 4.70E-06 0.020531 255 | 4.77E-06 0.020675 256 | 4.84E-06 0.020825 257 | 0.00000491 0.020981 258 | 4.99E-06 0.021142 259 | 5.06E-06 0.02131 260 | 5.14E-06 0.021484 261 | 5.23E-06 0.021665 262 | 5.31E-06 0.021854 263 | 5.40E-06 0.022049 264 | 5.49E-06 0.022253 265 | 5.59E-06 0.022465 266 | 5.69E-06 0.022686 267 | 5.79E-06 0.022916 268 | 5.89E-06 0.023156 269 | 6.00E-06 0.023406 270 | 6.11E-06 0.023666 271 | 6.23E-06 0.023938 272 | 6.35E-06 0.024222 273 | 6.48E-06 0.024519 274 | 6.61E-06 0.02483 275 | 6.75E-06 0.025154 276 | 6.89E-06 0.025494 277 | 7.04E-06 0.025851 278 | 7.20E-06 0.026224 279 | 7.36E-06 0.026616 280 | 7.54E-06 0.027028 281 | 7.72E-06 0.027461 282 | 7.90E-06 0.027917 283 | 8.10E-06 0.028397 284 | 8.31E-06 0.028903 285 | 8.53E-06 0.029438 286 | 8.76E-06 0.030003 287 | 9.00E-06 0.030602 288 | 9.26E-06 0.031236 289 | 9.53E-06 0.03191 290 | 9.82E-06 0.032626 291 | 0.000010127 0.033389 292 | 0.000010453 0.034203 293 | 0.000010802 0.035073 294 | 0.000011174 0.036006 295 | 0.000011573 0.037007 296 | 0.000012002 0.038084 297 | 0.000012464 0.039246 298 | 0.000012962 0.040504 299 | 0.000013502 0.041869 300 | 0.000014089 0.043355 301 | 0.00001473 0.044978 302 | 0.000015431 0.046759 303 | 0.000016203 0.04872 304 | 0.000017056 0.05089 305 | 0.000018003 0.053305 306 | 0.000019062 0.056007 307 | 0.000020254 0.059049 308 | 0.000021604 0.0625 309 | 0.000023147 0.066448 310 | 0.000024927 0.071006 311 | 0.000027005 0.076327 312 | 0.00002946 0.082619 313 | 0.000032406 0.090173 314 | 0.000036006 0.099408 315 | -------------------------------------------------------------------------------- /solar-cell-simulation/notebooks/data/model_i_a_silicon_k.txt: -------------------------------------------------------------------------------- 1 | 0.0000003 3.2014 2 | 0.00000031 3.1371 3 | 0.00000032 3.0356 4 | 0.00000033 2.9018 5 | 0.00000034 2.743 6 | 0.00000035 2.5676 7 | 0.00000036 2.3843 8 | 0.00000037 2.2002 9 | 0.00000038 2.021 10 | 0.00000039 1.8508 11 | 0.0000004 1.6916 12 | 0.00000041 1.5448 13 | 0.00000042 1.4104 14 | 0.00000043 1.2882 15 | 0.00000044 1.1774 16 | 0.00000045 1.0772 17 | 0.00000046 0.98653 18 | 0.00000047 0.90461 19 | 0.00000048 0.83051 20 | 0.00000049 0.76342 21 | 0.0000005 0.70259 22 | 0.00000051 0.64735 23 | 0.00000052 0.59712 24 | 0.00000053 0.55137 25 | 0.00000054 0.50963 26 | 0.00000055 0.47149 27 | 0.00000056 0.43658 28 | 0.00000057 0.40458 29 | 0.00000058 0.37521 30 | 0.00000059 0.34822 31 | 0.0000006 0.32338 32 | 0.00000061 0.30049 33 | 0.00000062 0.27937 34 | 0.00000063 0.25986 35 | 0.00000064 0.24183 36 | 0.00000065 0.22514 37 | 0.00000066 0.20969 38 | 0.00000067 0.19536 39 | 0.00000068 0.18206 40 | 0.00000069 0.16972 41 | 0.0000007 0.15825 42 | 0.00000071 0.14758 43 | 0.00000072 0.13766 44 | 0.00000073 0.12842 45 | 0.00000074 0.11982 46 | 0.00000075 0.1118 47 | 0.00000076 0.10432 48 | 0.00000077 0.097347 49 | 0.00000078 0.090839 50 | 0.00000079 0.084764 51 | 0.0000008 0.079091 52 | 0.00000081 0.073791 53 | 0.00000082 0.068839 54 | 0.00000083 0.06421 55 | 0.00000084 0.059882 56 | 0.00000085 0.055835 57 | 0.00000086 0.05205 58 | 0.00000087 0.04851 59 | 0.00000088 0.045197 60 | 0.00000089 0.042098 61 | 0.0000009 0.039199 62 | 0.00000091 0.036486 63 | 0.00000092 0.033949 64 | 0.00000093 0.032039 65 | 0.00000094 0.031553 66 | 0.00000095 0.031081 67 | 0.00000096 0.030627 68 | 0.00000097 0.030189 69 | 0.00000098 0.029768 70 | 0.00000099 0.029362 71 | 0.000001 0.028971 72 | 0.00000101 0.028595 73 | 0.00000102 0.028233 74 | 0.00000103 0.027884 75 | 0.00000104 0.027548 76 | 0.00000105 0.027224 77 | 0.00000106 0.026911 78 | 0.00000107 0.02661 79 | 0.00000108 0.026319 80 | 0.00000109 0.026038 81 | 0.0000011 0.025767 82 | 0.00000111 0.025505 83 | 0.00000112 0.025252 84 | 0.00000113 0.025008 85 | 0.00000114 0.024772 86 | 0.00000115 0.024543 87 | 0.00000116 0.024322 88 | 0.00000117 0.024109 89 | 0.00000118 0.023902 90 | 0.00000119 0.023702 91 | 0.0000012 0.023508 92 | 0.00000121 0.02332 93 | 0.00000122 0.023139 94 | 0.00000123 0.022963 95 | 0.00000124 0.022792 96 | 0.00000125 0.022627 97 | 0.00000126 0.022466 98 | 0.00000127 0.022311 99 | 0.00000128 0.02216 100 | 0.00000129 0.022014 101 | 0.0000013 0.021872 102 | 0.00000131 0.021734 103 | 0.00000132 0.0216 104 | 0.00000133 0.021471 105 | 1.34E-06 0.021356 106 | 0.00000134 0.021345 107 | 0.00000135 0.021222 108 | 1.36E-06 0.021152 109 | 0.000001379 0.020887 110 | 1.40E-06 0.020695 111 | 1.42E-06 0.020507 112 | 0.00000143 0.020361 113 | 1.43E-06 0.020324 114 | 0.00000144 0.020266 115 | 0.00000145 0.020175 116 | 1.46E-06 0.020088 117 | 0.00000146 0.020085 118 | 0.00000147 0.019998 119 | 1.48E-06 0.019916 120 | 0.00000148 0.019914 121 | 0.00000149 0.019832 122 | 1.49E-06 0.019805 123 | 0.0000015 0.019752 124 | 0.00000151 0.019674 125 | 1.51E-06 0.019641 126 | 0.00000152 0.019598 127 | 0.00000153 0.019525 128 | 1.54E-06 0.019483 129 | 0.00000154 0.019453 130 | 0.00000155 0.019384 131 | 0.000001558 0.01933 132 | 0.00000156 0.019316 133 | 0.00000157 0.01925 134 | 1.57E-06 0.01923 135 | 0.00000158 0.019186 136 | 0.00000159 0.019124 137 | 1.60E-06 0.019085 138 | 0.0000016 0.019063 139 | 0.00000161 0.019004 140 | 1.61E-06 0.018991 141 | 0.00000162 0.018946 142 | 0.00000163 0.01889 143 | 1.64E-06 0.018854 144 | 0.00000164 0.018836 145 | 0.00000165 0.018783 146 | 1.65E-06 0.018766 147 | 0.00000166 0.018731 148 | 0.00000167 0.018681 149 | 1.68E-06 0.018637 150 | 0.00000168 0.018633 151 | 0.00000169 0.018585 152 | 1.70E-06 0.018554 153 | 0.0000017 0.018539 154 | 1.71E-06 0.018474 155 | 1.73E-06 0.018396 156 | 1.75E-06 0.01832 157 | 1.77E-06 0.018246 158 | 1.79E-06 0.018175 159 | 1.81E-06 0.018106 160 | 1.83E-06 0.01804 161 | 1.85E-06 0.017976 162 | 1.87E-06 0.017915 163 | 1.90E-06 0.017856 164 | 1.92E-06 0.017799 165 | 1.93E-06 0.017772 166 | 1.95E-06 0.01772 167 | 0.000001976 0.01767 168 | 1.99E-06 0.017646 169 | 2.01E-06 0.0176 170 | 2.04E-06 0.017557 171 | 0.000002051 0.017536 172 | 2.08E-06 0.017497 173 | 2.09E-06 0.017479 174 | 0.000002118 0.017444 175 | 0.000002132 0.017428 176 | 2.15E-06 0.017412 177 | 2.17E-06 0.017384 178 | 2.19E-06 0.017371 179 | 2.22E-06 0.017347 180 | 2.23E-06 0.017336 181 | 2.25E-06 0.017326 182 | 2.27E-06 0.017317 183 | 2.30E-06 0.017301 184 | 2.31E-06 0.017294 185 | 2.33E-06 0.017288 186 | 2.35E-06 0.017283 187 | 2.37E-06 0.017279 188 | 2.38E-06 0.017276 189 | 2.42E-06 0.017273 190 | 2.44E-06 0.017272 191 | 0.000002455 0.017273 192 | 2.47E-06 0.017274 193 | 2.49E-06 0.017277 194 | 2.51E-06 0.01728 195 | 2.53E-06 0.017285 196 | 2.55E-06 0.017291 197 | 2.57E-06 0.017297 198 | 2.59E-06 0.017305 199 | 2.61E-06 0.017314 200 | 2.63E-06 0.017324 201 | 2.66E-06 0.017335 202 | 2.68E-06 0.017347 203 | 2.70E-06 0.01736 204 | 2.72E-06 0.017375 205 | 2.75E-06 0.017391 206 | 2.77E-06 0.017408 207 | 2.79E-06 0.017426 208 | 2.82E-06 0.017446 209 | 2.84E-06 0.017467 210 | 2.87E-06 0.017489 211 | 2.89E-06 0.017512 212 | 2.92E-06 0.017537 213 | 0.000002946 0.017564 214 | 0.000002973 0.017592 215 | 3.00E-06 0.017621 216 | 3.03E-06 0.017652 217 | 3.06E-06 0.017685 218 | 3.09E-06 0.017719 219 | 3.12E-06 0.017755 220 | 3.15E-06 0.017792 221 | 0.000003177 0.017832 222 | 3.21E-06 0.017873 223 | 3.24E-06 0.017916 224 | 3.27E-06 0.01796 225 | 3.31E-06 0.018007 226 | 3.34E-06 0.018056 227 | 3.38E-06 0.018107 228 | 3.41E-06 0.018159 229 | 3.45E-06 0.018214 230 | 3.48E-06 0.018271 231 | 3.52E-06 0.018331 232 | 3.56E-06 0.018393 233 | 3.60E-06 0.018457 234 | 3.64E-06 0.018523 235 | 3.68E-06 0.018593 236 | 3.72E-06 0.018665 237 | 3.77E-06 0.018739 238 | 3.81E-06 0.018817 239 | 3.86E-06 0.018897 240 | 3.90E-06 0.01898 241 | 3.95E-06 0.019067 242 | 4.00E-06 0.019156 243 | 4.05E-06 0.019249 244 | 0.000004102 0.019346 245 | 4.15E-06 0.019446 246 | 4.21E-06 0.01955 247 | 4.26E-06 0.019657 248 | 4.32E-06 0.019769 249 | 4.38E-06 0.019884 250 | 4.44E-06 0.020004 251 | 4.50E-06 0.020129 252 | 4.56E-06 0.020258 253 | 4.63E-06 0.020392 254 | 4.70E-06 0.020531 255 | 4.77E-06 0.020675 256 | 4.84E-06 0.020825 257 | 0.00000491 0.020981 258 | 4.99E-06 0.021142 259 | 5.06E-06 0.02131 260 | 5.14E-06 0.021484 261 | 5.23E-06 0.021665 262 | 5.31E-06 0.021854 263 | 5.40E-06 0.022049 264 | 5.49E-06 0.022253 265 | 5.59E-06 0.022465 266 | 5.69E-06 0.022686 267 | 5.79E-06 0.022916 268 | 5.89E-06 0.023156 269 | 6.00E-06 0.023406 270 | 6.11E-06 0.023666 271 | 6.23E-06 0.023938 272 | 6.35E-06 0.024222 273 | 6.48E-06 0.024519 274 | 6.61E-06 0.02483 275 | 6.75E-06 0.025154 276 | 6.89E-06 0.025494 277 | 7.04E-06 0.025851 278 | 7.20E-06 0.026224 279 | 7.36E-06 0.026616 280 | 7.54E-06 0.027028 281 | 7.72E-06 0.027461 282 | 7.90E-06 0.027917 283 | 8.10E-06 0.028397 284 | 8.31E-06 0.028903 285 | 8.53E-06 0.029438 286 | 8.76E-06 0.030003 287 | 9.00E-06 0.030602 288 | 9.26E-06 0.031236 289 | 9.53E-06 0.03191 290 | 9.82E-06 0.032626 291 | 0.000010127 0.033389 292 | 0.000010453 0.034203 293 | 0.000010802 0.035073 294 | 0.000011174 0.036006 295 | 0.000011573 0.037007 296 | 0.000012002 0.038084 297 | 0.000012464 0.039246 298 | 0.000012962 0.040504 299 | 0.000013502 0.041869 300 | 0.000014089 0.043355 301 | 0.00001473 0.044978 302 | 0.000015431 0.046759 303 | 0.000016203 0.04872 304 | 0.000017056 0.05089 305 | 0.000018003 0.053305 306 | 0.000019062 0.056007 307 | 0.000020254 0.059049 308 | 0.000021604 0.0625 309 | 0.000023147 0.066448 310 | 0.000024927 0.071006 311 | 0.000027005 0.076327 312 | 0.00002946 0.082619 313 | 0.000032406 0.090173 314 | 0.000036006 0.099408 315 | -------------------------------------------------------------------------------- /docs/site_libs/quarto-nav/quarto-nav.js: -------------------------------------------------------------------------------- 1 | const headroomChanged = new CustomEvent("quarto-hrChanged", { 2 | detail: {}, 3 | bubbles: true, 4 | cancelable: false, 5 | composed: false, 6 | }); 7 | 8 | window.document.addEventListener("DOMContentLoaded", function () { 9 | let init = false; 10 | 11 | function throttle(func, wait) { 12 | var timeout; 13 | return function () { 14 | const context = this; 15 | const args = arguments; 16 | const later = function () { 17 | clearTimeout(timeout); 18 | timeout = null; 19 | func.apply(context, args); 20 | }; 21 | 22 | if (!timeout) { 23 | timeout = setTimeout(later, wait); 24 | } 25 | }; 26 | } 27 | 28 | function headerOffset() { 29 | // Set an offset if there is are fixed top navbar 30 | const headerEl = window.document.querySelector("header.fixed-top"); 31 | if (headerEl) { 32 | return headerEl.clientHeight; 33 | } else { 34 | return 0; 35 | } 36 | } 37 | 38 | function footerOffset() { 39 | const footerEl = window.document.querySelector("footer.footer"); 40 | if (footerEl) { 41 | return footerEl.clientHeight; 42 | } else { 43 | return 0; 44 | } 45 | } 46 | 47 | function updateDocumentOffsetWithoutAnimation() { 48 | updateDocumentOffset(false); 49 | } 50 | 51 | function updateDocumentOffset(animated) { 52 | // set body offset 53 | const topOffset = headerOffset(); 54 | const bodyOffset = topOffset + footerOffset(); 55 | const bodyEl = window.document.body; 56 | bodyEl.setAttribute("data-bs-offset", topOffset); 57 | bodyEl.style.paddingTop = topOffset + "px"; 58 | 59 | // deal with sidebar offsets 60 | const sidebars = window.document.querySelectorAll( 61 | ".sidebar, .headroom-target" 62 | ); 63 | sidebars.forEach((sidebar) => { 64 | if (!animated) { 65 | sidebar.classList.add("notransition"); 66 | // Remove the no transition class after the animation has time to complete 67 | setTimeout(function () { 68 | sidebar.classList.remove("notransition"); 69 | }, 201); 70 | } 71 | 72 | if (window.Headroom && sidebar.classList.contains("sidebar-unpinned")) { 73 | sidebar.style.top = "0"; 74 | sidebar.style.maxHeight = "100vh"; 75 | } else { 76 | sidebar.style.top = topOffset + "px"; 77 | sidebar.style.maxHeight = "calc(100vh - " + topOffset + "px)"; 78 | } 79 | }); 80 | 81 | // allow space for footer 82 | const mainContainer = window.document.querySelector(".quarto-container"); 83 | if (mainContainer) { 84 | mainContainer.style.minHeight = "calc(100vh - " + bodyOffset + "px)"; 85 | } 86 | 87 | // link offset 88 | let linkStyle = window.document.querySelector("#quarto-target-style"); 89 | if (!linkStyle) { 90 | linkStyle = window.document.createElement("style"); 91 | window.document.head.appendChild(linkStyle); 92 | } 93 | while (linkStyle.firstChild) { 94 | linkStyle.removeChild(linkStyle.firstChild); 95 | } 96 | if (topOffset > 0) { 97 | linkStyle.appendChild( 98 | window.document.createTextNode(` 99 | section:target::before { 100 | content: ""; 101 | display: block; 102 | height: ${topOffset}px; 103 | margin: -${topOffset}px 0 0; 104 | }`) 105 | ); 106 | } 107 | if (init) { 108 | window.dispatchEvent(headroomChanged); 109 | } 110 | init = true; 111 | } 112 | 113 | // initialize headroom 114 | var header = window.document.querySelector("#quarto-header"); 115 | if (header && window.Headroom) { 116 | const headroom = new window.Headroom(header, { 117 | tolerance: 5, 118 | onPin: function () { 119 | const sidebars = window.document.querySelectorAll( 120 | ".sidebar, .headroom-target" 121 | ); 122 | sidebars.forEach((sidebar) => { 123 | sidebar.classList.remove("sidebar-unpinned"); 124 | }); 125 | updateDocumentOffset(); 126 | }, 127 | onUnpin: function () { 128 | const sidebars = window.document.querySelectorAll( 129 | ".sidebar, .headroom-target" 130 | ); 131 | sidebars.forEach((sidebar) => { 132 | sidebar.classList.add("sidebar-unpinned"); 133 | }); 134 | updateDocumentOffset(); 135 | }, 136 | }); 137 | headroom.init(); 138 | 139 | let frozen = false; 140 | window.quartoToggleHeadroom = function () { 141 | if (frozen) { 142 | headroom.unfreeze(); 143 | frozen = false; 144 | } else { 145 | headroom.freeze(); 146 | frozen = true; 147 | } 148 | }; 149 | } 150 | 151 | // Observe size changed for the header 152 | const headerEl = window.document.querySelector("header.fixed-top"); 153 | if (headerEl && window.ResizeObserver) { 154 | const observer = new window.ResizeObserver( 155 | throttle(updateDocumentOffsetWithoutAnimation, 50) 156 | ); 157 | observer.observe(headerEl, { 158 | attributes: true, 159 | childList: true, 160 | characterData: true, 161 | }); 162 | } else { 163 | window.addEventListener( 164 | "resize", 165 | throttle(updateDocumentOffsetWithoutAnimation, 50) 166 | ); 167 | setTimeout(updateDocumentOffsetWithoutAnimation, 500); 168 | } 169 | 170 | // fixup index.html links if we aren't on the filesystem 171 | if (window.location.protocol !== "file:") { 172 | const links = window.document.querySelectorAll("a"); 173 | for (let i = 0; i < links.length; i++) { 174 | links[i].href = links[i].href.replace(/\/index\.html/, "/"); 175 | } 176 | 177 | // Fixup any sharing links that require urls 178 | // Append url to any sharing urls 179 | const sharingLinks = window.document.querySelectorAll( 180 | "a.sidebar-tools-main-item" 181 | ); 182 | for (let i = 0; i < sharingLinks.length; i++) { 183 | const sharingLink = sharingLinks[i]; 184 | const href = sharingLink.getAttribute("href"); 185 | if (href) { 186 | sharingLink.setAttribute( 187 | "href", 188 | href.replace("|url|", window.location.href) 189 | ); 190 | } 191 | } 192 | 193 | // Scroll the active navigation item into view, if necessary 194 | const navSidebar = window.document.querySelector("nav#quarto-sidebar"); 195 | if (navSidebar) { 196 | // Find the active item 197 | const activeItem = navSidebar.querySelector("li.sidebar-item a.active"); 198 | if (activeItem) { 199 | // Wait for the scroll height and height to resolve by observing size changes on the 200 | // nav element that is scrollable 201 | const resizeObserver = new ResizeObserver((_entries) => { 202 | // The bottom of the element 203 | const elBottom = activeItem.offsetTop; 204 | const viewBottom = navSidebar.scrollTop + navSidebar.clientHeight; 205 | 206 | // The element height and scroll height are the same, then we are still loading 207 | if (viewBottom !== navSidebar.scrollHeight) { 208 | // Determine if the item isn't visible and scroll to it 209 | if (elBottom >= viewBottom) { 210 | navSidebar.scrollTop = elBottom; 211 | } 212 | 213 | // stop observing now since we've completed the scroll 214 | resizeObserver.unobserve(navSidebar); 215 | } 216 | }); 217 | resizeObserver.observe(navSidebar); 218 | } 219 | } 220 | } 221 | }); 222 | -------------------------------------------------------------------------------- /solar-cell-simulation/7a-optimization.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # # Example 7a: Simple optimization 5 | # 6 | # In a few of the previous examples, we have used anti-reflection coatings. In [Example 5a](5a-ultrathin_GaAs_cell.ipynb), we introduced a nanophotonic grating for light trapping. But how do you find out the right thickness for the anti-reflection coating layer(s), or the right dimensions for a light-trapping grating? This is where optimization comes in. Here, we will look at a very simple 'brute-force' optimization for a single or double-layer ARC, and a more complicated framework for running optimizations using Solcore/RayFlare and a differential evolution algorithm in [Example 7b](7b-optimization.ipynb). 7 | 8 | # In[83]: 9 | 10 | 11 | import numpy as np 12 | import os 13 | import matplotlib.pyplot as plt 14 | 15 | from solcore import material, si 16 | from solcore.solar_cell import Layer 17 | from solcore.light_source import LightSource 18 | from solcore.absorption_calculator import search_db 19 | 20 | from rayflare.transfer_matrix_method import tmm_structure 21 | from rayflare.options import default_options 22 | import seaborn as sns 23 | 24 | 25 | # ## Setting up 26 | 27 | # In[84]: 28 | 29 | 30 | opts = default_options() 31 | 32 | wavelengths = np.linspace(300, 1200, 800)*1e-9 33 | 34 | AM15g = LightSource(source_type="standard", version="AM1.5g", output_units="photon_flux_per_m") 35 | spectrum = AM15g.spectrum(wavelengths)[1] 36 | normalised_spectrum = spectrum/np.max(spectrum) 37 | 38 | opts.wavelengths = wavelengths 39 | opts.coherent = False 40 | opts.coherency_list = ['c', 'i'] 41 | 42 | Si = material("Si")() 43 | SiN = material("Si3N4")() 44 | Ag = material("Ag")() 45 | Air = material("Air")() 46 | 47 | 48 | # ## Single-layer ARC 49 | # 50 | # Here, we will calculate the behaviour of a single-layer SiN anti-reflection coating on Si while changing the ARC thickness between 0 and 200 nm. We will consider two values to optimize: the mean reflectance `mean_R`, and the reflectance weighted by the photon flux in an AM1.5G spectrum (`weighted_R`). The reason for considering the second value is that it is more useful to suppress reflection at wavelengths where there are more photons which could be absorbed. 51 | # 52 | # We will loop through the different ARC thicknesses in `d_range`, build the structure for each case, and then calculate the reflectance. We then save the mean reflected and weighted mean reflectance in the corresponding arrays. We also plot the reflectance for each 15th loop (this is just so the plot does not get too crowded). 53 | 54 | # In[85]: 55 | 56 | 57 | d_range = np.linspace(0, 200, 200) 58 | 59 | mean_R = np.empty_like(d_range) 60 | weighted_R = np.empty_like(d_range) 61 | 62 | cols = sns.cubehelix_palette(np.ceil(len(d_range)/15)) 63 | 64 | plt.figure() 65 | jcol = 0 66 | 67 | for i1, d in enumerate(d_range): 68 | 69 | struct = tmm_structure([Layer(si(d, 'nm'), SiN), Layer(si('300um'), Si)], incidence=Air, transmission=Ag) 70 | RAT = struct.calculate(opts) 71 | 72 | if i1 % 15 == 0: 73 | plt.plot(wavelengths*1e9, RAT['R'], label=str(np.round(d, 0)), color=cols[jcol]) 74 | jcol += 1 75 | 76 | mean_R[i1] = np.mean(RAT['R']) 77 | weighted_R[i1] = np.mean(RAT['R']*normalised_spectrum) 78 | 79 | plt.legend() 80 | plt.show() 81 | 82 | 83 | # We now find at which index `mean_R` and `weighted_R` are minimised using `np.argmin`, and use this to print the ARC thickness at which this occurs (rounded to 1 decimal place). 84 | 85 | # In[86]: 86 | 87 | 88 | print('Minimum mean reflection occurs at d = ' + str(np.round(d_range[np.argmin(mean_R)], 1)) + ' nm') 89 | print('Minimum weighted reflection occurs at d = ' + str(np.round(d_range[np.argmin(weighted_R)], 1)) + ' nm') 90 | 91 | 92 | # We see that the values of $d$ for the two different ways of optimizing are very similar, but not exactly the same, as we would expect. The minimum in both cases occurs around 70 nm. We can also plot the evolution of the mean and weighted $R$ with ARC thickness $d$: 93 | 94 | # In[87]: 95 | 96 | 97 | plt.figure() 98 | plt.plot(d_range, mean_R, label='Mean reflection') 99 | plt.plot(d_range[np.argmin(mean_R)], np.min(mean_R), 'ok') 100 | plt.plot(d_range, weighted_R, label='Weighted mean reflection') 101 | plt.plot(d_range[np.argmin(weighted_R)], np.min(weighted_R), 'ok') 102 | plt.xlabel('d$_{SiN}$') 103 | plt.ylabel('(Weighted) mean reflection 300-1200 nm') 104 | plt.show() 105 | 106 | 107 | # And the actual reflectance with wavelength for the two different optimizations: 108 | 109 | # In[88]: 110 | 111 | 112 | struct = tmm_structure([Layer(si(d_range[np.argmin(mean_R)], 'nm'), SiN), Layer(si('300um'), Si)], incidence=Air, transmission=Ag) 113 | RAT_1 = struct.calculate(opts) 114 | 115 | struct = tmm_structure([Layer(si(d_range[np.argmin(weighted_R)], 'nm'), SiN), Layer(si('300um'), Si)], incidence=Air, transmission=Ag) 116 | RAT_2 = struct.calculate(opts) 117 | 118 | plt.figure() 119 | plt.plot(wavelengths*1e9, RAT_1['R'], label='Mean R minimum') 120 | plt.plot(wavelengths*1e9, RAT_2['R'], label='Weighted R minimum') 121 | plt.legend() 122 | plt.xlabel("Wavelength (nm)") 123 | plt.ylabel("R") 124 | plt.show() 125 | 126 | 127 | # We see that the two reflectance curves are very similar. 128 | # 129 | # ## Double-layer ARC 130 | # 131 | # We will now consider a similar situation, but for a double-layer MgF$_2$/Ta$_2$O$_5$ ARC on GaAs. We search for materials in the refractiveindex.info database (see [Example 2a](2a-optical_constants.ipynb)), and use only the part of the solar spectrum relevant for absorption in GaAs (in this case, there is no benefit to reducing absorption above the GaAs bandgap around 900 nm). We will only consider the weighted mean $R$ in this case. 132 | 133 | # In[89]: 134 | 135 | 136 | #| output: false 137 | 138 | pageid_MgF2 = search_db(os.path.join("MgF2", "Rodriguez-de Marcos"))[0][0] 139 | pageid_Ta2O5 = search_db(os.path.join("Ta2O5", "Rodriguez-de Marcos"))[0][0] 140 | 141 | GaAs = material("GaAs")() 142 | MgF2 = material(str(pageid_MgF2), nk_db=True)() 143 | Ta2O5 = material(str(pageid_Ta2O5), nk_db=True)() 144 | 145 | MgF2_thickness = np.linspace(50, 100, 20) 146 | Ta2O5_thickness = np.linspace(30, 80, 20) 147 | 148 | weighted_R_matrix = np.zeros((len(MgF2_thickness), len(Ta2O5_thickness))) 149 | 150 | wavelengths_GaAs = wavelengths[wavelengths < 900e-9] 151 | normalised_spectrum_GaAs = normalised_spectrum[wavelengths < 900e-9] 152 | 153 | opts.coherent = True 154 | opts.wavelengths = wavelengths_GaAs 155 | 156 | 157 | # We now have two thicknesses to loop through; otherwise, the procedure is similar to the single-layer ARC example. 158 | 159 | # In[90]: 160 | 161 | 162 | #| output: false 163 | 164 | for i1, d_MgF2 in enumerate(MgF2_thickness): 165 | for j1, d_Ta2O5 in enumerate(Ta2O5_thickness): 166 | struct = tmm_structure([Layer(si(d_MgF2, 'nm'), MgF2), Layer(si(d_Ta2O5, 'nm'), Ta2O5), 167 | Layer(si('20um'), GaAs)], 168 | incidence=Air, transmission=Ag) 169 | RAT = struct.calculate(opts) 170 | 171 | weighted_R_matrix[i1, j1] = np.mean(RAT['R'] * normalised_spectrum_GaAs) 172 | 173 | # find the row and column indices of the minimum weighted R value 174 | ri, ci = np.unravel_index(weighted_R_matrix.argmin(), weighted_R_matrix.shape) 175 | 176 | 177 | # We plot the total absorption ($1-R$) in the structure with the optimized ARC, and print the thicknesses of MgF$_2$ and Ta$_2$O$_5$ at which this occurs: 178 | 179 | # In[91]: 180 | 181 | 182 | plt.figure() 183 | plt.imshow(1-weighted_R_matrix, extent=[min(Ta2O5_thickness), max(Ta2O5_thickness), 184 | min(MgF2_thickness), max(MgF2_thickness)], 185 | origin='lower', aspect='equal') 186 | plt.plot(Ta2O5_thickness[ci], MgF2_thickness[ri], 'xk') 187 | plt.colorbar() 188 | plt.xlabel("Ta$_2$O$_5$ thickness (nm)") 189 | plt.ylabel("MgF$_2$ thickness (nm)") 190 | plt.show() 191 | 192 | print("Minimum reflection occurs at MgF2 / Ta2O5 thicknesses of %.1f / %.1f nm " 193 | % (MgF2_thickness[ri], Ta2O5_thickness[ci])) 194 | 195 | 196 | # For these two examples, where we are only trying to optimize one and two parameters respectively across a relatively small range, using a method (TMM) which executes quickly, brute force searching is possible. However, as we introduce more parameters, a wider parameter space, and slower simulation methods, it may no longer be computationally tractable. 197 | -------------------------------------------------------------------------------- /solar-cell-simulation/1c-simple_cell.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # # Example 1c: Electrical models 5 | # In the first two examples, we mostly focused on different optical models and how they can be applied to an Si cell. 6 | # Here we will look at different electrical models, roughly in increasing order of how 'realistic' they are expected to be: 7 | # 8 | # 1. Two-diode model (2D) 9 | # 2. Detailed balance (DB) 10 | # 3. Depletion approximation (DA) 11 | # 4. Poisson drift-diffusion solver (PDD) 12 | 13 | # In[81]: 14 | 15 | 16 | import numpy as np 17 | import matplotlib.pyplot as plt 18 | 19 | from solcore.solar_cell import SolarCell, Layer, Junction 20 | from solcore.solar_cell_solver import solar_cell_solver 21 | from solcore.absorption_calculator import OptiStack, calculate_rat 22 | 23 | from solcore import material, si 24 | 25 | from solcore.interpolate import interp1d 26 | 27 | 28 | # ## Setting up 29 | # 30 | # Define some materials: 31 | 32 | # In[82]: 33 | 34 | 35 | GaAs = material("GaAs")() 36 | Al2O3 = material("Al2O3")() 37 | Ag = material("Ag")() 38 | 39 | wavelengths = si(np.linspace(300, 950, 200), "nm") 40 | 41 | 42 | # We are going to do an optical calculation first to get absorption for a GaAs layer; we will use this as an estimate for the EQE as input for the two-diode model. 43 | 44 | # In[83]: 45 | 46 | 47 | OS = OptiStack([Layer(si("3um"), GaAs)], substrate=Ag) 48 | 49 | 50 | # Calculate reflection/absorption/transmission (note that we have to give the wavelength to this function in nm rather than m!) 51 | 52 | # In[84]: 53 | 54 | 55 | RAT = calculate_rat(OS, wavelength=wavelengths*1e9, no_back_reflection=False) 56 | 57 | 58 | # Create a function which interpolates the absorption - note that we pass a function which returns the absorption when given a wavelength to the Junction, rather than a table of values! 59 | 60 | # In[85]: 61 | 62 | 63 | eqe_func = interp1d(wavelengths, RAT["A"]) 64 | 65 | 66 | # ## 2D and DB junctions 67 | # 68 | # Define the 2D junction with reasonable parameters for GaAs. The units of j01 and j01 are A/m^2. The units for the resistances are (Ohm m)^2. We use the standard ideality factors (1 and 2 respectively) for the two diodes: 69 | 70 | # In[86]: 71 | 72 | 73 | twod_junction = Junction(kind='2D', n1=1, n2=2, j01=3e-17, j02=1e-7, 74 | R_series=6e-4, R_shunt=5e4, eqe=eqe_func) 75 | 76 | 77 | # Define two instances of a detailed-balance type junction. In both cases, there will be a sharp absorption onset at the bandgap (1.42 eV for GaAs). By specifying A, we set the fraction of light above the bandgap that is absorbed (A = 1 means 100% absorption above the gap). 78 | 79 | # In[87]: 80 | 81 | 82 | db_junction_A1 = Junction(kind='DB', Eg=1.42, A=1, R_shunt=1e4, n=1) 83 | db_junction = Junction(kind='DB', Eg=1.42, A=0.8, R_shunt=1e4, n=1) 84 | 85 | V = np.linspace(0, 1.5, 200) 86 | 87 | 88 | # Set some options and define solar cells based on these junctions: 89 | 90 | # In[88]: 91 | 92 | 93 | opts = {'voltages': V, 'light_iv': True, 'wavelength': wavelengths, 'mpp': True} 94 | 95 | solar_cell_db_A1 = SolarCell([db_junction_A1]) 96 | solar_cell_db = SolarCell([db_junction]) 97 | solar_cell_2d = SolarCell([twod_junction]) 98 | 99 | 100 | # Calculate and plot the IV curves: 101 | 102 | # In[89]: 103 | 104 | 105 | solar_cell_solver(solar_cell_db_A1, 'iv', user_options=opts) 106 | solar_cell_solver(solar_cell_db, 'iv', user_options=opts) 107 | solar_cell_solver(solar_cell_2d, 'iv', user_options=opts) 108 | 109 | 110 | # **PLOT 1**: IV curves for the DB and 2D models. 111 | 112 | # In[90]: 113 | 114 | 115 | plt.figure() 116 | plt.plot(*solar_cell_db_A1.iv["IV"], label='Detailed balance (Eg = 1.44 eV, A = 1)') 117 | plt.plot(*solar_cell_db.iv["IV"], label='Detailed balance (Eg = 1.44 eV, A = 0.8)') 118 | plt.plot(*solar_cell_2d.iv["IV"], '--', label='Two-diode') 119 | plt.xlim(0, 1.5) 120 | plt.ylim(0, 500) 121 | plt.xlabel("V (V)") 122 | plt.ylabel("J (A/m$^2$)") 123 | plt.legend() 124 | plt.title('(1) IV curves calculated through detailed balance and two-diode models') 125 | plt.show() 126 | 127 | 128 | # As we expect, the two DB solar cells have a very similar shape, but the A = 1 case has a higher Jsc. 129 | # The two-diode model has a lower current, which makes sense as it's EQE is specified based on a more realistic 130 | # absorption calculation which includes front-surface reflection and an absorption edge which is not infinitely 131 | # sharp at the bandgap, as is assumed by the detailed balance model. 132 | # 133 | # ## DA and PDD junctions 134 | # 135 | # Now let's consider the two slightly more complex models, which will actually take into account the absorption profile 136 | # of light in the cell and the distribution of charge carriers; the depletion approximation and the Poisson drift-diffusion 137 | # solver. 138 | # 139 | # *Note:* for the PDD example to work, the PDD solver must be installed correctly; see the [Solcore documentation](http://docs.solcore.solar/en/master/Installation/installation.html) for more 140 | # information. 141 | 142 | # In[91]: 143 | 144 | 145 | T = 293 # ambient temperature 146 | 147 | window = material('AlGaAs')(T=T, Na=si("5e18cm-3"), Al=0.8) 148 | p_GaAs = material('GaAs')(T=T, Na=si("1e18cm-3"), electron_diffusion_length=si("400nm")) 149 | n_GaAs = material('GaAs')(T=T, Nd=si("8e16cm-3"), hole_diffusion_length=si("8um")) 150 | bsf = material('GaAs')(T=T, Nd=si("2e18cm-3")) 151 | 152 | SC_layers = [Layer(width=si('150nm'), material=p_GaAs, role="Emitter"), 153 | Layer(width=si('2850nm'), material=n_GaAs, role="Base"), 154 | Layer(width=si('200nm'), material=bsf, role="BSF")] 155 | 156 | 157 | # `sn` and `sp` are the surface recombination velocities (in m/sec). `sn` is the SRV for the n-doped junction, `sp` for the 158 | # p-doped junction. 159 | 160 | # In[92]: 161 | 162 | 163 | # Depletion approximation: 164 | solar_cell_da = SolarCell( 165 | [Layer(width=si("90nm"), material=Al2O3), Layer(width=si('20nm'), 166 | material=window, role="Window"), 167 | Junction(SC_layers, sn=5e4, sp=5e4, kind='DA')], 168 | R_series=0, substrate=Ag 169 | ) 170 | 171 | 172 | # In[93]: 173 | 174 | 175 | # Drift-diffusion solver: 176 | solar_cell_pdd = SolarCell( 177 | [Layer(width=si("90nm"), material=Al2O3), Layer(width=si('20nm'), 178 | material=window, role="Window"), 179 | Junction(SC_layers, sn=5e4, sp=5e4, kind='PDD')], 180 | R_series=0, substrate=Ag 181 | ) 182 | 183 | 184 | # In both cases, we set the series resistance to 0. Other loss factors, such as shading, are also assumed to be zero by default. 185 | 186 | # In[94]: 187 | 188 | 189 | #| output: false 190 | 191 | opts["optics_method"] = "TMM" # Use the transfer-matrix method to calculate the cell's optics 192 | opts["position"] = 1e-10 # This is the spacing used when calculating the depth-dependent absorption (0.1 nm) 193 | opts["no_back_reflection"] = False 194 | 195 | solar_cell_solver(solar_cell_da, "iv", user_options=opts); 196 | solar_cell_solver(solar_cell_da, "qe", user_options=opts); 197 | 198 | solar_cell_solver(solar_cell_pdd, "iv", user_options=opts); 199 | solar_cell_solver(solar_cell_pdd, "qe", user_options=opts); 200 | 201 | 202 | # **PLOT 2**: IV curves for the DA and PDD models 203 | 204 | # In[95]: 205 | 206 | 207 | plt.figure() 208 | plt.plot(*solar_cell_da.iv["IV"], label="Depletion approximation") 209 | plt.plot(*solar_cell_pdd.iv["IV"], '--', label="Poisson Drift Diffusion") 210 | plt.xlim(0, 1.2) 211 | plt.ylim(0, 330) 212 | plt.legend() 213 | plt.xlabel("V (V)") 214 | plt.ylabel("J (A/m$^2$)") 215 | plt.title('(2) IV curves from depletion approximation and drift-diffusion models') 216 | plt.show() 217 | 218 | 219 | # **PLOT 3**: EQE and absorption calculated for the PDD and DA models. 220 | 221 | # In[96]: 222 | 223 | 224 | plt.figure() 225 | plt.plot(wavelengths*1e9, 100*solar_cell_da[2].eqe(wavelengths), 'k-', label="EQE (DA)") 226 | plt.plot(wavelengths*1e9, 100*solar_cell_pdd[2].eqe(wavelengths), 'k--', label="EQE (PDD)") 227 | plt.plot(wavelengths*1e9, 100*solar_cell_da[2].layer_absorption, 'r-', label="A (DA)") 228 | plt.plot(wavelengths*1e9, 100*solar_cell_pdd[2].layer_absorption, 'b--', label="A (PDD)") 229 | plt.legend() 230 | plt.xlabel("Wavelength (nm)") 231 | plt.ylabel("EQE/A (%)") 232 | plt.title('(3) EQE and absorption from depletion approximation and drift-diffusion models') 233 | plt.show() 234 | 235 | -------------------------------------------------------------------------------- /docs/site_libs/clipboard/clipboard.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * clipboard.js v2.0.10 3 | * https://clipboardjs.com/ 4 | * 5 | * Licensed MIT © Zeno Rocha 6 | */ 7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return o}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),c=n.n(e);function a(t){try{return document.execCommand(t)}catch(t){return}}var f=function(t){t=c()(t);return a("cut"),t};var l=function(t){var e,n,o,r=1 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | solcore-education - About 11 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
64 |
65 | 83 | 91 |
92 | 93 |
94 | 95 | 176 | 177 | 180 | 181 |
182 | 183 |
184 |
185 |

About

186 |
187 | 188 | 189 | 190 |
191 | 192 | 193 | 194 |
195 | 196 | 197 |
198 | 199 |

Welcome to the solcore-education website.

200 | 201 | 202 | 203 |
204 | 283 |
284 | 285 | 286 | 287 | -------------------------------------------------------------------------------- /solar-cell-simulation/5a-ultrathin_GaAs_cell.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # # Example 5a: Ultra-thin GaAs cell with diffraction grating 5 | # 6 | # In previous examples, we have considered a few different methods used to improve absorption in solar cells: 7 | # anti-reflection coatings, to decrease front-surface reflection, metallic rear mirrors to reduce transmission and increase 8 | # the path length of light in the cell, and textured surfaces (with pyramids) which are used on Si cells to reduce 9 | # reflection and increase the path length of light in the cell. Another method which can be used for light-trapping is the 10 | # inclusion of periodic structures such as diffraction gratings or photonic crystals; here, we will consider an ultra-thin 11 | # (80 nm) GaAs cell with a diffraction grating. 12 | # 13 | # This example is based on the simulations done for [this paper](https://doi.org/10.1002/pip.3463). 14 | # 15 | # *Note:* This example requires that you have a [working S4 installation](https://rayflare.readthedocs.io/en/latest/Installation/installation.html). 16 | 17 | # In[1]: 18 | 19 | 20 | import numpy as np 21 | import matplotlib.pyplot as plt 22 | import seaborn as sns 23 | import os 24 | 25 | from solcore import si, material 26 | from solcore.structure import Layer 27 | from solcore.light_source import LightSource 28 | from solcore.solar_cell import SolarCell 29 | from solcore.constants import q 30 | from solcore.absorption_calculator import search_db 31 | 32 | from rayflare.rigorous_coupled_wave_analysis.rcwa import rcwa_structure 33 | from rayflare.transfer_matrix_method.tmm import tmm_structure 34 | from rayflare.options import default_options 35 | 36 | 37 | # ## Setting up 38 | # 39 | # First, defining all the materials. We are just going to do an optical simulation, so don't have to worry about doping levels 40 | # and other parameters which would affect the electrical performance of the cell. 41 | 42 | # In[2]: 43 | 44 | 45 | InAlP = material('AlInP')(Al=0.5) # In0.5Al0.5P 46 | GaAs = material('GaAs')() 47 | InGaP = material('GaInP')(In=0.5) # Ga0.5In0.5P 48 | SiN = material('Si3N4')() # for the ARC 49 | Al2O3 = material('Al2O3P')() # for the ARC 50 | 51 | Air = material('Air')() 52 | 53 | 54 | # The optical constants used for the silver are [very important](https://doi.org/10.1016/j.solmat.2018.11.008), so we search for a known reliable dataset (from [this paper](https://doi.org/10.1038/srep30605)). 55 | 56 | # In[3]: 57 | 58 | 59 | Ag_pageid = search_db(os.path.join("Ag", "Jiang"))[0][0] 60 | Ag = material(str(Ag_pageid), nk_db=True)() 61 | 62 | 63 | # AM0 spectrum (photon flux) for calculating currents. For space applications (i.e. above the atmosphere) we are often interested in AM0. We use Solcore's LightSource class, then 64 | # extract the AM0 photon flux at the wavelengths we are going to use in the simulations. 65 | 66 | # In[4]: 67 | 68 | 69 | wavelengths = np.linspace(303, 1000, 200) * 1e-9 70 | 71 | AM0_ls = LightSource(source_type='standard', version='AM0', x=wavelengths, output_units="photon_flux_per_m") 72 | AM0 = AM0_ls.spectrum(x=wavelengths)[1] # Photon flux; used to calculate photogenerated current later on 73 | 74 | 75 | # Setting options. We choose `s` polarization because, for normal incidence, there will not be a difference in the results for [$s$ and $p$ polarization](https://www.edmundoptics.com.au/knowledge-center/application-notes/optics/introduction-to-polarization/) (and thus for unpolarized light, `u`, which would be calculated as the average of the results for $s$ and $p$ polarization. We could set the polarization to `u` for equivalent results (at normal incidence only), but this would take longer because then RayFlare has to run two calculations and then average them. 76 | # 77 | # The other key option is the number of Fourier orders retained: rigorous coupled-wave analysis (RCWA) is a Fourier-space method, and we have to specify how many Fourier orders should be retained in the calculation. As we increase the number of orders, the calculation should become more accurate and eventually converge, but the computation time increases (it scales with the cube of the number of orders). 78 | 79 | # In[5]: 80 | 81 | 82 | options = default_options() 83 | options.pol = 's' 84 | options.wavelengths = wavelengths 85 | options.orders = 100 # Reduce the number of orders to speed up the calculation. 86 | 87 | 88 | # ## On-substrate device 89 | # 90 | # This device is still on the GaAs substrate (it is also inverted compared to the other devices, since it represents the device before patterning and lift-off). We create the simulation object using `tmm_structure` class, and then use the `.calculate` function defined for the class to calculate the reflection, absorption per layer, and transmission. 91 | 92 | # In[6]: 93 | 94 | 95 | print("Calculating on-substrate device...") 96 | 97 | struct = SolarCell([Layer(si('20nm'), InAlP), Layer(si('85nm'), GaAs), 98 | Layer(si('20nm'), InGaP)]) 99 | 100 | # make TMM structure for planar device 101 | TMM_setup = tmm_structure(struct, incidence=Air, transmission=GaAs) 102 | 103 | # calculate 104 | RAT_TMM_onsubs = TMM_setup.calculate(options) 105 | 106 | Abs_onsubs = RAT_TMM_onsubs['A_per_layer'][:,1] # absorption in GaAs 107 | # indexing of A_per_layer is [wavelengths, layers] 108 | 109 | R_onsubs = RAT_TMM_onsubs['R'] 110 | T_onsubs = RAT_TMM_onsubs['T'] 111 | 112 | 113 | # ## Planar silver mirror device 114 | # 115 | # This device is now flipped (in fabrication terms, the back mirror was applied and then the device lifted off). It has a silver back mirror, which should increase reflection and the rear surface so that less light is lost to the substrate. 116 | 117 | # In[7]: 118 | 119 | 120 | print("Calculating planar Ag mirror device...") 121 | 122 | solar_cell_TMM = SolarCell([Layer(material=InGaP, width=si('20nm')), 123 | Layer(material=GaAs, width=si('85nm')), 124 | Layer(material=InAlP, width=si('20nm'))], 125 | substrate=Ag) 126 | 127 | TMM_setup = tmm_structure(solar_cell_TMM, incidence=Air, transmission=Ag) 128 | 129 | RAT_TMM = TMM_setup.calculate(options) 130 | 131 | Abs_TMM = RAT_TMM['A_per_layer'][:, 1] 132 | Abs_TMM_InAlPonly = RAT_TMM['A_per_layer'][:, 2] 133 | Abs_TMM_InGaPonly = RAT_TMM['A_per_layer'][:, 0] 134 | R_TMM = RAT_TMM['R'] 135 | T_TMM = RAT_TMM['T'] 136 | 137 | 138 | # ## Nanophotonic grating device 139 | # 140 | # Finally, this device has a grating made of silver and SiN, followed by a planar silver back mirror; this leads to diffraction, increasing the path length of light in the cell, while keeping reflection high. Here we use the `rcwa_structure` class, which is used in the same way as `tmm_structure` above and `rt_structure` in [Example 4a](4a-textured_Si_cell.ipynb). Because we are now dealing with a structure which is periodic in the $x$ and $y$ directions (unlike the TMM structures, which are uniform in the plane), we have to specify the size of the unit cell (this does not have to be square; here we have a triangular unit cell to give a grating with a hexagonal layout of circles). Otherwise, the grating layer is specified as normal but with a `geometry` argument which lists the shapes in the grating and the material they are made of. 141 | # 142 | # There are many additional options which can be specified for S4 (which is used to actually run the RCWA calculations); more detail can be found in its documentation [here](https://web.stanford.edu/group/fan/S4/python_api.html). 143 | 144 | # In[8]: 145 | 146 | 147 | print("Calculating nanophotonic grating device...") 148 | 149 | x = 600 150 | 151 | # lattice vectors for the grating. Units are in nm! 152 | size = ((x, 0), (x / 2, np.sin(np.pi / 3) * x)) 153 | 154 | ropt = dict(LatticeTruncation='Circular', 155 | DiscretizedEpsilon=False, 156 | DiscretizationResolution=8, 157 | PolarizationDecomposition=False, 158 | PolarizationBasis='Default', 159 | #LanczosSmoothing=dict(Power=2, Width=1), 160 | LanczosSmoothing=False, 161 | SubpixelSmoothing=False, 162 | ConserveMemory=False, 163 | WeismannFormulation=False, 164 | Verbosity=0) 165 | 166 | options.S4_options = ropt 167 | 168 | # grating layers 169 | grating = [Layer(width=si(100, 'nm'), material=SiN, geometry=[{'type': 'circle', 'mat': Ag, 'center': (0, 0), 170 | 'radius': x/3, 'angle': 0}])] # actual grating part of grating 171 | 172 | 173 | # DTL device without anti-reflection coating 174 | solar_cell = SolarCell([Layer(material=InGaP, width=si('20nm')), 175 | Layer(material=GaAs, width=si('85nm')), 176 | Layer(material=InAlP, width=si('20nm'))] + grating, 177 | substrate=Ag) 178 | 179 | # make RCWA structure 180 | S4_setup = rcwa_structure(solar_cell, size, options, Air, Ag) 181 | 182 | # calculate 183 | 184 | RAT = S4_setup.calculate(options) 185 | 186 | Abs_DTL = RAT['A_per_layer'][:,1] # absorption in GaAs 187 | 188 | R_DTL = RAT['R'] 189 | T_DTL = RAT['T'] 190 | 191 | 192 | # ## Nanophotonic grating device with ARC 193 | # 194 | # This device is exactly like the previous one, but with the additional of a simple single-layer anti-reflection coating. 195 | 196 | # In[9]: 197 | 198 | 199 | print("Calculating nanophotonic grating device with ARC...") 200 | 201 | # DTL device with anti-reflection coating 202 | solar_cell = SolarCell([Layer(material=Al2O3, width=si('70nm')), 203 | Layer(material=InGaP, width=si('20nm')), 204 | Layer(material=GaAs, width=si('85nm')), 205 | Layer(material=InAlP, width=si('20nm'))] + grating, 206 | substrate=Ag) 207 | 208 | # make RCWA structure 209 | S4_setup = rcwa_structure(solar_cell, size, options, Air, Ag) 210 | 211 | # calculate 212 | RAT_ARC = S4_setup.calculate(options) 213 | 214 | Abs_DTL_ARC = RAT_ARC['A_per_layer'][:,2] # absorption in GaAs + InGaP 215 | 216 | R_DTL_ARC = RAT_ARC['R'] 217 | T_DTL_ARC = RAT_ARC['T'] 218 | 219 | 220 | # ## Plotting results 221 | # 222 | # **PLOT 1**: Comparing the absorption in GaAs for the four different device architectures 223 | 224 | # In[10]: 225 | 226 | 227 | 228 | pal = sns.color_palette("husl", 4) 229 | 230 | fig = plt.figure(figsize=(6.4, 4.8)) 231 | 232 | plt.plot(wavelengths*1e9, 100*Abs_onsubs, color=pal[0], label="On substrate") 233 | plt.plot(wavelengths*1e9, 100*Abs_TMM, color=pal[1], label="Planar mirror") 234 | plt.plot(wavelengths*1e9, 100*Abs_DTL, color=pal[2], label="Nanophotonic grating (no ARC)") 235 | plt.plot(wavelengths*1e9, 100*Abs_DTL_ARC, color=pal[3], label="Nanophotonic grating (with ARC)") 236 | 237 | plt.xlim(300, 950) 238 | plt.ylim(0, 100) 239 | plt.xlabel('Wavelength (nm)') 240 | plt.ylabel('EQE (%)') 241 | plt.legend(loc='upper left') 242 | plt.show() 243 | 244 | 245 | # We see that the addition of a planar silver mirror significantly boosts the absorption around 700 nm, essentially by creating a Fabry-Perot (thin film) cavity in the semiconductor layers through high reflection at the rear of the cell. The grating introduces multiple resonances relating to different diffraction orders and waveguide modes in the structure, which boosts the absorption especially close to the absorption edge in comparison to the planar devices. 246 | # 247 | # **PLOT 2**: Absorption per layer in the planar Ag device. 248 | 249 | # In[11]: 250 | 251 | 252 | fig = plt.figure(figsize=(6.4, 4.8)) 253 | plt.stackplot(wavelengths*1e9, 254 | [100*Abs_TMM, 100*Abs_TMM_InGaPonly, 100*Abs_TMM_InAlPonly], 255 | colors=pal, 256 | labels=['Absorbed in GaAs', 'Absorbed in InGaP', 'Absorbed in InAlP']) 257 | plt.xlim(300, 950) 258 | plt.ylim(0, 90) 259 | plt.xlabel('Wavelength (nm)') 260 | plt.ylabel('EQE (%)') 261 | plt.legend(loc='upper right') 262 | plt.show() 263 | 264 | 265 | # The plot above shows that at short wavelengths, even very thin layers (in this case, 20 nm of InGaP) can absorb a very significant fraction of the incident radiation. Depending on the device, the carriers generated here may or may not be extracted as current. 266 | # 267 | # ## Calculating photogenerated current 268 | # 269 | # Finally, we use the photon flux in the AM0 spectrum to calculate the maximum possible achievable current for these devices. 270 | 271 | # In[12]: 272 | 273 | 274 | onsubs = 0.1 * q * np.trapz(Abs_onsubs*AM0, wavelengths) 275 | Ag = 0.1 * q * np.trapz(Abs_TMM*AM0, wavelengths) 276 | DTL = 0.1 * q * np.trapz(Abs_DTL*AM0, wavelengths) 277 | DTL_ARC = 0.1 * q * np.trapz(Abs_DTL_ARC*AM0, wavelengths) 278 | 279 | 280 | print('On substrate device current: %.1f mA/cm2 ' % onsubs) 281 | print('Planar Ag mirror device current: %.1f mA/cm2 ' % Ag) 282 | print('Nanophotonic grating (no ARC) device current: %.1f mA/cm2 ' % DTL) 283 | print('Nanophotonic grating (with ARC) device current: %.1f mA/cm2 ' % DTL_ARC) 284 | 285 | 286 | # As expected, simply adding a planar mirror boosts the current significantly. The addition of a nanophotonic grating gives a further boost (note that the grating we used here is optimized in terms of grating pitch (period) and dimension; not all gratings would give a boost in current, and some may even reduce performance due to e.g. parasitic absorption). 287 | -------------------------------------------------------------------------------- /solar-cell-simulation/1a-simple_cell.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # # Example 1a: Simple Si solar cell 5 | # 6 | # In this first set of examples, we will look at simple planar solar cells (Si and GaAs). 7 | # 8 | # In this script, we will look at the difference between Beer-Lambert absorption calculations, using the Fresnel equations for front-surface reflection, and using the transfer-matrix model. 9 | # 10 | # First, lets import some very commonly-used Python packages: 11 | 12 | # In[23]: 13 | 14 | 15 | import numpy as np 16 | import matplotlib.pyplot as plt 17 | 18 | 19 | # Numpy is a Python library which adds supports for multi-dimensional data arrays and matrices, so it is very useful for 20 | # storing and handling data. You will probably use it in every Solcore script you write. Here, it is imported under the 21 | # alias 'np', which you will see used below. matplotlib is used for making plots, and is imported under the alias 'plt'. 22 | # Both the 'np' and 'plt' aliases are extremely commonly used in Python programming. 23 | # 24 | # Now, let's import some things from Solcore (which will be explained as we use them): 25 | 26 | # In[24]: 27 | 28 | 29 | from solcore import material, si 30 | from solcore.solar_cell import SolarCell, Layer, Junction 31 | from solcore.solar_cell_solver import solar_cell_solver 32 | from solcore.interpolate import interp1d 33 | 34 | 35 | # ## Defining materials 36 | # 37 | # To define our solar cell, we first want to define some materials. Then we want to organise those materials into Layers, 38 | # organise those layers into a Junction, and then finally define a SolarCell with that Junction. 39 | # 40 | # First, let's define a Si material. Silicon, along with many other semiconductors, dielectrics, and metals common in 41 | # solar cells, is included in Solcore's database: 42 | 43 | # In[25]: 44 | 45 | 46 | Si = material("Si") 47 | GaAs = material("GaAs") 48 | 49 | 50 | # This creates an instance of the Si and GaAs materials. However, to use this in a solar cell we need to do specify some more 51 | # information, such as the doping level. The 'si' function comes in handy here to convert all quantities to based units 52 | # e.g. m, m^(-3)... 53 | 54 | # In[26]: 55 | 56 | 57 | Si_n = Si(Nd=si("1e21cm-3"), hole_diffusion_length=si("10um"), relative_permittivity=11.7) 58 | Si_p = Si(Na=si("1e16cm-3"), electron_diffusion_length=si("400um"), relative_permittivity=11.7) 59 | 60 | 61 | # ## Defining layers 62 | # 63 | # Now we define the emitter and base layers we will have in the solar cell; we specify their thickness, the material they 64 | # are made of and the role they play within the cell (emitter or base) 65 | 66 | # In[27]: 67 | 68 | 69 | emitter_layer = Layer(width=si("600nm"), material=Si_n, role='emitter') 70 | base_layer = Layer(width=si("200um"), material=Si_p, role='base') 71 | 72 | 73 | # create the p-n junction using the layers defined above. We set kind="DA" to tell Solcore to use the Depletion Approximation 74 | # in the calculation (we will discuss the different electrical solver options more later on): 75 | 76 | # In[28]: 77 | 78 | 79 | Si_junction = Junction([emitter_layer, base_layer], kind="DA") 80 | 81 | 82 | # ## Setting user options 83 | # 84 | # Wavelengths we want to use in the calculations; wavelengths between 300 and 1200 nm, at 200 evenly spaced intervals: 85 | 86 | # In[29]: 87 | 88 | 89 | wavelengths = si(np.linspace(300, 1200, 200), "nm") 90 | 91 | 92 | # Note that here and above in defining the layers and materials we have used the "si()" function: you can use this to automatically 93 | # convert quantities in other units to base SI units (e.g. nanometres to metres). 94 | # 95 | # Now we specify some options for running the calculation. Initially we want to use the Beer-Lambert absorption law to 96 | # calculate the optics of the cell ("BL"). We set the wavelengths we want to use, and we set "recalculate_absorption" to 97 | # True so that further down in the script when we try different optics methods, Solcore knows we want to re-calculate the 98 | # optics of the cell. We specify the options in a Python format called a dictionary: 99 | 100 | # In[30]: 101 | 102 | 103 | options = { 104 | "recalculate_absorption": True, 105 | "optics_method": "BL", 106 | "wavelength": wavelengths 107 | } 108 | 109 | 110 | # ## Running cell simulations 111 | # 112 | # Define the solar cell; in this case it is very simple and we just have a single junction: 113 | 114 | # In[31]: 115 | 116 | 117 | solar_cell = SolarCell([Si_junction]) 118 | 119 | 120 | # Now use solar_cell_solver to calculate the QE of the cell; we can ask solar_cell_solver to calculate 'qe', 'optics' or 'iv'. 121 | # 122 | 123 | # In[32]: 124 | 125 | 126 | solar_cell_solver(solar_cell, 'qe', options) 127 | 128 | 129 | # **PLOT 1**: plotting the QE in the Si junction, as well as the fraction of light absorbed in the junction and reflected: 130 | 131 | # In[33]: 132 | 133 | 134 | plt.figure() 135 | plt.plot(wavelengths*1e9, 100*solar_cell[0].eqe(wavelengths), 'k-', label="EQE") 136 | plt.plot(wavelengths*1e9, 100*solar_cell[0].layer_absorption, label='Absorptance (A)') 137 | plt.plot(wavelengths*1e9, 100*solar_cell.reflected, label='Reflectance (R)') 138 | plt.legend() 139 | plt.xlabel("Wavelength (nm)") 140 | plt.ylabel("QE/Absorptance (%)") 141 | plt.title("(1) QE of Si cell - Beer-Lambert absorption") 142 | plt.show() 143 | 144 | 145 | # ## Adding front-surface reflection: Fresnel 146 | # 147 | # Now, to make this calculation a bit more realistic, there are a few things we could do. We could load some measured front 148 | # surface reflectance from a file, or we could calculate the reflectance. To calculate the reflectance, 149 | # there are many approaches we could take; we are going to explore two of them here. 150 | # 151 | # If we assume the silicon is infinitely thick (or at least much thicker than the wavelengths we care about) then the 152 | # reflectance will approach the reflectivity of a simple air/Si interface. We can calculate what this is using the [Fresnel equation for reflectivity]( https://en.wikipedia.org/wiki/Fresnel_equations). 153 | 154 | # In[34]: 155 | 156 | 157 | def calculate_R_Fresnel(incidence_n, transmission_n, wl): 158 | # return a function that gives the value of R (at normal incidence) at the input wavelengths 159 | 160 | Rs = np.abs((incidence_n - transmission_n)/(incidence_n + transmission_n))**2 161 | 162 | return interp1d(wl, Rs) 163 | 164 | 165 | # complex reflective index at our wavelengths for the transmission medium (Si). The incidence_n = 1 (air). 166 | 167 | # In[35]: 168 | 169 | 170 | trns_n = Si_n.n(wavelengths) + 1j*Si_n.k(wavelengths) 171 | reflectivity_fn = calculate_R_Fresnel(1, trns_n, wavelengths) 172 | 173 | 174 | # we define the solar cell again, with the same layers but now supplying the function for the externally-calculated 175 | # reflectivity, and calculate the optics (reflection, absorption, transmission): 176 | 177 | # In[36]: 178 | 179 | 180 | solar_cell_fresnel = SolarCell([Si_junction], reflectivity=reflectivity_fn) 181 | 182 | solar_cell_solver(solar_cell_fresnel, 'optics', options) 183 | 184 | 185 | # ## Adding front surface reflection: TMM 186 | # 187 | # Finally, we do the same again but now instead of supplying the external reflectivity we ask set the optics_method to 188 | # "TMM" (Transfer Matrix Method), to correctly calculate reflection at the front surface: 189 | 190 | # In[37]: 191 | 192 | 193 | Si_junction = Junction([emitter_layer, base_layer], kind="DA") 194 | 195 | solar_cell_TMM = SolarCell([Si_junction]) 196 | 197 | 198 | # Set some more options: 199 | 200 | # In[38]: 201 | 202 | 203 | options["optics_method"] = "TMM" 204 | voltages = np.linspace(0, 1.1, 100) 205 | options["light_iv"] = True 206 | options["mpp"] = True 207 | options["voltages"] = voltages 208 | 209 | 210 | # we calculate the QE and the IV (we set the light_iv option to True; if we don't do this, Solcore just calculates the 211 | # dark IV). We also ask Solcore to find the maximum power point (mpp) so we can get the efficiency. 212 | 213 | # In[39]: 214 | 215 | 216 | solar_cell_solver(solar_cell_TMM, 'iv', options) 217 | solar_cell_solver(solar_cell_TMM, 'qe', options) 218 | 219 | 220 | # **PLOT 2**: here we plot the reflection, transmission, and absorption calculated with the Fresnel equation defined above, 221 | # and with the TMM solver in Solcore, showing that for this simple situation (no anti-reflection coating, thick Si junction) 222 | # they are exactly equivalent. 223 | 224 | # In[40]: 225 | 226 | 227 | plt.figure() 228 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM.reflected, color='firebrick', label = "R (TMM)") 229 | plt.plot(wavelengths*1e9, 100*solar_cell_fresnel.reflected, '--', color='orangered', label = "R (Fresnel)") 230 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM.absorbed, color='dimgrey', label = "A (TMM)") 231 | plt.plot(wavelengths*1e9, 100*solar_cell_fresnel.absorbed, '--', color='lightgrey', label = "A (Fresnel)") 232 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM.transmitted, color='blue', label = "T (TMM)") 233 | plt.plot(wavelengths*1e9, 100*solar_cell_fresnel.transmitted, '--', color='dodgerblue', label = "T (Fresnel)") 234 | plt.ylim(0, 100) 235 | plt.legend() 236 | plt.title("(2) Optics of Si cell - Fresnel/TMM") 237 | plt.show() 238 | 239 | 240 | # **PLOT 3**: As above for the TMM calculation, plotting the EQE as well, which will be slightly lower than the absorption 241 | # because not all the carriers are collected. Comparing to plot (1), we can see we now have lower absorption due to 242 | # the inclusion of front surface reflection. 243 | 244 | # In[41]: 245 | 246 | 247 | plt.figure() 248 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM[0].eqe(wavelengths), 'k-', label="EQE") 249 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM[0].layer_absorption, label='A') 250 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM.reflected, label="R") 251 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM.transmitted, label="T") 252 | plt.title("(3) QE of Si cell (no ARC) - TMM") 253 | plt.legend() 254 | plt.xlabel("Wavelength (nm)") 255 | plt.ylabel("QE/Absorptance (%)") 256 | plt.ylim(0, 100) 257 | plt.show() 258 | 259 | 260 | # ## Adding an ARC 261 | # 262 | # Now we will try adding a simple anti-reflection coating (ARC), a single layer of silicon nitride (Si3N4): 263 | 264 | # In[42]: 265 | 266 | 267 | SiN = material("Si3N4")() 268 | 269 | Si_junction = Junction([emitter_layer, base_layer], kind="DA") 270 | 271 | solar_cell_TMM_ARC = SolarCell([Layer(width=si(75, "nm"), material=SiN), Si_junction]) 272 | 273 | solar_cell_solver(solar_cell_TMM_ARC, 'qe', options) 274 | solar_cell_solver(solar_cell_TMM_ARC, 'iv', options) 275 | 276 | 277 | # **PLOT 4**: Absorption, EQE, reflection and transmission for the cell with a simple one-layer ARC. We see the reflection 278 | # is significantly reduced from the previous plot leading to higher absorption/EQE. 279 | 280 | # In[43]: 281 | 282 | 283 | plt.figure() 284 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM_ARC[1].eqe(wavelengths), 'k-', label="EQE") 285 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM_ARC[1].layer_absorption, label='A') 286 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM_ARC.reflected, label="R") 287 | plt.plot(wavelengths*1e9, 100*solar_cell_TMM_ARC.transmitted, label="T") 288 | plt.legend() 289 | plt.title("(4) QE of Si cell (ARC) - TMM") 290 | plt.xlabel("Wavelength (nm)") 291 | plt.ylabel("QE/Absorptance (%)") 292 | plt.ylim(0, 100) 293 | plt.show() 294 | 295 | 296 | # **PLOT 5**: Compare the IV curves of the cells with and without an ARC. The efficiency is also shown on the 297 | # plot. Note that because we didn't specify a light source, Solcore will assume we want to use AM1.5G; in later 298 | # examples we will set the light source used for IV simulations explicitly. 299 | # 300 | 301 | # In[44]: 302 | 303 | 304 | plt.figure() 305 | plt.plot(voltages, -solar_cell_TMM[0].iv(voltages)/10, label="No ARC") 306 | plt.plot(voltages, -solar_cell_TMM_ARC[1].iv(voltages)/10, label="75 nm SiN") 307 | plt.text(0.5, solar_cell_TMM.iv["Isc"]/10, str(round(solar_cell_TMM.iv["Eta"]*100, 1)) + ' %') 308 | plt.text(0.5, solar_cell_TMM_ARC.iv["Isc"]/10, str(round(solar_cell_TMM_ARC.iv["Eta"]*100, 1)) + ' %') 309 | plt.ylim(0, 38) 310 | plt.xlim(0, 0.8) 311 | plt.legend() 312 | plt.xlabel("V (V)") 313 | plt.ylabel(r"J (mA/cm$^2$)") 314 | plt.title("(5) IV curve of Si cell with and without ARC") 315 | plt.show() 316 | 317 | 318 | # ## Conclusions 319 | # 320 | # We see that the cell with an ARC has a significantly higher Jsc, and a slightly higher Voc, 321 | # than the bare Si cell. In reality, most Si cells have a textured surface rather than a planar 322 | # surface with an ARC; this will be discussed later in the course. 323 | # 324 | # Overall, some things we can take away from the examples in this script: 325 | # - The Beer-Lambert law is a very simple way to calculate absorption in a cell, but won't take into 326 | # account important effects such as front-surface reflection or the effects of anti-reflection coatings 327 | # - Using the transfer-matrix method (TMM) we can account for front surface reflection and interference 328 | # effects which make e.g. ARCs effective. In the simple situation of a thick cell without any front surface 329 | # layers, it is equivalent to simply calculation the reflection with the Fresnel equations and assuming 330 | # Beer-Lambert absorption in the cell. 331 | # - Adding a simple, one-layer ARC can significantly reduce front-surface reflection for a single-junction 332 | # cell, leading to improved short-circuit current. 333 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | solcore-education 11 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
64 |
65 | 83 | 91 |
92 | 93 |
94 | 95 | 176 | 177 | 180 | 181 |
182 | 183 |
184 |
185 |

solcore-education

186 |
187 | 188 | 189 | 190 |
191 | 192 | 193 | 194 |
195 | 196 | 197 |
198 | 199 |

This is the website for the solcore-education GitHub, where we host readable versions of Solcore and RayFlare examples, which are linked on the left. Note that this is not an introductory Python course, or a course about the fundamentals of solar cells.

200 |

The examples on this website are hosted in Jupyter Notebook (.ipynb) format for readability. To run the examples yourself, you can find standard .py versions on the GitHub here. We recommend using these rather than the Notebook versions.

201 |

Package requirements

202 |

To use these examples, you will need to install Solcore and RayFlare (the links take you to installation instructions for each package). In the simplest case, you can install them with:

203 |
pip install solcore rayflare
204 |

But this will not install all functionality, as detailed in the documentation for both packages.

205 |

The only other dependency, which is used for plotting, is seaborn, which you can install simply with:

206 |
pip install seaborn
207 | 208 | 209 | 210 |
211 | 290 |
291 | 292 | 293 | 294 | --------------------------------------------------------------------------------