from matplotlib import pyplot as plt
from math import *
V0=[0,0.5,1,1.5,2,2.5,3,3.6,4.5,5.5,6,6.5,7,7.5,8,8.7,9.1,9.3,9.7,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15.5,16.5,17.5,18,19,20,21,22,23,24,25]
V1=[5.5,6,6.5,7,7.5,8,8.7,9.1,9.3,9.7,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15.5,16.5,17.5,18,19,20]
pH=[1.11,1.11,1.12,1.14,1.17,1.2,1.22,1.26,1.33,1.44,1.51,1.59,1.7,1.84,2.04,2.96,8.07,8.35,8.64,8.81,9.06,9.25,9.46,9.67,9.95,10.4,11.12,11.47,11.67,11.92,12.04,12.15,12.19,12.26,12.32,12.37,12.41,12.45,12.48,12.5]
conduct=[19.75,18.46,17.28,16.12,14.85,13.72,12.07,11.8,11.73,11.59,11.49,11.32,11.18,11.02,10.88,10.74,10.67,10.98,11.58,12.21,13.62,14.88,16.14,16.74,17.95,19.2]
derivpH=[0]
V9=[8.7,9.1,9.3,9.7,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15.5,16.5,17.5,18,19,20,21,22,23,24,25]
for i in range(1,len(V0)):
    derivpH.append((pH[i]-pH[i-1])/(V0[i]-V0[i-1]))

gran=[]
for i in range(len(V0)):
    a=(100+V0[i])*(10**(-1*pH[i]))
    gran.append(a)

gran1=[]
for i in range (len(V9)):
    a=(V9[i]-8.7)*(10**(-1*pH[i]))
    gran1.append(a)
V3=[e-8.7 for e in V9]
plt.plot(V3,gran1)
print(gran1)
plt.show()
#plt.show()
#plt.plot(V0,pH)
#plt.plot(V0,pH,"r"'+')
#plt.plot(V0,derivpH)
#plt.show()
#plt.plot(V1,conduct,'+')
#plt.show()

