| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimBiology |
| Contents | Index |
| Learn more about SimBiology |
| On this page… |
|---|
This example shows you how to add an event to a model to trigger a time-based change. For information on events and how they are evaluated see Changing Model Component Values Using Events.
This example shows you how to add an event that modifies amount of ligand (L), thus modeling a delay in the addition of α-factor to the cell culture.
This example uses the model from Modeling a G Protein Cycle in the SimBiology Model Reference documentation.
This table shows the reactions used to model the G protein cycle and the corresponding rate parameters (rate constants) for each reaction. For reversible reactions, the forward rate parameter is listed first.
| No. | Name | Reaction | Rate Parameters |
|---|---|---|---|
| 1 | Receptor-ligand interaction | L + R <-> RL | kRL,kRLm |
| 2 | Heterotrimeric G protein formation | Gd + Gbg -> G | kG1 |
| 3 | G protein activation | RL + G -> Ga + Gbg + RL | kGa |
| 4 | Receptor synthesis and degradation | R <-> null | kRdo, kRs |
| 5 | Receptor-ligand degradation | RL -> null | kRD1 |
| 6 | G protein inactivation | Ga -> Gd | kGd |
Load the example project by typing the following at the command line:
sbioloadproject gprotein
The model is stored in a variable called m1.
Open the SimBiology desktop with the model loaded by typing:
simbiology(m1)
The desktop opens with Model Session-Heterotrimeric_G_Protein_wt.
Select File > Save Project As. The Save SimBiology Project dialog box opens.
Specify a name (for example, gprotein_ex) and location for your project, and click Save.
In the Project Explorer expand SimBiology Model and click Events to open the Events pane.
In the Enter Trigger box, type the following expression and press Enter:
time >= 100
In the EventFcns box, type the following expression and press Enter:
L = 6.022E17
In the Settings tab, note that the species L is available.
In the row containing the species L, double-click the InitialAmount column, type 0, and then press Enter.
The InitialAmount of L is set to be 0.0 when the simulation starts.
The Events pane should now resemble the following:

Save the project by selecting File > Save Project.
In the Project Explorer, expand Model Variable Settings and click Configuration Settings to open the pane that contains solver settings.

In the Settings tab, from the SolverType list, select sundials. This solver lets you simulate models with events.

In the Project Explorer, right-click Model Session-Heterotrimeric_G_Protein_wt and select Run Simulation.
The simulation runs to completion and plots the result in a figure. Notice that the plot shows that the ligand amount increases when the event is executed.

The plot does not show the species of interest due to a wide range in species amounts. Follow the next steps to view the species of interest.
In the Project Explorer, under Simulation, right-click Data and select Save Data. The Save Data dialog box opens.
Specify a name for the saved data, for example, event_ex, and click Save. The Project Explorer shows a new item with the saved data name under Simulation.
In the Project Explorer, click the saved data, for example, event_ex, to open the Data pane for the saved data.
Click the Plots tab.
In the Plot Type box, select Time and click Add Plot Type.
Select the new plot (second row), and in the Arguments section,
click
. The Select Values for y dialog box
opens.
Clear the check boxes for the species L and Gbg.
Click OK.
(Optional) Clear the Create Plot check box for the first plot.
Click Plot. Your plot should resemble the one below. Notice the increase in activation of G protein (species Ga, shown in red) after ligand (L) is added at time = 100 (simulation time).

![]() | Changing Model Component Values Using Events | Storing and Applying Alternate Model Values Using Variants | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |