Official Information 
Course Number:  SCTC 2100.001 
Course Title:  Topics in Science and Technology: Modeling and Simulation in Science and Technology 
Times:  TR 3:304:50 
Places:  SERC 456 
 
Instructor: 
Benjamin Seibold 
Instructor Email: 
seibold(at)temple.edu 
Instructor Office:  518 Wachman Hall 
Instructor Office Hours:  T 1:002:00, R 2:003:20. 
 
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 realworld 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 largescale 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:  05/03/2018. 
Course Schedule 
01/16/2018 Lec 1 
Mexican wave example, fundamentals of Matlab

01/18/2018 Lec 2 
Deterministic vs. stochastic models, contagion model, Matlab data structures

01/23/2018 Lec 3 
MonteCarlo method, nested functions in Matlab

01/25/2018 Lec 4 
Random walks, randomness in Matlab

01/30/2018 Lec 5 
Random walks in 2d, histograms

02/06/2018 Lec 6 
Random walks with bias, simulated annealing

02/12/2018 Lec 7 
Butterfly example, runandtumble, E. coli example

02/13/2018 Lec 8 
Agents affecting field quantities

02/15/2018 Lec 9 
Diffusion (macroscopic and microscopic)

02/20/2018 Lec 10 
Interactions between agents, population dynamics

02/22/2018 Lec 11 
Theory of population dynamics

02/27/2018 Lec 12 
Population dynamics, dynamical systems, equilibria, stability

03/01/2018 Lec 13 
Continuous vs. discrete time stepping

03/13/2018 Lec 14 
Numerical time stepping

03/15/2018 Lec 15 
RungeKutta methods, complexity

03/20/2018 Lec 16 
Traffic flow: car following models, traffic waves, instabilities

03/22/2018 Lec 17 
Traffic flow: cellular automaton models

03/27/2018 Lec 18 
Conway's game of life

03/29/2018 Lec 19 
General cellular automaton models

04/03/2018 Lec 20 
Models for crowd dynamics

04/05/2018 Lec 21 
Swarming and flocking

04/10/2018 Lec 22 
Ant colony simulation

04/12/2018 Lec 23 
Agentbased economic models: fundamentals

04/17/2018 Lec 24 
Agentbased economic models: trading

04/19/2018 Lec 25 
Agentbased economic models: stock market

04/24/2018 Lec 26 
Opinion dynamics, Calibration, Verification, Validation,

04/26/2018 Lec 27 
Project presentations

05/03/2018 
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 nonvectorized fashion:
temple_abm_mexican_wave_alternative.m
 Simple model for a contagion process of agents in a onedimensional 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 heavytailed step lengths) in two space dimensions, with lognormally 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 runandtumble, 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 concentrationbased runandtumble motion, the bacteria consume the concentration in their vicinity:
temple_abm_bacteria_run_and_tumble_and_eat.m
 Constructing density field from point positions in 2d, via histogram and kernel density estimation, using Gaussian kernels:
temple_abm_kde.m
 Diffusion of a 2d concentration field (with noflux boundary conditions), computed via a macroscopic finite volume method:
temple_abm_diffusion_macroscopic.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: predatorprey, 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
 Followtheleader 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 NagelSchreckenberg 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
 Opinion dynamics model. In a onedimensional opinion space, each agent is drawn towards the average opinion of other agents who are nearby in opinion space:
temple_abm_opinion_dynamics.m
 Opinion dynamics model with spatial component. In a twodimensional space (location, opinion), each agent is drawn towards the average opinion of other agents who are nearby in location as well as in opinion:
temple_abm_opinion_dynamics_2d.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/30/2018. Midterm project reports are due Tue 03/13/2018. Final project reports are due Tue 05/01/2018.
