Computational Methods for Physics & Astronomy
Contents
To open in Colab use the previous button or replace in the address bar:
github.com → colab.research.google.com/github
Computational Methods for Physics & Astronomy#
Book version:#
https://restrepo.github.io/ComputationalMethods/
by: Sebastian Bustamante 2014/2015 Diego Restrepo 2017…
This course is intended for students of Astronomy and Physics at the Universidad de Antioquia and will cover some numerical methods commonly used in science and specially in physics ans astronomy. These topics will be addressed from a formal context but also keeping a practical and computational approach, illustrating many useful applications in problems of physics and astronomy.
The practical component will be almost entirely developed in Python and slightly less in C (when computational performance is required). However students with knowledge in other programming languages (except privative languages like MatLab, Mathematica) are also aimed to use them.
In this repository it can be found all the related material of the course, including the detailed program, notes and presentations, examples (ipython notebooks) and homeworks. (This repository may be subject to changes continuously as the course advances).
Instructions to use the repository#
Use the Colab button to open the reposotry in an executable enviroment
To save changes:
File
→Download .ipynb
Open a repository in GitHub and Upload the file
To open again in Colab replace in the address bar:
github.com → colab.research.google.com/github
SYLLABUS: detailed description of the program of the course, including a brief motivation and presentation, topics to be covered, evaluation and bibliography.
Contents#
Links to chapters
Contents#
Links to notebooks:
1. Python (1 week)#
Topics
Git usage [View]
Processing
Overview of python [View]
Data analysis
Visualization
Activities
Activity 01: Solve the problems in the section Exercises.
2. Mathematical Preliminaries (1 week)#
Topics
3. One Variable Equations (2 weeks)#
./one-variable-equations.ipynb Topics
4. Interpolation Techniques (2 weeks)#
Topics
5. Numerical Calculus (2 weeks)#
Topics
Activities
Activity: Derivative exercise
6. Linear Algebra (2 weeks)#
Topics
7. Differential Equations (2 weeks)#
Topics
8. Statistics (1 week)#
Topics
9. Extra material (1 session)#
Topics
Bibliography#
[1a] Gonzalo Galiano Casas, Esperanza García Gonzalo Numerical Computation - GD - Web page with notebooks
[1b] Scipy Lecture Notes [PDF]
[1b] Jensen, Computational_Physics. GitHub
[1d] Introduction to computational physics
[1e] Thomas J. Sargent John Stachurski, Python Programming for Quantitative Economics
GitHub
[1f] Ani Adhikari and John DeNero, Computational and Inferential Thinking
[1g] Mo Mu, MATH 3311: Introduction to Numerical Methods GD
[1h] Zhiliang Xu, ACMS 40390: Fall 2016 - Numerical Analysis GD
[1f] Computational Physiscs, University of Toronto https://computation.physics.utoronto.ca/
[1g] Simon Sirca, Computational Methods for Physicists GD
[1h] Anthony Scopatz and Kathryn D. Huff, Effective Computation in Physics: Field Guide to Research with Python PDF GD
[1i] Tao Pang, An Introduction to Computational Physics PDF
[1k] Raúl Ramos Inteligencia Artificial para las Ciencias e Ingenierías
[1l] Marijn Haverbeke Eloquent JavaScript
[1m] Diego Restrepo Computadores en física
[2] Landau Paez, A Survey of Computational Physics
[3] Kiusalaas, Numerical Methods in Engineering with Python
[4] Sørenssen Elementary Mechanics Using Python_ A Modern Course Combining Analytical and Numerical Techniques_
[5] Langtangen_Python_Scripting_for_Computational_Science_3rd_edition
[6] Python programming standards Repository: https://github.com/kennethreitz/python-guide)
[7] Lecture notes Course Numerical Analysis (MatLab)
[8] Jupyter+Python: Python in Science
[9] Jupyter+Python: Python for Computational Science and Engineering PDF Notebooks
[10] Jupyter+Python: Scientific Computing and Simulation
[11] E. Ayres, Computational Physics With Python
[12] Hans Petter Langtangen A worked example on scientific computing with Python
[12] By Ani Adhikari and John DeNero Computational and Inferential Thinking
[13] By Sam Lau, Joey Gonzalez, and Deb Nolan. DS100 Principles and Techniques of Data Science](https://www.textbook.ds100.org/)
[14] Software Design and Development: The Preliminary Course, – January 1, 2002, by Samuel Davis (Author) [PDF]
[15] Bradley Voytek, et al, Data Science in Practice
[16] P. DeVries, A First Course in Computational Physics PDF
Appendix#
General configuration modules. It is recommended to use the following magic command to load all the plotting capabilities of python (also load numpy as np
) and display
%pylab inline
Populating the interactive namespace from numpy and matplotlib
Some times it is convenient to have advance display capabilities in the evaluation cells. It is possible with the module Ipython.display
. To have multiple special outputs in the same cell, it is necessary to use the display
function loaded with %pylab inline
from IPython.display import Math, Latex, HTML, JSON , Markdown, YouTubeVideo
HTML('<h1>Hola mundo</h1>')
Hola mundo
display( HTML('<h1>Hola mundo</h1>') )
display( Math(' \int \sin x\, d x') )
print('multiple and mixed print with display(..)')
Hola mundo
multiple and mixed print with display(..)
LaTeX is fully supported (see: https://stackoverflow.com/a/44375719/2268280)
Requirements#
Modules installed with pip(3)
%%writefile requirements.txt
sympy
ipywidgets
Writing requirements.txt
%%writefile postBuild
jupyter nbextension enable --py widgetsnbextension
Writing postBuild
Special modules HOWTO: Install JSAnimation for IPython Notebook
git clone https://github.com/jakevdp/JSAnimation.git
cd JSAnimation
python3 setup.py install
python setup.py install
Recomended libraries for final projects#
Vpython-jupyter See demo.ipynb