Created
October 6, 2016 05:49
-
-
Save theeluwin/75d1f3328e22bc83d983370110644dfd to your computer and use it in GitHub Desktop.
chem2_ex3.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from __future__ import division, print_function, unicode_literals | |
| __author__ = "theeluwin" | |
| __email__ = "[email protected]" | |
| import numpy as np | |
| def main(): | |
| R = 8.3145 | |
| a = np.array([3.32, 5.74, 9.00]) | |
| T = np.array([301, 319, 334]) | |
| y = 2 * R * np.log(a) | |
| x = 1 / T | |
| m, n = np.polyfit(x, y, 1) | |
| dH = -m | |
| dS = n | |
| print("dH = {}".format(dH)) | |
| print("dS = {}".format(dS)) | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment