28.【Visualization】Viewing pn-Junction Band Structures with 3D Animation

tags: [“Semiconductor”, “pn Junction”, “Visualization”, “Python”, “matplotlib”]


What’s Hard to See in Static Diagrams? 🤔

In textbooks, pn-junction band diagrams are usually shown like this:

However, in a real pn junction, multiple factors interact simultaneously:

As a result, the band structure
continuously deforms depending on conditions.

With static diagrams,
it is honestly difficult to grasp
this flow of change caused by varying conditions.


🎞 Viewing It as a 3D Animation

To address this, the pn-junction band structure was visualized in 3D:

Position × Bias × Energy

pn band energy surface

Meaning of Each Axis

👉 Instead of thinking
👉 “the band bends”,
👉 you can intuitively see that
👉 an energy surface moves as conditions change.


🧩 GIF Generation Code (Excerpt)

This GIF was generated using Python (matplotlib),
by incrementally adding bias conditions step by step.

from matplotlib.animation import FuncAnimation

ani = FuncAnimation(fig, update, frames=Nv, interval=200)
ani.save("pn_band_energy_surface.gif", writer="pillow", fps=5)

📌 The key point:
📌 This is not an animation of rotating a 3D plot,
📌 but an animation that accumulates conditions over time.


📎 Python Code Used

The full code used to generate the GIF is available here 👇

Running it as-is will output
the same GIF used in this article.


✨ What This Visualization Aims to Convey

The goal is to grasp these ideas
as mental images before diving into equations or text.

In the next article,
the same visualization approach will be applied to
control theory (P control) 👉