Search 75,602 tutors
Ask a question
0 0

Hey, I have this question for Matlab, and I am completely lost on what I need to do .

Chemical, environmental, and nuclear engineers must be able to predict the changes in chemical concen- tration in a reaction. A model used for many single reactant process is

Rate of change of concentration = −kC n

where C is the chemical concentration and k is the rate constant. The order of the reaction is the value of the exponent n. It is known that the solution for a first-order reaction (n = 1) is

C (t) = C (0)e−kt

and the solution for a second order reaction (n = 2) is

1 1
C (t) = C (0) + kt.

The data in Table 1 describes the gas-phase decomposition of nitrogen at 300? :

2N O2 −→ 2N O + O2.

Table 1: Data for the gas-phase decomposition of nitrogen dioxide at 300?

Time, t [seconds]     C [moles of N O2/liter]
0.0                         0.100
50                          0.0079
100                        0.0065
200                        0.0048
300                        0.0038

Use the data given in Table 1 to determine whether this is a first-order or second-order reaction, and estimate the value of the constant k.
I need a matlab file for this.. Thank you so much! 
Tutors, please sign in to answer this question.

1 Answer

Create two variables for the two columns of data and plot them.
Create the time-vector t and the concentration vector C (Same as columns of data but you have to store them in Matlab memory).  This is a straight execution on the Matlab Command line. Meaning I did not create a script/function.  I used the built in plot function which basically plots the two variables t and C with t on the x-axis and C on the y-axis.  anything after the % sign is a comment. It is highlighted in green. Comments are used to make your program more understandable. 
t = 0, 50, 100, 200, 300;
C = 0.100, 0.0079, 0.0065, 0.0048, 0.0038;
grid on % Turn on grid lines for this plot
Now that you have plot the graph your analysis begins:
Remember y = mx + c the equation of a line
C (t) = C (0)e−kt     ......(1)

C (t) = C (0) + kt    ........(2)
The difference between the two is that the second order fits the linear equation meaning that the concentration changes uniformly with time.
The first order equation on the other hand should be exponential and the Matlab graph should show this clearly if it is exponential.
Finally to estimate the value of k you have to analyse the graph. If it is linear then it is second order with k being the slope of the line.  If it is exponential however the you will have to do another step in Matlab.  We basically Log everything in equation (1) using Natural Logs (Ln)  
Therefore:  ln C (t) = ln [C (0)e−kt]
Based on log rules ln[ab] = ln a + ln b
Thus it becomes: ln C (t) = ln C (0) + ln [e−kt]   
Remember ln ex = x which makes ln [e−kt]  = -kt
So we end up with ln C (t) = ln C (0) - kt
Hence if you plot ln C vs t and you get a straight line then the slope is -k   
Remember C(0) is your initial concentration which you can get at t=0 (ie 0.100).  
So your Matlab becomes:
t = 0, 50, 100, 200, 300;
C = 0.100, 0.0079, 0.0065, 0.0048, 0.0038;
R = ln (C)   %R is just a variable.  You can use anything you like once it doesn't replace another variable or                   %conflict with built in variables like sin or log
Plot (t, R)  
grid on % Turn on grid lines for this plot
%Remember you only need to do the second plot if it is first order as determined from the first plot.  If it is second order then yo will get a straight line.