1 function Tl = ThDDGOXupdatelattice_temp(mesh,Dnodes,Tl,Tn,Tp,n,p,...
3 twn0,twp0,twn1,twp1,n0,p0)
5 %% Tl = ThDDGOXupdatelattice_temp(mesh,Dnodes,Tl,Tn,Tp,n,p,...
6 %% kappa,Egap,tn,tp,...
7 %% twn0,twp0,twn1,twp1,n0,p0)
9 %% This file is part of
11 %% SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
12 %% -------------------------------------------------------------------
13 %% Copyright (C) 2004-2006 Carlo de Falco
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.
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.
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/>.
30 Nnodes = columns(mesh.p);
31 Nelements = columns(mesh.t);
32 Varnodes = setdiff(1:Nnodes,Dnodes);
34 alpha = kappa*ones(Nelements,1);
36 eta = ones (Nnodes,1);
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;
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;
51 Tl(Varnodes) = LHS(Varnodes,Varnodes) \...
52 (RHS(Varnodes) - LHS(Varnodes,Dnodes)*Tl(Dnodes));