Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 11: Simulation: Modeling the Physical World

Similar presentations


Presentation on theme: "Chapter 11: Simulation: Modeling the Physical World"— Presentation transcript:

1 Chapter 11: Simulation: Modeling the Physical World
Simulation is one of the most important uses of computers today. It allows us to visualize worlds that might not exist outside of the computer. The Computer Continuum The Computer Continuum

2 Simulation: Modeling the Physical World
Chapter 11 Simulation: Modeling the Physical World In this chapter: Why do we need simulations? What is a model and how do they differ? How can the simulation game Monopoly be categorized? What can SimCity teach us? What do programmers consider when planning, designing, and implementing a simulation? Virtual reality, what are its uses? How can an electronic spreadsheet be used as a simulation tool? The Computer Continuum The Computer Continuum

3 Reasons for Simulation
Chapter 11 Reasons for Simulation Simulation: A technique used to mimic or imitate some phenomenon in a way that represents the real situation in most of its details. A physical or mathematical model is designed to behave like the object or event of interest. By manipulating and working with the model, a person can: Predict outcomes. Better understand the model. Experiment with the model. Test the model. Use the model for training purposes. The Computer Continuum The Computer Continuum

4 Reasons for Simulation
Chapter 11 Reasons for Simulation Time compression must be possible in order to predict the future in some way. Presidential elections. Weather forecasting. National economic trends. Population growth. Predictions are only as good as the model used in the simulation! The Computer Continuum The Computer Continuum

5 Reasons for Simulation
Chapter 11 Reasons for Simulation Simulation of the Inaccessible or Impossible Many simulations are necessary because it is impossible to gain knowledge any other way. Observing the collapse of a star. Reactions within a nuclear reactor. Genetic evolution. The weather on Venus. Recreation of the bomb blast that destroyed the Alfred P. Murrah Federal Building in Oklahoma City, Oklahoma. The Computer Continuum The Computer Continuum

6 Reasons for Simulation
Chapter 11 Reasons for Simulation Based on the explosives investigation, a simulation of the bomb’s force was recreated. Oklahoma Bombing Simulation The Computer Continuum The Computer Continuum

7 Reasons for Simulation
Chapter 11 Reasons for Simulation Experimentation and Testing Testing the simulated model of a complicated system is sometimes more feasible than testing the real thing. Experimentation on a new jet engine. Repeatedly crashing automobiles into cement barriers. Results from changing tax rates and interest rates on the US economy. Changing fertilizer compounds on corn crops. The Computer Continuum The Computer Continuum

8 Reasons for Simulation
Chapter 11 Reasons for Simulation Testing guardrail designs using simulated car crashes. The Computer Continuum The Computer Continuum

9 Reasons for Simulation
Chapter 11 Reasons for Simulation Education and Training Offers greater flexibility than traditional education and training. Can offer the benefit of years of experience to people learning some complex skill. Diagnostics in medicine. Flight training. Training a nuclear power plant technician. Managing salmon runs. Managing traffic patterns. Building and bridge construction. The Computer Continuum The Computer Continuum

10 Reasons for Simulation
Chapter 11 Reasons for Simulation Simulated landing onto an aircraft carrier. The Computer Continuum The Computer Continuum

11 The Computer Continuum
Chapter 11 Building a Model Models, whether physical or computer-simulated, share general characteristics: Continuous systems: Have quantities that vary smoothly or in a continuous manner. Example: Simulated landing of a rocket on the moon has quantities in engine thrust, velocity, and deceleration. All these vary smoothly (don’t jump). Discrete systems: Have quantities that vary in steps or jumps. Example: Modeling the traffic flow at an intersection. The number of cars can be counted precisely. Can’t have half a car pass through the intersection. The Computer Continuum The Computer Continuum

12 The Computer Continuum
Chapter 11 Building a Model Models can also be characterized as predictable or probabilistic Predictable systems: Have systems that predict exactly what will happen. Example: Using the mathematical model of the solar system to predict exactly when an eclipse will happen. Probabilistic systems: Have models that contain unpredictable features. Example: Weather simulation programs combine multitudes of information from satellites and previously recorded data. Yet, weather systems have unpredictable features. The Computer Continuum The Computer Continuum

13 The Computer Continuum
Chapter 11 Building a Model Models can also be characterized as having feedback versus non-feedback features. Feedback: A general term denoting the feeding back or recycling of actions or results of a model to itself. An automobile driver system is a feedback type of system: Driver tries to avoid an object in the road A turn away from the object is started. Driver’s eyes feed back information... If the turn is not sharp enough Driver increases the turn The Computer Continuum The Computer Continuum

14 Monopoly Game Simulation
Chapter 11 Monopoly Game Simulation Monopoly Simulation: Probabilistic: Controlled by random toss of dice or instructions given by randomly shuffled cards. Discrete: Dice or instructions both show exact number of steps to be taken. Feedback? If players are involved, then yes there is feedback in the system. If the system is defined not to include the players but only the dice tosses on the board, it does not have a feedback loop. The Computer Continuum The Computer Continuum

15 Monopoly Game Simulation
Chapter 11 Monopoly Game Simulation Monopoly Simulation: How can computers be used to simulate systems? A partial list of activities necessary to simulate the game of Monopoly: Toss dice. Move game pieces. Allow real estate, hotel and house purchases. Draw Chance or Community Chest card if necessary. Toss second or third time if necessary. Go to jail if doubles on third toss. Collect $ upon passing GO. Check for rent payment. Keep records of each player’s assets (cash and real estate)... The Computer Continuum The Computer Continuum

16 Monopoly Game Simulation
Chapter 11 Monopoly Game Simulation To understand the process of writing a program to play Monopoly, look at part of the problem of getting out of jail... Pay $50.00 Roll Start in Jail Use Get out of Jail free card Doubles? Roll No Count = 1 Yes Yes Yes Yes Is Count >2? Use Get out of Jail free card Pay $50.00 Move # Shown Wait Turn No No No Wait Turn Out of Jail The Computer Continuum The Computer Continuum

17 Monopoly Game Simulation
Chapter 11 Monopoly Game Simulation The probabilities for landing on the various squares in Monopoly: 1 Mediterranean St. James Place Pacific 2 Community Chest Community Chest North Carolina 3 Baltic Tennessee Community Chest 4 Income Tax New York Pennsylvania 5 Reading Railroad Free Parking Short Line Rail 6 Oriental Kentucky Chance 7 Chance Chance Park Place 8 Vermont Indiana Luxury Tax 9 Connecticut Illinois Boardwalk 10 Just Visiting B&O Railroad Go Jail Possibilities 11 St. Charles Place Atlantic J(1) Sent to Jail 12 Electric Co Ventnor J(2) in Jail 2 Turns 13 States Water Works J(3) in Jail 3 Turns 14 Virginia Marvin Gardens 15 Pennsylvania Rail Go to Jail The Computer Continuum The Computer Continuum

18 Monopoly Game Simulation
Chapter 11 Monopoly Game Simulation 120 Calculating the return on investment, taking into account the probability of landing on that particular property: 100 80 60 40 20 $1000 $2000 The Computer Continuum The Computer Continuum

19 SimCity: Simulation for City Planning
Chapter 11 SimCity: Simulation for City Planning SimCity: A game or simulation rich in details needed to do real city planning. Basic thesis: To build and run a city. Building Cities: (Problem Solving) Zoning areas as Residential, Commercial or Industrial. Building roads, rail systems, power and water facilities. Taxing and appropriating funds. Building police stations, fire stations, and hospitals. Including educational institutions and libraries. Adding zoos, parks and recreational areas. Building marinas, airports, and seaports. The Computer Continuum The Computer Continuum

20 SimCity: Simulation for City Planning
Chapter 11 SimCity: Simulation for City Planning Choices of power plants in the year 2026. The Computer Continuum The Computer Continuum

21 SimCity: Simulation for City Planning
Chapter 11 SimCity: Simulation for City Planning Sims: The people who live in the simulation. People will stay in a city if they feel safe, taxes are reasonable, jobs are available, and services are provided. City Planning must include replacement and repairs as needed. Power plants wear out. Roads need repair. As cities grow, increasing water system demand grows. Money needs to be coming in for services to be provided! The Computer Continuum The Computer Continuum

22 SimCity: Simulation for City Planning
Chapter 11 SimCity: Simulation for City Planning The water system is “under the city”. The Computer Continuum The Computer Continuum

23 Design and Implementation of Computer Simulations
Chapter 11 Design and Implementation of Computer Simulations Five basic tasks to be performed in setting up a computer simulation: 1. Determine if the simulation is feasible. Cost and other alternatives must be examined first. 2. Create a model to mimic the real situation. 3. Write a computer program that is based on the model. 4. Validate and verify that the program correctly represents the real-world system. A model is verified or validated when it proves to be a reasonable representation of the system being simulated. 5. Experiment with the computer simulation to resolve the problem. The Computer Continuum The Computer Continuum

24 Design and Implementation of Computer Simulations
Chapter 11 Design and Implementation of Computer Simulations Programming languages used to create simulations: Can be written in any language including Visual BASIC, Smalltalk, C++, Pascal, etc. For complex simulations, several simulation programs have been developed. Usually have a graphics orientation. One example is Extend: Library-based simulation program. Programmer can build libraries of icons that represent the behaviors of elements in the system being modeled. The Computer Continuum The Computer Continuum

25 Design and Implementation of Computer Simulations
Chapter 11 Design and Implementation of Computer Simulations The classic predator/prey problem as modeled in Extend: The Computer Continuum The Computer Continuum

26 The Computer Continuum
Chapter 11 Virtual Reality Virtual Reality (Artificial reality): A situation in which an individual has a three-dimensional view into a world that doesn’t exist except in the computer. Uses: Industry and military train people in the use of complex systems. Entertainment. Special equipment is necessary to experience the environment fabricated by the computer. Can include visual images, smells, and touch. The Computer Continuum The Computer Continuum

27 The Computer Continuum
Chapter 11 Virtual Reality Special equipment is necessary to experience the environment fabricated by the computer. Can include smells, and touch. Can include visual images using a headset, goggles, or a special environment. Three approaches to this type of simulation: A computer creates a tiny video display in a headset. Special goggles are worn that will make 3D images appear. Create a room whose walls are video projections of scenes that are created alternately for the left eye, then the right eye. The Computer Continuum The Computer Continuum

28 The Computer Continuum
Chapter 11 Virtual Reality CAVE Automatic Virtual Environment Physical environment: 10’x10’x9’ room where 3 of the 4 walls and the floor are projection surfaces. Electronically controlled shutter glasses alternately allow projected images to appear to each eye. The Computer Continuum The Computer Continuum

29 The Computer Continuum
Chapter 11 Virtual Reality Virtual Surgery: (Surgery project) Surgery training workstations with video monitor and hand manipulators. Surgeons practice various types of surgery. Can be used as a remote surgery facility. Surgeon connects via satellite to an operating room where robot-like devices at an operating room do the job. The Computer Continuum The Computer Continuum

30 Electronic Spreadsheets as Simulation Tools
Chapter 11 Electronic Spreadsheets as Simulation Tools Electronic spreadsheet application consists of rows/columns of cells that can contain numbers, text, and formulas. The next slides will display how spreadsheets are used in a: Continuous simulation model. Probabilistic simulation model. Model with feedback. The Computer Continuum The Computer Continuum

31 Electronic Spreadsheets as Simulation Tools
Chapter 11 Electronic Spreadsheets as Simulation Tools Continuous Simulation Model Expres is a standard three-phase, dispersed-flow, black-oil, finite-difference reservoir simulator. Uses a spreadsheet’s macro capabilities to simulate oil well production. Expres Simulator web site… The Computer Continuum The Computer Continuum

32 Electronic Spreadsheets as Simulation Tools
Chapter 11 Electronic Spreadsheets as Simulation Tools Probabilistic Simulation Model Each time a probabilistic simulation is run, a different result will occur. This simulation uses a random number function to simulate a die toss. The Computer Continuum The Computer Continuum

33 Electronic Spreadsheets as Simulation Tools
Chapter 11 Electronic Spreadsheets as Simulation Tools Model with Feedback Deals with the issue of time. Something happens that affects a reaction later. A widely used type of feedback is the “what-if” simulation. Example: Backpacking trip If you only have 4 days and need 4 each of breakfasts, lunches, and dinners. What combinations can you make if you only have $45.00 to spend? The Computer Continuum The Computer Continuum


Download ppt "Chapter 11: Simulation: Modeling the Physical World"

Similar presentations


Ads by Google