#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 28 15:47:12 2018

@author: Alain
"""
import matplotlib.pyplot as plt
from math import log
from utilitaire_solution import *

theta=[35,40,45,50]
k=[0.188,0.257,0.354,0.477]

unSurT = [1/(t+273) for t in theta]
lnk = [log(x) for x in k]

a,b,r = regrelin(unSurT, lnk)

print("Energie d'activation : ", round(- 8.314*a/1000 ), " kJ/mol") 
print("r^2 = ", r**2)

plt.plot(unSurT, lnk,'o')
plt.plot([unSurT[0], unSurT[len(unSurT)-1]], [a*unSurT[0]+b, a*unSurT[len(unSurT)-1]+b])
plt.show()