News
Mar 27, 2025
Project presentations will take place on Wednesday, April 2. Each
presentation is 3 minutes long. Project presentation schedule is
here.
Mar 23, 2025
We are getting to the end of term. No new labs. The focus now is to complete the course projects.
Mar 23, 2025
Student feedback instructions are sent out via Canvas. Please take a moment to complete course feedback.
Feb 05, 2025
We covered random processes, random walks, LCM, and Chi-Square and Kolmogorov-Smirnoff tests.
Feb 26, 2025
We covered collision response for rigid bodies.
Feb 16, 2025
No classes during reading week. Regular programming will resume on Monday, Feb 24.
Feb 12, 2025
Feb 12 in-class notes are now uploaded.
Feb 3, 2025
First midterm will take place on Wednesday,
February 5. The midterm will start at 11:10. The duration is 80 minutes.
The midterm will cover everything that we will have covered thus far. It
is a paper based midterms. No aids are allowed. It is okay, however, to
bring a basic calculator, in case you need it.
Jan 30, 2025
Jan 29 in-class notes are now uploaded.
Jan 27, 2025
Lab 3 on earth and moon is now available on Canvas.
Jan 23, 2025
Jan 22 in-class notes are now uploaded.
Jan 18, 2025
Lab 2 on projectile motion is now available on Canvas.
Jan 16, 2025
Jan 15 in-class notes are now uploaded.
Jan 8, 2025
Labs will start from the week of Jan 13.
Jan 1, 2025
Course website is now up.
Description
This is a survey course on simulation methodologies, techniques, and
applications.
Constructing computer simulations is perhaps one of the funnest
things one can do with a computer. Imagine the thrill of simulating an
entire planet inhabited with life-like beings going about their
business, pondering life’s big questions? Ok, we aren’t quite there yet,
but already we have access to countless games that simulate one
phenomenon or another for the purposes of entertainment. Think SimCity
that simulates a metropolis, or Factorio that simulates, what can only
be described as, a logistics nightmare. We have games that simulate
driving cars, flying airplanes, playing soccer, hunting big game, and
fighting in wars, etc. Similarly we have games that simulate entire
worlds populated with dinosaurs and robots and everything in-between:
Xenoblade, any one.
Within this context, this course aims to introduce students to
computer simulations. We will not be using simulation packages rather we
will explore the mathematical models and programming practices that
underpin systems that can be used to create computer simulations.
Entertainment and games are not the primary use of computer
simulations however. Designers and engineers rely heavily on simulations
when designing and implementing complex systems, e.g., airplanes,
bridges, highways, drugs, nuclear reactors, etc. Simulations enable us
to ask the what if question, which is especially useful when we do not
have the access to the actual system or when it is simply too dangerous
to run the experiments on the actual system. E.g., how many cars before
a bridge collapses? Clearly, we cannot pile cars on a bridge and wait
for it to collapse! Many a times simulation is the only mechanism
through which we can study a phenomenon.
Another use of simulations is in education and training sphere where
it is sometimes easier, cheaper, less dangerous to use a simulation for
training. Think how pilots are routinely trained on high-fidelity flight
simulators.
Within this context, we will discuss the mathematics, physics, and
statistics theory plus programming practices that underpin modern
computer simulations. The focus is not to use existing computer
simulation tools rather the course aims at developing competency needed
to implement computer simulations. By necessity we will focus on setting
up simulations for toy problems, such as a ball bouncing on an inclined
plane, a factory floor, nuclear decay, random walks, etc.
Grading
- Class participation, quizzes, and exercises 10%
- Lab and assignment participation and completion 15%
- Midterm exams 60%
- Course project 15%
A student must get 50% in the midterm exams to pass the
course.
Important dates
- Midterm 1, Wednesday, February 5, in class
- Study break during the week of February 17
- Midterm 2, Wednesday, March 19, in class
- Project selection due by March 3
You may loose up to 10% of the course project grade if project
selection isn’t finalized by Mar 4. You may loose up to an additional
20% of the course project grade if the project selection isn’t finalized
by Mar 11. If the project isn’t selected by Mar 11, you’ll be asked to
provide a written explanation for the delay.
- Project topics presentations on March 5 (tentative)
- Project report due on April 6, 11:59 pm
You may be asked to record a 3 minute long project presenation that
will be submitted before the last week of lectures.
Ontario Tech University’s academic calendar that lists important
dates (and deadlines) is available at here.
Course Calendar
Week 1
Topics
- Why simulations?
- Validate a model or a theory
- Perform experiments
- Support model-based design
- Education and training
- Building simulations
- Requirements
- Modeling
- Data collection
- Implementation
- Validation
- Use
Notes
Lab
Labs start from the second week. Labs will be available on the course
canvas.
Week 2
Topics
- Continuous systems
- Variables: state, input, and output
- Time
- Ordinary Differential Equations (ODEs)
- Mass-Spring system
- Ball falling under gravity
- Bouncing balls
- Energy calculations
- Potential and kinetic energy
- Projectile motion
- Terminal Velocity
- Modelling drag
Notes
Code examples
Activity
Lab
Week 3
Topics
- Continue our discussion of continuous systems
- 2D Mass-Spring System Implementation
- Solving ODEs in Python
- Euler method
- Runga-Kutta method
- Many body simulations
Notes
Code examples
Activity
Lab
Week 4
Topics
- Coordinate frames
- Rigid body dynamics
- Particles vs. rigid bodies
- Position and Orientation
- Linear and angular velocities
- Forces and Torques
- Center of mass
Notes
Code examples
Activity
Lab
Week 5
Midterm 1
Topics
- Rigid body dynamics (continued from last week)
- Inertia tensor
- Equations of motions
- Shape representation
Activity
Lab
- No new labs this week. Labs will still take place and all of you are
encouraged to use these times to prepare for the midterm and catch up on
the material.
Week 6
Topics
- Collision detection
- Collisions with a static object
- Collision between moving targets
- Efficiency considerations
Notes
Code examples
Activity
Lab
Reading week break
Week 7
Topics
- Collision response
- Rigid body collisions
- Conservation of momentum
- Newton’s Law of Restitution for Instantaneous Collision with no
Friction
- Empirical model of frictionless collision
Notes
Activity
Lab
Week 8
Topics
- Random processes
- Monte Carlo simulations
- Random walks
- Generating Random numbers
- Linear Congruential Method (LCM)
- Chi-Square test
- Kolmogorov-Smirnov test
Notes
Code examples
Activity
Lab
Week 9
Topics
- Generating random numbers from uniform and non-uniform discrete
distributions
- Generating random numbers from Gaussian distribution
Activity
Lab
- No new lab this week. Rigid body simulation lab is a two weeks
lab.
Week 10
Midterm 2
Topics
- Discrete event systems
- Anatomy of a DES
- Entity
- Variable
- Queue
- Resources
- Statistics
Notes
Week 11
Topics
- Discrete Event Systems (DES)
Activity
Lab
Week 12
Topics
- Many particle systems
- Molecular dynamics
- Boundary conditions
- Setting up initial conditions
- Pressure and temperature
- Ensemble
- Microcanonical ensemble
- Quasi-ergodic hypothesis
- Demon algorithm
- Ising model
- Validation and verification
Notes
Labs
Activity
Course project (Slides)
The course project is an independent exploration of a specific
problem within the context of this course. The topic of the project will
be decided in consultation with the instructor.
Project grade will depend on the ideas, how well you present them in
the report, how well you position your work in the related literature,
how thorough are your experiments and how thoughtful are your
conclusions.
Teams of up to two students are allowed.
Below, you will find a list of projects that students have done in
the previous iterations of this course:
- Angry birds;
- Flappy birds;
- Balancing an inverted pendulum on a moving platform;
- Billiard;
- Rocket simulation;
- Stock market simulation;
- High-performance collision detection;
- Simulating a waving flag;
- The attack of zombies;
- Rigibu puzzle;
- Modeling storms;
- Fireworks;
- An analysis of customer service in call centres;
- Crowd simulation;
- A vehicle rental network;
- Golf;
- A leaf blowing in the wind; and
- Simulating waves.
Final report and a
three-minutes video
For your final project write-up you must use the VCLab course project
template available at Overleaf.
Project report is expected to be between 4 to 8 pages.
Additionally, you may submit a 3 minutes video for your project.
Resources
Reading material
No single textbook covers all the material that we will discuss in
this course. Still the following two books are useful for a deeper study
of most of the topics that we will cover in this course.
- Harvey Gould, Jan Tobochnik, and Wolfgang Christian, “An
Introduction to Computer Simulation Methods: Applications to Physical
Systems,” Third Edition, Addison Wesley, 2007.
- Wolfgang Christian, “Open Source Physics: A User’s Guide with
Examples,” Addison Wesley, 2007.
Students are strongly encouraged to take their own notes during
lectures.
Programming resources
Course labs will use Python3.
In the past, we have also used the OSP Java Package and Arena
Simulation Software.