PN diode example (1D): Difference between revisions

From Flooxs
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
To compare the numerical results with an analytical solution, the built-in voltage is solved both numerically and analytically in this example.  The results are shown at the end.
This example builds on the 1D resistor example, showing how to create a floods structure with a doping profile that varies with x. After solving, the example compares floods's numerical results with an analytical solution.


Define constants
== New Concepts ==
set eps [expr 11.8 * 8.854e-14 / 1.619e-19]
* refining the grid with non-tagged lines
set Emob 200.0;
* Doping=f(x) : use "sel z="
set Hmob 100.0;
* "sel z=" if-then-else syntax (?:)
* tcl "foreach"


Define Poisson and continuity equations
== 1D PN Diode Deck ==
  set eqnP "$eps * grad(DevPsi) + Doping - Elec + Hole"
Create 1D structure - [[PN diode example 1D - Create 1D structure explanation | explanation]]
  set eqnE "ddt(Elec) - $Emob * 0.025 * sgrad(Elec, DevPsi/0.025)"
#Grid
  set eqnH "ddt(Hole) - $Hmob * 0.025 * sgrad(Hole, -DevPsi/0.025)"
  #line x loc=0.0 spac=.01 tag=Top
  #line x loc=0.4 spac=0.01
  #line x loc=0.7 spac=0.01
#line x loc=2.0 spac=0.05 tag=Bottom


  pdbSetDouble Si DevPsi DampValue 0.025
  line x loc=0.0 spac=0.1 tag=Top
  pdbSetDouble Si DevPsi Abs.Error 1.0e-9
  line x loc=0.5 spac=0.01
pdbSetString Si DevPsi Equation $eqnP
  line x loc=1.0 spac=0.1 tag=Bottom
pdbSetString Si Elec Equation $eqnE
  pdbSetDouble Si Elec Abs.Error 1.0e-5
pdbSetString Si Hole Equation $eqnH
pdbSetDouble Si Hole Abs.Error 1.0e-5


  pdbSetDouble top Hole Abs.Error 1.0e-8
  mater add name=Silicon
  pdbSetDouble top Elec Abs.Error 1.0e-8
region Silicon xlo=Top xhi=Bottom
  pdbSetDouble top DevPsi Abs.Error 1.0e-6
init
  pdbSetDouble top Hole Rel.Error 1.0e-2
  pdbSetDouble top Elec Rel.Error 1.0e-2
#Contacts
  pdbSetDouble top DevPsi Rel.Error 1.0e-2
contact name=VSS Silicon xlo=-0.1 xhi=0.1 add
  pdbSetDouble top DevPsi Flux.Scale 1.619e-19
  contact name=GND Silicon xlo=0.9  xhi=1.1 add
  pdbSetDouble top Elec Flux.Scale 1.619e-19
 
  pdbSetDouble top Hole Flux.Scale 1.619e-19
Declare solution variables
DevicePackage
  solution add name=DevPsi pde solve negative damp
solution add name=Elec  pde solve !negative
  solution add name=Hole   pde solve !negative
 
Define constants
set T 300.0
set k 1.38066e-23
  set q 1.619e-19
  set Vt [expr {$k*$T/$q}]
set ni 1.1e10
  set esi [expr 11.8 * 8.85418e-14]
set eps [expr $esi / $q]
  set Emob 350.0
set Hmob 150.0
  set small 1.0e-10


pdbSetDouble ReflectBottom Hole Abs.Error 1.0e-8
Ionized dopant profile - [[PN diode example 1D - Ionized dopant profile explanation | explanation]]
pdbSetDouble ReflectBottom Elec Abs.Error 1.0e-8
  sel z=1.0e20*(x<0.5) name=Nd
  pdbSetDouble ReflectBottom DevPsi Abs.Error 1.0e-6
  sel z=1.0e17 name=Na
pdbSetDouble ReflectBottom Hole Rel.Error 1.0e-2
  sel z=(Nd-Na) name=Doping
  pdbSetDouble ReflectBottom Elec Rel.Error 1.0e-2
  pdbSetDouble ReflectBottom DevPsi Rel.Error 1.0e-2


  pdbSetBoolean top Elec Fixed 1
  #plot doping
  pdbSetBoolean top Hole Fixed 1
  sel z=Doping
pdbSetBoolean top DevPsi Fixed 1
  plot.1d
pdbSetBoolean top Elec Flux 1
pdbSetBoolean top Hole Flux 1
pdbSetBoolean top DevPsi Flux 1
pdbSetString top Elec Equation {Doping - Elec + Hole}
pdbSetString top Hole Equation {DevPsi + 0.025*log((Hole+1.0e-10)/1.0e10) - top}
  pdbSetString top DevPsi Equation {DevPsi - 0.025*log((Elec+1.0e-10)/1.0e10) - top}


  pdbSetBoolean ReflectBottom Elec Fixed 1
  #sel z=1.0e20*(x<0.5)-1.0e17 name=Doping
pdbSetBoolean ReflectBottom Hole Fixed 1
pdbSetBoolean ReflectBottom DevPsi Fixed 1
pdbSetBoolean ReflectBottom Elec Flux 1
pdbSetBoolean ReflectBottom Hole Flux 1
pdbSetBoolean ReflectBottom DevPsi Flux 1
pdbSetString ReflectBottom Hole Equation "Doping - Elec + Hole"
pdbSetString ReflectBottom Elec Equation "DevPsi - 0.025*log((Elec+1.0e-10)/1.0e10)"
pdbSetString ReflectBottom DevPsi Equation "DevPsi + 0.025*log((Hole+1.0e-10)/1.0e10)"


Establish the grid and initialize
Bulk Equations
  line x loc=0.0 spac=.01 tag=Top
  set eqnP "$eps * grad(DevPsi) + $Doping - Elec + Hole"
  line x loc=0.4 spac=0.01
  set eqnE "ddt(Elec) - ($Emob) * $Vt * sgrad(Elec, DevPsi/$Vt)"
  line x loc=0.7 spac=0.01
  set eqnH "ddt(Hole) - ($Hmob) * $Vt * sgrad(Hole, -DevPsi/$Vt)"
  line x loc=2.0 spac=0.05 tag=Bottom
  pdbSetString Silicon DevPsi Equation $eqnP
  region silicon xlo=Top xhi=Bottom
  pdbSetString Silicon Elec  Equation $eqnE
  init
  pdbSetString Silicon Hole  Equation $eqnH


pdbSetDouble Silicon DevPsi DampValue $Vt
pdbSetDouble Silicon DevPsi Abs.Error 1.0e-9
pdbSetDouble Silicon Elec  Abs.Error 1.0e-5
pdbSetDouble Silicon Hole  Abs.Error 1.0e-5


Create the contact
Contact Equations
  contact name=top silicon xlo=-0.1 xhi=0.1 add
  proc OhmicContact {Contact} {
contact name=top current=1.619e-19*(Hole-Elec) voltage supply=0.0
    global Vt ni Nd Na
    pdbSetBoolean $Contact Elec Flux 1
    pdbSetBoolean $Contact Hole Flux 1
    pdbSetBoolean $Contact DevPsi Flux 1
    pdbSetBoolean $Contact Elec Fixed 1
    pdbSetBoolean $Contact Hole Fixed 1
    pdbSetBoolean $Contact DevPsi Fixed 1
    pdbSetDouble $Contact Elec Flux.Scale 1.619e-19
    pdbSetDouble $Contact Hole Flux.Scale 1.619e-19
    pdbSetString $Contact DevPsi Equation "$Nd - $Na - Elec + Hole"
    pdbSetString $Contact Elec Equation "DevPsi - $Vt*log((Elec)/$ni) -$Contact"
    pdbSetString $Contact Hole Equation "DevPsi + $Vt*log((Hole)/$ni) -$Contact"
}
OhmicContact VSS
OhmicContact GND


Initial guesses
Initial Conditions - [[PN diode example 1D - Initial conditions explanation | explanation]]
  sel z=1.0e20*(x<0.5)-1.0e17 name=Doping
  #Bias contacts
  sel z=0.5*(Doping+sqrt(Doping*Doping+4.0e20))/1.0e10 name=arg
  contact name=VSS voltage supply=0.0
sel z=0.025*log(arg) name=DevPsi
  contact name=GND voltage supply=0.0
  sel z=1.0e10*exp(DevPsi/0.025) name=Elec
sel z=1.0e10*exp(-DevPsi/0.025) name=Hole


solve
#Initial Guess
sel z= {(Doping>0.0)
            ?  ( 0.025*log( (Doping+$small) / $ni))
            :  (-0.025*log(-(Doping+$small) / $ni))} name = DevPsi
sel z=$ni*exp(DevPsi/$Vt)  name=Elec
sel z=$ni*exp(-DevPsi/$Vt) name=Hole
1st DC Solve at Equilibrium (0V)
  device
  device
  puts "Electron Flux [contact name=top sol=Elec flux]"
  puts "Electron Flux [contact name=top sol=Elec flux]"
  puts "Hole Flux [contact name=top sol=Hole flux]"
  puts "Hole Flux [contact name=top sol=Hole flux]"


Plot the concentration profiles of the initial doping and electrons and holes at equilibrium
#Plot the equilibrium concentration profiles
  sel z=log10(abs(Doping))
  foreach var {Doping Elec Hole} {
plot.1d
    sel z=log10(abs($var+1.0))
sel z=log10(Elec)
    plot.1d !cle
plot.1d !cle
  }
  sel z=log10(Hole)
plot.1d !cle


initialize an array, bias (Vb) and counter (i), and create and new graph window
Ramp the DC Bias to make I-V plot
#initialize an array, bias (Vb) and counter (i), and create and new graph window
  array set curr {}
  array set curr {}
  set Vb 0.0
  set Vb 0.0
Line 95: Line 117:
  set i 1
  set i 1


For loop that plots the IV curve of the diode in forward bias from 0V to 1.2V
#Ramp from 0.0-1.2V and Plot
  for {set Vb 0.0} {$Vb < 1.2} {set Vb [expr $Vb+0.05]} {
  for {set Vb 0.0} {$Vb < 1.2} {set Vb [expr $Vb+0.05]} {
     contact name=top supply = -$Vb
     contact name=top supply = -$Vb
set Vbias($i) -$Vb   
    set Vbias($i) -$Vb   
device init
    device init
set curr($i) [expr ([contact name=top sol=Elec flux] - [contact name=top sol=Hole flux])]
    set curr($i) [expr ([contact name=top sol=Elec flux] - [contact name=top sol=Hole flux])]
plot.1d !cle
    plot.1d !cle
AddtoLine $Win IV -$Vb $curr($i)
    AddtoLine $Win IV -$Vb $curr($i)
incr i
    incr i
  }
  }



Revision as of 18:02, 5 November 2010

This example builds on the 1D resistor example, showing how to create a floods structure with a doping profile that varies with x. After solving, the example compares floods's numerical results with an analytical solution.

New Concepts

  • refining the grid with non-tagged lines
  • Doping=f(x) : use "sel z="
  • "sel z=" if-then-else syntax (?:)
  • tcl "foreach"

1D PN Diode Deck

Create 1D structure - explanation

#Grid
#line x loc=0.0 spac=.01 tag=Top
#line x loc=0.4 spac=0.01 
#line x loc=0.7 spac=0.01 
#line x loc=2.0 spac=0.05 tag=Bottom
line x loc=0.0 spac=0.1 tag=Top
line x loc=0.5 spac=0.01
line x loc=1.0 spac=0.1 tag=Bottom
mater add name=Silicon
region Silicon xlo=Top xhi=Bottom
init

#Contacts
contact name=VSS Silicon xlo=-0.1 xhi=0.1 add
contact name=GND Silicon xlo=0.9  xhi=1.1 add

Declare solution variables

DevicePackage
solution add name=DevPsi pde solve negative damp
solution add name=Elec   pde solve !negative
solution add name=Hole   pde solve !negative

Define constants

set T 300.0
set k 1.38066e-23
set q 1.619e-19
set Vt [expr {$k*$T/$q}]
set ni 1.1e10
set esi [expr 11.8 * 8.85418e-14]
set eps [expr $esi / $q]
set Emob 350.0
set Hmob 150.0
set small 1.0e-10

Ionized dopant profile - explanation

sel z=1.0e20*(x<0.5) name=Nd
sel z=1.0e17 name=Na
sel z=(Nd-Na) name=Doping
#plot doping
sel z=Doping
plot.1d
#sel z=1.0e20*(x<0.5)-1.0e17 name=Doping

Bulk Equations

set eqnP "$eps * grad(DevPsi) + $Doping - Elec + Hole"
set eqnE "ddt(Elec) - ($Emob) * $Vt * sgrad(Elec, DevPsi/$Vt)"
set eqnH "ddt(Hole) - ($Hmob) * $Vt * sgrad(Hole, -DevPsi/$Vt)"
pdbSetString Silicon DevPsi Equation $eqnP
pdbSetString Silicon Elec   Equation $eqnE
pdbSetString Silicon Hole   Equation $eqnH 
pdbSetDouble Silicon DevPsi DampValue $Vt
pdbSetDouble Silicon DevPsi Abs.Error 1.0e-9
pdbSetDouble Silicon Elec   Abs.Error 1.0e-5
pdbSetDouble Silicon Hole   Abs.Error 1.0e-5

Contact Equations

proc OhmicContact {Contact} {
    global Vt ni Nd Na
    pdbSetBoolean $Contact Elec Flux 1
    pdbSetBoolean $Contact Hole Flux 1
    pdbSetBoolean $Contact DevPsi Flux 1
    pdbSetBoolean $Contact Elec Fixed 1
    pdbSetBoolean $Contact Hole Fixed 1
    pdbSetBoolean $Contact DevPsi Fixed 1
    pdbSetDouble $Contact Elec Flux.Scale 1.619e-19
    pdbSetDouble $Contact Hole Flux.Scale 1.619e-19
    pdbSetString $Contact DevPsi Equation "$Nd - $Na - Elec + Hole"
    pdbSetString $Contact Elec Equation "DevPsi - $Vt*log((Elec)/$ni) -$Contact"
    pdbSetString $Contact Hole Equation "DevPsi + $Vt*log((Hole)/$ni) -$Contact"
}
OhmicContact VSS
OhmicContact GND

Initial Conditions - explanation

#Bias contacts
contact name=VSS voltage supply=0.0
contact name=GND voltage supply=0.0
#Initial Guess
sel z= {(Doping>0.0) 
            ?  ( 0.025*log( (Doping+$small) / $ni))
            :  (-0.025*log(-(Doping+$small) / $ni))} name = DevPsi
sel z=$ni*exp(DevPsi/$Vt)  name=Elec
sel z=$ni*exp(-DevPsi/$Vt) name=Hole

1st DC Solve at Equilibrium (0V)

device
puts "Electron Flux [contact name=top sol=Elec flux]"
puts "Hole Flux [contact name=top sol=Hole flux]"
#Plot the equilibrium concentration profiles
foreach var {Doping Elec Hole} {
    sel z=log10(abs($var+1.0))
    plot.1d !cle
}

Ramp the DC Bias to make I-V plot

#initialize an array, bias (Vb) and counter (i), and create and new graph window
array set curr {}
set Vb 0.0
set Win [CreateGraphWindow]
set i 1
#Ramp from 0.0-1.2V and Plot
for {set Vb 0.0} {$Vb < 1.2} {set Vb [expr $Vb+0.05]} {
   contact name=top supply = -$Vb
   set Vbias($i) -$Vb  
   device init
   set curr($i) [expr ([contact name=top sol=Elec flux] - [contact name=top sol=Hole flux])]
   plot.1d !cle
   AddtoLine $Win IV -$Vb $curr($i)
   incr i
}

Get the last few points on the IV curve to use for linear extrapolation of the built-in voltage

set l [list "$Vbias(24)" "$curr(24)" "$Vbias(23)" "$curr(23)" "$Vbias(22)" "$curr(22)" ]

Fit the data points with "Bestline". The output will give the x-intercept or built-in voltage

Bestline $l

Create a "fit" line to plot on top of IV curve using the data points and "Bestline" x-intercept result

set line [list "$Vbias(24)" "$curr(24)" "$Vbias(23)" "$curr(23)" "$Vbias(22)" "$curr(22)" 0.9998 0] 
CreateSingleLine  $Win Vbi_fit $line


In forward bias (negative voltage applied to the top (n-type) contact), the output IV plot with the absolute value of the built-in voltage equal to 0.9998 is shown below. The built in voltage calculated by the equation Vbi=Vt*ln((Nd*Na)/ni^2) is 0.9786.