Text this: Numerical simulation and optimisation of organic light emitting diodes and photovoltaic cells