Add dose object to model
|Name of a dose object to construct and add to a model object. |
|Type of dose object to construct and add to a model object.
Enter either |
|Dose object to add to a model object. Created with the constructor |
Before using a dose object in a simulation, use the
to add the dose object to a SimBiology®
object. Then, set the
object property to
a SimBiology RepeatDose object (
DoseName to the property
adds the dose object to a SimBiology model object (
modelObj to the property
either a SimBiology
ScheduleDose object or
adds a SimBiology dose object (
) to a
SimBiology model object
copies the dose object to a second dose object (
modelObj to the property
Active property of
is set to
false by default.
Add an Infusion Dose
This example shows how to add a constant-rate infusion dose to a one-compartment model.
Suppose you have a one-compartment model with a species named
drug that represents the total amount of drug in the body. The drug is removed from the body via the first-order elimination represented by the reaction
drug -> null, with the elimination rate constant
ke. In other words, the drug concentration versus the time profile follows the monoexponential decline , where is the drug concentration at time t, is the initial concentration, and
ke is the elimination rate constant. This example shows how to set up such a one-compartment model and add an infusion dose at a constant rate of 10 mg/hour for the total dose amount of 250 mg.
Create a One-Compartment Model
Create a SimBiology model named
m1 = sbiomodel('onecomp');
Define the elimination of the drug from the system by adding a reaction
drug -> null to the model.
r1 = addreaction(m1,'drug -> null');
drug is automatically created and added to the compartment. The
null species is a reserved species that acts as a sink in this reaction.
Add a mass action kinetic law to the reaction. This kinetic law defines the drug elimination to follow the first-order kinetics.
k1 = addkineticlaw(r1,'MassAction');
Define the elimination rate parameter
ke and add it to the kinetic law.
p1 = addparameter(k1,'ke','Value',1.0,'ValueUnits','1/hour');
Specify the rate parameter
ke as the forward rate parameter of the reaction by setting the
ParameterVariableNames property of kinetic law object
k1. This allows SimBiology to determine the reaction rate for
drug -> null reaction.
k1.ParameterVariableNames = 'ke';
Set Up an Infusion Dose
Add a dose object to the model using the
adddose method. Specify the amount of the dose (
Amount), the dose target (
TargetName), and the infusion rate (
Rate). You also need to set the
Active property of the dose object to
true so that the dose is applied to the model during simulation.
d1 = adddose(m1,'InfusionDose'); d1.Amount = 250; d1.TargetName = 'drug'; d1.Rate = 10; d1.RateUnits = 'milligram/hour'; d1.Active = true;
Simulate the Model
Change the simulation stop time to 48 hours to see the complete time course.
cs = getconfigset(m1); cs.StopTime = 48; cs.TimeUnits = 'hour'; sd = sbiosimulate(m1);
Plot the concentration versus the time profile of the drug in the system.
Version HistoryIntroduced in R2010a
R2022a: Component naming restriction
Behavior change in future release
In a future release, there will be a naming restriction on the following model component types: model, compartment, species, parameter, reaction, rule, event, observable, dose, and variant. The restriction is that within a single model, these components will be required to have unique names even when they are of different types with the following two exceptions:
Species in different parent compartments can have the same name.
Parameters with different parents can have the same name. Specifically, you can use the same name for a model-scoped parameter and reaction-scoped parameters, where each reaction-scoped parameter belongs to a different reaction.