%% Verify SimBiology Model While Using Configset, Dose, and Variant Objects
% Load a sample SimBiology model.

sbioloadproject radiodecay.sbproj

%
% Add a new configuration set using a different stop time of 15 seconds.

csObj = m1.addconfigset('newStopTimeConfigSet');
csObj.StopTime = 15;

%
% Add a scheduled dose of 100 molecules at 2 seconds for species x.

dObj = adddose(m1,'d1','schedule');
dObj.Amount = 100;
dObj.AmountUnits = 'molecule';
dObj.TimeUnits = 'second';
dObj.Time = 2;
dObj.TargetName = 'unnamed.x';

%
% Add a variant of species x using a different initial amount of 500 molecules.

vObj = addvariant(m1,'v1');
addcontent(vObj,{'species','x','InitialAmount',500});

%
% Verify the model while using the configset, dose, and variant objects. Note that the order of arguments should be as described.

verify(m1,csObj,vObj,dObj);

%
% After verification, check the latest errors and warnings if there is any.

sbiolasterror

%
%

sbiolastwarning

%
%
% Simulate the model using the same configset, variant, and dose objects.

sim = sbiosimulate(m1,csObj,vObj,dObj);

%
% Plot the result.

sbioplot(sim);

% Copyright 2012 The MathWorks, Inc.