]> Creatis software - CreaPhase.git/blob - octave_packages/secs2d-0.0.8/ThDDGOX/ThDDGOXelectron_driftdiffusion.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / secs2d-0.0.8 / ThDDGOX / ThDDGOXelectron_driftdiffusion.m
1 function n=ThDDGOXelectron_driftdiffusion(mesh,Dnodes,n,pin,V,...
2                                           Tn,mobn0,mobn1,tn,tp,n0,p0)
3
4   %%
5   %%   n=ThDDGOXelectron_driftdiffusion(mesh,Dnodes,n,pin,V,Tn,un0,un1,tn,tp,n0,p0)
6   %%
7
8   %% This file is part of 
9   %%
10   %%            SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
11   %%         -------------------------------------------------------------------
12   %%            Copyright (C) 2004-2006  Carlo de Falco
13   %%
14   %%
15   %%
16   %%  SECS2D is free software; you can redistribute it and/or modify
17   %%  it under the terms of the GNU General Public License as published by
18   %%  the Free Software Foundation; either version 2 of the License, or
19   %%  (at your option) any later version.
20   %%
21   %%  SECS2D is distributed in the hope that it will be useful,
22   %%  but WITHOUT ANY WARRANTY; without even the implied warranty of
23   %%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24   %%  GNU General Public License for more details.
25   %%
26   %%  You should have received a copy of the GNU General Public License
27   %%  along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
28
29   Nnodes    = columns(mesh.p);
30   Nelements = columns(mesh.t);
31   Varnodes  = setdiff(1:Nnodes,Dnodes);
32
33   alpha = mobn0;
34   gamma = mobn1;
35   eta   = Tn;
36   beta  = V-Tn;
37   Dn = Uscharfettergummel3(mesh,alpha,gamma,eta,beta);
38
39   denom = (tp*(n+sqrt(n0.*p0))+tn*(pin+sqrt(n0.*p0)));
40   MASS_LHS = Ucompmass2(mesh,pin./denom,ones(Nelements,1));
41
42   LHS = Dn+MASS_LHS;
43
44   RHS     = Ucompconst (mesh,p0.*n0./denom,ones(Nelements,1));
45
46   n(Varnodes) = LHS(Varnodes,Varnodes) \(RHS(Varnodes) -...
47       LHS(Varnodes,Dnodes)*n(Dnodes));
48