Skip to content

amandaedwin/PHYS248

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHYS248: Computer Assisted Mathematics and Physics

A second-year course Introduction to Computational Physics expressed in the Python programing language.

(c) Copyright 2020 Falk Herwig (University of Victoria)

Index of PHYS248

Topics, week-by-week

  1. Python programming I: Language elements, basic math operations
  2. Python programming II: Plotting, interpolation, units, examples and applications
  3. Linux/Unix OS, GNU, editors, git
  4. Numerical integration and differentiation
  5. Python programming III: program organization (functions, modules, classes, libraries, scripts, parameter passing)
  6. Numerical Analysis: Integration and differentiation with libraries
  7. ODE I: Skydiver problem or similar, explicit Euler-step integration, mulit-processing
  8. ODE II, Linear transformations and linear algebra
  9. Simple stats & data modeling
  10. Data analysis and examples
  11. Sympy (symbolic computing) and image processing
  12. Optimization (simulated annealing), audification, LIGO graviational wave signals

1.1 Intro to Python language I (1/2)

  • Intro
    • JupyterLab and notebooks
    • Using a code cell like a calculator
    • Variables
  • Algebra and statements
    • Arithmetic operators
    • Difference between mathematical equality and computational statment
    • How to solve an exercise?
  • Data types
    • Overview
    • Strings and scalar variables
    • Lists and arrays
  • Formatted printing

1.2 Intro to Python language I (2/2)

  • Data types II
    • Type of a variable and type conversion
    • Boolean
    • Array review: slicing, index arrays, masks
  • Intro to libraries
    • Loading libraries, Python name space and the doc string
    • Four different ways to do sqrt
  • Flow control
    • if, for loop, while, try
    • Avoiding loops

2.1 Intro to Python language II (1/2)

  • Simple line plots and examples
    • Convergence of geometric series
  • Advanced arrays
    • Array analysis
    • A selection of array functions
    • Higher-dimensional arrays

2.2 Intro to Python language II (2/2)

  • Advanced plotting
    • Bar plots, scatter plots
    • 2D plots
  • Basic I/O
    • Interactive input
    • Writing and reading ASCII tables

3.1 Linux/Unix OS, GNU, editors, git

  • JupyterLab
    • Notebooks
    • Terminal, Markdown documents and text editor
    • Restarting the JupyetLab application
  • Software and hardware
  • Introduction to the command line
    • Shell
    • Basic file system commands
    • Networking and compressing data
    • Command line editor
  • Distributed version control - Git
    • Basic concepts
    • The most important git commands

3.2 Linux/Unix OS, GNU, editors, git

  • Review
    • Terminal FAQs
    • Git FAQs
  • Git - part II
    • Additional useful commands, branching and merging
    • How to get and stay out of trouble
  • Advanced terminal and shell commands
    • More file system commands
    • More about the shell
    • Networking
    • Shell scripts
  • More git
  • The sys module

4.1 Numerical integration and differentiation

  • The Riemann sum
    • Midpoint rule
    • Trapezoidal rule

4.2 Numerical integration and differentiation

  • Introduction to functions
    • def
    • lambda
  • Numerical derivatives
    • Difference equations
    • Derivatives
    • Errors: accuracy vs. precision
    • Convergence
    • Higher-order derivative

5.1 Python programming III: program organization

  • Functions an modules
    • Try - except
    • Combine functions into a module for later use
  • Python scripts
    • Module as Python script - the test block
    • A module directory
  • Units and constants
  • Miscellaneous
    • Dictionaries

5.2 Python programming III: program organization

  • Review:
    • units
    • dictionaries
    • An example where Monte-Carlo integration wins
  • Integration with libraries
  • Miscellaneous
    • sort, join, split, strip

6.1 Numerical Analysis: Integration and differentiation with libraries

  • Derivatives
    • Derivative of numerical data
    • Non-equidistant and noisy data
    • Gradient of 2D function
  • Miscellaneous
    • map
    • Multi-threaded processing
    • Animation, make movie with ffmpeg

6.2 Midterm

7.1 ODE I

  • Ordinary differential equations
    • Euler step
    • Discretisation
  • Miscellaneous
    • map
    • Multi-threaded processing
    • Animation, make movie with ffmpeg

7.2 ODE I

  • Non-linear equations
    • Relaxation method
    • Binary search - bisection method
    • Newton-Raphson
  • Skydiver problem: Falling body with drag
    • Equation of motion
    • Solve ODE explicit
    • Solve with library

8.1 ODE II

  • 3D line plots
  • ODE's with mulitple coupled equations
    • Lotka–Volterra equations and comparison of two solvers
    • Discuss and understand the accuracy of a numerical solution, and how to use libraries properly
    • Conclusions and recommendations
  • Chaos: Lorenz equations

8.2 Linear transformations and linear algebra

  • Linear Algebra
    • Basic matrix and vector operations
    • Linear transformations
    • Solving systems of equations

9.1 Data modeling

  • Fitting data
  • Standard normal distribution
  • Moments of distribution
  • Least-square fitting of arbitrary curve

9.2 Data modeling

  • Linear correlation
  • Fitting data with a model

10.1 Data analysis

  • Fitting a Gaussian distribution to a data set
  • Application: Fitting mixing results from hydrodynamic simulations

10.2 Examples

  • A couple of miscellaneous items: plotting lines with colormap color, integer word length and sets
  • Lorenz equations
  • Recaman's sequence

11.1 Sympy

  • An introduction to Sympy

11.2 More Sympy and image processing

  • More Sympy
    • limits
    • series expansion
    • root finding
    • differential equations
  • Image Processing for fun and science!
    • image basics
    • linear image filters
    • other filters (median)
    • histograms and statistics

12.1 Optimization: Simulated Annealing

  • Simulated Annealing
    • Travelling salesman problem

12.2 Audification, LIGO Gravitational Wave Signals

  • Audification
  • The LIGO gravitational wave discovery in 2015

About

Introduction to Computational Physics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.3%
  • Other 0.7%