%% Convert Substrate into Product Using Henri-Michaelis-Menten Kinetics
% This example shows how to simulate the conversion of a substrate into a product using the Henri-Michaelis-Menten enzyme kinetics.
% Create a model named mymodel.

model = sbiomodel('mymodel');

%
% Add a reaction that represents the conversion of a substrate to a product.

reaction = addreaction(model,'Substrate -> Product');

%
% Add the built-in Henri-Michaelis-Menten kinetic law to the reaction.

kineticLaw = addkineticlaw(reaction,'Henri-Michaelis-Menten');
kineticLaw.Expression

%
% The kinetic law has two parameters and a species that you need to define. View these parameters.

kineticLaw.ParameterVariables
kineticLaw.SpeciesVariables

%
% To define the parameters, create two parameter objects and set parameter values.

Vm_param = addparameter(kineticLaw,'Vm_param','Value',6.0);
Km_param = addparameter(kineticLaw,'Km_param','Value',1.25);

%
% Map the parameters accordingly by setting the ParameterVariableNames property. This associates the parameters in the expression with the two parameters you just created using a one-to-one mapping in the order given.

kineticLaw.ParameterVariableNames = {'Vm_param','Km_param'};

%
% Also associate the Substrate species with the species S in the expression.

kineticLaw.SpeciesVariableNames = {'Substrate'};

%
% Verify the mapping by looking at the reaction rate and checking the parameters and species are correctly substituted according to the expression.

reaction.ReactionRate

%
% Enter the initial amount of the substrate species for simulation.

model.Species(1).InitialAmount  = 8;

%
% Simulate the model and plot results.

simdata  = sbiosimulate(model);
sbioplot(simdata);

% Copyright 2015 The MathWorks, Inc.