You are on page 1of 9

GARCIA, Krizzi Eve D.

3CHEM1
I. TITLE:

Experiment 11: Modeling Chemical Kinetics

II. OBJECTIVES:

 To learn the modeling of chemical reactions


 To know how to read a Python code
 To input a markdown which states the numerical modeling problem assigned

III. METHODOLOGY:

Figure 1: Set up of online simulated experiment


Figure 2. Selection of Python 3 option (https://chemcompute.org/jupyterhub/submit).

Figure 3. Coding Screen for data input

The experiment was conducted through the online simulated experiment by ChemCompute. The
experiment began by going to the website Chemcompute which is an online software for chemical
modeling. From the home page (Fig. 1), the option “Use JupyterHub/PSI4” was clicked which would load
and lead to a new page in which logging in is required. After logging in, another page loads that displays
the Jupyter Hub interface in which the option “new” was selected and followed by option “python 3”.
The coding screen will load afterwards and the appropriate codes were entered in the blank cell and
were ran. The markdown was made by selecting the option from the drop-down option which is found
in the toolbar.

The main objective of the experiment is to apply the principles of chemical kinetics to model
these reactions by application of Python codes in the Jupyter notebook.
IV. RESULTS:

A. Outputs for a simple complex reaction of two consecutive, irreversible elementary steps

Figure 4. Markdown output of the numerical modeling problem

Figure 5. Code of the numerical modeling problem


B. Outputs for k1 = 1; k2 = 0.1

Figure 6. Markdown output for k1 = 1; k2 = 0.1

Code for k1 = 1; k2 = 0.1:

import numpy as np

from scipy.integrate import odeint

#matplotlib%

import matplotlib.pyplot as plt

def rxn(C,t):

k1 = 1

k2 = 0.1

   

r1 = k1 * C[0]

r2 = k2 * C[1]

   

dAdt = -r1
dBdt = r1 - r2

dCdt = r2

   

return[dAdt,dBdt,dCdt]

t = np.linspace(0,10)

C0 = [1,0,0]

C = odeint(rxn,C0,t)

plt.plot(t,C[:,0],'r--',linewidth=2.0)

plt.plot(t,C[:,1],'b:',linewidth=2.0)

plt.plot(t,C[:,2],'g-',linewidth=2.0)

plt.xlabel ('Time(s)')

plt.ylabel ('Concentration')

plt.legend (['Ca','Cb','Cc'])

Figure 7. Code for k1 = 1; k2 = 0.1


 

Figure 8. Matplotlib output for k1 = 1; k2 = 0.1

C. Outputs for k1 = 1; k2 = 10

Figure 9. Markdown output for k1 = 1; k2 = 10

Code for k1 = 1; k2 = 10:


 

import numpy as np

from scipy.integrate import odeint

#matplotlib%

import matplotlib.pyplot as plt

def rxn(C,t):

k1 = 1

k2 = 10

   

r1 = k1 * C[0]

r2 = k2 * C[1]

   

dAdt = -r1

dBdt = r1 - r2

dCdt = r2

   

return[dAdt,dBdt,dCdt]

t = np.linspace(0,10)

C0 = [1,0,0]

C = odeint(rxn,C0,t)

plt.plot(t,C[:,0],'r--',linewidth=2.0)

plt.plot(t,C[:,1],'b:',linewidth=2.0)

plt.plot(t,C[:,2],'g-',linewidth=2.0)

plt.xlabel ('Time(s)')

plt.ylabel ('Concentration')
plt.legend (['Ca','Cb','Cc'])

Figure 10. Code for k1 = 1; k2 = 10

Figure 11. Matplotlib output for k1 = 1; k2 = 10


V. CONCLUSION:

The experiment that was conducted involved the use of the online simulation from the website
Chemcompute. Using the Jupyterhub, python scripts were applied to fulfill the objectives of the
experiment. The codes that were utilized corresponds to a chemical reaction model. Based on the
results of the simulation, in which the chemical reaction A k 1 B k 2 C was modelled, the results
→ →

obtained were k 1 ≫ k 2 (k 1=1; k 2=0.1) and k 1 ≪ k 2 (k 1=1; k 2=10).

You might also like