Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente Prochaine révisionLes deux révisions suivantes | ||
teaching:progappchim:ph-3d [2014/02/17 11:04] – créée villersd | teaching:progappchim:ph-3d [2017/02/22 12:24] – villersd | ||
---|---|---|---|
Ligne 38: | Ligne 38: | ||
p=np.array([-Ka*Kw, | p=np.array([-Ka*Kw, | ||
x=poly.polyroots(p) | x=poly.polyroots(p) | ||
- | y = poly.polyval(x, | ||
return float(-np.log10(x[np.where(abs(x-27.5)< | return float(-np.log10(x[np.where(abs(x-27.5)< | ||
- | |||
Ka=1.75E-5 # acid constant (acetic acid) | Ka=1.75E-5 # acid constant (acetic acid) | ||
Ligne 49: | Ligne 47: | ||
Vb=0. # volume of added base | Vb=0. # volume of added base | ||
log10dil=0 | log10dil=0 | ||
- | print pH_monoprotic_acid(log10dil, | + | print(pH_monoprotic_acid(log10dil, |
+ | |||
fig = plt.figure() | fig = plt.figure() | ||
ax = Axes3D(fig) | ax = Axes3D(fig) | ||
X,Y = np.linspace(-9., | X,Y = np.linspace(-9., | ||
- | print type(X), X.ndim, X.shape, X.dtype | + | print(type(X), X.ndim, X.shape, X.dtype) |
- | print type(Y), Y.ndim, Y.shape, Y.dtype | + | print(type(Y), Y.ndim, Y.shape, Y.dtype) |
Xc, Yc = np.meshgrid(X, | Xc, Yc = np.meshgrid(X, | ||
Z = Xc+Yc # just to create Z | Z = Xc+Yc # just to create Z | ||
- | print type(Xc), Xc.ndim, Xc.shape, Xc.dtype | + | print(type(Xc), Xc.ndim, Xc.shape, Xc.dtype) |
- | print type(Yc), Yc.ndim, Yc.shape, Yc.dtype | + | print(type(Yc), Yc.ndim, Yc.shape, Yc.dtype) |
- | print type(Z), Z.ndim, Z.shape, Z.dtype | + | print(type(Z), Z.ndim, Z.shape, Z.dtype) |
- | print range(len(X)) | + | print(range(len(X))) |
for ix in range(len(X)): | for ix in range(len(X)): | ||
for iy in range(len(Y)): | for iy in range(len(Y)): |