% CatalyticReaction.m

clear all; 
% Define problem parameters:
FA0 = 1.5;              % flow rate of A
CA0 = 1;                % initial conc. of A
CB0 = 1;                % initial conc. of B
k = 10; 
kA = 1; 
kC = 2;
% define an anonymous function for the right-hand side of the ODE:
dXdW = @(W,X) (k*CA0*CB0/FA0)*(1-X).^2./(1+kA*(1-X)+kC*X);

% call MATLAB's Runge Kutta method to solve the 1st order ODE:
[W, X] = ode45(dXdW, [0, 2], 0);
plot(W, X);
xlabel('W'); ylabel('X');
