Vous êtes sur la page 1sur 35

Semiconductor Process/Device

Simulation (EEE533)
Assignment 5
1D Drift Diffusion simulator for modeling
pn-junction Diode
Due date !cto"er 13 #$$%
Dr& Dragica 'asiles(a
Student
Pina(pani )a*a( (++5$3$+%+)
Assignment 5 1D Drift Diffusion pn Diode simulator
,A-.E !/ 0!),E),
1 E1uili"rium Solver&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& #
1.1 NA = 1016 and ND = 1016 .......................................................................................................2
1.2 NA = 1016 and ND = 1018 ......................................................................................................4
1.3 NA = 1018 and ND = 1018 .......................................................................................................6
# )onE1uili"rium Solver&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& %
2.1 Objective .........................................................................................................................................8
2.2 Specifications .................................................................................................................................8
2.3 Methodoo!"....................................................................................................................................8
2.4 #o$ cha%t fo% 1D D%ift Diff&sion Sove% .....................................................................................10
2.' #inite Diffe%ence (ep%esentation of )inea%i*ed +oisson,s -.n ...................................................11
2.6 Scha%fette% / 0&11e Disc%eti*ation Sche1e .............................................................................11
3 Simulation 2esults&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 13
3.1 2ond&ction 3and vs Device )en!th..............................................................................................14
3.2 -ect%on and 4oe Densities vs Device )en!th.............................................................................1'
3.3 56 2ha%acte%istics .........................................................................................................................17
3.4 -ect%on and 4oe 8&asi #e%1i )eves ........................................................................................18
3.' -ect%ic #ied ................................................................................................................................19
3.6 -.&iib%i&1 2ondition...................................................................................................................19
3 APPE)D45 A &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& #1
4.1 (es&ts f%o1 )a%!e% 3ias steps = 6:. ..........................................................................................21
5 APPE)D45 - &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ##
'.1 Matab 2ode fo% 1D d%ift Diff&sion si1&ato% fo% 1odein! pn;j&nction <diodes=.......................22
Pina(pani )a*a( (++5$3$+%+) 1
Assignment 5 1D Drift Diffusion pn Diode simulator
1 E1uili"rium Solver
1&1 )A 6 1$
17
and )D 6 1$
17

P!,E),4A.
8A,.A- )ano9u"
0 1 2 3 4 5 6 7
-15
-10
-5
0
5
10
15
x [um]
P
o
t
e
n
t
i
a
l

[
e
V
]
Potential vs Position - at Equilibrium

E.E0,240 /4E.D
8A,.A- )ano9u"
0 1 2 3 4 5 6 7
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
x 10
4
X: 3.215
Y: -34.66
X: 3.617
Y: -3.117e+004
X: 3.985
Y: -80.89
x [um]
E
l
e
c
t
r
i
c

F
i
e
l
d

[
V
/
c
m
]
Field Profile vs Position - at Equilibrium
Width of Deplition
Region = 0.766um
Peak Electric Field
= -3.117e4 V/cm
Width of Depletion Region = 0.766um and Peak electric field = - 3.117E !"cm
Pina(pani )a*a( (++5$3$+%+) #
Assignment 5 1D Drift Diffusion pn Diode simulator
E.E0,2!) A)D 9!.E DE)S4,4ES
8A,.A- )ano9u"
0 1 2 3 4 5 6 7
10
4
10
6
10
8
10
10
10
12
10
14
10
16
x [um]
E
l
e
c
t
r
o
n

&

H
o
l
e

D
e
n
s
i
t
i
e
s

[
1
/
c
m
3
]
Electron & Hole Densities vs Position - at Equilibrium
n
p

,!,A. 09A2:ES
8A,.A- )ano9u"
0 1 2 3 4 5 6 7
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
x 10
-3
x [um]
T
o
t
a
l

C
h
a
r
g
e

D
e
n
s
i
t
y

[
C
/
c
m
3
]
Total Charge Density vs Position - at Equilibrium

#hu$ %anohu& and 'atla& re$ult$ match.
Pina(pani )a*a( (++5$3$+%+) 3
Assignment 5 1D Drift Diffusion pn Diode simulator
1.2 )A 6 1$
17
and )D 6 1$
1%

P!,E),4A.
8A,.A- )ano9u"
0 1 2 3 4 5 6 7
-15
-10
-5
0
5
10
15
20
X: 0.7983
Y: -13.44
X: 5.024
Y: 18.05
x [um]
P
o
t
e
n
t
i
a
l

[
e
V
]
Potential vs Position - at Equilibrium
E.E0,240 /4E.D
8A,.A- )ano9u"
0 1 2 3 4 5 6 7
-7
-6
-5
-4
-3
-2
-1
0
1
x 10
4
X: 2.813
Y: -31.7
X: 3.366
Y: -6.017
X: 3.326
Y: -6.641e+004
x [um]
E
l
e
c
t
r
i
c

F
i
e
l
d

[
V
/
c
m
]
Field Profile vs Position - at Equilibrium
Depletion region 6 $&553 um
Pea( Electric /ield 6 -7&731;1$
3
'/cm
Pina(pani )a*a( (++5$3$+%+) 3
Assignment 5 1D Drift Diffusion pn Diode simulator
E.E0,2!) A)D 9!.E DE)S4,4ES
8A,.A- )ano9u"
0 1 2 3 4 5 6 7
10
5
10
10
10
15
X: 1.25
Y: 1e+016
X: 4.46
Y: 1e+018
X: 4.911
Y: 210.2
x [um]
E
l
e
c
t
r
o
n

&

H
o
l
e

D
e
n
s
i
t
i
e
s

[
1
/
c
m
3
]
Electron & Hole Densities vs Position - at Equilibrium
X: 1.443
Y: 2.103e+004
n
p

,!,A. 09A2:ES
8A,.A- )ano9u"
0 1 2 3 4 5 6 7
-0.06
-0.04
-0.02
0
0.02
0.04
0.06
0.08
0.1
0.12
x [um]
T
o
t
a
l

C
h
a
r
g
e

D
e
n
s
i
t
y

[
C
/
c
m
3
]
Total Charge Density vs Position - at Equilibrium
Pina(pani )a*a( (++5$3$+%+) 5
Assignment 5 1D Drift Diffusion pn Diode simulator
1&3 )A 6 1$
1%
and )D 6 1$
1%

P!,E),4A.
8A,.A- )ano9u"
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
-20
-15
-10
-5
0
5
10
15
20
X: 0.2185
Y: -18.05
X: 0.5981
Y: 18.05
x [um]
P
o
t
e
n
t
i
a
l

[
e
V
]
Potential vs Position - at Equilibrium

E.E0,240 /4E.D
8A,.A- )ano9u"
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
x 10
5
X: 0.3674
Y: -491.8
X: 0.4495
Y: -894.1
x [um]
E
l
e
c
t
r
i
c

F
i
e
l
d

[
V
/
c
m
]
Field Profile vs Position - at Equilibrium
X: 0.4098
Y: -3.651e+005

<idt= of Depletion 2egion 6 $&$%#1 um
Pea( Electric /ield 6 -3&751E5 '/cm
Pina(pani )a*a( (++5$3$+%+) 7
Assignment 5 1D Drift Diffusion pn Diode simulator
E.E0,2!) A)D 9!.E DE)S4,4ES
8A,.A- )ano9u"
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
10
0
10
5
10
10
10
15
10
20
X: 0.1594
Y: 1e+018
X: 0.5963
Y: 1e+018
X: 0.1705
Y: 210.3
X: 0.5835
Y: 210.2
x [um]
E
l
e
c
t
r
o
n

&

H
o
l
e

D
e
n
s
i
t
i
e
s

[
1
/
c
m
3
]
Electron & Hole Densities vs Position - at Equilibrium
n
p


,!,A. 09A2:ES
8A,.A- )ano9u"

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
-0.2
-0.15
-0.1
-0.05
0
0.05
0.1
0.15
0.2
x [um]
T
o
t
a
l

C
h
a
r
g
e

D
e
n
s
i
t
y

[
C
/
c
m
3
]
Total Charge Density vs Position - at Equilibrium

($ Doping den$it) of a particular $ection increa$e$ the depletion region in that $ection
decrea$e$.
Pina(pani )a*a( (++5$3$+%+) >
Assignment 5 1D Drift Diffusion pn Diode simulator
# )onE1uili"rium Solver
#&1 !"jective
*oal of thi$ pro+ect i$ to de,elop a one-dimen$ional -1D. drift-diffu$ion $imulator for modeling pn-
+unction$ -diode$. under for/ard &ia$ condition$. 0oth t)pe$ of carrier$ ha,e to &e included in the
model -electron$ and hole$.. 1inite-difference e2pre$$ion$ $hould &e u$ed for the electron and hole
current continuit) e3uation$ u$ing 4harfetter-*ummel di$creti5ation $cheme.
#&# Specifications
6$c = 1.07210
-10

ni = 1.7210
10
cm
-3
8 # = 3009.
Electron mo&ilit) = 1700 cm
:
"!-$
;ole mo&ilit) = 1000 cm
:
"!-$
Doping ? %( = 10
16
cm
-3
for p-region and %D = 10
16
cm
-3
for n-region.
)umerical 8et=ods used < => Decompo$ition method for the $olution of 1D Poi$$on and 1D
electron and ;ole continuit) e3uation.
#&3 8et=odolog*
#he flo/ chart e2plain$ the methodolog) follo/ed. 1ollo/ing $tep$ /ere follo/ed to $imulate the non-
e3uili&rium condition of a 1D pn-diode.
1. ?alculate the e3uili&rium condition of the diode &) $ol,ing the lineari5ed Poi$$on@$ e3uation.
:. Define an initial 'e$h8 /hich $hould &e fine enough to gi,e correct re$ult. Af the 'e$h $i5e i$
too large then the re$ult$ o&tained /ill not &e correct. #he me$h $i5e i$ le$$ than the De"*e
.engt=.
3. Anitiali5e all di$creti5ation co-efficient$8 doping den$it) and potential &a$ed on charge den$it).
. 4ol,e for the updated potential u$ing => decompo$ition method.
7. >pdate coefficient of the lineari5ed Poi$$on@$ e3uation.
6. ?heck for con,ergence again$t a predefined error ,alue-10
-7
..
7. E3uili&rium $olution gi,e$ electric field8 electric potential and net doping ,alue$ -n and p
concentration. to &e u$ed a$ the initial ,alue$ for the non-e3uili&rium $ol,er.
Pina(pani )a*a( (++5$3$+%+) %
Assignment 5 1D Drift Diffusion pn Diode simulator
B. 0a$ed on the e3uili&rium ,alue$ /e $ol,e the continuit) e3uation for electron and hole$ to get
the current.
C. ?alculate the lo/ field mo&ilit). mun0 = 1700 cm
:
"!-$ and mup0 = 1000 cm
:
"!-$. 4tore the
mo&ilit) ,alue$ in an arra) for each node point$.
10. ?alculate the field dependant mo&ilit) &a$ed on the local filed at each node. mun-E. for
electron and mup-E. for hole$. -1D'.
11. ?alculate 0ernauli@$ function that depend$ on potential. -01.
1:. Determine the di$creti5ation coefficient$ -product of 1D' and 01. of continuit) e3n$ for
electron and hole$.
13. >pdate the generation and recom&ination rate i.e. the forcing function of the continuit)
e3uation.
= < = <
.
2
i n i p
i
p p n n
n n p
G
+ + +


1. 4ol,e electron continuit) e3n u$ing => decompo$ition and /e get DnE.
17. 4ol,e hole continuit) e3n u$ing => decompo$ition and /e get DpE.
16. >pdate central coefficient and forcing function in Poi$$on@$ e3uation -no/ u$e n and p in$tead
of e
F
and e
-F
..
17. 4ol,e Poi$$on@$ e3uation u$ing => decompo$ition.
1B. ?heck tolerance8 if not ,alid then go to $tep C and repeat -a$ /e ha,e updated the potential
the field dependant mo&ilit) ha$ changed..

Pina(pani )a*a( (++5$3$+%+) +
Assignment 5 1D Drift Diffusion pn Diode simulator
#&3 /lo@ c=art for 1D Drift Diffusion Solver
4nitialiAe parameters?
-'e$h $i5e
-Di$creti5ation coefficient$
-Doping den$it)
-Potential &a$ed on charge neutralit)
4ol,e for the updated potential
gi,en the forcing function u$ing => decompo$ition
>pdateG
- ?entral coefficient of the lineari5ed Poi$$on E3uation
- 1orcing function
#e$t ma2imum
a&$olute error update
E3uili&rium $ol,er
!
(
= !
(
H!
?alculate coefficient$ forG
- Electron continuit) e3uation
- ;ole continuit) e3uation
- >pdate generation recom&ination rate
4ol,e electron continuit) e3uation u$ing => decompo$ition
4ol,e hole continuit) e3uation u$ing => decompo$ition
>pdateG
- ?entral coefficient of the lineari5ed Poi$$on E3uation
- 1orcing function
4ol,e for the updated potential
gi,en the forcing function u$ing => decompo$ition
#e$t ma2imum
a&$olute error update
'a2imum ,oltage e2ceededI
?alculate current
4#JP
)e$
no
K tolerance
L tolerance
%on-E3uili&rium $ol,er
K tolerance
L tolerance
! i$ a fraction of the
thermal ,oltage !
#
Pina(pani )a*a( (++5$3$+%+) 1$
Assignment 5 1D Drift Diffusion pn Diode simulator
#&5 /inite Difference 2epresentation of .ineariAed PoissonBs E1n
[ ] ( )
i i
n
i i i i
n
i
n
i i i
n
i
n p C n p n p + +

,
_

+ +

+ +
+

1
1 2
1
2
1
1 2
1 2 1

(t E3uili&rium G ni = e
F
and pi = e
-F
#&7 Sc=arfetter :ummel DiscretiAation Sc=eme
Electron ?urrent i$ gi,en &)
1
]
1

,
_

,
_

+ +
+
+
+
T
i i
i
T
i i
i
n
i n
i
V
B n
V
B n
eD
J
1 1
1
2 > 1
2 > 1


1
]
1

,
_

,
_

T
i i
i
T
i i
i
n
i n
i
V
B n
V
B n
eD
J

1
1
1 2 > 1
2 > 1

;ole ?urrent i$ *i,en &)
1
]
1

,
_

,
_

+ +
+
+
+
T
i i
i
T
i i
i
p
i p
i
V
B p
V
B p
eD
J

1 1
1
2 > 1
2 > 1

1
]
1

,
_

,
_

T
i i
i
T
i i
i
p
i p
i
V
B p
V
B p
eD
J
1
1
1 2 > 1
2 > 1


#he electron ?ontinuit) e3uation i$ gi,en &)
i i
T
i i n
i i
T
i i n
i
T
i i n
i i
T
i i n
i
G n
V
B D n
V
B D
V
B D n
V
B D

,
_

+
1
]
1

,
_

,
_

,
_

+
+

+
+
+ 1
1
2 > 1
2
1
2 > 1
2
1
2 > 1
2
1
1
2 > 1
2
1 1 1 1


#he hole ?ontinuit) e3uation i$ gi,en &)
i i
T
i i p
i i
T
i i p
i
T
i i p
i i
T
i i p
i
G p
V
B D p
V
B D
V
B D p
V
B D

,
_

+
1
]
1

,
_

,
_

,
_

+
+

+
+
+ 1
1
2 > 1
2
1
2 > 1
2
1
2 > 1
2
1
1
2 > 1
2
1 1 1 1


= < = <
.
2
int
i n i p
i
p p n n
n n p
G
+ + +


8
T
V


?
@
T T
B
V D V
q
T K D

>
1
= <

x
e
x
x B @ x = normali5ed8 nint = intrin$ic carrier concentration8 M i$ normali5ed &) =Di
Pina(pani )a*a( (++5$3$+%+) 11
Assignment 5 1D Drift Diffusion pn Diode simulator
1or electron
( ) ( ) ( )
( )
[ ]
int
2
int
2
int
int 1 1
2 2
2 > 1
int 1
2 2
2 > 1
1
2 2
2 > 1
int 1 1
2 2
2 > 1
= 1 < = 1 <
.
? ?
? ? ? ? ? ?
n p n
n n n p
n n B
L
V
n n B
L
V
B
L
V
n n B
L
V
i n i p
i i
i i i i
Di
T
n
i
i i i i
Di
T
n
i
i i
Di
T
n
i
i i i
Di
T
n
i
+ + +

+
1
1
]
1

+
+

+ +
+

( ) ( ) ( ) [ ] ( )
[ ]
T
Di
i n i p
i i
i i i
n
i i i i
n
i i i
n
i i i i
n
i
V
L
p n
n p
n B n B B n B
2 2
1 1 2 > 1 1 2 > 1 1 2 > 1 1 1 2 > 1

= 1 < = 1 <
1 .

? ? ? ? ? ? ? ?

+ + +

+ +
+ + + + +


4o the coefficient$ of electron ?ontinuit) e3n are
( )
( ) ( ) [ ]
( )
[ ]
T
Di
i n i p
i i
i i
n
i
i i
n
i i i
n
i
i i
n
i
V
L
p n
n p
f
B a
B B b
B c
2 2
i
1 2 > 1 i
1 2 > 1 1 2 > 1 i
1 2 > 1 i

= 1 < = 1 <
1 .

? ?
? ? ? ?
? ?

+ + +


+


+ +
+ +




4imilarl) for ;ole$ the coefficient$ can &e determined a$
( )
( ) ( ) [ ]
( )
[ ]
T
Di
i n i p
i i
i i
p
i
i i
p
i i i
p
i
i i
p
i
V
L
p n
n p
f
B a
B B b
B c
2 2
i
1 2 > 1 i
1 2 > 1 1 2 > 1 i
1 2 > 1 i

= 1 < = 1 <
1 .

? ?
? ? ? ?
? ?

+ + +


+


+ +
+ +




,=e simulation @as performed "* var*ing Anode voltage from $ to $&7#5' in $&33C',
steps& All t=e results @ere plotted as mentioned "elo@&
)!,E ?
4t @as o"served t=at "* var*ing t=e D0 voltage from $ to $&7#5 @it= smaller "ias steps
li(e $&33', gives "etter results compared to larger "ias steps li(e ', & ,=e results
o"tained from smaller "ias steps e;actl* matc=e @it= )ano9u" plots&
Pina(pani )a*a( (++5$3$+%+) 1#
nint = Antrin$ic carrier concentration
LDi = Antrin$ic De&)e =ength
M = normali5ed me$h
VT = #hermal !oltage
ni pi = electron and hole
concentration at node i
Assignment 5 1D Drift Diffusion pn Diode simulator
Appendi; A contains t=e grap=s for .arger -ias steps and t=e difference can "e
o"served&
Pina(pani )a*a( (++5$3$+%+) 13
Assignment 5 1D Drift Diffusion pn Diode simulator
3 Simulation 2esults
Anode 'oltage varied from $ to $&7#5' in steps of $&33C't
3&1 0onduction -and vs Device .engt=
8at.a" ('a 6 $&7#5') )ano 9u" ('a 6 $&7#5')
0 1 2 3 4 5 6 7
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
X: 3.088
Y: 0.303
x [um]
C
o
n
d
u
c
t
i
o
n

B
a
n
d

E
n
e
r
g
y

(
e
V
)
Conduction Band vs Position - at Applied Bias (0.625)
X: 3.413
Y: 0.1457

8at.a" (E1uili"rium) )ano 9u" (E1uili"rium)
0 1 2 3 4 5 6 7
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
x [um]
C
o
n
d
u
c
t
i
o
n

B
a
n
d

E
n
e
r
g
y

(
e
V
)
Conduction Band vs Position - at Equilibrium

Pina(pani )a*a( (++5$3$+%+) 13
Assignment 5 1D Drift Diffusion pn Diode simulator
3&# Electron and 9ole Densities vs Device .engt=
8at.a" (E1uili"rium) )ano 9u" (E1uili"rium)
0 1 2 3 4 5 6 7
10
2
10
4
10
6
10
8
10
10
10
12
10
14
10
16
10
18
x [um]
E
l
e
c
t
r
o
n

&

H
o
l
e

D
e
n
s
i
t
i
e
s

[
1
/
c
m
3
]
Electron & Hole Densities vs Position - at Equilibrium
n
p
8at.a" ('a 6 $&7#5') )ano 9u" ('a 6 $&7#5')
Pina(pani )a*a( (++5$3$+%+) 15
Assignment 5 1D Drift Diffusion pn Diode simulator
0 1 2 3 4 5 6 7
10
2
10
4
10
6
10
8
10
10
10
12
10
14
10
16
10
18
X: 3.126
Y: 2.237e+014
X: 0.1936
Y: 2.25e+004
X: 3.365
Y: 2.602e+013
X: 6.475
Y: 2250
x [um]
E
l
e
c
t
r
o
n

&

H
o
l
e

D
e
n
s
i
t
i
e
s

[
1
/
c
m
3
]
Electron & Hole Densities vs Position - at Applied Bias(0.625V)
n
p
#he electron and hole den$itie$ calculated at 0.6:7! in 'atla& matche$ /ith %anohu& ,alue$.
Pina(pani )a*a( (++5$3$+%+) 17
Assignment 5 1D Drift Diffusion pn Diode simulator
3&3 4' 0=aracteristics
,otal 0urrent - 8at.a" ('a 6 $&7#5) ,otal 0urrent - )ano 9u" ('a 6 $&7#5')
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
-0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
X: 0.6226
Y: 4.177
VA [V]
T
o
t
a
l

C
u
r
r
e
n
t

D
e
n
s
i
t
y

[
A
m
p
/
c
m
2
]
I vs V Plot

#he final current at !a=0.6::6 i$ .177 ("cm
:
. #he 'atla& and %anohu& ,alue$ match.

4' Plot for ElectronD 9ole and ,otal 0urrent 0urrent 0ontinuit*
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
-1
0
1
2
3
4
5
VA [V]
T
o
t
a
l

C
u
r
r
e
n
t

D
e
n
s
i
t
y

[
A
m
p
/
c
m
2
]
I vs V Plot
Jtotal
Jhole
Jelec

0 1 2 3 4 5 6 7
0
1
2
3
4
5
6
x [um]
T
o
t
a
l

C
u
r
r
e
n
t

D
e
n
s
i
t
y

[
A
/
c
m
2
]
Total Current Density vs Position - at Applied Bias(0.625V)
#otal ?urrent -Electron H ;ole. going
from ?athode to (node i$ ?on$tant.
#otal ?urrent -$um of electron and ;ole current$. for 0.6:7 ! i$ found to &e 3&1>> A/cm
#

/hich matche$ /ith %ano;u& #otal current for the $ame &ia$ ,oltage. #he total current i$
con$tant through the entire de,ice from cathode to anode a$ $ho/n in the plot. #hi$ pro,e$
current continuit).
Pina(pani )a*a( (++5$3$+%+) 1>
Assignment 5 1D Drift Diffusion pn Diode simulator
3&3 Electron and 9ole Euasi /ermi .evels
8at.a" ('a 6 $&7#5') )ano 9u" ('a 6 $&7#5')
0 1 2 3 4 5 6 7
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
x [um]
E
n
e
r
g
y

[
e
V
]
Quasi Fermi Levels (Efn & Efp) vs Position - at Applied Bias(0.625V)
Ec
Ev
Ei
Efn
Efp
#he 3ua$i 1ermi le,el$ are calculated a$ gi,en &elo/
)et 0=arge Densit*
8at.a" ('a 6 $&7#5') )ano 9u" ('a 6 $&7#5')
0 1 2 3 4 5 6 7
-6
-4
-2
0
2
4
6
8
10
12
x 10
-3
X: 3.354
Y: 0.004766
x [um]
T
o
t
a
l

C
h
a
r
g
e

D
e
n
s
i
t
y

[
C
/
c
m
3
]
Total Charge Density vs Position - at Applied Bias(0.625V)
X: 3.322
Y: -0.003202
Pina(pani )a*a( (++5$3$+%+) 1%
Assignment 5 1D Drift Diffusion pn Diode simulator
3&5 Electric /ield
8at.a" ('a 6 $&7#5') )ano 9u" ('a 6 $&7#5')
0 1 2 3 4 5 6 7
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
x 10
4
X: 3.054
Y: -51.58
X: 3.432
Y: -18.2
x [um]
E
l
e
c
t
r
i
c

F
i
e
l
d

[
V
/
c
m
]
Field Profile vs Position - at Applied Bias(0.625V)
X: 3.322
Y: -1.719e+004
3&7 E1uili"rium 0ondition
0 1 2 3 4 5 6 7
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
x [um]
P
o
t
e
n
t
i
a
l

[
e
V
]
Potential vs Position - at Equilibrium

0 1 2 3 4 5 6 7
-4.5
-4
-3.5
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
x 10
4
x [um]
E
l
e
c
t
r
i
c

F
i
e
l
d

[
V
/
c
m
]
Field Profile vs Position - at Equilibrium

0 1 2 3 4 5 6 7
-4
-2
0
2
4
6
8
10
12
14
16
x 10
-3
x [um]
T
o
t
a
l

C
h
a
r
g
e

D
e
n
s
i
t
y

[
C
/
c
m
3
]
Total Charge Density vs Position - at Equilibrium
Pina(pani )a*a( (++5$3$+%+) 1+
Assignment 5 1D Drift Diffusion pn Diode simulator
1rom thi$ pro+ect A conclude that A learnt more &) de$igning the $imulator m)$elf compared to
generating the plot$ on %anohu&. %anohu& i$ a /onderful tool to e2plore de,ice propertie$
and ,erif) re$ult$. 0ut de$igning one@$ o/n $imulator gi,e$ greater in$ight into the actual
/orking of the commercial $imulator and %anohu&. A can &etter under$tand ho/ the
e3uation$ are $ol,ed8 ho/ it i$ &etter to take $maller &ia$e$ and finer me$h $i5e$ to $ol,e an
e3uili&rium condition.
Pina(pani )a*a( (++5$3$+%+) #$
Assignment 5 1D Drift Diffusion pn Diode simulator
3 APPE)D45 A
3&1 2esults from .arger -ias steps 6 ',&
#he output plot$ do not match /ith the actual %ano;u& re$ult$ /hen larger 0ia$ $tep$ are
u$ed for (node ,oltage increment. ;ence finer &ia$ $tep$ gi,e &etter re$ult$.
0 1 2 3 4 5 6 7
10
2
10
4
10
6
10
8
10
10
10
12
10
14
10
16
10
18
x [um]
E
l
e
c
t
r
o
n

&

H
o
l
e

D
e
n
s
i
t
i
e
s

[
1
/
c
m
3
]
Electron & Hole Densities vs Position - at Applied Bias(0.625V)
n
p

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
-5
0
5
10
15
20
x 10
-3
VA [V]
T
o
t
a
l

C
u
r
r
e
n
t

D
e
n
s
i
t
y

[
A
m
p
/
c
m
2
]
I vs V Plot
,=e c=arge densit* values are lo@er t=an actual ,=e total current plot is distorted and lesser&
0 1 2 3 4 5 6 7
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
x [um]
E
n
e
r
g
y

[
e
V
]
Quasi Fermi Levels (Efn & Efp) vs Position - at Applied Bias(0.625V)
Ec
Ev
Ei
Efn
Efp

0 1 2 3 4 5 6 7
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
x [um]
P
o
t
e
n
t
i
a
l

[
e
V
]
Potential vs Position - at Applied Bias(0.625V)
Euasi /ermi levels are lesser t=an actual Potential values for $ to 3um is less t=an actual
Pina(pani )a*a( (++5$3$+%+) #1
Assignment 5 1D Drift Diffusion pn Diode simulator
5 APPE)D45 -
5&1 8atla" 0ode for 1D drift Diffusion simulator for modeling pn-junction (diodes)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% 1D Drift Diffusion Model for pn Diodes %%
%% Equilibrium and Non Equilibrium Solver %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear all;
close all;
% Defining the Fundamental and Material Constants %
q 1!"#$E%1&; % C or '()e*+
,b 1!-.E%$-; % '()/+
eps 1!#0E%1$; % 1his includes the eps 11!2 for Si 'F)cm+
1 -##; % '/+
ni 1!0E1#; % 3ntrinsic carrier concentration '1)cm4-+
*t ,b51)q; % 'e*+
6Nc $!.E1&; % 1his is $!.e$# in the F76168N file
189N# #!1E%"; % Electron S6: life time
189;# #!1E%"; % :ole S6: life time
mun# 10##; % Electron Mobilit< in cm$)*%s
mup# 1###; % :ole Mobilit< in cm$)*%s


dEc *t5log=6Nc)ni>;
% Define Doping *alues %
Na 1E1"; % '1)cm4-+
Nd 1E12; % '1)cm4-+
% Calculate relevant parameters for the simulation %
*bi *t5log=Na5Nd)=ni5ni>>;
? sqrt=$5eps5=Na@Nd>5*bi)=q5Na5Nd>> % 'cm+
?n ?5sqrt=Na)=Na@Nd>> % 'cm+
?p ?5sqrt=Nd)=Na@Nd>> % 'cm+
?one sqrt=$5eps5*bi)=q5Na>> % 'cm+
EAp q5Nd5?n)eps % '*)cm+
Bdn sqrt=eps5*t)=q5Nd>>;
Bdp sqrt=eps5*t)=q5Na>>;
Bdi sqrt=eps5*t)=q5ni>>
% Calculate relevant parameters in an input file %
% ?rite to a file
save inputAparams!tCt Na Nd *bi ? ?n ?p EAp Bdn Bdp
%MaterialAConstants %Define some material constants

% Setting the siDe of the simulation domain based
% on the anal<tical results for the Eidth of the depletion regions
Pina(pani )a*a( (++5$3$+%+) ##
Assignment 5 1D Drift Diffusion pn Diode simulator
% for a simple pn%diode %
CAmaC #;
if=CAmaC F ?n>
CAmaC ?n;
end
if=CAmaC F ?p>
CAmaC ?p;
end
CAmaC $#5CAmaC
% Setting the grid siDe based on the eCtrinsic Deb<e lengths %
dC Bdn;
if=dC G Bdp>
dCBdp;
end
dC dC)$#;
% Calculate the required number of grid points and renormaliDe dC %
nAmaC CAmaC)dC
nAmaC round=nAmaC>;
dC dC)Bdi; % 6enormaliDe lengths Eith Bdi
% Set up the doping C=C>Nd=C>%Na=C> that is normaliDed Eith ni %
for i 1HnAmaC
if=i F nAmaC)$>
dop=i> % Na)ni;
elseif=i G nAmaC)$>
dop=i> Nd)ni;
end
end
% 3nitialiDe the potential based on the requirement of charge
% neutralit< throughout the Ehole structure
for i 1H nAmaC
DD #!05dop=i>;
if=DD G #>
CC DD5=1 @ sqrt=1@1)=DD5DD>>>;
elseif=DD F #>
CC DD5=1 % sqrt=1@1)=DD5DD>>>;
end
fi=i> log=CC>;
n=i> CC;
p=i> 1)CC;
end
deltaAacc 1E%0; % ;reset the 1olerance
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% EI93B3J639M S7B9137N ;861 JEK3NS %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%=8> Define the elements of the coefficient matriC for the internal nodes and
% initialiDe the forcing function
Pina(pani )a*a( (++5$3$+%+) #3
Assignment 5 1D Drift Diffusion pn Diode simulator
dC$ dC5dC;
for i 1H nAmaC
a=i> 1)dC$;
c=i> 1)dC$;
b=i> %=$)dC$@eCp=fi=i>>@eCp=%fi=i>>>;
f=i> eCp=fi=i>> % eCp=%fi=i>> % dop=i> % fi=i>5=eCp=fi=i>>@eCp=%fi=i>>>;
end
%=J> Define the elements of the coefficient matriC and initialiDe the forcing
% function at the ohmic contacts
a=1> #;
c=1> #;
b=1> 1;
f=1> fi=1>;
a=nAmaC> #;
c=nAmaC> #;
b=nAmaC> 1;
f=nAmaC> fi=nAmaC>;
%=C> Start the iterative procedure for the solution of the lineariDed ;oisson
% equation using B9 decomposition methodH
flagAconv #; % convergence of the ;oisson loop
,Aiter #;
Ehile=LflagAconv>
,Aiter ,Aiter @ 1;

alpha=1> b=1>;
for i$HnAmaC
beta=i>a=i>)alpha=i%1>;
alpha=i>b=i>%beta=i>5c=i%1>;
end

% Solution of Bv f %
v=1> f=1>;
for i $HnAmaC
v=i> f=i> % beta=i>5v=i%1>;
end

% Solution of 95fi v %
temp v=nAmaC>)alpha=nAmaC>;
delta=nAmaC> temp % fi=nAmaC>;
fi=nAmaC>temp;
for i =nAmaC%1>H%1H1 %delta%
temp =v=i>%c=i>5fi=i@1>>)alpha=i>;
delta=i> temp % fi=i>;
fi=i> temp;
end

deltaAmaC #;

for i 1H nAmaC
CC abs=delta=i>>;
if=CC G deltaAmaC>
deltaAmaCCC;
end
%sprintf=MdeltaAmaC %dMNdeltaAmaC> %M,Aiter %dMN,AiterNM

end
Pina(pani )a*a( (++5$3$+%+) #3
Assignment 5 1D Drift Diffusion pn Diode simulator
%deltaAmaCmaC=abs=delta>>;

% 1est convergence and recalculate forcing function and
% central coefficient b if necessar<

if=deltaAmaC F deltaAacc>
flagAconv 1;
else
for i $H nAmaC%1
b=i> %=$)dC$ @ eCp=fi=i>> @ eCp=%fi=i>>>;
f=i> eCp=fi=i>> % eCp=%fi=i>> % dop=i> % fi=i>5=eCp=fi=i>> @ eCp=%fi=i>>>;
end
end
end
CC1=1> dC51eO;
for i $HnAmaC%1
Ec=i> dEc % *t5fi=i>; %*alues from the second Node%
ro=i> %ni5=eCp=fi=i>> % eCp=%fi=i>> % dop=i>>;
elAfield1=i> %=fi=i@1> % fi=i>>5*t)=dC5Bdi>;
elAfield$=i> %=fi=i@1> % fi=i%1>>5*t)=$5dC5Bdi>;
n=i> eCp=fi=i>>;
p=i> eCp=%fi=i>>;
CC1=i> CC1=i%1> @ dC5Bdi51eO;
end
Ec=1> Ec=$>;
Ec=nAmaC> Ec=nAmaC%1>;
CC1=nAmaC> CC1=nAmaC%1> @ dC5Bdi51eO;
elAfield1=1> elAfield1=$>;
elAfield$=1> elAfield$=$>;
elAfield1=nAmaC> elAfield1=nAmaC%1>;
elAfield$=nAmaC> elAfield$=nAmaC%1>;
nf n5ni;
pf p5ni;
ro=1> ro=$>;
ro=nAmaC> ro=nAmaC%1>;
figure=1>
plot=CC1N *t5fiNMrMNMBine?idthMN$>
Clabel=MC 'um+M>;
<label=M;otential 'e*+M>;
title=M;otential vs ;osition % at EquilibriumM>;
figure=$>
plot=CC1N elAfield1NMrMNMBine?idthMN$>
hold on;
plot=CC1N elAfield$NMrMNMBine?idthMN$>
Clabel=MC 'um+M>;
<label=MElectric Field '*)cm+M>;
title=MField ;rofile vs ;osition % at EquilibriumM>;
figure=->
%plot=CC1N nfNMgMNMBine?idthMN$>
semilog<=CC1N nfNMgMNMBine?idthMN$>
hold on;
%plot=CC1N pfNMrMNMBine?idthMN$>
semilog<=CC1N pfNMrMNMBine?idthMN$>
Clabel=MC 'um+M>;
<label=MElectron P :ole Densities '1)cm4-+M>;
Pina(pani )a*a( (++5$3$+%+) #5
Assignment 5 1D Drift Diffusion pn Diode simulator
title=MElectron P :ole Densities vs ;osition % at EquilibriumM>;
legend=MnMNMpM>;
%aCis='# "!20 # 1#!$e12+>
figure=O>
%plot=CC1N roNMrMNMBine?idthMN$>
plot=CC1N q5roNMrMNMBine?idthMN$>
Clabel=MC 'um+M>;
%<label=M1otal Charge Densit< '1)cm4-+M>;
<label=M1otal Charge Densit< 'C)cm4-+M>;
title=M1otal Charge Densit< vs ;osition % at EquilibriumM>;
%aCis='#!0 0 %-e12 .e12+>
figure=0>
plot=CC1N EcNMrMNMBine?idthMN$>
Clabel=MC 'um+M>;
%<label=M1otal Charge Densit< '1)cm4-+M>;
<label=MConduction Jand Energ< =e*>M>;
title=MConduction Jand vs ;osition % at EquilibriumM>;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% END 7F EI93B3J639M S7B9137N ;861 %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%
%% N7N%EI93B3J639M S7B9137N ;861 JEK3NS %%
%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 1! Calculate BoE filed mobilit< %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ;rameters for BoE field mobilit< calculation %%
1B -##; % 1emp in /elvin
N Na @ Nd; % Bocal =total> impurit< concentration
M91N!C89K 00!$O; % cm$)=*!s>
M9$N!C89K 1O$&!$-; % cm$)=*!s>
8B;:8N!C89K #!#; % unitless
JE18N!C89K %$!-; % unitless
K8MM8N!C89K %-!.; % unitless
DEB18N!C89K #!2-; % unitless
NC631N!C89K 1!#2$51#412; % cm%-
M91;!C89K O&!2; % cm$)=*!s>
M9$;!C89K O2&!-2; % cm$)=*!s>
8B;:8;!C89K #!#; % unitless
JE18;!C89K %$!$; % unitless
K8MM8;!C89K 1-!2; % unitless
DEB18;!C89K #!2#; % unitless
NC631;!C89K 1!"#"51#412; % cm%-
JE18N $!#;
JE18; 1!#;

% % mun# = M91N!C89K5==1B)-##>48B;:8N!C89K> > !!!
% % @ == =M9$N!C89K5==1B)-##>4JE18N!C89K>> % =M91N!C89K5==1B)-##>48B;:8N!C89K>> > !!!
% % ) = 1 @ ==1B)-##>4K8MM8N!C89K> 5 ==N)NC631N!C89K>4DEB18N!C89K> >>
% %
Pina(pani )a*a( (++5$3$+%+) #7
Assignment 5 1D Drift Diffusion pn Diode simulator
% %
% % mup# = M91;!C89K5==1B)-##>48B;:8;!C89K> > !!!
% % @ == =M9$;!C89K5==1B)-##>4JE18;!C89K>> % =M91;!C89K5==1B)-##>48B;:8;!C89K>> > !!!
% % ) = 1 @ ==1B)-##>4K8MM8;!C89K> 5 ==N)NC631;!C89K>4DEB18;!C89K> >>

*S81N =$!O51#42> ) =1 @ #!.5eCp=1B)"##>>; % Saturation *elocit< of Electrons
*S81; *S81N; % Saturation *elocit< of :oles
%%%%%%%%%%%%%%%%%%% END of BoE Field Mobilit< Calculation %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% $! Start the main Boop to increment the 8node voltage b< *t/b1)q %%
%% till it reaches #!"$0*! %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
vindeC#;
for *8 #H#!--5*tH#!"$0 % Start *8 increment loop
*8

EachAStep #!--5*t
1otalASteps #!"$0)=#!--5*t>
vindeC vindeC @1
*plot=vindeC> *8;

fi=1> fi=1> @ *8; % 8ppl< potential to 8node =1st node>
%fi=1>

flagAconv$ #; % Convergence of the ;oisson loop
,Aitern #;

%% 3nitialiDe the First and Bast Node for ;oissonMs eqn
a=1> #;
c=1> #;
b=1> 1;
f=1> fi=1>;
a=nAmaC> #;
c=nAmaC> #;
b=nAmaC> 1;
f=nAmaC> fi=nAmaC>;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% -! Start the ;oisson equation solver loop to calculate the %%
%% potential for each 8node voltage increase %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Ehile=LflagAconv$> % Start ;oissonMs eqn

,Aitern ,Aitern @ 1

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% -!1 ! Calculate Field Dependant Mobilit< for each value of MfiM %%
%% at each node point of the ;N diode! %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% 1o test Eith Constant Mobilit< Eithout field dependanc<!
% % for i 1HnAmaC % Start Boop for Field Dep Mobilit<
% % mup=i> mup#;
% % mun=i> mun#;
% % end
Pina(pani )a*a( (++5$3$+%+) #>
Assignment 5 1D Drift Diffusion pn Diode simulator
%% Calculate the Electric Field at each Node
for i $HnAmaC%1
Ef=i> abs=fi=i> % fi=i@1>>5*t)=dC5Bdi>;
end

Ef=1> Ef=$>;
Ef=nAmaC> Ef=nAmaC%1>;
%% Calculate the Field Dependant Mobilit< at each Node
for i 1HnAmaC
pdeno =mup# 5 Ef=i> ) *S81;> 4 JE18;;
mup=i> mup# 5 = =1)=1 @ pdeno>> 4=1)JE18;>>;

ndeno =mun# 5 Ef=i> ) *S81N> 4 JE18N;
mun=i> mun# 5 = =1)=1 @ ndeno>> 4=1)JE18N>>;

end

mup=1> mup=$>;
mup=nAmaC> mup=nAmaC%1>;

mun=1> mun=$>;
mun=nAmaC> mun=nAmaC%1>;

%%%%%%%%%%% END of F3EBD Dependant Mobilit< Calculation %%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% -!$ Solve Continuit< Equation for Electron and :oles using B9 Decomposition %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%=8> Define the elements of the coefficient matriC and initialiDe the forcing
% function at the ohmic contacts for EBEC167N and :7BE Continuit< Eqns
an=1> #; %Co%ef for electron at 8node
bn=1> 1; %Co%ef for electron at 8node
cn=1> #; %Co%ef for electron at 8node
ap=1> #; %Co%ef for hole at 8node
bp=1> 1; %Co%ef for hole at 8node
cp=1> #; %Co%ef for hole at 8node
%fnp=1> =Bdi5Bdi5dC$)*t> 5 = p=1>5n=1> % 1 > ) = 189;#5=n=1> @ 1 > @ 189N#5=p=1>
@ 1 > >;
fn=1> n=1>;
fp=1> p=1>;

an=nAmaC> #; %Co%ef for electron at Cathode
bn=nAmaC> 1; %Co%ef for electron at Cathode
cn=nAmaC> #; %Co%ef for electron at Cathode
ap=nAmaC> #; %Co%ef for hole at Cathode
bp=nAmaC> 1; %Co%ef for hole at Cathode
cp=nAmaC> #; %Co%ef for hole at Cathode
%fnp=nAmaC> =Bdi5Bdi5dC$)*t> 5 = p=nAmaC>5n=nAmaC> % 1 > ) = 189;#5=n=nAmaC> @ 1>
@ 189N#5=p=nAmaC> @ 1> >;
fn=nAmaC> n=nAmaC>;
fp=nAmaC> p=nAmaC>;
%=J> Define the elements of the coefficient matriC for the internal nodes and
% initialiDe the forcing function
Pina(pani )a*a( (++5$3$+%+) #%
Assignment 5 1D Drift Diffusion pn Diode simulator
for i $H nAmaC%1
munim1b<$ =mun=i%1>@mun=i>>)$;
munip1b<$ =mun=i>@mun=i@1>>)$;
mupim1b<$ =mup=i%1>@mup=i>>)$;
mupip1b<$ =mup=i>@mup=i@1>>)$;

%% Co%efficients for :7BE Continuit< eqn
cp=i> mupip1b<$ 5 JE6=fi=i> % fi=i@1>>;
ap=i> mupim1b<$ 5 JE6=fi=i> % fi=i%1>>;
bp=i> %= mupim1b<$ 5 JE6=fi=i%1> % fi=i>> @ mupip1b<$ 5 JE6=fi=i@1> % fi=i>>>;
%% Co%efficients for EBEC167N Continuit< eqn
cn=i> munip1b<$ 5 JE6=fi=i@1> % fi=i>>;
an=i> munim1b<$ 5 JE6=fi=i%1> % fi=i>>;
n=i> %= munim1b<$ 5 JE6=fi=i> % fi=i%1>> @ munip1b<$ 5 JE6=fi=i> % fi=i@1>>>;
%% Forcing Function for EBEC167N and :7BE Continuit< eqns
fn=i> =Bdi5Bdi5dC$)*t> 5 = p=i>5n=i> % 1 > ) = 189;#5=n=i> @ 1> @ 189N#5=p=i>@1>>;
fp=i> =Bdi5Bdi5dC$)*t> 5 = p=i>5n=i> % 1 > ) = 189;#5=n=i> @ 1> @ 189N#5=p=i>@1>>;
end

%=C> Start the iterative procedure for the solution of the lineariDed Continuit<
% equation for QEBEC167NSQ using B9 decomposition methodH
alphan=1> bn=1>;
for i$HnAmaC
betan=i>an=i>)alphan=i%1>;
alphan=i>bn=i>%betan=i>5cn=i%1>;
end
% Solution of Bv f %
vn=1> fn=1>;
for i $HnAmaC
vn=i> fn=i> % betan=i>5vn=i%1>;
end
% Solution of 95fi v %
tempn vn=nAmaC>)alphan=nAmaC>;
%deltan=nAmaC> tempn % n=nAmaC>;
n=nAmaC>tempn;
for i =nAmaC%1>H%1H1 %delta%
tempn =vn=i>%cn=i>5n=i@1>>)alphan=i>;
% deltan=i> tempn % n=i>;
n=i> tempn;
end

%%%%%%%%%%%%%%%%%%%%%%% END of EBEC167N Continut< Solver %%%%%%%%%%%

%=D> Start the iterative procedure for the solution of the lineariDed Continuit<
% equation for Q:7BESQ using B9 decomposition methodH
alphap=1> bp=1>;
for i$HnAmaC
betap=i>ap=i>)alphap=i%1>;
alphap=i>bp=i>%betap=i>5cp=i%1>;
end
% Solution of Bv f %
Pina(pani )a*a( (++5$3$+%+) #+
Assignment 5 1D Drift Diffusion pn Diode simulator
vp=1> fp=1>;
for i $HnAmaC
vp=i> fp=i> % betap=i>5vp=i%1>;
end
% Solution of 95fi v %
tempp vp=nAmaC>)alphap=nAmaC>;
%deltap=nAmaC> tempp % p=nAmaC>;
p=nAmaC>tempp;
for i =nAmaC%1>H%1H1 %delta%
tempp =vp=i>%cp=i>5p=i@1>>)alphap=i>;
% deltap=i> tempp % p=i>;
p=i> tempp;
end

%%%%%%%%%%%%%%%%%%%%%%% END of :7BE Continut< Solver %%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% -!- Calculate potential fi again Eith neE values of QnQ and QpQ%%
%% and chec, for convergence %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% 6ecalculate forcing function and central coefficient b for fi
for i $H nAmaC%1
b=i> %=$)dC$ @ n=i> @ p=i>>;
f=i> n=i> % p=i> % dop=i> % =fi=i>5=n=i> @ p=i>>>;
%% here values of n=i> and p=i> are used in place of eCp=fi=i>>
end

% Solve for 9pdated potential given the neE value of Forcing
% Function using B9 decomposition

alpha=1> b=1>;
for i$HnAmaC
beta=i>a=i>)alpha=i%1>;
alpha=i>b=i>%beta=i>5c=i%1>;
end
% Solution of Bv f %
v=1> f=1>;
for i $HnAmaC
v=i> f=i> % beta=i>5v=i%1>;
end
% Solution of 95fi v %
temp v=nAmaC>)alpha=nAmaC>;
delta=nAmaC> temp % fi=nAmaC>;
fi=nAmaC>temp;
for i =nAmaC%1>H%1H1 %delta%
temp =v=i>%c=i>5fi=i@1>>)alpha=i>;
delta=i> temp % fi=i>;
fi=i> temp;
end
deltaAmaC #;
Pina(pani )a*a( (++5$3$+%+) 3$
Assignment 5 1D Drift Diffusion pn Diode simulator
for i 1H nAmaC
CC abs=delta=i>>;
if=CC G deltaAmaC>
deltaAmaCCC; %% Calculate the maC error
end
end
%deltaAmaCmaC=abs=delta>>;
% 1est convergence and start the loop if necessar< else increase
% the applied potential
%% deltaAmaC
if=deltaAmaC F deltaAacc>
flagAconv$ 1;
end
end % End of ?:3BE Boop for ;oissonMs eqn solver

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% C8BC9B81E C966EN1 %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Electron Current
for i$HnAmaC%1
(nim1b<$=vindeCNi> =q5mun=i>5*t)=dC5Bdi>> 5 ni5= n=i>5JE6=fi=i>%fi=i%1>> R
% n=i%1>5JE6=fi=i%1>%fi=i>> >;
(nip1b<$=vindeCNi> =q5mun=i>5*t)=dC5Bdi>> 5 ni5= n=i@1>5JE6=fi=i@1>%fi=i>> R
% n=i>5JE6=fi=i>%fi=i@1>> >;
(elec=vindeCNi> =(nip1b<$=vindeCNi> @ (nim1b<$=vindeCNi>>)$;

% % % Electron Current Eith onl< one node
% % (nim1b<$ =q5mun=$>5*t)dC5Bdi> 5 = =n=$>5ni>5JE6==fi=$>%fi=$%1>>>
% =n=$%1>5ni>5JE6==fi=$%1>%fi=$>>> >;
% % (nip1b<$ =q5mun=$>5*t)dC5Bdi> 5 = =n=$@1>5ni>5JE6==fi=$@1>%fi=$>>>
% =n=$>5ni>5JE6==fi=$>%fi=$@1>>> >;
% % (elec=vindeC> =(nip1b<$ @ (nim1b<$>)$;
% :ole Current
% % (pim1b<$ =q5mup=$>5*t)dC5Bdi> 5 = =p=$>5ni>5JE6==fi=$%1>%fi=$>>>
% =p=$%1>5ni>5JE6==fi=$>%fi=$%1>>> >;
% % (pip1b<$ =q5mup=$>5*t)dC5Bdi> 5 = =p=$@1>5ni>5JE6==fi=$>%fi=$@1>>>
% =p=$>5ni>5JE6==fi=$@1>%fi=$>>> >;
% % (hole=vindeC> =(pip1b<$ @ (pim1b<$>)$;
(pim1b<$=vindeCNi> =q5mup=i>5*t)=dC5Bdi>> 5 ni5= p=i>5JE6==fi=i%1>%fi=i>>> R
% p=i%1>5JE6==fi=i>%fi=i%1>>> >;
(pip1b<$=vindeCNi> =q5mup=i>5*t)=dC5Bdi>> 5 ni5= p=i@1>5JE6==fi=i>%fi=i@1>>> R
% p=i>5JE6==fi=i@1>%fi=i>>> >;
(hole=vindeCNi> =(pip1b<$=vindeCNi> @ (pim1b<$=vindeCNi>>)$;
end
(total (elec @ (hole;
%% (total=vindeC> (elec;


end % End of main F76 loop for *8 increment!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% END 7F N7N%EI93B3J639M S7B9137N ;861 %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Pina(pani )a*a( (++5$3$+%+) 31
Assignment 5 1D Drift Diffusion pn Diode simulator
% ?rite the results of the simulation in files %
CC1=1> dC51eO;
for i $HnAmaC%1
Ec=i> dEc % *t5fi=i>; %*alues from the second Node%
ro=i> %ni5=n=i> % p=i> % dop=i>>;
elAfield1=i> %=fi=i@1> % fi=i>>5*t)=dC5Bdi>;
elAfield$=i> %=fi=i@1> % fi=i%1>>5*t)=$5dC5Bdi>;
CC1=i> CC1=i%1> @ dC5Bdi51eO;
end
(total=HN1> (total=HN$>;
(elec=HN1> (elec=HN$>;
(hole=HN1> (hole=HN$>;
(total=HNnAmaC> (total=HN=nAmaC%1>>;
(elec=HNnAmaC> (elec=HN=nAmaC%1>>;
(hole=HNnAmaC> (hole=HN=nAmaC%1>>;
Ec=1> Ec=$>;
Ec=nAmaC> Ec=nAmaC%1>;
CC1=nAmaC> CC1=nAmaC%1> @ dC5Bdi51eO;
elAfield1=1> elAfield1=$>;
elAfield$=1> elAfield$=$>;
elAfield1=nAmaC> elAfield1=nAmaC%1>;
elAfield$=nAmaC> elAfield$=nAmaC%1>;
nf n5ni;
pf p5ni;
ro=1> ro=$>;
ro=nAmaC> ro=nAmaC%1>;
%% Calculate Iuasi Fermi Bevel % Efn Efp
for i 1HnAmaC
Ei=i> Ec=i> % #!0";
Efn=i> Ei=i> @ *t5log=nf=i>)ni>;
Efp=i> Ei=i> % *t5log=pf=i>)ni>;
end
Ev Ec % 1!1$;
figure=1O>
plot=CC1N EcNMblac,MNMBine?idthMN$!0>;
hold on;
plot=CC1N EvNMblac,MNMBine?idthMN$!0>;
hold on;
plot=CC1N EiNM%%blac,MNMBine?idthMN$!0>;
hold on;
plot=CC1N EfnNMrMNMBine?idthMN$!0>;
hold on;
plot=CC1N EfpNMbMNMBine?idthMN$!0>;
Clabel=MC 'um+M>;
<label=MEnerg< 'e*+M>;
title=MIuasi Fermi Bevels =Efn P Efp> vs ;osition % at 8pplied Jias=#!"$0*>M>;
legend=MEcMNMEvMNMEiMNMEfnMNMEfpM>;
aCis='# 2 %1 1+>;
figure=">
plot=CC1N EcNMbMNMBine?idthMN$>
Clabel=MC 'um+M>;
<label=MConduction Jand Energ< =e*>M>;
title=MConduction Jand vs ;osition % at 8pplied Jias =#!"$0>M>;
Pina(pani )a*a( (++5$3$+%+) 3#
Assignment 5 1D Drift Diffusion pn Diode simulator
figure=2>
plot=CC1N *t5fiNMbMNMBine?idthMN$>
Clabel=MC 'um+M>;
<label=M;otential 'e*+M>;
title=M;otential vs ;osition % at 8pplied Jias=#!"$0*>M>;
figure=.>
plot=CC1N elAfield1NMbMNMBine?idthMN$>
hold on;
plot=CC1N elAfield$NMbMNMBine?idthMN$>
Clabel=MC 'um+M>;
<label=MElectric Field '*)cm+M>;
title=MField ;rofile vs ;osition % at 8pplied Jias=#!"$0*>M>;
figure=&>
%plot=CC1N nfNMgMNMBine?idthMN$>
semilog<=CC1N nfNMgMNMBine?idthMN$>
hold on;
%plot=CC1N pfNMbMNMBine?idthMN$>
semilog<=CC1N pfNMbMNMBine?idthMN$>
Clabel=MC 'um+M>;
<label=MElectron P :ole Densities '1)cm4-+M>;
title=MElectron P :ole Densities vs ;osition % at 8pplied Jias=#!"$0*>M>;
legend=MnMNMpM>;
%aCis='# "!20 # 1#!$e12+>
figure=1#>
%plot=CC1N roNMbMNMBine?idthMN$>
plot=CC1N q5roNMbMNMBine?idthMN$>
Clabel=MC 'um+M>;
%<label=M1otal Charge Densit< '1)cm4-+M>;
<label=M1otal Charge Densit< 'C)cm4-+M>;
title=M1otal Charge Densit< vs ;osition % at 8pplied Jias=#!"$0*>M>;
%aCis='#!0 0 %-e12 .e12+>
figure=11>
plot=*plotN (total=HN$>NMrMNMBine?idthMN$>
hold on
plot=*plotN (hole=HN$>NMgMNMBine?idthMN$>
hold on
plot=*plotN (elec=HN$>NMbMNMBine?idthMN$>
Clabel=M*8 '*+M>;
<label=M1otal Current Densit< '8mp)cm4$+M>;
title=M3 vs * ;lotM>;
legend=M(totalMNM(holeMNM(elecMNM$M>;
figure=1$>
plot=*plotN (total=HN$>NMrMNMBine?idthMN$>
Clabel=M*8 '*+M>;
<label=M1otal Current Densit< '8mp)cm4$+M>;
title=M3 vs * ;lotM>;
%legend=M(totalMNM(holeMNM(elecMNM$M>;
figure=1->
plot=CC1N(total==round==1otalASteps>%1>>NH>NMbMNMBine?idthMN$>
Clabel=MC 'um+M>;
<label=M1otal Current Densit< '8)cm4$+M>;
title=M1otal Current Densit< vs ;osition % at 8pplied Jias=#!"$0*>M>;
aCis='# 2 # "+>;
Pina(pani )a*a( (++5$3$+%+) 33
Assignment 5 1D Drift Diffusion pn Diode simulator
%figure=0>
%plot=CC1N n>
%hold all
%plot=CC1N p>
save condAband CC1 Ec;
save totAcharge CC1 ro;
save elAfield CC1 elAfield1 elAfield$;
save npAdata CC1 nf pf;
save potA1 fi;
Pina(pani )a*a( (++5$3$+%+) 33

Vous aimerez peut-être aussi