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