• 0 Posts
  • 27 Comments
Joined 1 year ago
cake
Cake day: July 6th, 2023

help-circle


  • Here you go, you’ll need numpy, scipy and matplotlib:

    from scipy.optimize import curve_fit
    from matplotlib import pyplot as plt
    
    # 2010-2013 data from https://ourworldindata.org/renewable-energy [TWh]
    y = np.array([32, 63, 97, 132, 198, 256, 328, 445, 575, 659, 853, 1055, 1323, 1629])
    x = np.arange(0, len(y))
    
    # function we expect the data to fit
    fit_func = lambda x, a, b, c: a * np.exp2(b * x ) + c
    popt, _ = curve_fit(fit_func, x, y, maxfev=5000)
    
    fig, ax = plt.subplots()
    ax.scatter(x + 2010, y, label="Data", color="b", linestyle=":")
    ax.plot(x + 2010, fit_func(x, *popt), color="r", linewidth=3.0, linestyle="-", label='best fit curve: $y={0:.3f} * 2^{{{1:.3f}x}} + {2:.3f}$'.format(*popt))
    plt.legend()
    plt.show()
    

    Here’s what I get, global solar energy generated doubles every ~3.5 (1/0.284) years.














  • A moral cause in one country can be an evil wrongdoing in other. Case in point - Al-Qaeda was formed because US troops were deployed in some country in the middle east to defend someone.

    Uhm, where did you get that from?

    Anyway, I get your point, but your example only shows that morality doesn’t really stop at borders for most people.

    I’m okay with helping Ukraine. I’m not okay if it’s helping only to fuck with Russia.

    If it’s to stop an authoritarian state from taking over a democratic state it’s good for me. If it’s because of other less ulterior motives (and let’s not kid ourselves, it’s at least partly because of that), I don’t mind. Is it bad when a doctor only saves lives because it pays well?