no way to compare when less than two revisions
Différences
Ci-dessous, les différences entre deux révisions de la page.
— | teaching:progappchim:pressions_partielles_systemes_non_ideaux [2016/03/04 16:02] (Version actuelle) – créée villersd | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== Graphiques des pressions partielles de systèmes non-idéaux ====== | ||
+ | |||
+ | < | ||
+ | # | ||
+ | # -*- coding: utf-8 -*- | ||
+ | """ | ||
+ | Graphiques des pressions partielles de systèmes non-idéaux | ||
+ | Basé sur le travail de ML et VM, ba2 chimie 2013-2014 | ||
+ | """ | ||
+ | |||
+ | import numpy as np | ||
+ | import matplotlib.pyplot as plt | ||
+ | from Tkinter import* | ||
+ | |||
+ | #données | ||
+ | R = 0.082 #cste des gaz parfaits | ||
+ | T = 293 # temperature cste (k) | ||
+ | U01 = np.array([343, | ||
+ | U02 = np.array([0, | ||
+ | a1 = np.array([0, | ||
+ | a2 = np.ones(1)-a1 | ||
+ | |||
+ | x1 = np.array([0, | ||
+ | x2 = np.ones(1)-x1 | ||
+ | U03 = np.array([80]) | ||
+ | U04 = np.array([45]) | ||
+ | |||
+ | def graph1(): | ||
+ | U1= (np.log(a1)*R*T)+U01 | ||
+ | U2= (np.log(a2)*R*T)+U02 | ||
+ | plt.figure(1) | ||
+ | plt.plot(a1, | ||
+ | plt.plot(a1, | ||
+ | plt.plot(a1, | ||
+ | plt.xlabel (' | ||
+ | plt.ylabel (' | ||
+ | plt.title (' | ||
+ | plt.legend((" | ||
+ | plt.show() | ||
+ | |||
+ | def graph2(): | ||
+ | U3= (np.log(x1)*R*T)+U03 | ||
+ | U4= (np.log(x2)*R*T)+U04 | ||
+ | plt.figure(2) | ||
+ | plt.plot(x2, | ||
+ | plt.plot(x2, | ||
+ | plt.plot(x2, | ||
+ | plt.xlabel (' | ||
+ | plt.ylabel (' | ||
+ | plt.title (' | ||
+ | plt.legend((" | ||
+ | plt.show() | ||
+ | |||
+ | def graph3 (): | ||
+ | U1= (np.log(a1)*R*T)+U01 | ||
+ | U2= (np.log(a2)*R*T)+U02 | ||
+ | U3= (np.log(x1)*R*T)+U03 | ||
+ | U4= (np.log(x2)*R*T)+U04 | ||
+ | | ||
+ | plt.figure(3) | ||
+ | |||
+ | plt.subplot(121) | ||
+ | plt.plot(a1, | ||
+ | plt.plot(a1, | ||
+ | plt.plot(a1, | ||
+ | plt.xlabel (' | ||
+ | plt.ylabel (' | ||
+ | plt.title (' | ||
+ | plt.legend((" | ||
+ | |||
+ | plt.subplot(122) | ||
+ | plt.plot(x2, | ||
+ | plt.plot(x2, | ||
+ | plt.plot(x2, | ||
+ | plt.xlabel (' | ||
+ | plt.ylabel (' | ||
+ | plt.title (' | ||
+ | plt.legend((" | ||
+ | |||
+ | plt.show() | ||
+ | |||
+ | def abientot (): | ||
+ | print "en esperant vous revoir bientôt !" | ||
+ | fen1.destroy() | ||
+ | |||
+ | fen1 = Tk() | ||
+ | fen1.title(" | ||
+ | |||
+ | #création widget | ||
+ | |||
+ | Label(fen1, text=" | ||
+ | Button(fen1, | ||
+ | Button(fen1, | ||
+ | Button(fen1, | ||
+ | Button(fen1, | ||
+ | |||
+ | fen1.mainloop() | ||
+ | |||
+ | </ | ||
+ | |||