Modeling and Simulation Module 1: Lesson 1

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

Create a Simple Game in Scratch
Create a Simple Game in Scratch
1. Tuesday: Halloween Shoot due TOMORROW. You must make a contact sheet of your photos and print it from my computer tomorrow. -5 pts for every day I don’t.
Variables Conditionals Loops The concept of Iteration Two types of loops: While For When do we use them? Iteration in the context of computer graphics.
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 9: Variables.
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 4: Forever and Procedures.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Scratch Programming Session 6 of 10 If-then-else statements interactions Final projects specifications.
Automating Tasks With Macros
1 Exploring Stagecast Creator Stagecast Creator Tutorial: Kids Smoking on the Playground By: Community Simulations Team Center for Human-Computer Interaction.
Introduction to Modeling and Chemical Reactions Physical Science Module 4: Lesson 1-5.
B.A. (Mahayana Studies) Introduction to Computer Science November March Logo (Part 1) An introduction to Logo: drawing, moving,
Epidemiology Modeling the Spread of Disease Designing and Running Experiments Modeling and Simulation Module 1: Lesson 5.
INTRODUCTION TO SCRATCH. About Me Resources Scratch Website Learn Scratch Washington-Lee Computer.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement.
Fell View Computer Club StarLogo TNG – Session Two.
Introduction to VBA. This is not Introduction to Excel We’re going to assume you have a basic level of familiarity with Excel If you don’t, or you need.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
MrsBillinghurst. net A2 Computing A2 Computing Projects Game Animation in Pascal.
UNLOCKING THE SECRETS HIDDEN IN YOUR DATA PART 1 Data and Data Analysis.
Tutorial for Arrays and Lists By Ruthie Tucker. Description This presentation will cover the basics of using Arrays and Lists in an Alice world This presentation.
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards.
Study Guide For Test Chapter 5, 6,& 7 Test is Friday, May 15th.
Programming & Scratch. Programming Learning to program is ultimately about learning to think logically and to approach problems methodically. The building.
Spreadsheets in Finance and Forecasting Presentation 9 Macros.
1 Loops and Branches Ch 21 and Ch18 And how you can use them to draw cool pictures!
Adding Instrumentation Designing and Running Experiments Modeling and Simulation Module 1: Lesson 6.
Introduction to TouchDevelop
Differentiated Instruction in the Primary Mathematics Classroom J. Silva.
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 2: Keyboard Controls.
StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement.
Probability with Dice and Data, Wiggle Walk, and Colliding Turtles Modeling and Simulation Module 1: Lesson 1.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
POSC 202A: Lecture 4 Probability. We begin with the basics of probability and then move on to expected value. Understanding probability is important because.
Enzymes Activity: Chew on This!
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 13 Conditional.
Introduction to Modeling and Water Resources
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 7: Coordinate System.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Tutorial for Arrays and Lists. Description This presentation will cover the basics of using Arrays and Lists in an Alice world It uses a set of chickens.
1 Project designed and created by M. Shajith Kumar.
Getting started with the turtle Find the latest version of this document at
Aquarium Lab Series Developed by Alyce BradyAlyce Brady of Kalamazoo CollegeKalamazoo College.
Scratch for Interactivity Dr. Ben Schafer Department of Computer Science University of Northern Iowa.
More on Logic Today we look at the for loop and then put all of this together to look at some more complex forms of logic that a program will need The.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
1 CSC 221: Computer Programming I Fall 2009 Introduction to programming in Scratch  animation sprites  motion, control & sensing  costume changes 
CS320n –Visual Programming Execution Control with If / Else and Boolean Functions (Slides 6-2-1) Thanks to Wanda Dann, Steve Cooper, and Susan Rodger for.
Welcome, ________ Educators! Please have a seat at a Question Card and fill out your name, school, role, subjects taught, and grades taught. You don’t.
Introduction to Scratch We will be using the Scratch Environment today, so please log in to the Scratch website (scratch.mit.edu)
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Objective of the lesson Use Blockly to make a dice for Snakes and Ladders All of you will: – Make an image which displays when you press a button Most.
Modeling and Simulation Module 1: Lesson 1 Introduction to Complex Adaptive Systems and Computer Modeling and Simulation.
Welcome, ___________Educators! Welcome to another wonderful day with Project GUTS and Code.org!
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Computer Programming.
Programming & Scratch.
Scratch for Interactivity
Introduction to Events
Scratch for Interactivity
Learning to program with Logo
Introduction to TouchDevelop
Using Logo and Logic This presentation uses a version of Logo called StarLogo available through MIT. It can be downloaded for free and installed on your.
creating a ecosystems model in net logo
Creating a Simple Game in Scratch
Chapter 13 Conditional Repetition
Presentation transcript:

Modeling and Simulation Module 1: Lesson 1 Introduction to Complex Adaptive Systems and Computer Modeling and Simulation

Turn & Walk Activity Simple Rules You are an agent Form a circle (or not) Turn to face the person on your left Close your eyes and take three steps in that heading

Turn & Walk Computer Model Web-based StarLogo Nova Platform http://www.slnova.org/GUTS/projects/4591/ What is the relationship between the computer model and the real world? What was included and what was missing from the computer model of Turn & Walk? What are computer models good for?

Setup and Forever blocks

Complex Adaptive Systems (CAS) video “Introduction to Complex Systems” https://www.youtube.com/watch?v=CPHjsWSzOY0

Complex Adaptive Systems (CAS)

Terms to Remember Scatter Agent Initial conditions Simple rules Outcome Phenomenon Adaptive Agent Simple rules Heading Iteration Prediction Emergent patterns

Introduction to StarLogo Nova and Building Painting Turtles Modeling and Simulation Module 1: Lesson 2 Introduction to StarLogo Nova and Building Painting Turtles

StarLogo Nova A web-based software program Computer Science Concepts Instructions Computer Program Looping Iterations Public and Private Galleries Remixing

Guided Tour of StarLogo Nova Follow Guided Introduction to StarLogo Nova to see the different parts of site. www.slnova.org User Interface Terrain & Spaceland area Blocks & Drawers (workspace to create your code) Account & log in My Profile, public & private galleries, creating new project Sharing your project Remixing your project Use the Guided Introduction to StarLogo Nova- Reference Guide for Teachers See Activity 1, Lesson 2

Flower Turtles Project Start a new blank project. Name it ‘Flower Turtles’ with your name(s) in the title. Your challenge: Have turtles create a flower create 5 turtles that separate when ‘Setup’button is pushed. have the turtles move and leave trails with their pens down Save your project with both partners names Activity 2, Lesson 2

Flower Turtles Project In the World Page- create 5 turtles that separate when the setup button is pushed. In the Turtle Page- have the turtles move & turn to create a flower pattern. Activity 2, Lesson 2 Look for Lesson 2a: Flower Turtles in the GUTS gallery for Module 1 http://www.slnova.org/GUTS/projects/4703

Extensions: Painting Turtles Challenge REMIX your Flower Turtle project and call it “Painting Turtles” Your challenge: Paint a masterpiece create many turtles have the turtles move around the space leaving trails have a slight wiggle to their walk Change the colors of the turtles. Save your project with both partners names

Terms to Remember Agent Location Heading Steps Iteration Setup Runtime Random

Modeling and Simulation Module 1: Lesson 3 Conditional Branching Trailblazer and Bumper Turtles

Review from Lesson 2 What commands enabled turtles to change their environment? What could an agent leaving trails represent in a real world scenario? The pen down command was the block that let the turtles leave a trail, thus changing their environment. Real world examples include: ants & pheromones, walking in your house with muddy shoes, a truck that paints the dividers on a road

How turtles can react to their environment Trailblazer Instructions Starting and ending in the same place. Using a pencil, draw the path in the CENTER of squares. Pick up ALL the gold while avoiding the hazards. Color the squares as necessary according to the following rules: Take a step forward. If you are standing on a RED square, then turn right by 90 degrees Else If you are standing on a BLUE square, then turn left by 90 degrees Else If you are standing on a BLACK square, then turn right by 180 degrees Trade your map with your partner. Activity 1, Lesson 3

Discussion and New Concepts Comparing solutions Computer Science concept: conditionals New commands: If/Then and If/Then/Else Boolean statements- Evaluate to either True or False (Yes or No) Examples of conditionals in real life? Real life examples of conditional statements: If it is raining outside, take an umbrella If the bell rings, go to the next class

Setup and Forever blocks These blocks are known at ‘event handlers’ that are waiting for an action like the mouse click to execute the code inside.

New SLNova Blocks

Bumper Turtles Challenge Start with the program called “Bumper Turtles starter” program http://www.slnova.org/GUTS/projects/4593/ Click on the “Paint Landmarks” push button and see the program execute the code provided. Do not change the code in Paint Landmarks!  Remix the project, add your name(s) to the title Your challenge is to make the turtles react to the landmarks created by the “Paint Landmarks” Use logic blocks that evaluate the color of the terrain and tells the turtle how to turn. http://www.slnova.org/GUTS/projects/4593 Activity 2, Lesson 3

Partial Solution

Discussion What is the difference between if/then statements in a row vs. nested if/then/else statements Does execution order matter? What could these trails and bumpers represent in Bumper Turtles model? Terms to remember: conditional, Boolean, evaluation

Modeling and Simulation Module 1: Lesson 1 Probability with Dice and Data, Wiggle Walk, and Colliding Turtles

Review from Lesson 3 What commands enabled agents to react to their environments? Conditional statements that evaluate the terrain color

Review from Lesson 3 What commands enabled agents to react to their environments? IF/THEN IF/THEN/ELSE

Review from Lesson 3 An example of reacting to the environment: IF/THEN with a Boolean expression

New in Lesson 4 Today we are going to learn about probability (or the likelihood of something happening). Then we are going to use probability to make turtles do a “wiggle” walk. What is probability? Noun. The extent to which something is probable; the likelihood of something happening or being the case.

Chances Are Today we are going to learn about probability Form small groups and each group gets a cup and a die. Roll the die in the cup and record the result on your activity sheet. Repeat until you have 50 trials. Activity 1, Lesson 4

Chances Are What were your results? If you used a bar graph to visualize your results, what would it look like? Pool each groups data and see the results for the class. What are the chances of rolling each number between 1 and 6?

Chances Are We can mimic a roll of a die in StarLogo Nova using the random command. Random 6 will return a number between 0 and 5.

Chances Are Random can be used within other commands. For example, used within a left turn command, what do you think this command now does? If we used this command in an agent’s walk, what would it’s trail look like?

Wiggle walk Next imagine that you were going to roll two dice instead of one die. Do you think we will still get a flat distribution? In other words, is rolling a pair of ones as common as rolling a sum of 8?

Wiggle walk Fill in all the possible combinations of rolling two dice. Student 1 - Student 2 Fill in all the possible combinations of rolling two dice.

Wiggle Walk What is the most common result of rolling two dice? What is the next most common result? If we were to graph out the number of occurrences of each result, what would it look like? Common number is 0 (zero)

Wiggle Walk We use this “triangle” distribution when we want to to make agents walk with some randomness in their motion but mostly follow a straight line. We call this a wiggle walk.

Wiggle Walk We use this distribution when we want to to make agents walk with some randomness in their motion but mostly follow a straight line. We call this a wiggle walk.

Wiggle Walk

Wiggle Walk Try it yourself! Open your Bumper Turtle program and make your agents wiggle when they walk. Next you can get rid of the red, black and blue blocks

Wiggle Walk What’s the difference between a walk that uses one command And two commands?

Colliding Turtles New Command: Collision Collisions occur when two agents bump into one another. (They do not need to be centered on the same patch.) This is different from bumper turtles – In bumper turtles, agents were responding to colored patches in their environment, not other agents. Activity 2, Lesson 4

Colliding Turtles New Command: Collision

Colliding Turtles New Command: Collision with a condition

New StarLogo Nova Blocks

Colliding Turtles (coding agent to agent interaction) Start from a new blank project Create 50 blue turtles and 5 red turtles (use 2 ‘create do’ blocks) Have the turtles move forward with a little wiggle in their walk. (forever block on the turtle page) Upon colliding with a red turtle, have turtles react to that agent (the collidee) by changing their color to red. Save your project, make sure your name(s) are in the title. Extension: add a ‘chance’ or probability of a turtle turning red when it collides with a red turtle.

Review from Lesson 4 What could collisions represent in the real world? Why do we use probability in models?

End of Lesson 4

Modeling and Simulation Module 1: Lesson 5 Epidemiology Modeling the Spread of Disease Designing and Running Experiments

Review from Lesson 4 What could collisions represent in the real world? Why do we use probability in models? Collisions would be any type of interaction between 2 organisms- a rabbit eating some grass, 2 people talking, a car hitting another car Probability allows for some randomness and possible emergence of unexpected results, allows for each agent to behave slightly differently.

Lesson 5 Introduction to Epidemiology. Modeling the spread of a disease. Creating a slider for transmission rate. Using the slider value to determine whether or not to pass a disease from agent to agent. Creating a slider for recovery rate. Using it to determine if a sick agent recovers.

Introduction to Epidemiology Epidemics are the spread of disease Epidemiologists study the spread of disease One way epidemiologists try to study the spread of disease is through running simulations of how a disease spreads. Then they can test different measures to stop and epidemic. “Scientists who study epidemics are called epidemiologists. Epidemiologists study the spread of disease such as the swine flu. Epidemics are hard to study because they are made up of many connected and inter-related parts interacting in different ways. They can be hard to predict and sometimes the way a disease spreads creates patterns that cannot be predicted even if you know something about the people involved. These are characteristics of what we call “Complex systems”. (Many interacting parts, hard to predict, patterns emerge that are not predictable even if you know about individuals)” “One way epidemiologists try to understand epidemics is to run computer simulations of how diseases spread and test different measures that could be taken to stop an epidemic.” We are going to alter our Colliding turtles to make it into a model of an Epidemic.

What is MRSA? MRSA is a bacteria called Methicillin resistant Staphylococcus Aureus. Staphylococcus means grape-cluster in Greek. Viewed at 10,000 x magnification.

MRSA 30% of a population has some form of staphylococcus or staph on their skin or nose, which is known as colonization. About 880,000 people are infected with MRSA each year, out of those, 3% die.

How Does it Spread? Direct physical contact

How to treat an infection The infection is usually drained, cleaned, and covered. Treated with an appropriate antibiotic. Keep it covered and don’t share personal items.

Susceptible (Healthy) Picture of MRSA cycle MRSA transmission Susceptible (Healthy) Colonized Infected

Community-Associated MRSA Modeled as a Complex Adaptive System Can you guess “Who are the agents?” What are their behaviors? This is a screen shot from a simplified version of a Community-associated MRSA model developed by the University of Chicago / Argonne National Laboratory. In this model, students go from home to school and back again. The agents can be in one of three states: healthy, infected, or colonized, and can infect others if they are colonized or infected.

New in Lesson 5 CS concepts: Variables and Procedures We are going to turn our colliding turtles model to make it into an epidemic model. Let’s add a new widget called a slider. We will use this slider to hold a value called the transmission rate. This rate is the percentage of time a disease gets passed from one person to another upon collision. In colliding turtles, every time a red and blue agent collide, the blue one gets red. In diseases, not all collisions result in the spread of disease.

Variables Variables are containers for holding values. Think of a variable as a box with a label. In StarLogo Nova, Sliders can be used to hold values and set values as inputs to the model. In

Procedures Procedures are stacks of commands that perform a particular function and can be given a name. In colliding turtles, every time a red and blue agent collide, the blue one gets red. In diseases, not all collisions result in the spread of disease.

Create a New StarLogo Nova widget

New StarLogo Nova widget Change the max value to 100 by typing in 100 next to max and hitting the return key. Click on “Edit Widgets” again to get out into editing mode and back into play mode.

Use the New Widget We now have a way to set the transmission rate through the user interface with a slider. We can get the value of transmission rate in code. How do we “pass the disease to the healthy agent 40% of the time after a collision?” [hint: remember the dice rolls]

Use the Transmission Rate Widget We are rolling a 100-sided die. If the result is less than the transmission rate, pass the disease on. How often should we roll less than the transmission rate? What kind of distribution does the roll of a single die give us?

Save and Test your Model Try changing the transmission rate? What is missing if you wanted to use your model as an experimental test bed? A testbed (also commonly spelled as test bed in research publications) is a platform for experimentation. Testbeds allow for rigorous, transparent, and replicable testing of scientific theories, computational tools, and new technologies.

Extension: Adding Recovery People sometimes recover from a disease How can we use probability to determine when a sick person recovers?

Adding Recovery Recovery will be a new procedure. At each step a sick person has a chance of recovery. A procedure is a container for a group instructions or commands. We use a call block to call the procedure. Procedures are not “run” or “executed” unless they are called.

Adding Recovery Create a new slider for recovery rate. Use that slider in the recover procedure to determine whether the sick agent recovers (becomes healthy again).

Adding Recovery Create a new slider for recovery rate.

Adding Recovery Use that slider in the recover procedure to determine whether the sick agent recovers (becomes healthy again or blue). Note: even if the recovery rate is set to a low number, it will happen quickly and the disease might die out. Try changing the values of the sliders to make it more realistic to an identified communicable disease.

Save and Test your Model Try changing the recovery rate? Did you see any new outcomes or patterns? A testbed (also commonly spelled as test bed in research publications) is a platform for experimentation. Testbeds allow for rigorous, transparent, and replicable testing of scientific theories, computational tools, and new technologies.

Review from Lesson 5 What does this model tell you? What is the impact of changing the transmission rate? And recovery rate? What other things move through a population like a disease? We used probability in the wiggle walk, the chance of transmitting the disease and the chance of recovering from the disease. The impact of changing the transmission rate was to change the speed of the disease progression, but not the pattern.

End of Lesson 5

Modeling and Simulation Module 1: Lesson 6 Adding Instrumentation Designing and Running Experiments

Review from Lesson 5 What are the different ways we have used probability in this model? What is the impact of changing the transmission rate? What was the impact of changing the recovery rate? We used probability in the wiggle walk and in the chance of transmitting the disease. The impact of changing the transmission rate was to change the speed of the disease progression, but not the pattern.

Instrumenting your Model Definitions: Qualitative means relating to, measuring, or measured by the quality of something (its size, appearance, value, etc.) rather than its quantity.   Quantitative means relating to, measuring, or measured by the quantity of something rather than its quality. Number healthy and sick over time?

Instrumenting your Model We need some way of tracking the spread of disease. What data should we collect? Number healthy and sick over time?

Instrumenting your Model Let’s create a new “line graph” widget called “Population Healthy and Sick.” We’ll use it to track #red (sick) and #blue (healthy) over time. Number healthy and sick over time?

Instrumenting your Model Drag the line graph off to the side of Spaceland. Double click on New Series and change its name to “CountHealthy” then select blue as its line color. Add another Series and change its name to “CountSick” then select red as its line color. Finally, click “Edit Widgets” to leave editing mode and returning to play mode. Number healthy and sick over time?

Instrumenting your Model We want The World will update the line graph each time through the forever loop.

Test your Model Does the line graph work? What patterns can you see that were difficult to see without the line graph? Number healthy and sick over time?

Customization Researching diseases and adding in real transmission rate values.

Designing and Running Experiments Use the Experimental Design form to describe your experiment. Plan and run your experiment. Describe and share your findings. What are the variables in the model? What are the assumptions made? What are the initial conditions? What behaviors can influence whether or not one gets sick in the model?

Review from Lesson 6 Why is it important to instrument models? How can computer models of epidemics be used to better understand the spread of disease? We used probability in the wiggle walk, the chance of transmitting the disease and the chance of recovering from the disease. The impact of changing the transmission rate was to change the speed of the disease progression, but not the pattern.

End of Lesson 6