1 function [odata,it,res] =...
2 DDGgummelmap (x,idata,toll,maxit,ptoll,pmaxit,verbose)
7 % DDGgummelmap (x,idata,toll,maxit,ptoll,pmaxit,verbose)
9 % Solves the scaled stationary bipolar DD equation system
10 % using Gummel algorithm
12 % input: x spatial grid
13 % idata.D doping profile
14 % idata.p initial guess for hole concentration
15 % idata.n initial guess for electron concentration
16 % idata.V initial guess for electrostatic potential
17 % idata.Fn initial guess for electron Fermi potential
18 % idata.Fp initial guess for hole Fermi potential
19 % idata.l2 scaled electric permittivity (diffusion coefficient in Poisson equation)
20 % idata.un scaled electron mobility
21 % idata.up scaled electron mobility
22 % idata.nis scaled intrinsic carrier density
23 % idata.tn scaled electron lifetime
24 % idata.tp scaled hole lifetime
25 % toll tolerance for Gummel iterarion convergence test
26 % maxit maximum number of Gummel iterarions
27 % ptoll tolerance for Newton iterarion convergence test for non linear Poisson
28 % pmaxit maximum number of Newton iterarions
29 % verbose verbosity level: 0,1,2
31 % output: odata.n electron concentration
32 % odata.p hole concentration
33 % odata.V electrostatic potential
34 % odata.Fn electron Fermi potential
35 % odata.Fp hole Fermi potential
36 % it number of Gummel iterations performed
37 % res total potential increment at each step
39 ## This file is part of
41 ## SECS1D - A 1-D Drift--Diffusion Semiconductor Device Simulator
42 ## -------------------------------------------------------------------
43 ## Copyright (C) 2004-2007 Carlo de Falco
47 ## SECS1D is free software; you can redistribute it and/or modify
48 ## it under the terms of the GNU General Public License as published by
49 ## the Free Software Foundation; either version 2 of the License, or
50 ## (at your option) any later version.
52 ## SECS1D is distributed in the hope that it will be useful,
53 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
54 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55 ## GNU General Public License for more details.
57 ## You should have received a copy of the GNU General Public License
58 ## along with SECS1D; If not, see <http://www.gnu.org/licenses/>.
67 hole_density (:,1) = idata.p;
68 electron_density (:,1)= idata.n;
69 fermin (:,1)=idata.Fn;
70 fermip (:,1)=idata.Fp;
74 fprintf(1,'*****************************************************************\n');
75 fprintf(1,'**** start of gummel iteration number: %d\n',i);
76 fprintf(1,'*****************************************************************\n');
80 fprintf(1,'solving non linear poisson equation\n\n');
82 [vout(:,2),electron_density(:,2),hole_density(:,2)] =...
83 DDGnlpoisson (x,[1:Nnodes],vout (:,1),electron_density(:,1),hole_density(:,1),...
84 fermin(:,1),fermip(:,1),D,idata.l2,ptoll,pmaxit,verbose);
87 fprintf (1,'\n\nupdating electron qfl\n\n');
89 electron_density(:,3)=...
90 DDGelectron_driftdiffusion(vout(:,2), x, electron_density(:,2),hole_density(:,2),idata.nis,idata.tn,idata.tp,idata.un);
92 fermin(:,2) = DDGn2phin(vout(:,2),electron_density(:,3));
93 fermin(1,2) = idata.Fn(1);
94 fermin(end:2) = idata.Fn(end);
97 fprintf(1,'updating hole qfl\n\n');
100 hole_density(:,3)=...
101 DDGhole_driftdiffusion(vout(:,2), x, hole_density(:,2),electron_density(:,2),idata.nis,idata.tn,idata.tp,idata.up);
102 fermip(:,2) = DDGp2phip(vout(:,2),hole_density(:,3));
103 fermip(1,2) = idata.Fp(1);
104 fermip(end,2) = idata.Fp(end);
107 fprintf(1,'checking for convergence\n\n');
109 nrfn= norm(fermin(:,2)-fermin(:,1),inf);
110 nrfp= norm (fermip(:,2)-fermip(:,1),inf);
111 nrv = norm (vout(:,2)-vout(:,1),inf);
112 nrm(i) = max([nrfn;nrfp;nrv]);
115 fprintf (1,' max(|phin_(k+1)-phinn_(k)| , |phip_(k+1)-phip_(k)| , |v_(k+1)- v_(k)| )= %d\n',nrm(i));
121 vout(:,1) = vout(:,end);
122 hole_density (:,1) = hole_density (:,end) ;
123 electron_density (:,1)= electron_density (:,end);
124 fermin (:,1)= fermin (:,end);
125 fermip (:,1)= fermip (:,end);
129 DDGplotresults(x,electron_density,hole_density,vout,fermin,fermip);
137 fprintf(1,'\n\nInitial guess computed by DD: # of Gummel iterations = %d\n\n',it);
140 odata.n = electron_density(:,end);
141 odata.p = hole_density(:,end);
142 odata.V = vout(:,end);
143 odata.Fn = fermin(:,end);
144 odata.Fp = fermip(:,end);