Patrick Dwyer

Nature of Code

Can we capture the unpredictable evolutionary and emergent properties of nature in software? Can understanding the mathematical principles behind our physical world world help us to create digital worlds? This class will focus on the programming strategies and techniques behind computer simulations of natural systems. We’ll explore topics ranging from basic mathematics and physics concepts to more advanced simulations of complex systems. Subjects covered will include forces, trigonometry, fractals, cellular automata, self-organization, and genetic algorithms. Examples will be demonstrated using the processing environment with a focus on object oriented programming.
Syllabus ( pdf )
Homework Wiki ( html )

Week 1 - Introduction & Vector Motion ( html | pdf )
An introduction to the topics of the class. A quick review of the Processing environment is followed by a refresher on the basics of Object Oriented Programming. The basics of 2-dimensional vector motion are covered.
Week 2 - Forces ( html | pdf | examples )
The second week delves into Newtonian motion and gravitational forces. Starting with applying multiple forces to a single object, moving on to attractors, multiple objects in motion and mutual attraction.
Week 3 - No More Random Numbers ( html | pdf | examples )
The third week covers random number generation methods, including Uniform, Gaussian and Custom distributions, and how they effect simulations.
Week 4 - Making Waves ( html | pdf | examples )
This week we take a look at oscillations, polar coordinates, creating wave simulations, and 2D graphing.
Week 5 - Particle Systems ( html | pdf | examples )
The fundamentals of creating particle systems; includes a review of the Object Oriented Programming techniques of Inheritance and Polymorphism.
Week 7 - Fractals and Recursion ( html | pdf | examples )
The fundamentals of creating particle systems; includes a review of the Object Oriented Programming techniques of Inheritance and Polymorphism.
Week 8 - Autonomous Agents and Group Behavior ( html | pdf | examples )
Creating objects with environmentally responsive behavior, group behavior, flocking.
Week 9 - Genetic Algorithms ( html | pdf | examples )
The basics of creating Genetic Algorithms.
Week 10 - Applied Genetic Algorithms ( html | pdf | examples )
The basics of creating Genetic Algorithms.
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.