有机电子器件模拟器
oedes的Python项目详细描述
这是正在进行的工作。有关文档,请参见doc/,有关使用示例,请参见examples/。
安装
pip install oedes
建议在安装之后运行测试套件
python -c "import oedes; oedes.test()"
示例模拟
建立并求解了pn结突变的模型:
importoedesfromoedesimportmodels# Define doping profiledefdoping_profile(mesh,ctx,eq):Nd=ctx.param(eq,'Nd')Na=ctx.param(eq,'Na')returnoedes.ad.where(mesh.x<mesh.length*0.5,Nd,-Na)# Define device modelpoisson=models.PoissonEquation()temperature=models.ConstTemperature()electron=models.BandTransport(poisson=poisson,name='electron',z=-1,thermal=temperature)hole=models.BandTransport(poisson=poisson,name='hole',z=1,thermal=temperature)doping=models.FixedCharge(poisson,density=doping_profile)semiconductor=models.Electroneutrality([electron,hole,doping],name='semiconductor')recombination=models.DirectRecombination(semiconductor)anode=models.OhmicContact(poisson,semiconductor,'electrode0')cathode=models.OhmicContact(poisson,semiconductor,'electrode1')equations=[poisson,temperature,electron,hole,doping,semiconductor,anode,cathode,recombination]# Define device parametersparams={'T':300,'epsilon_r':12,'Na':1e24,'Nd':1e24,'hole.mu':1,'electron.mu':1,'hole.energy':-1.1,'electron.energy':0,'electrode0.voltage':0,'electrode1.voltage':0,'hole.N0':1e27,'electron.N0':1e27,'beta':1e-9}# Discretize and solve discrete modelmesh=oedes.fvm.mesh1d(100e-9)model=oedes.fvm.discretize(equations,mesh)c=oedes.context(model)c.solve(params)# Plot bands and quasi Fermi potentialsimportmatplotlib.pylabaspltp=c.mpl(plt.gcf(),plt.gca())p.plot(['electron.Eband'],label='$E_c$')p.plot(['hole.Eband'],label='$E_v$')p.plot(['electron.Ef'],linestyle='--',label='$E_{Fn}$')p.plot(['hole.Ef'],linestyle='-.',label='$E_{Fp}$')p.apply_settings({'xunit':'n','xlabel':'nm'})p.ax.legend(loc=0,frameon=False)plt.show()