Skip to content
Snippets Groups Projects
Commit ec0ebca0 authored by Kostas Vilkelis's avatar Kostas Vilkelis :flamingo:
Browse files

add band diagram

parent 596d0a1e
No related branches found
No related tags found
1 merge request!107Write up np junctions
Pipeline #59802 passed
......@@ -5,10 +5,16 @@ import numpy as np
from scipy.optimize import curve_fit
from scipy.integrate import quad
import plotly.offline as py
import plotly.graph_objs as go
from common import draw_classic_axes, configure_plotting
configure_plotting()
py.init_notebook_mode(connected=True)
def sqrt_plus(x):
return np.sqrt(x * (x >= 0))
......@@ -204,7 +210,233 @@ The main idea is to plot the dependence of various energies ($E_F$, bottom of co
So here is our problem for today:
![](figures/band_diagram_question.svg)
```python
def trans(x, a, b):
x = (x-a)/(b-a)
return h(x)/(h(x) + h(1-x))
def h(x):
return (x > 0) * np.exp(-1/x)
left_cutoff = 0.3
right_cutoff = 0.7
x = np.linspace(0, 1, 100)
mid_idx = (x > left_cutoff) * (x < right_cutoff)
Ef_p = 0.5
Ef_n = Ef_p + 0.25
Ef_delta = Ef_n - Ef_p
E_C_1 = 1
E_V_1 = 0.25
E_C = E_C_1 - trans(x, left_cutoff, right_cutoff)*Ef_delta
E_V = E_V_1 - trans(x, left_cutoff, right_cutoff)*Ef_delta
fig1 = go.Figure()
fig1.add_trace(go.Scatter(
x = [0, left_cutoff],
y = [E_V_1, E_V_1],
line_color = 'red',
mode = 'lines',
name = r'$E_V$',
))
fig1.add_trace(go.Scatter(
x = [0, left_cutoff],
y = [E_C_1, E_C_1],
line_color = 'blue',
mode = 'lines',
name = r'$E_C$',
))
# n bands (button 1)
fig1.add_trace(go.Scatter(
x = [right_cutoff, 1],
y = [E_V_1, E_V_1],
line_color = 'red',
mode = 'lines',
showlegend=False
))
fig1.add_trace(go.Scatter(
x = [right_cutoff, 1],
y = [E_C_1, E_C_1],
line_color = 'blue',
mode = 'lines',
showlegend=False
))
# p fermi
fig1.add_trace(go.Scatter(
x = [0, left_cutoff],
y = [Ef_p, Ef_p],
line_color='black',
mode = 'lines',
line_dash='dot',
name=r'$E_F$'
))
# n fermi (button 1)
fig1.add_trace(go.Scatter(
x = [right_cutoff, 1],
y = [Ef_n, Ef_n],
line_color='black',
mode = 'lines',
line_dash='dot',
name='r$E_f$',
showlegend=False
))
fig1.add_trace(go.Scatter(
x = [right_cutoff, 1],
y = [E_V_1-Ef_delta, E_V_1-Ef_delta],
line_color = 'red',
mode = 'lines',
showlegend=False,
visible=False
))
fig1.add_trace(go.Scatter(
x = [right_cutoff, 1],
y = [E_C_1-Ef_delta, E_C_1-Ef_delta],
line_color = 'blue',
mode = 'lines',
showlegend=False,
visible=False
))
fig1.add_trace(go.Scatter(
x = [0, 1],
y = [Ef_p, Ef_p],
line_color='black',
mode = 'lines',
line_dash='dot',
name='r$E_F$',
visible=False,
))
fig1.add_trace(go.Scatter(
x = x[mid_idx],
y = E_C[mid_idx],
line_color='blue',
line_dash='dot',
visible=False,
showlegend=False
))
fig1.add_trace(go.Scatter(
x = x[mid_idx],
y = E_V[mid_idx],
line_color = 'red',
line_dash='dot',
visible=False,
showlegend=False
))
updatemenus=list([
dict(
type="buttons",
direction="down",
active=0,
buttons=list([
dict(label="n and p",
method="update",
args=[{"visible": [True, True, True, True, True, True, False, False, False, False, False]}]),
dict(label="Equilibrium",
method="update",
args=[{"visible": [True, True, False, False, False, False, True, True, True, False, False]}]),
dict(label="Band Bending",
method="update",
args=[{"visible": [True, True, False, False, False, False, True, True, True, True, True]}]),
]),
)
]
)
layout = dict(
dragmode=False,
showlegend = True,
updatemenus=updatemenus,
plot_bgcolor = 'rgb(254, 254, 254)',
yaxis_range=[(E_V_1-Ef_delta)-0.1, 0.1+E_C_1],
xaxis_range=[-0.05, 1.05],
width = 800,
height = 600,
xaxis=dict(title=r'$x$', showticklabels=False),
yaxis=dict(title=r'$E$', showticklabels=False),
title='Band Diagram'
)
fig1.update_xaxes(showline=True, linewidth=2, linecolor='black')
fig1.update_yaxes(showline=True, linewidth=2, linecolor='black')
fig1.add_annotation(
x = 1.065,
y = -0.1,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "",
ax = 0.9,
ay = -0.1,
showarrow=True,
arrowhead=3,
arrowsize=30,
arrowwidth=0.1,
arrowcolor='black')
fig1.add_annotation(
x = -0.05,
y = 1.12,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "",
ax = -0.05,
ay = 1.1,
showarrow=True,
arrowhead=3,
arrowsize=30,
arrowwidth=0.1,
arrowcolor='black')
fig1.add_annotation(
showarrow=False,
x = 0.15,
y = -0.05,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "p-region")
fig1.add_annotation(
showarrow=False,
x = 0.5,
y = -0.05,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "depletion region")
fig1.add_annotation(
showarrow=False,
x = 0.85,
y = -0.05,
xref = "x", yref = "y",
axref = "x", ayref = "y",
text = "n-region")
fig1.update_layout(layout)
py.plot(fig1)
fig1.show()
```
The main difference between $n$-type and $p$-type semiconductors is the location of the Fermi level $E_F$.
The Fermi level of an $n$-type semiconductor is close to the donor states.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment