ee150_chemical1 - Y(1,i+1) = Y(1,i); Y(2,i+1) = Y(2,i);...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% ee150_chemical1.m dt = .01; % calculate concentrations every dt seconds duration = 100; % stop after duration seconds k = [1e6; 1e-4; 1e-1]; % reaction rate constants Y = zeros(4,1); % Initialize the Y-matrix as a 4x1 matrix. The number % of columsn will grow as we calculate the concentrations % over time Y(1,1) = 5e-7; % initial substrate concentration Y(2,1) = 2e-7; % initial enzyme concentration Y for i = 1:(duration/dt) % Modify the following lines to update the concentrations appropriately
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Y(1,i+1) = Y(1,i); Y(2,i+1) = Y(2,i); Y(3,i+1) = Y(3,i); Y(4,i+1) = Y(4,i); Y(:,i+1) % display the current concentrations (by leaving off the ';') end e % Generate time vector - you will need to modify the following line. t = 0; t figure; plot(t,Y(1,:),'r+'); hold on; % Plot the following concentrations on the same figure; plot(t,Y(2,:),'b+'); plot(t,Y(3,:),'g+'); plot(t,Y(4,:),'y+'); p...
View Full Document

This note was uploaded on 09/15/2011 for the course EE 150 at USC.

Ask a homework question - tutors are online