Universidad de Puerto Rico,
Recinto de Río Piedras
Facultad de Ciencias Naturales, Departamento
de Física
Título: Tópicos Especiales en Física I: Introduction to Scientific Computing
Código: PHYS
4041
Créditos: 3
Profesor: Julian
Velev
Office: Natural Sciences II, C-346
Email: julian.velev@upr.edu
Hours: Monday,
Wednesday 8:30-9:50; C-311
Office
hours: By appointment
Prerequisites: Sufficient
preparation in calculus and physics to understand the examples. Basic computer
literacy such as text editing, administering the computing environment
(installing applications and libraries), executing code from the command
prompt, etc. Access to a computer where the Python programming environment and
libraries could be installed (preferably a laptop). It is the students’
responsibility to setup their own working Python environment.
Course
description: The goal of this course is to develop basic programming
proficiency for science majors. In class the students will learn the main
programming paradigms: data representation (data types and data structures),
program control (branching and loops); input and output (files and
visualization); error handling (exceptions); and object-oriented programming
(classes).
This
will be done in the context of examples taken from mathematics, physics,
biology, and economics. The unifying theme of the examples is that they are
statistical in nature. They include numerical methods such as Monte Carlo
integration, Monte Carlo simulations of thermodynamic equilibrium, game theory
and evolutionary game theory. The students will immediately apply the concepts
by implementing the examples in class and developing applications at home as
homework.
The
course will use the Python programming language because of its remarkable power
coupled with very clean and concise syntax. Python shortens the learning curve
allowing the students to quickly progress to the stage of producing meaningful
applications. At the same time is a very good foundation for those who will
continue to use other programming languages such as C++, Java, and Fortran.
Textbooks:
(1) H. P. Langtangen, A primer
on scientific programming with Python, 5nd
edition, (Springer, 2016), ISBN 978-3662498866
(2) H. P. Langtangen, Python
scripting for computational science, 3nd
edition, (Springer, 2009), ISBN 978-3540739159
Tentative schedule:
Week |
Title |
Reading |
1 |
Preliminaries Setup working python environment |
|
2 |
Introduction: General introduction to
computing Hands on: Setup the Python
environment. First program |
1.1,2 |
3 |
Data structures: Variables. Operators.
Standard data types. Math library Hands on:
Celsius-Fahrenheit conversion; Ball thrown vertically |
1.1,3,6; 6.3 |
4 |
Program elements: Branching. Loops Hands on: Calculation of functions
using Taylor expansions |
3.2; 2.1 |
|
Exam 1: Sep 29 (Mon) |
|
5 |
Data structures: Tuples and lists Hands on: Celsius-Fahrenheit (table) |
2.2-5; 6.2 |
6 |
Data structures: Arrays, strings, and
dictionaries. NumPy library Hands on: Polynomial
evaluation |
5.1,2,5,6 |
7 |
Program elements: Functions. Modules Hands on: Numerical differentiation.
Interest rates. |
1.4; 3.1; 4.4 |
|
Exam 2: Oct 20 (Mon) |
|
8 |
Input/Output: Standard input/output.
Command line. Files Hands on: Stock returns |
6.1,5; 5.3,4 |
9 |
Input/Output: Visualization.
Matplotlib library Hands on: Normal
distribution. Stock returns (plots) |
|
10 |
Error handling: Exceptions Hands on: |
4.3 |
|
Exam 3: Nov 17 (Mon) |
|
11 |
Numerical methods: Random numbers Hands on: Uniform and normal
distribution histogram |
8.1-3 |
12 |
Applications: Monte Carlo sampling Hands on: Numerical
integration. Monte Carlo integration |
8.5 |
13 |
Applications: Metropolis Monte Carlo.
Importance sampling Hands on: Ising model |
8.6,7 |
14 |
Applications: Game theory.
Evolutionary game theory Hands on: Cournot
duopoly. Hawk-dove game |
|
|
Exam 4: Dec 10 (Wed) |
|
Grading: The grade will be
based on four in class exams plus a course project, each
contributing 20% of the grade. Collaboration on the course project is not
allowed unless the project is explicitly assigned to a group. The course project will require the student
to produce working code and presentation. The project should be submitted in a
report form with introduction, design, implementation, and results sections.
The grading scheme is A, B, C, D, F.
University policies:
RIGHTS
OF STUDENTS WITH DISABILITIES
UPR
complies with all Federal and State Laws and regulations regarding
discrimination, including the Americans with Disabilities Act 1990 (ADA) and
the Commonwealth of Puerto Rico Law 51. Students receiving services through
Rehabilitation Vocational must contact the professor at the beginning of the
semester in order to plan for a reasonable
accommodation and any required support equipment according to the
recommendations given by the Oficina de Asuntos para Personas
con Impedimentos (OAPI) of the Dean of
Students. Likewise, students with special need that require some type of
accommodation must contact the professor at the beginning of the semester.
INTEGRIDAD ACADEMICA
La Universidad de Puerto Rico
promueve los más altos estándares de integridad académica y científica. El
artículo 6.2 del Reglamento General de Estudiantes de la UPR (Certificación
Núm. 13, 2009-2010, de la Junta de Síndicos) establece que "la deshonestidad
académica incluye, pero no se limita a: acciones fraudulentas, la obtención de
notas o grados académicos valiéndose de falsas o fraudulentas simulaciones,
copiar total o parcialmente la labor académica de otra persona, plagiar total o
parcialmente el trabajo de otra persona, copiar total o parcialmente las
respuestas de otra persona a las preguntas de un examen, haciendo o
consiguiendo que otro tome en su nombre cualquier prueba o examen oral o
escrito, así como la ayuda o facilitación para que otra persona incurra en la
referida conducta". Cualquiera de estas acciones estará sujeta a sanciones
disciplinarias en conformidad con el procedimiento disciplinario establecido en
el Reglamento General de Estudiantes de la UPR vigente.
INTELIGENCIA ARTIFICIAL
En estos cursos, a menos que el
silabo específicamente lo indique, todas las técnicas o los instrumentos para
la evaluación del aprendizaje deberán completarse sin asistencia de
herramientas de Inteligencia Artificial. El objetivo es garantizar que el
estudiante demuestre sus conocimientos, destrezas, habilidades y comprensión
fundamentales en un entorno controlado. Cualquier uso de la IA en las técnicas
o los instrumentos para la evaluación del aprendizaje será considerado una violación
de las normas de integridad académica.
ACOMODO RAZONABLE
La Universidad de Puerto Rico
cumple con todas las leyes federales, estatales y reglamentos concernientes a
discriminación, incluyendo "The American Dissabilities Act" (Ley
ADA) y la Ley 51 del Estado Libre Asociado de Puerto Rico. Los estudiantes que
reciban servicios de rehabilitación vocacional deben comunicarse con el (la)
profesor(a) al principio del semestre para planificar el acomodo razonable y
equipo de apoyo necesario conforme a las recomendaciones de la Oficina de
Asuntos para las Personas con Impedimento (OAPI) del Decanato de Estudiantes.
Una solicitud de acomodo razonable no exime al estudiante de cumplir con los
requisitos académicos del curso.
HOSTIGAMIENTO SEXUAL
La Universidad de Puerto Rico
prohíbe el discrimen par razón de sexo y género en todas sus modalidades,
incluyendo el hostigamiento sexual. Según la Política institucional contra el
Hostigamiento Sexual en la Universidad de Puerto Rico, Certificación Núm. 130,
2014-2015 de la Junta de Gobierno, si un estudiante está siendo o fue afectado
por conductas relacionadas a hostigamiento sexual, puede acudir ante la Oficina
de la Procuraduría Estudiantil, el Decanato de Estudiantes o la Coordinadora de
Cumplimiento con Titulo IX para orientación y/o presentar una queja.