1 function [odata,omesh] = Udescaling(imesh,idata);
3 % [odata,omesh] = Udescaling(imesh,idata);
7 % SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
8 % -------------------------------------------------------------------
9 % Copyright (C) 2004-2006 Carlo de Falco
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.
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.
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/>.
26 load (file_in_path(path,'constants.mat'));
32 % odata.xs = max(abs([max(imesh.p(1,:))-min(imesh.p(1,:)),max(imesh.p(2,:))-min(imesh.p(2,:))]));
34 % odata.ns = norm(idata.D,inf);
37 % adimensional constants
38 % odata.etan2 = hbar^2 / (2*mndos*odata.xs^2*q);
39 % odata.etap2 = hbar^2 / (2*mpdos*odata.xs^2*q);
40 % odata.beta = Vth/odata.Vs;
41 % odata.dn2 = hbar^2 / (6*mndos*odata.xs^2*q*odata.Vs);
42 % odata.dp2 = hbar^2 / (6*mpdos*odata.xs^2*q*odata.Vs);
43 % odata.l2 = (odata.Vs*esi) / (odata.ns*odata.xs^2*q);
44 % odata.un = un/odata.us;
45 % odata.up = up/odata.us;
48 odata.D = idata.D*odata.ns;
49 odata.n = idata.n*odata.ns;
50 odata.p = idata.p*odata.ns;
51 odata.Fn = (idata.Fn+log(ni/odata.ns))*odata.Vs;
52 odata.Fp = (idata.Fp-log(ni/odata.ns))*odata.Vs;
53 odata.V = idata.V*odata.Vs;
54 if (isfield(idata,'G'))
55 odata.G = idata.G*odata.Vs;
57 if (isfield(idata,'dt'))
58 odata.dt = idata.dt*odata.ts;
61 if (isfield(idata,'un'))
62 odata.un = idata.un*odata.us;
67 if (isfield(idata,'n0'))
68 odata.n0 = idata.n0*odata.ns;
69 odata.p0 = idata.p0*odata.ns;
75 if (isfield(idata,'up'))
76 odata.up = idata.up*odata.us;
80 if (isfield(idata,'FDn'))
81 odata.FDn = idata.FDn*odata.Vs;
83 if (isfield(idata,'FDp'))
84 odata.FDp = idata.FDp*odata.Vs;
87 if (isfield(idata,'Tl'))
88 odata.Tl = idata.Tl*odata.Ts;
91 if (isfield(idata,'Tn'))
92 odata.Tn = idata.Tn*odata.Ts;
95 if (isfield(idata,'Tp'))
96 odata.Tp = idata.Tp*odata.Ts;
99 omesh.p = imesh.p*odata.xs;