Course 2100 - Topics in Science and Technology: Modeling and Simulation in Science and Technology - Spring 2016

Official Information
Course Number:SCTC 2100.001
Course Title:Topics in Science and Technology: Modeling and Simulation in Science and Technology
Times:TR 2:00-3:20
Places:Pearson McGonigle Hall OP220
Instructor: Benjamin Seibold
Instructor Email: seibold(at) 
Instructor Office:518 Wachman Hall
Instructor Office Hours:T 3:30-4:30 and R 1:00-2:00.
Teaching Assistant: Stephan Grein
Instructor Email: tug41634(at) 
TA Office:513 Wachman Hall
TA Office Hours:W 2:00-4:00.
Course Textbooks: There is no single textbook for this course. The materials come from a variety of books and other sources. Recommended resources: Further resources will be provided over the course of the semester.
Official:Course Syllabus
Prerequisites:MATH 1042 or higher.
Topics Covered: This course introduces the concept of (a) building a mathematical model of a real-world process, (b) using computational resources to simulate the model, and (c) properly interpreting the results. The main focus lies on processes with many interacting agents, such as: traffic flow, spread of diseases, forest fires, animal swarming, economic markets, social networks, robotics. The course provides an overview of model building concepts, training on the implementation of models in a computing environment, as well as theoretical background on how to analyze and understand large-scale phenomena (traffic waves, stock market crashes, swarm intelligence, etc.). General interest in mathematical model building and in programming is required.
Course Goals: Expose students to the process of model building, the simulation and computation with mathematical models, and the interpretation and analysis of simulation results. Moreover, students will experience fundamental concepts ubiquitous in science and technology, such as: instabilities, phase transitions, resonance, upscaling.
Attendance Policy: Students are expected to attend every class. If a student cannot attend a class for some justifiable reason, he or she is expected to contact the instructor before class.
Course Grading: Homework problems sets: 30%; course project: 30%; exams: 40%.
Final Exam Date:04/28/2016.
Course Schedule
01/12/2016   Lec 1
Fundamentals and introductory examples: Mexican wave example, fundamentals of Matlab
01/14/2016   Lec 2
Deterministic vs. stochastic models, contagion model, Matlab data structures
   Read: Infection, Stochastic
01/19/2016   Lec 3
Monte-Carlo method, nested functions in Matlab
   Read: Monte Carlo method
01/21/2016   Lec 4
Random walks, randomness in Matlab
   Read: Random walk
01/26/2016   Lec 5
Random walks in 2d, histograms
   Read: Histogram, Lévy flight
01/28/2016   Lec 6
Random walks with bias, simulated annealing, butterfly example
   Read: Simulated annealing
02/02/2016   Lec 7
Run-and-tumble with background field, E. coli example
   Read: Chemotaxis
02/04/2016   Lec 8
Agents affecting field quantities
02/09/2016   Lec 9
Diffusion (macroscopic)
02/11/2016   Lec 10
Diffusion (microscopic)
   Read: Diffusion
02/16/2016   Lec 11
Interactions between agents, population dynamics
   Read: Population dynamics
02/18/2016   Lec 12
Theory of population dynamics
02/23/2016   Lec 13
Theory of population dynamics
   Read: Logistic growth
02/25/2016   Lec 14
Dynamical systems, equilibria, stability
03/08/2016   Lec 15
Continuous vs. discrete time stepping
03/10/2016   Lec 16
Numerical time stepping
03/15/2016   Lec 17
Traffic flow: car following models
03/17/2016   Lec 18
Traffic flow: traffic waves and instabilities
   Read: Traffic wave
03/22/2016   Lec 19
Traffic flow: high-order time stepping with Runge-Kutta methods
03/24/2016   Lec 20
Traffic flow: cellular automaton models
03/28/2016   Lec 21
Conway's game of life
03/29/2016   Lec 22
General cellular automaton models
   Read: Cellular automaton
04/05/2016   Lec 23
Models for crowd dynamics
   Read: Crowd
04/07/2016   Lec 24
Swarming and flocking
04/12/2016   Lec 25
Ant colony simulation
04/14/2016   Lec 26
Agent-based economic models: trading
04/19/2016   Lec 27
Agent-based economic models: stock market
04/21/2016   Lec 28
Project presentations
04/28/2016 Final Examination
Matlab Programs
  • Simple model for a mexican wave in a sports stadium, generated by spectators who stand up and sit down to create the wave as an emergent structure: temple_abm_mexican_wave.m
  • Same model as above, but implemented in an alternative fashion: plotting is done graphically, and the update rule is implemented in a non-vectorized fashion: temple_abm_mexican_wave_alternative.m
  • Simple model for a contagion process of agents in a one-dimensional arrangement. Infected agents infect neighbors with a certain probability, and the disease spreads: temple_abm_contagion1d.m
  • Multiple random walkers in one space dimension, whose paths cannot cross (any random step that would cause crossing is rejected). This is a simple example of multiple random walking agents whose paths are not independent: temple_abm_random_walkers.m
  • Random walkers in two space dimensions, exhibiting an animation of their paths. For one walker, each step is drawn uniformly from {-1,0,1}^2; for the other walker, each step is drawn uniformly from [-1,1]^2: temple_abm_random_walk_2d.m
  • Example of a Levy flight (a random walk with heavy-tailed step lengths) in two space dimensions, with log-normally distributed step length (and uniformly distributed angle). The 2d histogram of the final positions is plotted: temple_abm_random_walk_levy_histogram.m
  • Random walk on a given function with a certain probability that an upward step is rejected. The rejection probability increases in time. This is an example of the simulated annealing technique: temple_abm_random_walk_annealing.m
  • Random walk in 2d over a background map, modeling the motion of a butterfly. Each step is either a deterministic uphill motion or a random step: temple_abm_butterfly_animation.m
  • Motion of butterflies via random walk in 2d over a background map. Now, multiple agents are simulated and statistical properties of their paths are extracted (here: the width of corridors): temple_abm_butterfly_corridor_width.m
  • Model for bacteria (such as E. coli) moving in a 2d concentration field. Their motion is run-and-tumble, where the probability to terminate their straight motion depends on whether they "their" concentration value is improving or not: temple_abm_bacteria_run_and_tumble.m
  • Model for bacteria (such as E. coli) moving in a 2d concentration field. In addition to executing a concentration-based run-and-tumble motion, the bacteria consume the concentration in their vicinity: temple_abm_bacteria_run_and_tumble_and_eat.m
  • Diffusion of a 2d concentration field (with no-flux boundary conditions), computed via a macroscopic finite volume method: temple_abm_diffusion_macro.m
  • Comparison of microscopic diffusion (the histogram of many random walkers) with macroscopic diffusion (approximating the diffusion equation via finite volumes): temple_abm_diffusion_micro_vs_macro.m
  • Agents moving in a 2d rectangle, aging (and dying), and producing offspring if exactly two agents are in the same square of the domain: temple_abm_population_migrate_mate_and_age.m
  • Two populations of agents moving in a 2d rectangle, and reproducing and dying. The prey reproduction rate decreases with prey density, and the death rate increases with predator density. The predator reproduction rate increases with prey density, and the death rate increases with predator density: temple_abm_population_predator_prey.m
  • Classical population dynamics without agents. The dynamics of two species are demonstrated in various cases: predator-prey, logistic growth, competition, and mutalism: temple_abm_population_local.m
  • Comparison of three methods for time stepping for ordinary differential equations: temple_abm_ode_time_stepping.m
  • Follow-the-leader traffic model in which drivers equilibrate their car's velocity to that of the vehicle immediately ahead: temple_abm_traffic_follow_the_leader.m
  • A more complex car following model in which drivers have two objective: a) equilibrate their velocity to that of the vehicle immediately ahead, and b) go towards an optimal velocity that depends on the headway: temple_abm_traffic_car_following.m
  • Cellular automaton model for vehicular traffic flow (the Nagel-Schreckenberg model). Vehicles move from cell to cell while constantly adjusting their velocity: temple_abm_traffic_cellular.m
  • Implementation of the popular cellular automaton model game of life by John Conway: temple_abm_cellular_game_of_life.m
  • Same game of life, but now initial configurations are read from data files. temple_abm_cellular_game_of_life_file_ic.m. This program needs the two data files temple_abm_cellular_game_of_life_file_ic_blinker_ship.txt and temple_abm_cellular_game_of_life_file_ic_glider_gun.txt to be in the same directory.
  • Binary cellular model in 1d with immediate neighbor interaction only. This particular example implements rule 184: temple_abm_cellular_rule184.m
  • Cellular model in 2d for the dynamics of crowds. This example has agents that wish to walk to the right, and agents that wish to walk to the left. Each cell can be occupied only by a single agent: temple_abm_cellular_crowd.m
  • Model for swarming birds. Each agent (bird) is moving with a fixed speed, and it adjusts its direction of flight according to other agents nearby. There is a zone of repulsion (radius 1/3) and a zone of alignment (radius between 1/3 and 1): temple_abm_swarming_birds.m
  • Model for foraging ants. Each agent (ant) is moving with a fixed speed, and it adjusts its direction of motion to trace high concentrations of a pheromone field. In turn, every agent leaves a trail of pheromones when walking: temple_abm_swarming_ants.m
  • Model for a market. Producing agents sell goods to consuming agents at a market price. Each agent has a desired price, and a trade occurs when the market price meets or is even better than the agent's desired price. In turn, the market price adjusts according to the balance of willing buyers vs. sellers: temple_abm_economy_supply_and_demand.m
  • Model for a stock market. Agents possess shares of stock, cash, and individual buying and selling prices. The stock price adjusts to balance supply and demand. Whenever possible, trades take place. The agents' prices adjust randomly, plus a momentum component: temple_abm_economy_stock_market.m
Matlab Introductions and References
Homework Problem Sets
Course Projects
Every student has to conduct an individual course project over the course of the semester. Proposals (written, via email) for projects are due Tue 01/26/2016. Midterm project reports are due Tue 03/08/2016.
  • Keaon Brown: Virus spreads through a system
  • Aidan Lorenz: Information spread and how certain causes gain public traction
  • Charles Patterson: Modeling the impact of financial trades on stock and options pricing
  • Hansen Pei: How a topic goes viral among social media
  • Michael Saah: Modeling pedestrian movement
  • Tommy Wong: Modeling firms in competition