SimBiology Tutorials: Building a Model – Differential Equations
From the series: SimBiology Tutorials for QSP, PBPK, and PK/PD Modeling and Analysis
Learn how to define differential equations with SimBiology® using the Model Builder app.
In this video tutorial, we will see how to build a model with SimBiology, and more particularly, how to define differential equations.
SimBiology allows you to define your model as a reaction network from which alternative differential equations are derived automatically. You can build your model programmatically, or using the model builder app that provides a block diagram editor to build your model interactively. You'll find the model builder in your MATLAB app category.
The diagram you see in the middle is not only a graphical representation of the model, but it's the model itself. This model is composed of two compartments-- target mediated direct disposition model for the PK part, and an indirect response model with inhibition of kin for the PG part.
The PK part is modeled as a set of reactions that describe the processes involved, such as the banding of the direct through receptor, the elimination of direct receptor and complex, the synthesis of receptor, and the transport of the direct between the central and the peripheral compartment.
We define the PD dynamics by writing directly its ODE in a so-called rate rule.
So let's see now how to build this kind of model. We will start from scratch by creating a blank model. This newly-created model contains one compartment by default, as every model must contain at least one compartment. A compartment is a well-mixed container that is characterized by its spatial dimension-- in general, its volume.
Now that this compartment is selected, you see the property editor populated with the properties of this specific component. So let's rename it central and define its unit.
By default, the volume of a compartment is constant, but it could also change over time. A compartment could also contain other compartments, like this cytoplasm could contain a nucleus.
Let's now add the peripheral compartment. To do this, I will drag and drop a compartment from the block library and modify its properties.
Now let's add state variables, which are called species in SimBiology. Species can represent the dynamical states of metabolites, proteins, receptors-- whatever would be included in your model-- and must be defined in unit of concentration, or amount.
So let's drag and drop our four species. Drag receptor complex in the central compartment, and drag in the peripheral compartment. Species must have unique names within one compartment, but they can share the same name as another species from another compartment.
We can select multiple species by pressing shift to change a common property at the same time, such as the unit. We can also set the binary condition to true. In that case, species would not be modified by the reactions it participates in. They can still be modified by events, rules, or doses.
The constant property, or constant value property, could be set to true, as well. And in that case, the species can vary during the simulation.
Let's now add reactions. Reactions describe processes between reactants and products, like a transformation, transport, and binding.
To add a reaction, the first option is to drag and drop a reaction block. Now you can press control and drag a line from the species to the reaction to define it as a reactant. As you can see, the reaction scheme was automatically updated in the property editor.
Likewise, you can drag a line from the reaction to a species to define it as a product of that reaction. By default, the reaction will have a mass action of kinetics, and its parameter will be created automatically. You can change the default behavior in the preferences. For instance, I can decide not to create parameters automatically.
Reactions can be reversible. Here, we then need to add a new dissociation constant. Once the kinetic flow and parameters are defined, SimBiology derived direction rate automatically. You can also set the kinetic flow to a noun and write your own custom reaction rate.
The second option to create a reaction is to drag a line from one species to another one, and SimBiology will create a reaction in-between.
Let's now define this reaction as reversible and define its parameters. Reactions don't necessarily need both reactants and products. They could only have a product in the case of a synthesis, or only a reactant in case of elimination.
Let's implement this for the receptor. If we add a reaction and make it a receptor, you see that the reaction scheme now contains null, which is a key word in SimBiology.
Also, you can edit direction scheme directly in the property editor, and SimBiology will update the diagram accordingly by adding a line. A species could also be both reactant and product. In this case, its concentration direct mix would not be affected by the reaction, and its link to the reaction would be shown on a diagram using a dashed line. This is useful for the case of enzymatic reactions.
So far, we have created parameters directly while we defined reactions. We can also define parameters, or any other components, using the lists in the model browser. We will use the list of parameters to create the parameters we need for indirect response, kin, Imax, IC50, and kout.
We will also define the response r as a parameter because r is dimensionless. And remember that the species must be a concentration or an amount. And this is fine because a parameter can be non-constant, and its dynamics can be defined by a rate rule. A rate rule helps you specify the time derivative of a parameter value, species amount, or compartment capacity.
The app shows a parameter block only for a parameter that is on the left-hand side of an ODE, a natural break equation, or is modified by an event.
We can now display the expression line to show the dependency of this equation on the direct concentration in the plasma. It will be shown us a dash dotted line.
Since we have defined all units in our system, it is recommended to activate the unit conversion in the simulation settings associated to this model. SimBiology would then convert all quantities to one consistent unique system in order to solve the equations that will return the results into user-specified units.
Once we are ready, we can use the model assessment tools to verify our model.
We can now visualize the differential equations derived from our diagram using mass patterns principles.
This concludes this tutorial. In the next video, we will see how to add algebraic equations to our model.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.