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