STEM Model Creator/Tutorials
- 1 Tutorials
Create a SEIR model by extending SIR
This tutorial shows how to create a new SEIR Disease Model by extending the existing SIR Disease Model. STEM already has a built-in SEIR model, so this tutorial is more a simple how-to.
Create Model Project and Initial Disease Model
- Launch the STEM application
- Open the Designer perspective
- From the New menu, select Model Generator Project
- Choose Create and configure a new STEM Model Package
- Click Next
- On the Model Package page, enter the following values:
- Package Name: Demo
- Package Prefix: com.example.diseasemodels
- Click Add Model to add the disease model
- On the Model Properties page, enter these values:
- Model Name: MySEIR
- Model Type: Disease Model
- Parent Model: Select SIR from the list
- [ Model Properties image]
- Click Finish
- At this point, your package properties should look like this:
- package properties image
- Click Finish to run the Model Generator and create your model project
- This step may take 1-2 minutes to complete
- After the Model Generator finishes, the Visual Editor should automatically open
- Initial layout picture
Add New Compartment
Now that your model project is created, it's time to add new parameters and compartments. First, lets create a new compartment.
We're creating an S-E-I-R model, which is made up of compartments S, E, I, and R. Since we extended the built-in S-I-R model, we need to add a new E compartment.
- In the Visual Editor, click the Add Compartment button.
- Add Compartment Button
- In the Add Compartment dialog, enter the following values
- Name: e (make sure this is lower case)
- Compartment Type: Standard
- Data Type: double
- Click Finish
- A new e box now appears in the diagram.
- You may want to rearrange the shapes so that the S, E, I, and R boxes are in order. Simply Select a compartment and drag it to a new location.
- [ layout picture ]
That's it. You've added a new compartment to your model. This is now an S-E-I-R model.