What is Model Verification?
SimBiology® has functionality that helps you find and fix warnings that you might need to be aware of, and errors that would prevent you from simulating and analyzing your model.
Model verification checks many aspects of the model including:
Validity of mathematical expressions
Unit conversion issues
When to Verify a Model
You can check your model for warnings and errors at any time when constructing or working with your model. For example:
Verify your model during construction to ensure that the model is complete.
Verify the model after changing simulation settings, dimensional analysis settings, or unit conversion settings.
Analyses such as simulation, scanning, and parameter fitting automatically verify a model.
Repeatedly running a task using a different variant or setting
a different value for the
of a species, the
Capacity property of a compartment,
Value property of a parameter, generates
warnings only the first time you simulate a model. Use the verification
functionality described in this section to display warnings again.
Verifying That a Model Has No Warnings or Errors
to see a list of warnings and errors in your model.
sbiolasterror functions to return the
last warning and last error encountered during verification.
Model Verification Example
Create a model with a reaction that references
K1, an undefined parameter:
% Create a model named example model = sbiomodel('example'); % Add a compartment named cell to model compartment = addcompartment(model, 'cell'); % Add two species, A and B, to the cell compartment species_1 = addspecies(compartment, 'A'); species_2 = addspecies(compartment, 'B'); % Add the reaction A -> B to the model reaction = addreaction(model, 'A -> B', 'ReactionRate', 'K1');
Verify the model to check for warnings and errors:
??? --> Error reported from Expression Validation: The name 'K1' in reaction 'A -> B' does not refer to any in-scope species, parameters, or compartments.
Address the error by defining the parameter
% Add a parameter, K1, to the model with a value of 3 parameter = addparameter(model, 'K1', 3);
Verify the model again:
View Model Equations
As you verify the model, you can view the underlying system of equations of the model. Viewing model equations is useful for:
For details, see
getequations or Show Model Equations and Initial Conditions.