#! /usr/bin/env python
# -*- coding:utf8 -*-
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize as op
from math import *
# data: "The case for a national research program on semiconductor lighting" Sandia Report (2000), "Solid-state lighting", Optik & Photonik 2 (2011), and others
# flux in lm/W
flux = zip(
(1968, 0.001, 'GaAsP'),
(1970, 0.0027, 'GaAsP'),
(1972, 0.0041, 'GaAsP'),
(1974, 0.035, 'GaAsPN'),
(1980, 0.062, 'GaAsPN'),
(1983, 0.12, 'GaAlAs'),
(1987, 0.41, 'GaAlAs'),
(1989, 0.78, 'GaAlAs'),
(1992, 1.2, 'GaAlInP'),
(1995, 2.6, 'GaAlInP'),
(1996, 3.9, 'GaAlInP'),
(1998, 11., 'GaAlInP'),
(1999, 17., 'GaAlInP'),
(2000, 46., 'GaAlInP'),
(2005, 170., 'GaAlInP'),
(2003, 110., 'GaInN'),
(2006, 310., 'GaInN'),
(2007, 460., 'GaInN'),
(2009, 1.7e3, 'GaInN'),
(2010, 5.3e3, 'GaInN')
)
# cost in $/lm
cost = zip(
(1973, 53., 'GaAsP'),
(1976, 9.2, 'GaAsPN'),
(1979, 6.2, 'GaAsPN'),
(1981, 3.6, 'GaAsPN'),
(1983, 2.1, 'GaAlAs'),
(1987, 0.64, 'GaAlAs'),
(1989, 0.32, 'GaAlAs'),
(1994, 0.28, 'GaAlInP'),
(1996, 0.14, 'GaAlInP'),
(1997, 0.10, 'GaAlInP'),
(1999, 0.099, 'GaAlInP'),
(2000, 0.077, 'GaAlInP'),
(2001, 0.059, 'GaAlInP'),
(2003, 0.022, 'GaAlInP'),
(2005, 0.017, 'GaAlInP'),
(2007, 0.0096, 'GaInN'),
(2009, 0.0076, 'GaInN'),
(2010, 0.0038, 'GaInN')
)
fig = plt.figure(figsize=(520 / 90.0, 340 / 90.0), dpi=72)
plt.plot(flux[0], flux[1], 'ro', mew=0.8, label='flux / package [lm]')
plt.plot(cost[0], cost[1], 'bD', mew=0.8, label='cost / lumen [$/lm]')
def line(p, x):
return p[0] * (x - p[1])
flux_line = op.minimize(lambda p, x, y: sum((line(p, x) - np.log10(y))**2), x0=(0.1, 2000), args=(np.array(flux[0]), np.array(flux[1])))
trange = np.linspace(1967.5, 2016, 100)
plt.plot(trange, 10**line(flux_line.x, np.array(trange)), 'r-')
cost_line = op.minimize(lambda p, x, y: sum((line(p, x) - np.log10(y))**2), x0=(0.1, 2000), args=(np.array(cost[0]), np.array(cost[1])))
plt.plot(trange, 10**line(cost_line.x, np.array(trange)), 'b-')
plt.gca().tick_params(axis='both', which='major', labelsize=14.4)
plt.gca().set_yscale('log')
plt.grid(True)
plt.xlim(1966, 2017)
plt.ylim(0.6e-3, 1e4)
plt.legend(loc='upper left')
plt.tight_layout()
plt.savefig('Haitz-law.svg')