]> Creatis software - CreaPhase.git/blob - octave_packages/secs2d-0.0.8/DDGOX/DDGOXelectron_driftdiffusion.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / secs2d-0.0.8 / DDGOX / DDGOXelectron_driftdiffusion.m
1 function n=DDGOXelectron_driftdiffusion(mesh,Dsides,nin,pin,V,un,tn,tp,n0,p0)
2
3 %%
4 %   n=DDGelectron_driftdiffusion(mesh,Dsides,nin,pin,V,un,tn,tp,n0,p0)
5 %   IN:
6 %         v    = electric potential
7 %         mesh = integration domain
8 %     ng   = initial guess and BCs for electron density
9 %     p    = hole density (to compute SRH recombination)
10 %   OUT:
11 %     n    = updated electron density
12 %%
13
14 % This file is part of 
15 %
16 %            SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
17 %         -------------------------------------------------------------------
18 %            Copyright (C) 2004-2006  Carlo de Falco
19 %
20 %
21 %
22 %  SECS2D is free software; you can redistribute it and/or modify
23 %  it under the terms of the GNU General Public License as published by
24 %  the Free Software Foundation; either version 2 of the License, or
25 %  (at your option) any later version.
26 %
27 %  SECS2D is distributed in the hope that it will be useful,
28 %  but WITHOUT ANY WARRANTY; without even the implied warranty of
29 %  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30 %  GNU General Public License for more details.
31 %
32 %  You should have received a copy of the GNU General Public License
33 %  along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
34
35 if (Ucolumns(nin)>Urows(nin))
36     nin=nin';
37 end
38
39 if (Ucolumns(V)>Urows(V))
40     V=V';
41 end
42
43 if (Ucolumns(pin)>Urows(pin))
44     pin=pin';
45 end
46
47 Nnodes    = max(size(mesh.p));
48 Nelements = max(size(mesh.t));
49
50 denom = (tp*(nin+sqrt(n0.*p0))+tn*(pin+sqrt(n0.*p0)));
51 u     = un;
52 U     = p0.*n0./denom;
53 M     = pin./denom;
54 guess = nin;
55
56 n = Udriftdiffusion(mesh,Dsides,guess,M,U,V,u);
57
58