Semiconductor Process/Device Simulation (EEE533) Assignment 5 1D Drift Diffusion simulator for modeling pn-junction Diode Due date – October 13 2008 Dr. Dragica Vasileska Student Pinakpani Nayak (995030989) Assignment 5 1D Drift Diffusion pn Diode simulator TABLE OF CONTENT 1 2 3 4 5 Equilibrium Solver ..................................................................................................................... 2 1.1 NA = 1016 and ND = 1016 .................................................................................................. 2 1.2 NA = 1016 and ND = 1018 .................................................................................................. 4 1.3 NA = 1018 and ND = 1018 .................................................................................................. 6 Non–Equilibrium Solver ............................................................................................................ 8 2.1 Objective .............................................................................................................................. 8 2.2 Specifications ....................................................................................................................... 8 2.3 Methodology ........................................................................................................................ 8 2.4 Flow chart for 1D Drift Diffusion Solver ............................................................................... 10 2.5 Finite Difference Representation of Linearized Poisson’s Eqn ............................................ 11 2.6 Scharfetter – Gummel Discretization Scheme .................................................................... 11 Simulation Results................................................................................................................... 13 3.1 Conduction Band vs Device Length.................................................................................... 13 3.2 Electron and Hole Densities vs Device Length ................................................................... 14 3.3 IV Characteristics ............................................................................................................... 15 3.4 Electron and Hole Quasi Fermi Levels ............................................................................... 16 3.5 Electric Field ...................................................................................................................... 17 3.6 Equilibrium Condition ......................................................................................................... 17 APPENDIX A ............................................................................................................................ 19 4.1 Results from Larger Bias steps = VT. .................................................................................. 19 APPENDIX B ............................................................................................................................ 20 5.1 Matlab Code for 1D drift Diffusion simulator for modeling pn-junction (diodes) ................... 20 Pinakpani Nayak (995030989) 1 Assignment 5 1D Drift Diffusion pn Diode simulator 1 Equilibrium Solver 1.1 NA = 1016 and ND = 1016 POTENTIAL MATLAB NanoHub Potential vs Position - at Equilibrium 15 10 Potential [eV] 5 0 -5 -10 -15 0 1 2 3 4 5 6 7 x [um] ELECTRIC FIELD MATLAB 4 0.5 NanoHub Field Profile vs Position - at Equilibrium x 10 0 X: 3.215 Y: -34.66 X: 3.985 Y: -80.89 Electric Field [V/cm] -0.5 -1 -1.5 Width of Deplition Region = 0.766um -2 Peak Electric Field = -3.117e4 V/cm -2.5 X: 3.617 Y: -3.117e+004 -3 -3.5 0 1 2 3 4 5 6 7 x [um] Width of Depletion Region = 0.766um and Peak electric field = - 3.117E4 V/cm Pinakpani Nayak (995030989) 2 Assignment 5 1D Drift Diffusion pn Diode simulator ELECTRON AND HOLE DENSITIES MATLAB NanoHub Electron & Hole Densities vs Position - at Equilibrium 16 10 Electron & Hole Densities [1/cm3] 14 10 n p 12 10 10 10 8 10 6 10 4 10 0 1 2 3 4 5 6 7 x [um] TOTAL CHARGES MATLAB -3 2 NanoHub Total Charge Density vs Position - at Equilibrium x 10 Total Charge Density [C/cm3] 1.5 1 0.5 0 -0.5 -1 -1.5 -2 0 1 2 3 4 5 6 7 x [um] Thus Nanohub and Matlab results match. Pinakpani Nayak (995030989) 3 Assignment 5 1D Drift Diffusion pn Diode simulator NA = 1016 and ND = 1018 1.2 POTENTIAL MATLAB NanoHub Potential vs Position - at Equilibrium 20 X: 5.024 Y: 18.05 15 Potential [eV] 10 5 0 -5 -10 -15 X: 0.7983 Y: -13.44 0 1 2 3 4 5 6 7 x [um] ELECTRIC FIELD MATLAB 4 1 NanoHub Field Profile vs Position - at Equilibrium x 10 0 X: 2.813 Y: -31.7 X: 3.366 Y: -6.017 Electric Field [V/cm] -1 -2 -3 -4 -5 X: 3.326 Y: -6.641e+004 -6 -7 0 1 2 3 4 5 6 7 x [um] Depletion region = 0.553 um Peak Electric Field = -6.641x104 V/cm Pinakpani Nayak (995030989) 4 Assignment 5 1D Drift Diffusion pn Diode simulator ELECTRON AND HOLE DENSITIES MATLAB NanoHub Electron & Hole Densities vs Position - at Equilibrium Electron & Hole Densities [1/cm3] X: 1.25 Y: 1e+016 X: 4.46 Y: 1e+018 15 10 n p 10 10 X: 1.443 Y: 2.103e+004 5 10 X: 4.911 Y: 210.2 0 1 2 3 4 5 6 7 x [um] TOTAL CHARGES MATLAB NanoHub Total Charge Density vs Position - at Equilibrium 0.12 0.1 Total Charge Density [C/cm3] 0.08 0.06 0.04 0.02 0 -0.02 -0.04 -0.06 0 1 2 3 4 5 6 7 x [um] Pinakpani Nayak (995030989) 5 Assignment 5 1.3 1D Drift Diffusion pn Diode simulator NA = 1018 and ND = 1018 POTENTIAL MATLAB NanoHub Potential vs Position - at Equilibrium 20 X: 0.5981 Y: 18.05 15 Potential [eV] 10 5 0 -5 -10 X: 0.2185 Y: -18.05 -15 -20 0 0.1 0.2 0.3 0.4 x [um] 0.5 0.6 0.7 0.8 ELECTRIC FIELD MATLAB 5 0.5 NanoHub Field Profile vs Position - at Equilibrium x 10 0 X: 0.3674 Y: -491.8 Electric Field [V/cm] -0.5 X: 0.4495 Y: -894.1 -1 -1.5 -2 -2.5 -3 X: 0.4098 Y: -3.651e+005 -3.5 -4 0 0.1 0.2 0.3 0.4 x [um] 0.5 0.6 0.7 0.8 Width of Depletion Region = 0.0821 um Peak Electric Field = -3.651E5 V/cm Pinakpani Nayak (995030989) 6 Assignment 5 1D Drift Diffusion pn Diode simulator ELECTRON AND HOLE DENSITIES MATLAB NanoHub Electron & Hole Densities vs Position - at Equilibrium 20 10 Electron & Hole Densities [1/cm3] X: 0.1594 Y: 1e+018 X: 0.5963 Y: 1e+018 15 10 n p 10 10 5 10 X: 0.1705 Y: 210.3 X: 0.5835 Y: 210.2 0 10 0 0.1 0.2 0.3 0.4 x [um] 0.5 0.6 0.7 0.8 TOTAL CHARGES MATLAB NanoHub Total Charge Density vs Position - at Equilibrium 0.2 Total Charge Density [C/cm3] 0.15 0.1 0.05 0 -0.05 -0.1 -0.15 -0.2 0 0.1 0.2 0.3 0.4 x [um] 0.5 0.6 0.7 0.8 As Doping density of a particular section increases the depletion region in that section decreases. Pinakpani Nayak (995030989) 7 Assignment 5 1D Drift Diffusion pn Diode simulator 2 Non–Equilibrium Solver 2.1 Objective Goal of this project is to develop a one-dimensional (1D) drift-diffusion simulator for modeling pnjunctions (diodes) under forward bias conditions. Both types of carriers have to be included in the model (electrons and holes). Finite-difference expressions should be used for the electron and hole current continuity equations using Sharfetter-Gummel discretization scheme. 2.2 Specifications εsc = 1.05x10-10 ni = 1.5x1010 cm-3 , T = 300K. Electron mobility = 1500 cm2/V-s Hole mobility = 1000 cm2/V-s Doping : NA = 1016 cm-3 for p-region and ND = 1016 cm-3 for n-region. Numerical Methods used – LU Decomposition method for the solution of 1D Poisson and 1D electron and Hole continuity equation. 2.3 Methodology The flow chart explains the methodology followed. Following steps were followed to simulate the nonequilibrium condition of a 1D pn-diode. 1. Calculate the equilibrium condition of the diode by solving the linearized Poisson’s equation. 2. Define an initial Mesh, which should be fine enough to give correct result. If the Mesh size is too large then the results obtained will not be correct. The mesh size is less than the Debye Length. 3. Initialize all discretization co-efficients, doping density and potential based on charge density. 4. Solve for the updated potential using LU decomposition method. 5. Update coefficient of the linearized Poisson’s equation. 6. Check for convergence against a predefined error value(10-5). 7. Equilibrium solution gives electric field, electric potential and net doping values (n and p concentration) to be used as the initial values for the non-equilibrium solver. Pinakpani Nayak (995030989) 8 Assignment 5 1D Drift Diffusion pn Diode simulator 8. Based on the equilibrium values we solve the continuity equation for electron and holes to get the current. 9. Calculate the low field mobility. mun0 = 1500 cm2/V-s and mup0 = 1000 cm2/V-s. Store the mobility values in an array for each node points. 10. Calculate the field dependant mobility based on the local filed at each node. mun(E) for electron and mup(E) for holes. (FDM) 11. Calculate Bernauli’s function that depends on potential. (BF) 12. Determine the discretization coefficients (product of FDM and BF) of continuity eqns for electron and holes. 13. Update the generation and recombination rate i.e. the forcing function of the continuity equation. p.n ni G p (n ni ) n ( p pi ) 2 14. Solve electron continuity eqn using LU decomposition and we get “n”. 15. Solve hole continuity eqn using LU decomposition and we get “p”. 16. Update central coefficient and forcing function in Poisson’s equation (now use n and p instead of eφ and e-φ). 17. Solve Poisson’s equation using LU decomposition. 18. Check tolerance, if not valid then go to step 9 and repeat (as we have updated the potential the field dependant mobility has changed). Pinakpani Nayak (995030989) 9 Assignment 5 2.4 1D Drift Diffusion pn Diode simulator Flow chart for 1D Drift Diffusion Solver Initialize parameters: -Mesh size -Discretization coefficients -Doping density -Potential based on charge neutrality Solve for the updated potential given the forcing function using LU decomposition Update: - Central coefficient of the linearized Poisson Equation - Forcing function > tolerance Equilibrium solver Test maximum absolute error update < tolerance Non-Equilibrium solver VA = VA+V V is a fraction of the thermal voltage VT Calculate coefficients for: - Electron continuity equation - Hole continuity equation - Update generation recombination rate Solve electron continuity equation using LU decomposition Solve hole continuity equation using LU decomposition Update: - Central coefficient of the linearized Poisson Equation - Forcing function Solve for the updated potential given the forcing function using LU decomposition > tolerance Test maximum absolute error update < tolerance Calculate current no STOP Pinakpani Nayak (995030989) Maximum voltage exceeded? yes 10 Assignment 5 2.5 1D Drift Diffusion pn Diode simulator Finite Difference Representation of Linearized Poisson’s Eqn 1 n1 2 1 i 1 2 pi ni in1 2 in11 pi ni Ci in pi ni 2 ni = eφ At Equilibrium : 2.6 and pi = e-φ Scharfetter – Gummel Discretization Scheme Electron Current is given by J n i 1 / 2 i 1 i eDin1 / 2 ni 1 B VT i 1 ni B i V T J n i 1 / 2 i eDin1 / 2 i i 1 ni 1 B i 1 ni B VT VT Hole Current is Given by J p i 1 / 2 J p i 1 / 2 i i 1 i eDip1 / 2 p i B i 1 p i 1 B VT VT eDip1 / 2 i 1 i i 1 p i 1 B i p i B V V T T The electron Continuity equation is given by i 1 i 1 n D B i 1 / 2 2 VT 1 i 1 1 n i 1 i 1 ni 1 2 Din1 / 2 B i 2 Di 1 / 2 B i ni 2 Din1 / 2 B i 1 VT VT VT ni 1 Gi The hole Continuity equation is given by 1 p i i 1 i 1 i 1 p i 1 i i 1 1 p 1 p i 2 Dip1 / 2 B i p i 1 Gi D B p D B D B i 1 / 2 i 1 i 1 / 2 i 1 / 2 2 2 2 V V V V T T T T 2 D K BT p.n nint , ' , VT D VT VT p (n ni ) n ( p pi ) q x B( x) x , x = normalized, nint = intrinsic carrier concentration, Δ is normalized by LDi e 1 Gi Pinakpani Nayak (995030989) 11 Assignment 5 1D Drift Diffusion pn Diode simulator For electron in1 / 2VT in1 / 2VT B ' ' n n B ' ' B ' ' i 1 i i 1 int i i 1 i i 1 n i n i int 2 2 2 2 LDi 2 LDi 2 LDi in1 / 2VT in1 / 2VT LDi 2 2 B i 1 ' i 'ni 1 ni int pi .ni nint nint p (ni 1) n ( pi 1) nint 2 2 in1 / 2 B i 1 ' i 'ni 1 in1 / 2 B i ' i 1 ' in1 / 2 B i ' i 1 'ni in1 / 2 B i 1 ' i 'ni 1 p i .ni 1 L Di 2 p (ni 1) n ( p i 1) VT 2 So the coefficients of electron Continuity eqn are ci in1 / 2 B i 1 ' i ' bi in1 / 2 B i ' i 1 ' in1 / 2 B i ' i 1 ' ai in1 / 2 B i 1 ' i ' pi .ni 1 LDi 2 p (ni 1) n ( pi 1) VT 2 fi nint = Intrinsic carrier concentration LDi = Intrinsic Debye Length Δ = normalized mesh VT = Thermal Voltage ni pi = electron and hole concentration at node i Similarly for Holes the coefficients can be determined as ci ip1 / 2 B i ' i 1 ' bi ip1 / 2 B i 1 ' i ' ip1 / 2 B i 1 'i ' ai p i 1 / 2 B i ' i 1 ' pi .ni 1 LDi 2 p (ni 1) n ( pi 1) VT 2 fi The simulation was performed by varying Anode voltage from 0 to 0.625V in 0.33*V T steps. All the results were plotted as mentioned below. NOTE : It was observed that by varying the DC voltage from 0 to 0.625 with smaller bias steps like 0.33VT gives better results compared to larger bias steps like VT . The results obtained from smaller bias steps exactly matche with NanoHub plots. Appendix A contains the graphs for Larger Bias steps and the difference can be observed. Pinakpani Nayak (995030989) 12 Assignment 5 1D Drift Diffusion pn Diode simulator 3 Simulation Results Anode Voltage varied from 0 to 0.625V in steps of 0.33*Vt 3.1 Conduction Band vs Device Length MatLab (Va = 0.625V) Nano Hub (Va = 0.625V) Conduction Band vs Position - at Applied Bias (0.625) 1 0.8 Conduction Band Energy (eV) 0.6 X: 3.088 Y: 0.303 0.4 0.2 X: 3.413 Y: 0.1457 0 -0.2 -0.4 -0.6 -0.8 -1 0 1 2 3 4 5 6 7 x [um] MatLab (Equilibrium) Nano Hub (Equilibrium) Conduction Band vs Position - at Equilibrium 1 0.9 Conduction Band Energy (eV) 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 1 2 3 4 5 6 7 x [um] Pinakpani Nayak (995030989) 13 Assignment 5 3.2 1D Drift Diffusion pn Diode simulator Electron and Hole Densities vs Device Length MatLab (Equilibrium) Nano Hub (Equilibrium) Electron & Hole Densities vs Position - at Equilibrium 18 10 n p 16 Electron & Hole Densities [1/cm3] 10 14 10 12 10 10 10 8 10 6 10 4 10 2 10 0 1 2 3 4 5 6 7 x [um] MatLab (Va = 0.625V) Nano Hub (Va = 0.625V) Electron & Hole Densities vs Position - at Applied Bias(0.625V) 18 10 16 Electron & Hole Densities [1/cm3] 10 X: 3.365 Y: 2.602e+013 14 10 X: 3.126 Y: 2.237e+014 12 10 10 10 8 10 6 10 X: 0.1936 Y: 2.25e+004 n p 4 10 X: 6.475 Y: 2250 2 10 0 1 2 3 4 5 6 7 x [um] The electron and hole densities calculated at 0.625V in Matlab matches with Nanohub values. Pinakpani Nayak (995030989) 14 Assignment 5 3.3 1D Drift Diffusion pn Diode simulator IV Characteristics Total Current - MatLab (Va = 0.625) I vs V Plot Total Current - Nano Hub (Va = 0.625V) X: 0.6226 Y: 4.177 4.5 4 Total Current Density [Amp/cm2] 3.5 3 2.5 2 1.5 1 0.5 0 -0.5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 VA [V] The final current at Va=0.6226 is 4.177 A/cm2 . The Matlab and Nanohub values match. IV Plot for Electron, Hole and Total Current Current Continuity I vs V Plot Total Current Density vs Position - at Applied Bias(0.625V) 5 6 Jtotal Jhole Jelec 5 Total Current Density [A/cm2] Total Current Density [Amp/cm2] 4 3 2 1 0 -1 4 3 2 1 0 0.1 0.2 0.3 0.4 VA [V] 0.5 0.6 0.7 0 0 1 2 3 4 5 6 7 x [um] Total Current (Electron + Hole) going from Cathode to Anode is Constant. Total Current (sum of electron and Hole currents) for 0.625 V is found to be 4.177 A/cm2 which matches with NanoHub Total current for the same bias voltage. The total current is constant through the entire device from cathode to anode as shown in the plot. This proves current continuity. Pinakpani Nayak (995030989) 15 Assignment 5 3.4 1D Drift Diffusion pn Diode simulator Electron and Hole Quasi Fermi Levels MatLab (Va = 0.625V) Nano Hub (Va = 0.625V) Quasi Fermi Levels (Efn & Efp) vs Position - at Applied Bias(0.625V) 1 Ec Ev Ei Efn Efp 0.8 0.6 Energy [eV] 0.4 0.2 0 -0.2 -0.4 -0.6 -0.8 -1 0 1 2 3 4 5 6 7 x [um] The quasi Fermi levels are calculated as given below Net Charge Density MatLab (Va = 0.625V) -3 12 x 10 Nano Hub (Va = 0.625V) Total Charge Density vs Position - at Applied Bias(0.625V) 10 Total Charge Density [C/cm3] 8 6 4 X: 3.354 Y: 0.004766 2 0 -2 -4 -6 X: 3.322 Y: -0.003202 0 1 2 3 4 5 6 7 x [um] Pinakpani Nayak (995030989) 16 Assignment 5 3.5 1D Drift Diffusion pn Diode simulator Electric Field MatLab (Va = 0.625V) 4 0.5 Nano Hub (Va = 0.625V) Field Profile vs Position - at Applied Bias(0.625V) x 10 0 X: 3.054 Y: -51.58 -0.5 X: 3.432 Y: -18.2 Electric Field [V/cm] -1 -1.5 X: 3.322 Y: -1.719e+004 -2 -2.5 -3 -3.5 -4 -4.5 0 1 2 3 4 5 6 7 x [um] 3.6 Equilibrium Condition 4 Potential vs Position - at Equilibrium 0.5 0.5 0.4 0 -0.5 0.3 -1 Electric Field [V/cm] Potential [eV] 0.2 0.1 0 -0.1 -2 -2.5 -3.5 -0.3 -4 0 1 2 3 4 5 6 7 x [um] -3 16 -1.5 -3 -0.2 -0.4 Field Profile vs Position - at Equilibrium x 10 -4.5 0 1 2 3 4 5 6 7 x [um] Total Charge Density vs Position - at Equilibrium x 10 14 Total Charge Density [C/cm3] 12 10 8 6 4 2 0 -2 -4 0 1 2 3 4 5 6 7 x [um] Pinakpani Nayak (995030989) 17 Assignment 5 1D Drift Diffusion pn Diode simulator From this project I conclude that I learnt more by designing the simulator myself compared to generating the plots on Nanohub. Nanohub is a wonderful tool to explore device properties and verify results. But designing one’s own simulator gives greater insight into the actual working of the commercial simulator and Nanohub. I can better understand how the equations are solved, how it is better to take smaller biases and finer mesh sizes to solve an equilibrium condition. Pinakpani Nayak (995030989) 18 Assignment 5 1D Drift Diffusion pn Diode simulator 4 APPENDIX A 4.1 Results from Larger Bias steps = VT. The output plots do not match with the actual NanoHub results when larger Bias steps are used for Anode voltage increment. Hence finer bias steps give better results. -3 Electron & Hole Densities vs Position - at Applied Bias(0.625V) 18 10 20 n p 16 10 15 14 Total Current Density [Amp/cm2] Electron & Hole Densities [1/cm3] I vs V Plot x 10 10 12 10 10 10 8 10 6 10 10 5 0 4 10 2 10 0 1 2 3 4 5 6 -5 7 0 0.1 0.2 0.3 x [um] The charge density values are lower than actual 0.5 0.6 0.7 The total current plot is distorted and lesser. Quasi Fermi Levels (Efn & Efp) vs Position - at Applied Bias(0.625V) Potential vs Position - at Applied Bias(0.625V) 1 0.5 Ec Ev Ei Efn Efp 0.8 0.6 0.4 0.4 0.3 0.2 Potential [eV] Energy [eV] 0.4 VA [V] 0 -0.2 -0.4 0.2 0.1 0 -0.6 -0.1 -0.8 -1 0 1 2 3 4 5 6 7 x [um] Quasi Fermi levels are lesser than actual Pinakpani Nayak (995030989) -0.2 0 1 2 3 4 5 6 7 x [um] Potential values for 0 to 3um is less than actual 19 Assignment 5 1D Drift Diffusion pn Diode simulator 5 APPENDIX B 5.1 Matlab Code for 1D drift Diffusion simulator for modeling pn-junction (diodes) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% 1D Drift Diffusion Model for pn Diodes %% %% Equilibrium and Non Equilibrium Solver %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all; close all; % Defining the Fundamental and Material Constants % q kb eps T ni Vt RNc TAUN0 TAUP0 mun0 mup0 = = = = = = = = = 1.602E-19; 1.38E-23; 1.05E-12; 300; 1.5E10; kb*T/q; 2.8E19; 0.1E-6; 0.1E-6; = 1500; = 1000; % C or [J/eV] % [J/K] % This includes the eps = 11.7 for Si [F/cm] % [K] % Intrinsic carrier concentration [1/cm^3] % [eV] % This is 2.8e20 in the FORTRAN file % Electron SRH life time % Hole SRH life time % Electron Mobility in cm2/V-s % Hole Mobility in cm2/V-s dEc = Vt*log(RNc/ni); % Define Doping Values % Na = 1E16; Nd = 1E17; % [1/cm^3] % [1/cm^3] % Calculate relevant parameters for the simulation % Vbi = Vt*log(Na*Nd/(ni*ni)); W = sqrt(2*eps*(Na+Nd)*Vbi/(q*Na*Nd)) Wn = W*sqrt(Na/(Na+Nd)) Wp = W*sqrt(Nd/(Na+Nd)) Wone = sqrt(2*eps*Vbi/(q*Na)) E_p = q*Nd*Wn/eps Ldn = sqrt(eps*Vt/(q*Nd)); Ldp = sqrt(eps*Vt/(q*Na)); Ldi = sqrt(eps*Vt/(q*ni)) % % % % % [cm] [cm] [cm] [cm] [V/cm] % Calculate relevant parameters in an input file % % Write to a file save input_params.txt Na Nd Vbi W Wn Wp E_p Ldn Ldp %Material_Constants %Define some material constants % Setting the size of the simulation domain based % on the analytical results for the width of the depletion regions Pinakpani Nayak (995030989) 20 Assignment 5 1D Drift Diffusion pn Diode simulator % for a simple pn-diode % x_max = 0; if(x_max < Wn) x_max = Wn; end if(x_max < Wp) x_max = Wp; end x_max = 20*x_max % Setting the grid size based on the extrinsic Debye lengths % dx = Ldn; if(dx > Ldp) dx=Ldp; end dx = dx/20; % Calculate the required number of grid points and renormalize dx % n_max = x_max/dx n_max = round(n_max); dx = dx/Ldi; % Renormalize lengths with Ldi % Set up the doping C(x)=Nd(x)-Na(x) that is normalized with ni % for i = 1:n_max if(i <= n_max/2) dop(i) = - Na/ni; elseif(i > n_max/2) dop(i) = Nd/ni; end end % Initialize the potential based on the requirement of charge % neutrality throughout the whole structure for i = 1: n_max zz = 0.5*dop(i); if(zz > 0) xx = zz*(1 + sqrt(1+1/(zz*zz))); elseif(zz < 0) xx = zz*(1 - sqrt(1+1/(zz*zz))); end fi(i) = log(xx); n(i) = xx; p(i) = 1/xx; end delta_acc = 1E-5; % Preset the Tolerance %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% EQUILIBRIUM SOLUTION PART BEGINS %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %(A) Define the elements of the coefficient matrix for the internal nodes and % initialize the forcing function Pinakpani Nayak (995030989) 21 Assignment 5 1D Drift Diffusion pn Diode simulator dx2 = dx*dx; for i = 1: n_max a(i) = 1/dx2; c(i) = 1/dx2; b(i) = -(2/dx2+exp(fi(i))+exp(-fi(i))); f(i) = exp(fi(i)) - exp(-fi(i)) - dop(i) - fi(i)*(exp(fi(i))+exp(-fi(i))); end %(B) Define the elements of the coefficient matrix and initialize the forcing % function at the ohmic contacts a(1) = 0; c(1) = 0; b(1) = 1; f(1) = fi(1); a(n_max) = 0; c(n_max) = 0; b(n_max) = 1; f(n_max) = fi(n_max); %(C) % Start the iterative procedure for the solution of the linearized Poisson equation using LU decomposition method: flag_conv = 0; k_iter= 0; while(~flag_conv) k_iter = k_iter + 1; % convergence of the Poisson loop alpha(1) = b(1); for i=2:n_max beta(i)=a(i)/alpha(i-1); alpha(i)=b(i)-beta(i)*c(i-1); end % Solution of Lv = f % v(1) = f(1); for i = 2:n_max v(i) = f(i) - beta(i)*v(i-1); end % Solution of U*fi = v % temp = v(n_max)/alpha(n_max); delta(n_max) = temp - fi(n_max); fi(n_max)=temp; for i = (n_max-1):-1:1 %delta% temp = (v(i)-c(i)*fi(i+1))/alpha(i); delta(i) = temp - fi(i); fi(i) = temp; end delta_max = 0; for i = 1: n_max xx = abs(delta(i)); if(xx > delta_max) delta_max=xx; end %sprintf('delta_max = %d',delta_max) %'k_iter = %d',k_iter,' end Pinakpani Nayak (995030989) 22 Assignment 5 1D Drift Diffusion pn Diode simulator %delta_max=max(abs(delta)); % Test convergence and recalculate forcing function and % central coefficient b if necessary if(delta_max < delta_acc) flag_conv = 1; else for i = 2: n_max-1 b(i) = -(2/dx2 + exp(fi(i)) + exp(-fi(i))); f(i) = exp(fi(i)) - exp(-fi(i)) - dop(i) - fi(i)*(exp(fi(i)) + exp(-fi(i))); end end end xx1(1) = dx*1e4; for i = 2:n_max-1 Ec(i) = dEc - Vt*fi(i); %Values from the second Node% ro(i) = -ni*(exp(fi(i)) - exp(-fi(i)) - dop(i)); el_field1(i) = -(fi(i+1) - fi(i))*Vt/(dx*Ldi); el_field2(i) = -(fi(i+1) - fi(i-1))*Vt/(2*dx*Ldi); n(i) = exp(fi(i)); p(i) = exp(-fi(i)); xx1(i) = xx1(i-1) + dx*Ldi*1e4; end Ec(1) = Ec(2); Ec(n_max) = Ec(n_max-1); xx1(n_max) = xx1(n_max-1) + dx*Ldi*1e4; el_field1(1) = el_field1(2); el_field2(1) = el_field2(2); el_field1(n_max) = el_field1(n_max-1); el_field2(n_max) = el_field2(n_max-1); nf = n*ni; pf = p*ni; ro(1) = ro(2); ro(n_max) = ro(n_max-1); figure(1) plot(xx1, Vt*fi,'r','LineWidth',2) xlabel('x [um]'); ylabel('Potential [eV]'); title('Potential vs Position - at Equilibrium'); figure(2) plot(xx1, el_field1,'r','LineWidth',2) hold on; plot(xx1, el_field2,'r','LineWidth',2) xlabel('x [um]'); ylabel('Electric Field [V/cm]'); title('Field Profile vs Position - at Equilibrium'); figure(3) %plot(xx1, nf,'g','LineWidth',2) semilogy(xx1, nf,'g','LineWidth',2) hold on; %plot(xx1, pf,'r','LineWidth',2) semilogy(xx1, pf,'r','LineWidth',2) xlabel('x [um]'); ylabel('Electron & Hole Densities [1/cm^3]'); Pinakpani Nayak (995030989) 23 Assignment 5 1D Drift Diffusion pn Diode simulator title('Electron & Hole Densities vs Position - at Equilibrium'); legend('n','p'); %axis([0 6.75 0 10.2e17]) figure(4) %plot(xx1, ro,'r','LineWidth',2) plot(xx1, q*ro,'r','LineWidth',2) xlabel('x [um]'); %ylabel('Total Charge Density [1/cm^3]'); ylabel('Total Charge Density [C/cm^3]'); title('Total Charge Density vs Position - at Equilibrium'); %axis([0.5 5 -3e17 8e17]) figure(5) plot(xx1, Ec,'r','LineWidth',2) xlabel('x [um]'); %ylabel('Total Charge Density [1/cm^3]'); ylabel('Conduction Band Energy (eV)'); title('Conduction Band vs Position - at Equilibrium'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% END OF EQUILIBRIUM SOLUTION PART %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% %% NON-EQUILIBRIUM SOLUTION PART BEGINS %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% 1. Calculate Low filed mobility %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Prameters for Low field mobility calculation %% TL = 300; N = Na + Nd; MU1N.CAUG MU2N.CAUG ALPHAN.CAUG BETAN.CAUG GAMMAN.CAUG DELTAN.CAUG NCRITN.CAUG % % % % % % % % % Temp in Kelvin % Local (total) impurity concentration = = = = = = = 55.24; 1429.23; 0.0; -2.3; -3.8; 0.73; 1.072*10^17; % % % % % % % cm2/(V.s) cm2/(V.s) unitless unitless unitless unitless cm-3 MU1P.CAUG = MU2P.CAUG = ALPHAP.CAUG = BETAP.CAUG = GAMMAP.CAUG = DELTAP.CAUG = NCRITP.CAUG = BETAN = 2.0; BETAP = 1.0; 49.7; 479.37; 0.0; -2.2; 13.7; 0.70; 1.606*10^17; % % % % % % % cm2/(V.s) cm2/(V.s) unitless unitless unitless unitless cm-3 mun0 = ( MU1N.CAUG*((TL/300)^ALPHAN.CAUG) ) ... + (( (MU2N.CAUG*((TL/300)^BETAN.CAUG)) - (MU1N.CAUG*((TL/300)^ALPHAN.CAUG)) ) ... / ( 1 + ((TL/300)^GAMMAN.CAUG) * ((N/NCRITN.CAUG)^DELTAN.CAUG) )) Pinakpani Nayak (995030989) 24 Assignment 5 % % % % % % % % 1D Drift Diffusion pn Diode simulator mup0 = ( MU1P.CAUG*((TL/300)^ALPHAP.CAUG) ) ... + (( (MU2P.CAUG*((TL/300)^BETAP.CAUG)) - (MU1P.CAUG*((TL/300)^ALPHAP.CAUG)) ) ... / ( 1 + ((TL/300)^GAMMAP.CAUG) * ((N/NCRITP.CAUG)^DELTAP.CAUG) )) VSATN = (2.4*10^7) / (1 + 0.8*exp(TL/600)); VSATP = VSATN; % Saturation Velocity of Electrons % Saturation Velocity of Holes %%%%%%%%%%%%%%%%%%% END of Low Field Mobility Calculation %%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% 2. Start the main Loop to increment the Anode voltage by Vt=KbT/q %% %% till it reaches 0.625V. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% vindex=0; for VA = 0:0.33*Vt:0.625 VA % Start VA increment loop Each_Step = 0.33*Vt Total_Steps = 0.625/(0.33*Vt) vindex = vindex +1 Vplot(vindex) = VA; fi(1) = fi(1) + VA; %fi(1) flag_conv2 = 0; k_itern= 0; % Apply potential to Anode (1st node) % Convergence of the Poisson loop %% Initialize the First and Last Node for Poisson's eqn a(1) = 0; c(1) = 0; b(1) = 1; f(1) = fi(1); a(n_max) = 0; c(n_max) = 0; b(n_max) = 1; f(n_max) = fi(n_max); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% 3. Start the Poisson equation solver loop to calculate the %% %% potential for each Anode voltage increase %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% while(~flag_conv2) % Start Poisson's eqn k_itern = k_itern + 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% 3.1 . Calculate Field Dependant Mobility for each value of 'fi' %% %% at each node point of the PN diode. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% To test with Constant Mobility without field dependancy. % % for i = 1:n_max % Start Loop for Field Dep Mobility % % mup(i) = mup0; % % mun(i) = mun0; % % end Pinakpani Nayak (995030989) 25 Assignment 5 1D Drift Diffusion pn Diode simulator %% Calculate the Electric Field at each Node for i = 2:n_max-1 Ef(i) = abs(fi(i) - fi(i+1))*Vt/(dx*Ldi); end Ef(1) = Ef(2); Ef(n_max) = Ef(n_max-1); %% Calculate the Field Dependant Mobility at each Node for i = 1:n_max pdeno = (mup0 * Ef(i) / VSATP) ^ BETAP; mup(i) = mup0 * ( (1/(1 + pdeno)) ^(1/BETAP)); ndeno = (mun0 * Ef(i) / VSATN) ^ BETAN; mun(i) = mun0 * ( (1/(1 + ndeno)) ^(1/BETAN)); end mup(1) = mup(2); mup(n_max) = mup(n_max-1); mun(1) = mun(2); mun(n_max) = mun(n_max-1); %%%%%%%%%%% END of FIELD Dependant Mobility Calculation %%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% 3.2 Solve Continuity Equation for Electron and Holes using LU Decomposition %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %(A) Define the elements of the coefficient matrix and initialize the forcing % function at the ohmic contacts for ELECTRON and HOLE Continuity Eqns an(1) = bn(1) = cn(1) = ap(1) = bp(1) = cp(1) = %fnp(1) 0; %Co-ef 1; %Co-ef 0; %Co-ef 0; %Co-ef 1; %Co-ef 0; %Co-ef = (Ldi*Ldi*dx2/Vt) * ( for electron at for electron at for electron at for hole at for hole at for hole at p(1)*n(1) - 1 ) Anode Anode Anode Anode Anode Anode / ( TAUP0*(n(1) + 1 ) + TAUN0*(p(1) + 1 ) ); fn(1) = n(1); fp(1) = p(1); an(n_max) = bn(n_max) = cn(n_max) = ap(n_max) = bp(n_max) = cp(n_max) = %fnp(n_max) + TAUN0*(p(n_max) + fn(n_max) = fp(n_max) = 0; %Co-ef 1; %Co-ef 0; %Co-ef 0; %Co-ef 1; %Co-ef 0; %Co-ef = (Ldi*Ldi*dx2/Vt) 1) ); n(n_max); p(n_max); for for for for for for * ( electron at Cathode electron at Cathode electron at Cathode hole at Cathode hole at Cathode hole at Cathode p(n_max)*n(n_max) - 1 ) / ( TAUP0*(n(n_max) + 1) %(B) Define the elements of the coefficient matrix for the internal nodes and % initialize the forcing function Pinakpani Nayak (995030989) 26 Assignment 5 1D Drift Diffusion pn Diode simulator for i = 2: n_max-1 munim1by2 = (mun(i-1)+mun(i))/2; munip1by2 = (mun(i)+mun(i+1))/2; mupim1by2 = (mup(i-1)+mup(i))/2; mupip1by2 = (mup(i)+mup(i+1))/2; %% Co-efficients for HOLE Continuity eqn cp(i) = mupip1by2 * BER(fi(i) - fi(i+1)); ap(i) = mupim1by2 * BER(fi(i) - fi(i-1)); bp(i) = -( mupim1by2 * BER(fi(i-1) - fi(i)) + mupip1by2 * BER(fi(i+1) - fi(i))); %% Co-efficients for ELECTRON Continuity eqn cn(i) = munip1by2 * BER(fi(i+1) - fi(i)); an(i) = munim1by2 * BER(fi(i-1) - fi(i)); n(i) = -( munim1by2 * BER(fi(i) - fi(i-1)) + munip1by2 * BER(fi(i) - fi(i+1))); %% Forcing Function for ELECTRON and HOLE Continuity eqns fn(i) = (Ldi*Ldi*dx2/Vt) * ( p(i)*n(i) - 1 ) / ( TAUP0*(n(i) + 1) + TAUN0*(p(i)+1)); fp(i) = (Ldi*Ldi*dx2/Vt) * ( p(i)*n(i) - 1 ) / ( TAUP0*(n(i) + 1) + TAUN0*(p(i)+1)); end %(C) % Start the iterative procedure for the solution of the linearized Continuity equation for "ELECTRONS" using LU decomposition method: alphan(1) = bn(1); for i=2:n_max betan(i)=an(i)/alphan(i-1); alphan(i)=bn(i)-betan(i)*cn(i-1); end % Solution of Lv = f % vn(1) = fn(1); for i = 2:n_max vn(i) = fn(i) - betan(i)*vn(i-1); end % Solution of U*fi = v % tempn = vn(n_max)/alphan(n_max); %deltan(n_max) = tempn - n(n_max); n(n_max)=tempn; for i = (n_max-1):-1:1 %delta% tempn = (vn(i)-cn(i)*n(i+1))/alphan(i); % deltan(i) = tempn - n(i); n(i) = tempn; end %%%%%%%%%%%%%%%%%%%%%%% END of ELECTRON Continuty Solver %%%%%%%%%%% %(D) % Start the iterative procedure for the solution of the linearized Continuity equation for "HOLES" using LU decomposition method: alphap(1) = bp(1); for i=2:n_max betap(i)=ap(i)/alphap(i-1); alphap(i)=bp(i)-betap(i)*cp(i-1); end % Solution of Lv = f % Pinakpani Nayak (995030989) 27 Assignment 5 1D Drift Diffusion pn Diode simulator vp(1) = fp(1); for i = 2:n_max vp(i) = fp(i) - betap(i)*vp(i-1); end % Solution of U*fi = v % tempp = vp(n_max)/alphap(n_max); %deltap(n_max) = tempp - p(n_max); p(n_max)=tempp; for i = (n_max-1):-1:1 %delta% tempp = (vp(i)-cp(i)*p(i+1))/alphap(i); % deltap(i) = tempp - p(i); p(i) = tempp; end %%%%%%%%%%%%%%%%%%%%%%% END of HOLE Continuty Solver %%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% 3.3 Calculate potential fi again with new values of "n" and "p"%% %% and check for convergence %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Recalculate forcing function and central coefficient b for fi for i = 2: n_max-1 b(i) = -(2/dx2 + n(i) + p(i)); f(i) = n(i) - p(i) - dop(i) - (fi(i)*(n(i) + p(i))); %% here values of n(i) and p(i) are used in place of exp(fi(i)) end % Solve for Updated potential given the new value of Forcing % Function using LU decomposition alpha(1) = b(1); for i=2:n_max beta(i)=a(i)/alpha(i-1); alpha(i)=b(i)-beta(i)*c(i-1); end % Solution of Lv = f % v(1) = f(1); for i = 2:n_max v(i) = f(i) - beta(i)*v(i-1); end % Solution of U*fi = v % temp = v(n_max)/alpha(n_max); delta(n_max) = temp - fi(n_max); fi(n_max)=temp; for i = (n_max-1):-1:1 %delta% temp = (v(i)-c(i)*fi(i+1))/alpha(i); delta(i) = temp - fi(i); fi(i) = temp; end delta_max = 0; Pinakpani Nayak (995030989) 28 Assignment 5 for i = 1: n_max xx = abs(delta(i)); if(xx > delta_max) delta_max=xx; end end 1D Drift Diffusion pn Diode simulator %% Calculate the max error %delta_max=max(abs(delta)); % Test convergence and start the loop if necessary else increase % the applied potential %% delta_max if(delta_max < delta_acc) flag_conv2 = 1; end end % End of WHILE Loop for Poisson's eqn solver %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% CALCULATE CURRENT %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Electron Current for i=2:n_max-1 Jnim1by2(vindex,i) = (q*mun(i)*Vt/(dx*Ldi)) * ni*( n(i)*BER(fi(i)-fi(i-1)) \ - n(i-1)*BER(fi(i-1)-fi(i)) ); Jnip1by2(vindex,i) = (q*mun(i)*Vt/(dx*Ldi)) * ni*( n(i+1)*BER(fi(i+1)-fi(i)) \ - n(i)*BER(fi(i)-fi(i+1)) ); Jelec(vindex,i) = (Jnip1by2(vindex,i) + Jnim1by2(vindex,i))/2; % % % % % Electron Current with only one node Jnim1by2 = (q*mun(2)*Vt/dx*Ldi) * ( (n(2)*ni)*BER((fi(2)-fi(2-1))) - (n(2-1)*ni)*BER((fi(2-1)-fi(2))) ); Jnip1by2 = (q*mun(2)*Vt/dx*Ldi) * ( (n(2+1)*ni)*BER((fi(2+1)-fi(2))) - (n(2)*ni)*BER((fi(2)-fi(2+1))) ); Jelec(vindex) = (Jnip1by2 + Jnim1by2)/2; % % % % % Hole Current Jpim1by2 = (q*mup(2)*Vt/dx*Ldi) * ( (p(2)*ni)*BER((fi(2-1)-fi(2))) - (p(2-1)*ni)*BER((fi(2)-fi(2-1))) ); Jpip1by2 = (q*mup(2)*Vt/dx*Ldi) * ( (p(2+1)*ni)*BER((fi(2)-fi(2+1))) - (p(2)*ni)*BER((fi(2+1)-fi(2))) ); Jhole(vindex) = (Jpip1by2 + Jpim1by2)/2; % % % % % % Jpim1by2(vindex,i) = (q*mup(i)*Vt/(dx*Ldi)) * ni*( p(i)*BER((fi(i-1)-fi(i))) \ - p(i-1)*BER((fi(i)-fi(i-1))) ); Jpip1by2(vindex,i) = (q*mup(i)*Vt/(dx*Ldi)) * ni*( p(i+1)*BER((fi(i)-fi(i+1))) \ - p(i)*BER((fi(i+1)-fi(i))) ); Jhole(vindex,i) = (Jpip1by2(vindex,i) + Jpim1by2(vindex,i))/2; end %% end Jtotal = Jelec + Jhole; Jtotal(vindex) = Jelec; % End of main FOR loop for VA increment. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% END OF NON-EQUILIBRIUM SOLUTION PART %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Pinakpani Nayak (995030989) 29 Assignment 5 1D Drift Diffusion pn Diode simulator % Write the results of the simulation in files % xx1(1) = dx*1e4; for i = 2:n_max-1 Ec(i) = dEc - Vt*fi(i); %Values from the second Node% ro(i) = -ni*(n(i) - p(i) - dop(i)); el_field1(i) = -(fi(i+1) - fi(i))*Vt/(dx*Ldi); el_field2(i) = -(fi(i+1) - fi(i-1))*Vt/(2*dx*Ldi); xx1(i) = xx1(i-1) + dx*Ldi*1e4; end Jtotal(:,1) = Jtotal(:,2); Jelec(:,1) = Jelec(:,2); Jhole(:,1) = Jhole(:,2); Jtotal(:,n_max) = Jtotal(:,(n_max-1)); Jelec(:,n_max) = Jelec(:,(n_max-1)); Jhole(:,n_max) = Jhole(:,(n_max-1)); Ec(1) = Ec(2); Ec(n_max) = Ec(n_max-1); xx1(n_max) = xx1(n_max-1) + dx*Ldi*1e4; el_field1(1) = el_field1(2); el_field2(1) = el_field2(2); el_field1(n_max) = el_field1(n_max-1); el_field2(n_max) = el_field2(n_max-1); nf = n*ni; pf = p*ni; ro(1) = ro(2); ro(n_max) = ro(n_max-1); %% Calculate Quasi Fermi Level - Efn Efp for i = 1:n_max Ei(i) = Ec(i) - 0.56; Efn(i) = Ei(i) + Vt*log(nf(i)/ni); Efp(i) = Ei(i) - Vt*log(pf(i)/ni); end Ev = Ec - 1.12; figure(14) plot(xx1, Ec,'black','LineWidth',2.5); hold on; plot(xx1, Ev,'black','LineWidth',2.5); hold on; plot(xx1, Ei,'--black','LineWidth',2.5); hold on; plot(xx1, Efn,'r','LineWidth',2.5); hold on; plot(xx1, Efp,'b','LineWidth',2.5); xlabel('x [um]'); ylabel('Energy [eV]'); title('Quasi Fermi Levels (Efn & Efp) vs Position - at Applied Bias(0.625V)'); legend('Ec','Ev','Ei','Efn','Efp'); axis([0 7 -1 1]); figure(6) plot(xx1, Ec,'b','LineWidth',2) xlabel('x [um]'); ylabel('Conduction Band Energy (eV)'); title('Conduction Band vs Position - at Applied Bias (0.625)'); Pinakpani Nayak (995030989) 30 Assignment 5 1D Drift Diffusion pn Diode simulator figure(7) plot(xx1, Vt*fi,'b','LineWidth',2) xlabel('x [um]'); ylabel('Potential [eV]'); title('Potential vs Position - at Applied Bias(0.625V)'); figure(8) plot(xx1, el_field1,'b','LineWidth',2) hold on; plot(xx1, el_field2,'b','LineWidth',2) xlabel('x [um]'); ylabel('Electric Field [V/cm]'); title('Field Profile vs Position - at Applied Bias(0.625V)'); figure(9) %plot(xx1, nf,'g','LineWidth',2) semilogy(xx1, nf,'g','LineWidth',2) hold on; %plot(xx1, pf,'b','LineWidth',2) semilogy(xx1, pf,'b','LineWidth',2) xlabel('x [um]'); ylabel('Electron & Hole Densities [1/cm^3]'); title('Electron & Hole Densities vs Position - at Applied Bias(0.625V)'); legend('n','p'); %axis([0 6.75 0 10.2e17]) figure(10) %plot(xx1, ro,'b','LineWidth',2) plot(xx1, q*ro,'b','LineWidth',2) xlabel('x [um]'); %ylabel('Total Charge Density [1/cm^3]'); ylabel('Total Charge Density [C/cm^3]'); title('Total Charge Density vs Position - at Applied Bias(0.625V)'); %axis([0.5 5 -3e17 8e17]) figure(11) plot(Vplot, Jtotal(:,2),'r','LineWidth',2) hold on plot(Vplot, Jhole(:,2),'g','LineWidth',2) hold on plot(Vplot, Jelec(:,2),'b','LineWidth',2) xlabel('VA [V]'); ylabel('Total Current Density [Amp/cm^2]'); title('I vs V Plot'); legend('Jtotal','Jhole','Jelec','2'); figure(12) plot(Vplot, Jtotal(:,2),'r','LineWidth',2) xlabel('VA [V]'); ylabel('Total Current Density [Amp/cm^2]'); title('I vs V Plot'); %legend('Jtotal','Jhole','Jelec','2'); figure(13) plot(xx1,Jtotal((round((Total_Steps)-1)),:),'b','LineWidth',2) xlabel('x [um]'); ylabel('Total Current Density [A/cm^2]'); title('Total Current Density vs Position - at Applied Bias(0.625V)'); axis([0 7 0 6]); Pinakpani Nayak (995030989) 31 Assignment 5 1D Drift Diffusion pn Diode simulator %figure(5) %plot(xx1, n) %hold all %plot(xx1, p) save save save save save cond_band xx1 Ec; tot_charge xx1 ro; el_field xx1 el_field1 el_field2; np_data xx1 nf pf; pot_1 fi; Pinakpani Nayak (995030989) 32