"""別ファイルの関数をimportして、占有された状態密度を描く。"""
import numpy as np
import matplotlib.pyplot as plt
from fd import fd
from dos import dos


def plot(E, nE):
    plt.figure()
    plt.plot(E, nE)
    plt.xlabel("Energy (eV)")
    plt.ylabel("DOS x f (electrons / (eV m$^3$))")
    plt.title("Occupied density of states")
    plt.grid()
    plt.tight_layout()
    plt.show()


def main():
    T = 1000  # K
    EF = 1
    EC = 0
    meff = 1
    Emin, Emax = -1, 2
    E = np.linspace(Emin, Emax, 501)
    nE = fd(T, E, EF) * dos(E, EC, meff)
    plot(E, nE)


if __name__ == "__main__":
    main()
