In [ ]:
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np

from rmgpy.chemkin import loadChemkinFile

In [ ]:
chemkin = '/home/mjliu/Documents/1.inp'
dictionary = '/home/mjliu/Documents/species_dictionary.txt'

In [ ]:
# Load chemkin file
species, reactions = loadChemkinFile(chemkin, dictionary)

In [ ]:
pressure = 1e5 # Pa
temperature = np.linspace(298, 2000, 20)

In [ ]:
plt.style.use('seaborn-talk')

for reaction in reactions:
    # Get kinetics
    k = []
    for t in temperature:
        k.append(reaction.kinetics.getRateCoefficient(t, pressure))
    
    fig = plt.figure()

    x = 1000 / temperature
    y = np.log10(k)
    plt.plot(x, y)

    plt.xlabel('1000/T (K)')
    plt.ylabel('log(k)')
    plt.title(str(reaction))
    
    # Get reverse kinetics
    reverse = reaction.generateReverseRateCoefficient()
    krev = []
    for t in temperature:
        krev.append(reverse.getRateCoefficient(t, pressure))
    
    fig = plt.figure()

    x = 1000 / temperature
    y = np.log10(krev)
    plt.plot(x, y)

    plt.xlabel('1000/T (K)')
    plt.ylabel('log(k)')
    plt.title(str(reaction) + ' :: Reverse Rate')

In [ ]: