## SCME211 Computer Programming and Simulation

Instructor: Chaiwoot Boonyasiriwat (chaiwoot@gmail.com) Class Hours: Tuesday (1:30PM - 4:20PM) Classroom: TBA Objectives: To understand the fundamentals of computer programming and simulation, and to develop programming skills for solving real-world problems Grading: Homework 30, Project 30, Examination 40 Policies: Copying the work of others without acknowledgement is not allowed and may result in a failure to pass the course ## Tentative Course Schedule

Lecture Date Lecture Notes Notifications 1 Aug 16, 2016 Course overview, computer system and architecture 2 Aug 23, 2016 Introduction to C programming

Covered topics: Oracle Virtualbox, Ubuntu Linux system, vi, gedit, makeHW1: Write a report describing learned topics (Due Jan 19) 3 Aug 30, 2016 Introduction to C programming

Covered topics: program control, flowchart, function

Exercises: geometric series, Taylor's expansion of sin(x), absolute errorHW2: Write programs to compute and compare values of functions: cos(x), exp(x), ln(x), (1+x)^p (Due Jan 21)

Project proposal due Feb 11 in class4 Sep 6, 2016 Introduction to C programming

Covered topics: random number generation, file input/output, computing histogram of probability distribution of function rand() and load data from text file using MATLAB/Octave, Monte Carlo integration, Monte Carlo simulation of atomic orbitals

Resources: random number generator5 Sep 13, 2016 Introduction to C programming

Covered topics: array and pointer, writing programs with multiple source files

Resources: multiple files, complex number, function callHW3 6 Sep 20, 2016 Array and pointer (continued)

Resources: Gaussian function7 Sep 27, 2016 Web development using HTML, CSS, and JavaScript, graphics user interface (GUI), numerical methods for ODEs, Processing.js

Resources: Projectile with a linear dragHW4 (due Feb 9)

- Write your own personal web page using HTML and CSS
- Write a C program to compute the Mandelbrot fractal and save the result into a PPM file (Header: P2 601 601 16)
- Modify the JavaScript code to simulate a projectile motion with a quadratic drag
8 Oct 4, 2016 2D coordinate transformation: scaling and translation, introduction to object-oriented programming (comparison between structure and class) 9 Oct 11, 2016 Summary, numerical methods HW4 due 10 Oct 18, 2016 Project proposal presentation, student-centered learning 1: drawing 2D shapes, mouse-related event handling, introduction to object-oriented programming 11 Oct 25, 2016 student-centered learning 2: Euler methods, Client-Server paradigm, download/upload files, set-up web pages 12 Nov 1, 2016 student-centered learning 3: basic object-oriented and Java programming

Resource: Java codesHW5 due 13 Nov 8, 2016 student-centered learning 4: Java programming (animation, GUI), dynamic data structures, cellular automata and 2D game of life on a rectangular grid

Resources: Java codes14 Nov 15, 2016 student-centered learning 5: Drawing on a JPanel canvas, a simple Java animation, p-norm and infinity norm for checking if a square is selected, PHP (GET and POST examples), basics of OpenGL

Resources: PHP codes, OpenGL filesHW6 due 15 Nov 22, 2016 student-centered learning 6 16 Nov 29, 2016 Project presentation Turn in all project files (report, presentation, codes) - Dev 6, 2016 Midterm examination ## References

- P. Deitel and H. Deitel, 2010, C How to Program, Pearson Education.
- M. L. Boas, 2006, Mathematical Methods in The Physical Sciences, John Wiley & Sons.
- S. C. Chapra and R. P. Canale, 2010, Numerical Methods for Engineers, McGraw-Hill.