Simulation and Modeling

CSCI 3010U

Winter 2020

Faisal Qureshi

faisal.qureshi@ontariotechu.net

Mar 26, 2020

Midterm 2 can be found here https://docs.google.com/forms/d/e/1FAIpQLSecyibzrD0QF6z4lkI1qxxQuSb_agFGJtBpBKUS6li4eYo-bg/viewform?usp=sf_link. It will be come available at 9:30 am. *Use this link unless I have emailed you a specific link.*

Mar 23, 2020

Mar 23, 2020

Project reports are now due before midnight, April 10. It is not necessary, but you can include a slide deck along with the project report. You will not be penalized for not having an accompanying slide deck; however, the slide deck can help your project scores.

Mar 19, 2020

Updated syllabus posted here.

Mar 17, 2020

Today’s lecture notes are available here.

Mar 16, 2020

To join the online lecture, click this link https://meet.google.com/ydf-bvmc-prj. Otherwise, to join by phone, dial +1 407-986-7186 and enter this PIN 633 323 934#

Mar 13, 2020

Many particles systems code is now available here.

Mar 12, 2020

Check course blackboard for **IMPORTANT INFORMATION**.

Mar 3, 2020

Fermat experiment exercise solution is now posted below.

Mar 2, 2020

Feb 27, 2020

Feb 27, 2020

Code examples for random processes posted below.

Feb 27, 2020

It seems that the weather isn’t as bad as we imagined. We will have a class today.

Feb 26, 2020

There is good chance that ~~tomorrows (Feb 27) lecture will be cancelled~~ due to inclement weather and university closure. I will post any updates here.

Feb 24, 2020

Feb 12, 2020

Online office hours now at https://meet.google.com/pqk-ukvg-yyz **CLOSED**

Feb 11, 2020

Feb 11, 2020

I will have **online office hours tomorrow from 9 am to 10 am**. We will connect via Google Hangouts. I will be posting the meeting link here.

Feb 11, 2020

Today’s office hours **cancelled**.

Feb 11, 2020

Today’s lecture notes are available here.

Feb 7, 2020

A **sample exam** is available on the course Blackboard.

Feb 4, 2020

Today’s lecture notes are available here.

Jan 30, 2020

Python ODE Solver Handout here.

Jan 30, 2020

Today’s lecture notes are available here.

Jan 28, 2020

Today’s lecture notes are available here.

Jan 23, 2020

Today’s lecture notes are available here.

Jan 21, 2020

Today’s lecture notes are available here.

Jan 16, 2020

Today’s lecture notes are available here.

Jan 14, 2020

Today’s lecture notes are available here.

Jan 10, 2020

Check out Siggraph 2019 Technical Papers Preview video for some ideas about projects.

Jan 9, 2020

Today’s lecture notes are available here.

Jan 5, 2020

Labs will start from week 2.

Jan 2, 2020

Website is now online.

**Faisal Qureshi**

Email: faisal.qureshi@ontariotechu.net

Office: UA4032

We will be using course Blackboard for online communication.

- Tue, 1 - 2 pm in UA4032
- Or by appointment

- Tue, 9:40 - 11 in UA2140
- Thursday, 9:40 - 11 in UA2140

- Check mycampus for available lab sections

- Ashkan Kiani

Email: ashkan.kiani@ontariotechu.ca

This is a survey course on simulation methodologies, techniques, and applications. The main emphasis of the course is on the use of simulation in physical sciences, in particular its applications in Physics. In this course we will learn to build simulations and to use these simulations to solve real world problems.

- Week 1 - Introduction and building simulations
- Week 2, 3 - Continuous systems, particle-based simulations
- Week 4, 5 - Rigid body dynamics
- Week 6 - Collision detection,
**Midterm 1** - Week 7 - Collision detection
- Week 8, 9 - Random processes
- Week 10 - Discrete event systems, many particle systems
- Week 11 - validation & verifaction,
**Midterm 2** - Week 12 - Project presentations

- Class participation, quizzes, and exercises 10%
- Lab participation and completion 20%
- Midterm exams 30%
- Course project 40%

*A student must get 50% in the course project to pass the course.*

- Midterm 1 (70 minutes) on Feb 13
- Study break during the week of Feb 18
- Midterm 2 (70 minutes) on Mar 26
- Project selection due by Mar 4

*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 addition 20% of the course project grade if the project selection isn’t finalized by Mar 11.* - Project final presentations during last lecture
- Project report due on Apr 5 midnight

Ontario Tech University’s academic calendar that lists important dates (and deadlines) is available at here.

- Introduction and building simulations
- Continuous systems
- Rigid body dynamics
- Notes on unconstrained rigid body dynamics
- Collision detection
- Notes on collision response
- Random processes
- Many particle systems
- Discrete Event Simulations
- Validation and verification

- 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

- Continuous systems
- Variables: state, input, and output
- Time

- Ordinary Differential Equations (ODEs)
- Reducibility

Labs start from the second week.

- Mass-Spring system
- Ball falling under gravity
- Bouncing balls
- Energy calculations
- Potential and kinectic energy

- Projectile motion
- Terminal Velocity
- Modelling drag

- 2D Mass-Spring System Implementation
- Solving ODEs in Python
- Euler method
- Runga-Kutta method

- Many body simulations

- 2D Mass-Spring System Implementation (Solution: util.py, sim.py, mass-spring-2d.py, sim_rk4.py)

- Rigid body dynamics
- Particles vs. rigid bodies
- Coordinate frames
- Linear and angular velocities
- Torque
- Center of mass
- Inertia tensor
- Equations of motions
- Shape representation

- Ball bouncing on an irregular floor (Solution: here)

- Collision detection
- Collisions with a static object
- Collision between moving targets
- Efficiency considerations
- Spatial partitioning

- Rigid body collisions

- Collision response
**Midterm 1**

- Random processes
- Monte Carlo simulations
- Random walks

No lab this week.

- Random numbers
- Generating random numbers from uniform discrete
- Generating random numbers from non-uniform discrete distributions
- Generating random numbers from non-uniform continuous distributions
- Normal distribution
- Exponential distribution

- Many particle systems
- Molecular dynamics
- Boundary conditions
- Setting up initial conditions
- Pressure and temperature

- Ensemble
- Microcanonical ensemble
- Quasi-ergodic hypothesis
- Demon algorithm

- Ising model

- Continues from last week.

- Discrete Event Systems
**Midterm 2**

- No lab this week.

- Validation and verification

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.

- 15 minutes
- the problem description with a motivation
- a quick overview of related work
- the proposed solution
- a technical description of the solution
- encountered difficulties
- an evaluation
- future work and conclusion

Project report is due by April 5, 2020, midnight EST. This is a firm deadline. For your final project write-up you must use ACM SIG Proceedings Template (available at the ACM website). Project report is at most 12 pages long, plus extra pages for references.

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.*

Course labs will use Python3.

In the past, we have also used the OSP Java Package and Arena Simulation Software.