# Rappel:
# la virgule permet de séparer des valeurs dans une liste
# le point sert à entrer des valeurs décimles
# Compléter les lignes 9 et 10 avec vos listes de valeurs
from matplotlib import pyplot as plt
import numpy as np
pH=np.array([1,2]) #remplacer les ??
c=np.array([0.1,0.01]) #remplacer les ??
pHth=np.array([])
pHth=-np.log10(c)
print("pH :",pH)
print("concentrations :",c)
print("pH calculé avec la relation :",pHth)
a,b = np.polyfit(pHth,pH,1)
plt.plot(pHth,a*pHth+b,'b-',label='modélisation')
plt.plot(pHth,pH,'ro',label='points expérimentaux')
print("Modélisation : pH =",round(a,2),'pHth')
incert=np.array([])
incert = np.abs(pH-pHth)/0.05
print(incert)
plt.grid()
plt.title("Modèle mathématique")
plt.xlabel("pHth")
plt.ylabel("pH")
plt.xlim(0,6)
plt.ylim(0,6)
plt.legend()
plt.show()
Click Run or press shift + ENTER to run code