<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Steady-state simulation of organic light emitting cell
This is an example of steady-state simulation of the light emitting electrochemical cell.
It attempts to reproduce reference. Exact agreement is not achieved probably because of missing details regarding the electrode model. As in the reference, the temperature equal to 2500 K is assumed.
Step1:  Model and parameters
Step2:  Results
Distribution of cations and anions
Step3:  Distribution of the electric field
Step4:  Distribution of electrons and holes
Step5:  Distribution of holes near to contact
Step6:  Comparison between drift and diffusion parts of the current
<ASSISTANT_TASK:>
Python Code:
from oedes.fvm import mesh1d
from oedes import progressbar, testing, init_notebook, models, context
init_notebook()
%matplotlib inline
import matplotlib.pylab as plt
import numpy as np
Explanation: Steady-state simulation of organic light emitting cell
This is an example of steady-state simulation of the light emitting electrochemical cell.
It attempts to reproduce reference. Exact agreement is not achieved probably because of missing details regarding the electrode model. As in the reference, the temperature equal to 2500 K is assumed.
End of explanation
params = {'T': 2500.,
          'electron.mu': 1e-6,
          'electron.energy': 0.,
          'electron.N0': 5e26,
          'hole.mu': 1e-6,
          'hole.energy': -5.,
          'hole.N0': 5e26,
          'electrode0.workfunction': 2.5,
          'electrode0.voltage': 2.,
          'electrode1.workfunction': 2.5,
          'electrode1.voltage': 0.,
          'cation.mu': 1e-6,
          'anion.mu': 1e-6,
          'npi': 2e43,
          'epsilon_r': 3.
          }
L = 350e-9
mesh = mesh1d(L=L, epsilon_r=3.4)
cinit = 1.25e25
model = models.BaseModel()
models.std.electronic_device(model, mesh, 'pn')
cation, anion, ic = models.std.add_ions(model, mesh, zc=1, za=-1)
model.setUp()
xinit=ic(cinit=1e24)
c=context(model,x=xinit)
c.transient(params,1,1e-10, reltol=1, abstol=1e15, relfail=20.)
o = c.output()
m = mesh
Explanation: Model and parameters
End of explanation
plt.plot(m.cells['center'] / L - 0.5, o['cation.c'], '.-', label='cations')
plt.plot(m.cells['center'] / L - 0.5, o['anion.c'], '.-', label='anions')
testing.store(o['cation.c'], rtol=1e-6)
testing.store(o['anion.c'], rtol=1e-6)
plt.yscale('log')
plt.legend(loc=0, frameon=False)
plt.ylabel('carrier density [$m^{-3}$]')
plt.xlabel('distance [reduced units]')
plt.xlim([-0.5, 0.5])
plt.ylim([1e23, 1e27])
Explanation: Results
Distribution of cations and anions
End of explanation
testing.store(o['E'], rtol=1e-6)
plt.plot(m.faces['center'] / L - 0.5, o['E'], '.-')
plt.yscale('log')
plt.ylim([1e4, 1e10])
plt.xlim([-0.5, 0.5])
plt.xlabel('distance [reduced units]')
plt.ylabel('electric field [$Vm^{-1}$]')
Explanation: Distribution of the electric field
End of explanation
plt.plot(m.cells['center'] / L - 0.5, o['hole.c'], '.-', label='holes')
plt.plot(m.cells['center'] / L - 0.5, o['electron.c'], '.-', label='electrons')
plt.plot(
    m.cells['center'] /
    L -
    0.5,
    o['R'] *
    0.5e-7,
    '.-',
    label='recombination zone')
testing.store(o['hole.c'], rtol=1e-6)
testing.store(o['electron.c'], rtol=1e-6)
testing.store(o['R'], rtol=1e-6)
plt.xlabel('distance [reduced units]')
plt.ylabel('carrier density [$m^{-3}$]')
plt.xlim([-0.5, 0.5])
plt.legend(loc=0, frameon=False)
Explanation: Distribution of electrons and holes
End of explanation
plt.plot(m.cells['center'] / L - 0.5, o['hole.c'], '.-', label='holes')
plt.xlabel('distance [reduced units]')
plt.ylabel('carrier density [$m^{-3}$]')
plt.xlim([-0.505, -0.4])
plt.legend(loc=0, frameon=False)
Explanation: Distribution of holes near to contact
End of explanation
testing.store(o['hole.jdrift'], rtol=1e-6)
testing.store(o['hole.jdiff'], rtol=1e-6)
testing.store(o['electron.jdrift'], rtol=1e-6)
testing.store(o['electron.jdiff'], rtol=1e-6)
plt.plot(
    m.faces['center'] /
    L -
    0.5,
    o['hole.jdrift'] /
    np.amax(
        o['hole.jdrift']),
    '.-',
    label='$j^p_{drift}$')
plt.plot(
    m.faces['center'] /
    L -
    0.5,
    o['hole.jdiff'] /
    np.amax(
        o['hole.jdrift']),
    '.-',
    label='$j^p_{diff}$')
plt.xlim([-0.6, 0.1])
plt.legend(loc=0, frameon=False)
plt.xlabel('distance [reduced units]')
plt.ylabel('normalized current density')
Explanation: Comparison between drift and diffusion parts of the current
End of explanation
<END_TASK>