%run init.ipynb

def pf(t,r):
    f = (1-r**t)/(1-r) - t
    return f

from mpl_toolkits import mplot3d
def pf_3d(th,ph):
    import matplotlib
    matplotlib.rcParams.update({'font.size':12}); 
    #plt.figure(figsize = (6,4,4), dpi = 100)
    x = np.linspace(0, 1, 20)
    y = np.linspace(0, 1, 20) 
    X, Y = np.meshgrid(x, y)
    Z = pf(X,Y)
    fig = plt.figure(); 
    ax = plt.axes(projection="3d")
    ax.plot_wireframe(X, Y, Z, color='blue')
    ax.set_xlabel(r'$\lambda$')
    ax.set_ylabel(r'$t$'); ax.set_zlabel(r'$r$')
    ax.view_init(th, ph)
    fig.tight_layout()
    plt.show()
interactive(pf_3d, th = (0,90,10), ph = (0,360,10))

import numpy as np
import math
from matplotlib import pyplot as plt
x = np.arange(0.1,5,0.1) # d tau/dt
y = np.log(np.sinh(x/2)/math.sinh(1/2)) #faz beta*hbat*omega/2 = 1
plt.plot(x,y)
plt.show()

x = np.arange(0,10,0.1) # x = hb*omega, kT=1
y1 = np.exp(-x) # dtau/dt = 1
y2 = np.exp(-0.5*x) # dtau/dt = 0.5
y3 = np.exp(-1.5*x) # dtau/dt = 1.5
plt.plot(x,y1,label='1')
plt.plot(x,y2,label='0.5')
plt.plot(x,y3,label='1.5')
plt.legend()
plt.show()