|
Summary. A project-based introduction to scientific computing that in addition to covering foundational mathematical concepts, presents the Julia language as an introductory programming environment and uses the TeXmacs scientific editing platform to refine the concept of literate programming to the requirements of reproducible computational research.
Times |
MWF 9:05-9:55AM, Phillips 224 with Zoom synchronous meeting. |
Office hours |
Tu 4:00-4:30PM, We 3:00PM-4:00PM Chapman 451, and by email appointment, Zoom |
Instructor |
|
Jump to | Policies: 3.2 Lessons: 4.2Software: 5.2Live documents: 5.4 |
(The instructor reserves the right to make changes to the syllabus. Any changes will be announced as early as possible.)
Computational modeling of natural phenomena has become a cornerstone of scientific inquiry, completing the traditional methods of theory construction and experimentation. The distinctive feature of scientific computation is exhaustive testing of our understanding of well-defined theoretical models, to an extent that is not possible without machines to rapidly carry out arithmetic operations. This seminar will introduce students to the art of successful scientific simulation. Simple models from the physical, biological, and social sciences will be introduced, given correct mathematical formulations, implemented in computer code, and analyzed. Concepts from the sciences, mathematics, and programming will be introduced as needed with no formal prerequisites beyond typical high school material. The objective will be to produce “live” computational documents that serve as virtual experiments for some field of scientific inquiry.
Relevance of computational approaches to science requires adoption of the scientific method of verification of the predictions resulting from conjectures (or hypotheses or theories). For scientific computing, the conjectures are the mathematical approach and implementation into a program executed by a computer. Predictions are obtained from program execution and verified by comparison to known results or experiments. Such computational predictions should be reproducible. This course adopts the Julia programming language, a general-purpose language with many features useful for scientific computing, as the environment to introduce the practices of reproducible computational research.
A key part of the scientific method is documentation of an investigation, clearly citing sources, approaches, hypotheses, and results. Several specialized programming languages have been developed for this purpose (TeX, LaTeX, Markdown), some with an explicit focus on documenting theoretical approach and computer implementation simultaneously (web), a practice known as literate programming. The project-based approach of this course seeks to instill this practice of scholarship into all aspects of scientific computing, defining a literate programming approach based upon the TeXmacs platform in conjunction with Zotero reference management.
Upon successful course completion students will be:
able to recognize a well-formulated computational model of a natural phenomenon;
exposed to fundamental mathematical concepts arising in computational modeling including:
difference calculus, a computational system based on considering small increments of quantities of interest, and that leads to differential calculus when the increments become infinitesimally small
algebraic structures, a consistent set of rules on manipulation of mathematical objects
linear algebra, a particular algebraic structure that constructs complex objects by scaling and composition of simpler objects
random numbers arising from the probability of specific events arising in some phenomenon
stochastic calculus, a computational system for random variables
graphs and networks to model phenomena in which component parts have a finite number of interconnections
agent-based modeling as an introduction to the dichtomy between microscopic and macroscopic modeling;
introduced to basic programming techniques (e.g., comparable to COMP110 or COMP116) including:
data types, variables, constants, definition scope
statements, expressions, and operators
control flow, conditional, iterative and recursive code
data structures, lists, trees, dictionaries
functions, arguments, parameters, return types
object-oriented programming;
able to document computational research using rigorous scholarly practices.
Unless explicitly stated otherwise, all work is individual. You may discuss various approaches to homework problems with students, instructors, but must draft your answers by yourself. All external sources consulted must be acknowledged and cited. Students implicitly accept this honor code by submission of any work for grading.
Class attendance is expected and highly beneficial to understanding of course topics. There is no need to inform instructor of planned absences.
Course grade is based upon accumulation of credit points (0-100). There is no “grading on a curve”, but 112 total points are possible, enabling some margin of error in the coursework.
Homework is to be submitted in typeset form as a TeXmacs document through Sakai. Late homework is accepted only in the case of University approved class absences. E-mail messages requesting acceptance of late homework due to any other circumstance are deleted without review or response. Students are advised to prepare and submit homework well in advance of the Sakai deadline to allow for unforseen difficulties. Suspension of classes due to campus-wide events (weather, pandemic, etc.) will lead to modification of due dates or elimination of specific assignments for the entire class.
Accessibility resources and services. The University of North Carolina at Chapel Hill facilitates the implementation of reasonable accommodations, including resources and services, for students with disabilities, chronic medical conditions, a temporary disability or pregnancy complications resulting in barriers to fully accessing University courses, programs and activities.
Accommodations are determined through the Office of Accessibility Resources and Service (ARS) for individuals with documented qualifying disabilities in accordance with applicable state and federal laws. See the ARS Website for contact information: https://ars.unc.edu or email ars@unc.edu.
Counseling and psychological services (CAPS). CAPS is strongly committed to addressing the mental health needs of a diverse student body through timely access to consultation and connection to clinically appropriate services, whether for short or long-term needs. Go to their website: https://caps.unc.edu/ or visit their facilities on the third floor of the Campus Health Services building for a walk-in evaluation to learn more.
Title IX resources. Any student who is impacted by discrimination, harassment, interpersonal (relationship) violence, sexual violence, sexual exploitation, or stalking is encouraged to seek resources on campus or in the community. Reports can be made online to the EOC at https://eoc.unc.edu/report-an-incident/. Please contact the University's Title IX Coordinator (Elizabeth Hall, interim – titleixcoordinator@unc.edu), Report and Response Coordinators in the Equal Opportunity and Compliance Office (reportandresponse@unc.edu), Counseling and Psychological Services (confidential), or the Gender Violence Services Coordinators (gvsc@unc.edu; confidential) to discuss your specific needs. Additional resources are available at safe.unc.edu.
Coursework is centered around the development of seven computational projects, with 16 points possible in each project for a total of 112 offered course credit points.
Grade |
Points |
Grade |
Points |
Grade |
Points |
Grade |
Points |
A+ |
101-112 |
B+ |
86-90 |
C+ |
71-75 |
D+ |
56-60 |
A |
96-100 |
B |
81-85 |
C |
66-70 |
D |
50-55 |
A- |
91-95 |
B– |
76-80 |
C- |
61-65 |
F |
0-49 |
The following seven projects will be developed during the course at a pace of approximately two weeks per project:
Population models. P01
Crystals, quasicrystals, and tilings.
Image processing.
Random walks and diffusion in physics and finance.
Monte Carlo, legislative redistricting.
Graph Laplacian and spectral clustering in machine learning.
Flocking, schooling, and folding.
Each project introduces:
theoretical background drawn from the appropriate field of science;
mathematical concepts suitable for phenomenon description;
programming approaches to implement mathematical concepts;
representative scientific literature for the problem.
The course workcycle consists of five lessons to present theoretical material and computational techniques, followed by an in-class session to address final questions on project preparation. The project is due at 11:55PM on day of following class meeting. Due dates are marked in bold. A new project is started on the project due dates.
Week |
Notes |
Date |
Topic |
01 |
08/18 08/20 08/23 |
Introduction to Julia and TeXmacs Exponential, logistic population growth Difference equations and solutions |
|
02 |
08/25 08/27 08/30 |
Interacting populations: predator-prey Population states: Susceptible, Infectious, Recovered Differential equation models, correspondence principle |
|
03 |
09/01 09/03 09/08 |
In-class completion of Project 1 Periodic structures, crystals, mathematical groups Tilings, mathematical groupoids |
|
04 |
09/10 09/13 09/15 |
Crystals and quasicrystals in nature Tilings in art Diffraction, projection, visualization |
|
05 |
L12 L13 |
09/17 09/20 09/22 |
In-class completion of Project 2 Representation of visual information Vectors and matrices |
06 |
L14 L15 L16 |
09/24 09/27 09/29 |
Matrix factorization, singular value decomposition Image transformations Image compression and reconstruction |
07 |
L17 L18 |
10/01 10/04 10/06 |
In-class completion of Project 3 Probability and set theory Random walks |
08 |
L19 L20 |
10/08 10/11 |
Probability distributions Scaling, diffusion |
09 |
L21
|
10/13 10/15 |
Financial market modeling In-class completion of Project 4 |
10 |
L22 L23 L24 |
10/18 10/20 10/22 |
Deterministic versus random modeling Summation of many random events, Monte Carlo integration Stochastic modeling |
11 |
L25 L26
|
10/25 10/27 10/29 |
Packing within physical systems Legislative district allocation In-class completion of Project 5 |
12 |
L27 L28 L29 |
11/01 11/03 11/05 |
Discrete versus continuum models Graphs and networks Discrete and continuum Laplace operator |
13 |
L30 L31
|
11/08 11/10 11/12 |
Machine learning and clustering Spectral clustering In-class completion of Project 6 |
14 |
L32 L32 L34 |
11/15 11/17 11/19 |
Interacting system components: nucleons, particles, atoms, molecules Interacting system components: agents Clustering behavior: flocks, schools |
15 |
L35 L36
|
11/22 11/29 12/01 |
Correlated motion: protein folding Stochastic interactions: Langevin models In-class completion of Project 7 |
Students are required to have a laptop, that conforms to CCI minimal standards, and is brought to every class session.
Scientific computation benefits from freely available software of high quality. One goal of the course is to familiarize students with these capabilities and acquire the practical skills needed for scientific computing. Students are asked to carry out the following steps to install course software.
Students with laptops that use x86-64 architecture, and interested in gaining familiarity with the Linux operating system, widely used in scientific computing, especially in high-performance computing, can install the SciComp@UNC environment. All course tools have been preconfigured for immediate use. Follow instructions at SciComp@UNC to install on a laptop with at least 24GB free disk space and 8GB RAM.
Create a directory named C:\courses
Install TortoiseSVN
Open File Explorer and right-click to open options (“See more options” in Windows 11) for folder C:\courses. Select SVN checkout option and enter:
URL repository: svn://mitran-lab.amath.unc.edu/courses/MATH089
Checkout directory: C:\courses\MATH089
Click OK, and a copy of the course material repository is downloaded to your laptop.
Julia programming language. Choose installation directory C:\courses\julia
Modify the System variable PATH to include C:\courses\julia\bin
TeXmacs editing platform. Choose installation directory C:\courses\texmacs
Open File Explorer and right-click to open options (“See more options in Windows 11”) for folder C:\courses\texmacs\plugins. Select SVN checkout option and enter:
URL repository:
svn://mitran-lab.amath.unc.edu/courses/texmacs/plugins/julia
Checkout directory: C:\courses\texmacs\plugins\julia
Open the Terminal app and create a directory named ~/courses
cd ~; mkdir courses
Install SmartSVN
Open SmartSVN and select option Check out project from repository, click OK. Enter:
Repository: svn://mitran-lab.amath.unc.edu/courses/MATH089, select MATH089 directory
Local directory: ~/courses/MATH089
Click Continue, and a copy of the course material repository is downloaded to your laptop.
Julia programming language. Choose installation directory C:\courses\julia
Modify the System variable PATH to include /Applications/Julia-1.6.app/Contents/Resources/julia/bin
TeXmacs editing platform.
Open SmartSVN and select option Check out project from repository, click OK. Enter:
Repository:
svn://mitran-lab.amath.unc.edu/courses/texmacs/plugins/julia
Checkout directory: /Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/plugins
Software usage is introduced gradually in each class, so the first resource students should use is careful, active reading of the material posted in class. In particular, carry out small tasks until it becomes clear what the software commands accomplish. Some additional resources:
All course material is presented as TeXmacs documents with embedded interactive Julia sessions. Such documents have a .tm extension and are available through svn download from the course repository. Notes posted on the lesson plan contain translations of the live documents to .pdf or .html formats.
Live documents allow immediate application of course topics, as shown here to construct the Fibonacci numbers, defined as , , for a natural number, and an early model (1202) for rabbit population growth. This is an example of recursion, a function that calls itself, a useful programming paradigm, though not very efficient in this case.
Algorithm - Fibonacci numbers Input: a natural number if then return 0 if then return 1 return |
Julia (1.6.1) session in GNU TeXmacs
|