1 function [bp,bn]=Ubern(x)
5 % calcola la funzione di Bernoulli
6 % B(x)=x/(exp(x)-1) in corrispondenza dei
7 % due argomenti Z e -Z, ricordando che risulta
11 % This file is part of
13 % SECS2D - A 2-D Drift--Diffusion Semiconductor Device Simulator
14 % -------------------------------------------------------------------
15 % Copyright (C) 2004-2006 Carlo de Falco
19 % SECS2D is free software; you can redistribute it and/or modify
20 % it under the terms of the GNU General Public License as published by
21 % the Free Software Foundation; either version 2 of the License, or
22 % (at your option) any later version.
24 % SECS2D is distributed in the hope that it will be useful,
25 % but WITHOUT ANY WARRANTY; without even the implied warranty of
26 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 % GNU General Public License for more details.
29 % You should have received a copy of the GNU General Public License
30 % along with SECS2D; If not, see <http://www.gnu.org/licenses/>.
38 block21 = find((ax>80)&x>0);
39 block22 = find((ax>80)&x<0);
40 block3 = find((ax<=80)&(ax>xlim));
41 block4 = find((ax<=xlim)&(ax~=0));
46 % Calcola la funz. di Bernoulli per x=0
49 %fprintf(1,' -> executing block 1\n');
55 % Calcola la funz. di Bernoulli per valori
56 % asintotici dell'argomento
59 % fprintf(1,' -> eexecuting block 2\n');
62 bn(block21)=x(block21);
64 bp(block22)=-x(block22);
70 % Calcola la funz. di Bernoulli per valori
71 % intermedi dell'argomento
74 %fprintf(1,' -> eexecuting block 3\n');
75 bp(block3)=x(block3)./(exp(x(block3))-1);
76 bn(block3)=x(block3)+bp(block3);
82 % Calcola la funz. di Bernoulli per valori
83 % piccoli dell'argomento mediante sviluppo
84 % di Taylor troncato dell'esponenziale
86 %fprintf(1,' -> eexecuting block 4\n');
88 fp=1.*ones(size(block4));
92 while (norm(df,inf) > eps),