]> Creatis software - CreaPhase.git/blob - octave_packages/secs2d-0.0.8/ThDDGOX/ThDDGOXupdateelectron_temp.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / secs2d-0.0.8 / ThDDGOX / ThDDGOXupdateelectron_temp.m
1 function Tn = ThDDGOXupdateelectron_temp(imesh,Dnodes,Tn,n,p,Tl,Jn,E,mobn0,...
2                                          twn0,twn1,tn,tp,n0,p0)
3   %%
4   %%  Tn = ThDDGOXupdateelectron_temp(mesh,Dnodes,Tn,n,p,Tl,Jn,E,mobn,...
5   %%                                  twn0,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(imesh.p);
30   Nelements = columns(imesh.t);
31   Varnodes  = setdiff(1:Nnodes,Dnodes);
32
33   alpha = mobn0;
34   gamma = ones(Nnodes,1);
35   eta   = 1.5 * n .* Tl;
36   betax = Jn(1,:)./ mobn0';
37   betay = Jn(2,:)./ mobn0';
38   beta  = -2.5*[betax;betay];
39
40   Sn = Uscharfettergummel3(imesh,alpha,gamma,eta,beta);
41
42   denom  = (tp*(n+sqrt(n0.*p0))+tn*(p+sqrt(n0.*p0)));
43   R      = (p.*n)./denom;
44   MASS_LHS1 = Ucompmass2(imesh,1.5*R,ones(Nelements,1));
45   MASS_LHS2 = Ucompmass2(imesh,1.5*n./twn1,1./twn0);
46
47   LHS = Sn + MASS_LHS1 + MASS_LHS2;
48
49   G        = (p0.*n0)./denom;
50   PJoule   = Jn(1,:).*E(1,:) + Jn(2,:).*E(2,:);
51   PJoule(PJoule<0) = 0;
52
53   rhsJoule = Ucompconst (imesh,ones(Nnodes,1),PJoule');
54   rhsR_G   = Ucompconst (imesh,1.5*G.*Tn,ones(Nelements,1));
55   rhsTh_L  = Ucompconst (imesh,1.5*n.*Tl./twn1,1./twn0);
56   RHS      = rhsJoule + rhsR_G + rhsTh_L;
57
58   Tn(Varnodes) = LHS(Varnodes,Varnodes) \(RHS(Varnodes) -...
59       LHS(Varnodes,Dnodes)*Tn(Dnodes));