Set1Solutions

Set1Solutions - ChE 101 2012 Problem Set 1 Solutions 1. (a)...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ChE 101 2012 Problem Set 1 Solutions 1. (a) i. function varargout = eulers_method ( ode_func , t0 , tf , n , y0 ) t = linspace ( t0 , tf , n +1) ; y = zeros ( length ( y0 ) , n +1) ; y ( : , 1 ) = y0 ; h = ( tf- t0 ) / n ; for i = 1: n y ( : , i +1) = y ( : , i ) + h * ode_func ( t ( i ) , y ( : , i ) ) ; end varargout = { y , t } ; ii. A. dc A dt = k b c B- k f c A dc B dt = k f c A- k B c B B. Based on conservation of mass, we know that at all times, c A + c B = c A, + c B, Substituting into the first ODE, we see that dc A dt + ( k f + k b ) c A = k b ( c A, + c B, ) We then define the following variables for convenience: k f + k b k b ( c A, + c B, ) This yields the simplified equation dc A dt + c A = To make the equation separable, we multiply by the integrating factor = e t 1 The product rule then gives us the result d dt c A e t = e t Integrating with initial condition c A (0) = c A, , we find that c A e t- c A, = ( e t- 1 ) c A ( t ) = c A,- e- t + = k f c A,- k b c B, k f + k b e- ( k f + k b ) t + k b k f + k b ( c A, + c B, ) Based on overall mass conservation, we also know that c B ( t ) = c A, + c B,- c A ( t ) = k b c B,- k f c A, k f + k b e- ( k f + k b ) t + k f k f + k b ( c A, + c B, ) Notice that for t ( k f + k b )- 1 , the system reaches an equilibrium with c A, eq = k b k f + k b ( c A, + c B, ) c B, eq = k f k f + k b ( c A, + c B, ) Furthermore, notice that c B, eq c A, eq = k f k b = K eq , so our kinetics are indeed consistent with thermodynamic equilibrium. C. Plots of the trajectories of species A and B are shown in Figure 1 below. For teaching purposes, the Matlab code used to generate the plot is shown below: clear clc close a l l set (0 , ' DefaultTextInterpreter ' , ' latex ' ) t0 = 0; tf = 5; t = linspace ( t0 , tf , 1000) ; kf = 1; kb = 1; cA0 = 75; cB0 = 25; cA = ( kf * cA0- kb * cB0 ) /( kf + kb ) * exp (- ( kf + kb ) * t ) + kb /( kf + kb ) * ( cA0 + cB0 ) ; cB = ( kb * cB0- kf * cA0 ) /( kf + kb ) * exp (- ( kf + kb ) * t ) + kf /( kf + kb ) * ( cA0 + cB0 ) ; figure ( ' Position ' , [0 240 800 600]) axes ( ' FontSize ' , 16) plot ( t , cA , t , cB ) axis tight xlabel ( ' Time ( seconds ) ' , ' FontSize ' , 18) ylabel ( ' Species Concentrations (M) ' , ' FontSize ' , 18) leg = legend ( ' A ' , ' B ' ) ; set ( leg , ' FontSize ' , 18) set ( leg , ' Interpreter ' , ' latex ' ) set ( leg , ' Location ' , ' best ' ) set ( leg , ' Box ' , ' on ' ) 2 1 2 3 4 5 25 30 35 40 45 50 55 60 65 70 75 Time (seconds) SpeciesConcentrations(M) A B Figure 1: Analytical solution for the kinetics of reversible isomerization. iii. A comparison of the analytical solution and the results from Eulers method is shown in Figure 2. Matlab code used to generate Figure 2 is shown below....
View Full Document

Page1 / 11

Set1Solutions - ChE 101 2012 Problem Set 1 Solutions 1. (a)...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online