Skip to content

Instantly share code, notes, and snippets.

@theeluwin
Created October 6, 2016 05:49
Show Gist options
  • Select an option

  • Save theeluwin/75d1f3328e22bc83d983370110644dfd to your computer and use it in GitHub Desktop.

Select an option

Save theeluwin/75d1f3328e22bc83d983370110644dfd to your computer and use it in GitHub Desktop.
chem2_ex3.py
#!/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