]> Creatis software - CreaPhase.git/blob - octave_packages/secs2d-0.0.8/DDGOXT/DDGOXTelectron_driftdiffusion.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / secs2d-0.0.8 / DDGOXT / DDGOXTelectron_driftdiffusion.m
1 function n=DDGOXTelectron_driftdiffusion(mesh,Dsides,nin,pin,V,un,tn,tp,n0,p0,weight)
2
3 %%
4 %   n=DDGelectron_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 + initial guess
10 %     pin    = hole density in the past
11 %     n0,p0  = equilibrium densities
12 %     tn,tp  = carrier lifetimes
13 %     weight = BDF weights
14 %     un     = mobility
15 %
16 %   OUT:
17 %     n      = updated electron 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
46
47 denom = (tp*(nin(:,end)+sqrt(n0.*p0))+tn*(pin(:,end)+sqrt(n0.*p0)));
48 M     = weight(1) + pin(:,end)./denom;
49
50 u     = un;
51
52 U     = p0.*n0./denom;
53 for ii=1:BDForder
54   U  += -nin(:,end-ii)*weight(ii+1);
55 end
56
57 guess = nin(:,end);
58 n     = Udriftdiffusion(mesh,Dsides,guess,M,U,V,u);
59
60