% % add_external_reaction % % add reactions that are purley external and do not involve cells % function add_external_reaction(reactants, products, rate) % Variables global external_reaction_reactants; global external_reaction_products; global external_reaction_rates; global num_external_reactions; num_external_reactions = num_external_reactions + 1; disp(['External reaction ' num2str(num_external_reactions) ':' reactants '->' products]); % populate reactant names and their indices external_reaction_reactants(num_external_reactions,1) = {reactants}; reactant_indices = []; for i=1:size(reactants,2) if (i==1) reactant_indices = [lookup_species(reactants(i))]; else reactant_indices = [reactant_indices lookup_species(reactants(i))]; end end external_reaction_reactants(num_external_reactions,2) = {reactant_indices}; % populate product names and their indices external_reaction_products(num_external_reactions,1) = {products}; product_indices = []; for i=1:size(products,2) if (i==1) product_indices = [lookup_species(products(i))]; else product_indices = [product_indices lookup_species(products(i))]; end end external_reaction_products(num_external_reactions,2) = {product_indices}; % store reaction rate external_reaction_rates(num_external_reactions,1) = {rate}; end