Skip to main content
Ctrl+K
AST4007W Computational Methods - Home AST4007W Computational Methods - Home
  • UCT NASSP AST4007W Computational Methods

Introduction

  • 1 Programming and Python in a Nutshell
  • 2 Control Flow Diagrams
  • 3 Debugging and Problem Solving Strategies
    • 3.1 Errors, Bugs and Debugging
    • 3.2 Problem Solving Strategy

The Python Standard Library

  • 4 Python Basics
    • 4.1 Variables
    • 4.2 Comments
    • 4.3 Numerical Operators
    • 4.4 Compound Assignment Operators
    • Exercise 4.4
    • 4.5 Type Conversion
    • 4.6 Introduction to Using Functions
    • 4.7 Strings
    • Exercise 4.7
    • 4.8 String Formatting
  • 5 Data Structures
    • 5.1 Tuple
    • 5.2 Lists
    • 5.3 Dictionaries
  • 6 If Statements
    • 6.1 Booleans (bool)
    • 6.2 Comparison Operators
    • 6.3 Logical Operators
    • 6.4 Inclusion Operators
    • 6.5 If Statements
    • 6.6 Nested If Statements
    • Exercise 6
  • 7 Loops
    • 7.1 While Loops
    • Exercise 7.1
    • 7.2 For Loops
    • Exercise 7.2
    • 7.3 List and Dictionary Comprehension
    • 7.4 Nested Loops
    • 7.5 Breaking Out of Loops
    • Exercise 7.5
    • 7.6 Else Statement and Loops
  • 8 Defining Functions
    • 8.1 return Statement
    • 8.2 Function Arguments
    • 8.3 Local Namespace and Variables
    • Exercise 8.3
    • 8.4 Recursive Functions
    • Exercise 8.4
    • 8.5 Doc Strings
  • 9 File I/O
    • 9.1 File I/O
    • Exercise 9.1
    • 9.2 Structured Data Files
    • Exercise 9.2
  • 10 Python Modules

Scientific Packages

  • 11 Numpy
    • 11.1 Arrays
    • 11.2 Array Methods and Attributes
    • Exercise 11.2
    • 11.3 2D Arrays and Matrices
    • Exercise 11.3
    • 11.4 NumPy Random Module
    • Exercise 11.4
    • 11.5 Array Conditional Statements and numpy.where()
    • Exercise 11.5
  • 12 Matplotlib
    • 12.1 Simple Plots with Pyplot
    • Exercise 12.1
    • 12.2 Figures, Axes and Subplots
    • Exercise 12.2
    • 12.3 3D Plotting
    • Exercise 12.3
  • 13 SciPy
  • 14 Astropy
    • 14.1 Units and Quantities
    • 14.2 Constants
    • Exercise 14
    • 14.3 Reading Fits Files
    • Exercise 14.3

Numerical Methods

  • 15 Numerical Root Finding
    • 15.1 Bisection Method
    • Exercise 15.1
    • 15.2 Secant Method
    • Exercise 15.2
    • 15.3 Newton-Raphson Method
    • Exercise 15.3
    • 15.4 Comparing the Methods
    • 15.5 Root Finding Using SciPy
    • Exercise 15.5
  • 16 Curve Fitting
    • 16.1 Linear Regression
      • 16.1.1 Linear Least Squares Minimization
      • Exercise 16.1.1
      • 16.1.2 Linear Chi Squared Minimization
      • Exercise 16.1.2
      • 16.1.3 Multiple Linear Least Squares Minimization
      • Exercise 16.1.3
    • 16.2 Non-Linear Least Squares Minimization with scipy.optimize.least_squares
    • 16.3 Fitting Models to Data with scipy.optimize.curve_fit
    • Exercise 16.3
  • 17 Numerical Solutions to Ordinary Differential Equations
    • 17.1 Euler’s Method
    • 17.2 Euler’s Method: Truncation Error
    • Exercise 17.2
    • 17.3 Solving Coupled and Higher Order ODEs
    • Exercise 17.3
    • 17.4 Runge-Kutta Methods
    • Exercise 17.4
  • 18 Numerical Integration Techniques
    • 18.1 Midpoint Rule
    • Exercise 18.1
    • 18.2 Trapezoidal Rule
    • Exercise 18.2
    • 18.3 Simpson’s Rule
    • Exercise 18.3
  • Repository
  • Open issue

Index

By Luis A. Balona, Ed Elson, Masimba Paradza and Mayhew Steyn

© Copyright 2023.