You are on page 1of 21

Modeling & Simulation

Topical Lecture CS 101 Arif Zaman

Modeling

Create a model
Usually a simplified description Using a few rules

Solve the model


Using algebra, calculus, differential equations Using simulation

Improve the model

Adding more parameters, equations

Physics

Physics was spectacularly successful.

F = m a = G m1m2 /r 2 explains sun-moon-planets-stars-galaxies

But not quite right, so we add


Friction (static and dynamic) Rotation Collision Rigid and non-rigid bodies

Physics Envy

Economics Psychology Sociology Biology Political Science Agriculture Chemistry and even Physics

No simple equations No exact equations Probability needed Interactions of 1000s of individuals cant be accurately modeled by a simple composite number.

Computers to the Rescue


Benefits Loss Numerical solutions No longer able to to complex understand the differential equations model, or to solve it that have no closed (e.g. Two-body form solutions problem is an ellipse). Possible to model millions of individuals Solution may take a long time to find.

Flock of Birds (Boids)


Separation: steer to avoid Nothing random other crowding local than starting point flockmates According to rules. Alignment: steer towards Add Response to the average heading of threat local flockmates Another example of flocking Cohesion: steer to move Herd behavior of toward the average animals position of local Note that many flockmates things modeled http://www.red3d.com/cwr/ here.
boids/ Craig Reynolds

Water
u 0

Hydrodynamics 1 u v (u) (u )u p g Computers use Finite Element or Finite Difference Methods to solve with voxels. Navier-Stokes (1800) used PDEs to solve. Simplifications are needed to be able to do u(x,y,z,t) is velocity, this in any reasonable v is viscosity, amount of time. (4-7 is density, mins per frame) p is the pressure vector Nick Foster & Ronald Fedkiw g is the gravity vector. http://www.cis.upenn.edu/~fostern/

The Forest for the Trees


For each tree there are curves: Tree growth rate (as a function of light) Tree transparency Spread of seeds Death rate as a function of growth. Disasters or logging.
http://www.sciencemag.org/feature/data /deutschman/index.htm

With no logging
Total tree density climbs quickly from the sparse initial conditions, reaching a peak around year 200. Fast-growing species like black cherry, white pine, and red oak reach the canopy first. As the light reaching the forest floor declines, these species seedlings fail to recruit into the canopy, and the more shade-tolerant species (mainly beech, hemlock, and, to a lesser extent, yellow birch) increase in relative abundance. By the end of the 1000-year simulation, beech reaches almost 100% dominance in the forest.

With periodic logging


the same suite of species (white pine, red oak, and black cherry) dominate the early growth. But continued opening of the canopy leads to enhanced performance of yellow birch. Yellow birch has the longest dispersal and high growth in moderate light, which allows it to expand quickly throughout the forest. Beech and hemlock are common and show little sign of being displaced. The apparent paradox of higher density in disturbed simulations

NASA and Muslims


Rely on simulation of solar system to predict the times for prayer, the visibility and location of the moon. Solar system simulation (including several 100 asteroids) can be done extremely accurately, in a reasonable amount of time on a home computer.

Small time-step problem


Take small time steps Everything moves, so re-compute forces. This approach does not work well. Errors accumulate. Linear Algebra and Numerical Analysis come to the rescue.

Weather Prediction

Far harder than anyone suspected. Chaotic (a butterfly in China affects a hurricane in Louisiana). NEC Earth Simulator (now #4 after three years as #1) is 640 processors, each with 8 vector arithmetic processors. Each processor is 8Gflop, total 10Tb memory. NOAA feeds 2 million observations/day for weather prediction. Currently 1-3 day is so so, trying for 7 days.

Fire

To understand why two firefighters died. To understand what to do in case of fire.

For firefighters. For residents.

Simulations can help in

Training and teaching Providing cheaper, less dangerous labs Policy planning Design and prototyping Design of Pseudoexperiments. Movie/Game making Prediction and approximation

Flight simulator Space flight simulation Business Game Nuclear power plant emergency War Games Medical Simulation Car, aircraft, wing design Political planning

Simulation in the News


Diet and Health Cell Biology Trauma Injuries of the Eye New Orleans Hurricane

Diet, Smoking and Heart Disease

Researchers in Turkey constructed a computer model of the adult population of England and Wales, looking at the effect of reducing smoking, cholesterol, and blood pressure in those with and without heart disease. This showed that primary prevention has a four fold bigger impact on mortality than secondary prevention.

A Living Cell
Researchers are taking on a project that will attempt to create a detailed computer model of a living cell that includes all of the cell's genes and proteins, their function and their relationships to one another. The researchers will use Saccharomyces cerevisiae, a single-celled yeast, which, they say, shares many genetic traits with humans, making it a useful model. The work is part of a $4.88 million grant from the National Science Foundation. Over the next five years, Keck Graduate Institute of Applied Life Sciences will lead a team of biochemists and computer scientists including a team from the University of Rochester Medical Center to build the computer model of gene and protein function within the cell, and then test predictions against real-world experiments.

Eye Injuries
Stitzel and his colleagues have been working on the computer simulation model for several years and already have reported that the model tracks the actual results of a series of experiments in which foam particles, BBs and baseballs strike the human eye. The model predicts when the globe of the eye will rupture from high-speed blunt trauma. In an accompanying editorial, Paul F. Vinger, M.D., of Concord, Mass., said the Virginia Tech-Wake Forest center's project to create the computer simulation "is a formidable undertaking that is bound to change the course of eye trauma research." He said that when the model predictions were compared with actual results, there was "excellent correlation between the calculated and experimental results."

New Orleans Hurricane


As the hurricane hit, John Pardue sat in his home in Baton Rouge, nervously tracking the storms progress on his computer for three hours until the power was cut. As director of the Louisiana Water Resources Research Institute and an expert in the detection of levee flaws, he and his team had produced a computer model showing the calamitous consequences of a major hurricane striking the New Orleans region. The model was widely applauded when first developed five years ago, yet the federal government effectively refused to act on the warnings. Critically, the major civil engineering works needed to build a new sea wall which would have greatly limited the hurricanes devastating effect, did not transpire. We knew that it was going to be catastrophic, Pardue says. It was not a surprise; it was in the New York Times, National Geographic, Scientific American. This exact scenario: water will be 20 feet high in parts of the city, people will die, all the things that have happened. Its eerie because weve been thinking about this for a number of years, and to see it unfold before your eyes is just unbelievable.

Assignment
Write a simulator for your self. Send your sim to class, and you can sleep-in every morning!

You might also like