# Lesson 5 Activity 2 - Modeling Epidemics

**Modeling the Spread of Disease**

In this lesson students will convert their Colliding Turtles model into a simple Epidemic model by adding slider widgets and recovery. The Contagion model represents a very simplified version of an epidemic or spread of a disease. Two variables will be created: transmission rate and recovery rate. Students will later use this model to run experiments to determine if disease will spread throughout a virtual population in different scenarios.

- Watch a video introduction to the Challenge
- Learn new CS concepts and commands (variables and procedures)
- Add contagion to the "Colliding Turtles" to create an Epidemic Model
- Add recovery to the Epidemic Model

**Video introduction to the Challenge**

**Variables and Sliders**

**New CS Concepts and Commands**Watch the video above to see how to create a widget called a “slider”. Sliders are interface elements used to set variables. Variables hold values. These values are inputs to our model.

**Procedures**

Watch the video above to see how to create a procedure. A procedure is a named set of instructions that perform an action. Procedures must be written using a procedure block, then "called" or "invoked" using a call block.

Alter the Colliding Turtles to create an Epidemic Model

Alter the Colliding Turtles to create an Epidemic Model

What we have already is a model in which there are agents and collisions between agents have an outcome. Now we are going to alter our Colliding turtles to make it into a model of an Epidemic. To do this, we are going to create two variables: transmission rate and recovery rate.

*Transmission rate*is the probability that an agent will get sick upon colliding with a sick agent.

*Recovery rate*is the probability that a sick agent gets healthy at any turn. In the colliding turtles model, turtles always reacted to a collision. In our epidemic model, we will incorporate a transmission rate so only some of the time a disease is passed from one agent to another.

**Add a transmission rate to your model**

**then test your model**

Save and test your epidemic model. Try changing the transmission rate. Do you see any new outcomes or patterns?

**Save and test your epidemic model. Try changing the recovery rate. Do you see any new outcomes or patterns?**

Add in recovery then test your model again.

Add in recovery then test your model again.

**Reflect on the following questions:**

Reflection:

Reflection:

- What assumptions are made in your model?
- Was there any key factor that was left out that might be important in the real world?
- Would you trust a model if your life depended on it?