import matplotlib.pyplot as plt
import numpy as np

def flory_schulz(x, A, B, Gamma, sigma):
    return A*(1-(1+sigma**2*Gamma*x)**(-1/sigma**2))+B

def exponential(x, A, B, Gamma):
    return A*(1-np.exp(-Gamma*x))+B

x = np.logspace(-2, 2, num=200)

y1 = flory_schulz(x, 1, 0, 1, 1)
plt.semilogx(x, y1, 'b-', label=r'$\sigma^2=1$')
y2 = flory_schulz(x, 1, 0, 1, np.sqrt(0.5))
plt.semilogx(x, y2, 'r-', label=r'$\sigma^2=0.5$')
y3 = flory_schulz(x, 1, 0, 1, np.sqrt(0.1))
plt.semilogx(x, y3, 'k-', label=r'$\sigma^2=0.1$')
y4 = exponential(x, 1, 0, 1)
plt.semilogx(x, y4, '--', color='gray', label=r'exponential')
plt.xlabel(r'$\Delta t$')
plt.ylabel(r'$D(\Delta t)$')
plt.legend()
plt.show()