]> Creatis software - CreaPhase.git/blob - octave_packages/secs2d-0.0.8/Utilities/Uscaling.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / secs2d-0.0.8 / Utilities / Uscaling.m
1 function [odata,omesh] = Uscaling(imesh,idata);
2
3 % [odata,omesh] = Uscaling(imesh,idata);
4
5 % This file is part of 
6 %
7 %            SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
8 %         -------------------------------------------------------------------
9 %            Copyright (C) 2004-2006  Carlo de Falco
10 %
11 %
12 %
13 %  SECS2D is free software; you can redistribute it and/or modify
14 %  it under the terms of the GNU General Public License as published by
15 %  the Free Software Foundation; either version 2 of the License, or
16 %  (at your option) any later version.
17 %
18 %  SECS2D is distributed in the hope that it will be useful,
19 %  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 %  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 %  GNU General Public License for more details.
22 %
23 %  You should have received a copy of the GNU General Public License
24 %  along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
25
26 load (file_in_path(path,'constants.mat'));
27
28 omesh      = imesh;
29 odata      = idata;
30
31 % scaling factors
32 odata.xs   = max(abs([max(imesh.p(1,:))-min(imesh.p(1,:)),max(imesh.p(2,:))-min(imesh.p(2,:))]));
33 odata.Vs   = Vth;
34 odata.ns   = norm(idata.D,inf);
35 odata.us   = un;
36 odata.ts   = (odata.xs^2)/(odata.Vs*odata.us);
37 odata.Ts   = T0;
38 odata.kappas     = odata.Vs^2*q*odata.us*odata.ns/odata.Ts;
39                              
40 % adimensional constants
41 odata.etan2 = hbar^2 / (2*mndos*odata.xs^2*q*odata.Vs);
42
43 % 3-valley masses
44 odata.etanxx2 = hbar^2 / (2*mnl*odata.xs^2*q*odata.Vs);
45 odata.etanxy2 = hbar^2 / (2*mnt*odata.xs^2*q*odata.Vs);
46
47 odata.etanyx2 = hbar^2 / (2*mnt*odata.xs^2*q*odata.Vs);
48 odata.etanyy2 = hbar^2 / (2*mnl*odata.xs^2*q*odata.Vs);
49
50 odata.etanzx2 = hbar^2 / (2*mnt*odata.xs^2*q*odata.Vs);
51 odata.etanzy2 = hbar^2 / (2*mnt*odata.xs^2*q*odata.Vs);
52
53
54 odata.etap2 = hbar^2 / (2*mhdos*odata.xs^2*q*odata.Vs);
55 odata.beta  = Vth/odata.Vs;
56 odata.dn2   = hbar^2 / (4*rn*mndos*odata.xs^2*q*odata.Vs);
57 odata.dp2   = hbar^2 / (4*rp*mhdos*odata.xs^2*q*odata.Vs);
58 odata.l2    = (odata.Vs*esi) / (odata.ns*odata.xs^2*q);
59 odata.l2ox  = (odata.Vs*esio2) / (odata.ns*odata.xs^2*q);
60
61 if (isfield(idata,'un'))    
62     odata.un    = idata.un/odata.us;  
63 else
64     odata.un    = un/odata.us;
65 end
66
67 if (isfield(idata,'up'))
68     odata.up    = idata.up/odata.us;
69 else
70     odata.up    = up/odata.us;
71 end
72
73 if (isfield(idata,'FDn'))    
74     odata.FDn    = idata.FDn/odata.Vs;  
75 end
76 if (isfield(idata,'FDp'))    
77     odata.FDp    = idata.FDp/odata.Vs;  
78 end
79
80 if (isfield(idata,'tn')) 
81     odata.tn    = idata.tn/odata.ts;
82 else
83     odata.tn    = tn/odata.ts;
84 end
85 if (isfield(idata,'tp')) 
86     odata.tp    = idata.tp/odata.ts;
87 else
88     odata.tp   = tp/odata.ts;
89 end
90 if (isfield(idata,'twn')) 
91     odata.twn    = idata.twn/odata.ts;
92 else
93     odata.twn    = twn/odata.ts;
94 end
95 if (isfield(idata,'twp')) 
96     odata.twp    = idata.twp/odata.ts;
97 else
98     odata.twp    = twp/odata.ts;
99 end
100
101 if (isfield(idata,'kappa')) 
102   odata.kappa = idata.kappa /odata.kappas;
103 else
104   odata.kappa = kappaSi/odata.kappas;
105 end
106
107 odata.ni    = ni/odata.ns;
108 if (isfield(idata,'n0')) 
109   odata.n0 = idata.n0 /odata.ns;
110   odata.p0 = idata.p0 /odata.ns;
111 else
112   odata.n0 = ni /odata.ns;
113   odata.p0 = ni /odata.ns;
114 end
115 odata.Nc    = Nc/odata.ns;
116 odata.Nv    = Nv/odata.ns;
117
118 odata.ei    = Egap/(2*q*odata.Vs) - log(Nv/Nc)/2; 
119 odata.eip   = Egap/(2*q*odata.Vs) + log(Nv/Nc)/2; 
120 odata.Egap  = Eg0/(q*odata.Vs);
121
122 odata.wn2   = 6*sqrt(mndos*2*Kb*T0/(pi*hbar^2))/(ni*odata.xs^2);
123
124 odata.vsatn     = vsatn * odata.xs / (odata.us * odata.Vs);
125 odata.vsatp     = vsatp * odata.xs / (odata.us * odata.Vs);
126 odata.mubn      = mubn;
127 odata.mubp      = mubp;
128 odata.mudopparn = [ mudopparn(1:3)/odata.us;
129 mudopparn(4:6)/odata.ns;
130 mudopparn(7:8) ];
131 odata.mudopparp = [ mudopparp(1:3)/odata.us;
132 mudopparp(4:6)/odata.ns;
133 mudopparp(7:8) ];
134
135 % 3-valley weights
136 odata.wnx2   = 2*sqrt(mnt*2*Kb*odata.Ts/(pi*hbar^2))/(ni*odata.xs^2);
137 odata.wny2   = odata.wnx2;
138 odata.wnz2   = 2*sqrt(mnl*2*Kb*odata.Ts/(pi*hbar^2))/(ni*odata.xs^2);
139
140 % 3-valley weights
141 odata.wnx2FD   = 2*sqrt(mnt*2*Kb*odata.Ts/(pi*hbar^2))/(odata.ns*odata.xs^2);
142 odata.wny2FD   = odata.wnx2FD;
143 odata.wnz2FD   = 2*sqrt(mnl*2*Kb*odata.Ts/(pi*hbar^2))/(odata.ns*odata.xs^2);
144
145 odata.mg    = Egap/(2*Kb*odata.Ts) - log(Nv/Nc)/2;
146
147
148 % scaled quantities
149 odata.D     = idata.D/odata.ns;
150 odata.n     = idata.n/odata.ns;
151 odata.p     = idata.p/odata.ns;
152 odata.Fn    = idata.Fn/odata.Vs-log(ni/odata.ns);
153 odata.Fp    = idata.Fp/odata.Vs+log(ni/odata.ns);
154 odata.V     = idata.V/odata.Vs;
155 if (isfield(idata,'G'))
156     odata.G= idata.G/odata.Vs;
157 end
158 if (isfield(idata,'dt'))
159     odata.dt= idata.dt/odata.ts;
160 end
161 if (isfield(idata,'Tl'))
162     odata.Tl= idata.Tl/odata.Ts;
163 end
164 if (isfield(idata,'Tn'))
165     odata.Tn= idata.Tn/odata.Ts;
166 end
167 if (isfield(idata,'Tp'))
168     odata.Tp= idata.Tp/odata.Ts;
169 end
170
171
172 omesh.p     = imesh.p/odata.xs;
173
174