ASTE-404: Computational Programming and Numerical Methods 

Introduction

The objective of ASTE-404, offered by the USC Department of Astronautical Engineering, is to introduce upper level undergraduate astronautical and aerospace engineering students to the vast ecosystem of computational methods, tools, and hardware technologies encountered in numerical analysis of engineering problems. We cover several popular programming languages including MATLAB, Python, and C++, learn about interactive web-based computing using HTML and Javascript. We also discuss important code development topics such as object oriented programming, dynamic memory allocation, version control, unit testing, documentation, and debugging. We then learn how to integrate partial differential governing equations using methods such as Finite Difference and Finite Volume, and how to simulate gas flows using particle-based stochastic methods. We also cover code parallelization with multithreading, MPI and CUDA, and introduce the use of Arduino microcontrollers and FPGAs.  We close the semester by introducing optimization techniques and machine learning.

About the Instructor

The class is taught by Dr. Lubos Brieda, a part-time lecturer at the department, and a full-time president at Particle in Cell Consulting LLC. He holds a Ph.D. in Mechanical and Aerospace Engineering from The George Washington University, and a M.Sc. in Aerospace and Ocean Engineering from Virginia Tech. At both institutions, his research focused on modeling spacecraft electric propulsion thrusters and their impact on spacecraft. In 2019, he published a book on the topic of numerical plasma simulations (Plasma Simulations by Example, CRC Press, covered in ASTE-546) and is currently working on another textbook specific to the topics in ASTE-404.

Topics (Fall 2022)

1) Introduction to Scientific Computing. We start by reviewing numerical simulations relevant to astronautics, and mechanical/aerospace engineering. Basic concepts such as variables, loops, conditions, and functions are also introduced. Sample code is implemented in Matlab to demonstrate the graphical user interface for running the code and visualizing results.

2) Discretization Schemes. Finite Difference is introduced. We use this method to develop a solver for the diffusion (heat) equation in 2D in Matlab and Python. We learn about Google Colab, and NumPy, SciPy, MatplotLib, and TweePy packages.

3) Web technologies. We learn the basics of HTML and Javascript, and then learn how to utilize the canvas element to develop interactive applications running in a web browser. We also briefly introduce GPU rendering with WebGL.

4) Compiled Languages.  We start introducing C++. We cover important concepts such as variable types, arrays, functions, pointers and references, dynamic memory, compilation, and the use of development environments. We also introduce the Linux command-line environment and the use of Paraview for data visualization.

5) Linear Solvers and Visualization. We start by discussing multi-dimensional arrays in C++ and demonstrate the impact of data locality on run time. We then introduce matrix solver algorithms including Thomas, Jacobi, Gauss-Seidel, and SOR. For homework, students are asked to develop a C++ version of the steady-state heat equation solver. 

6) Object Oriented Programming. This class is a major crash-course in modern C++. We cover topics such as classes, inheritance, virtual functions, auto variables, lambda functions, templates, R-values, pointer wrappers, and C++ storage containers. We learn how we can use custom data types with overloaded operators to simplify the code syntax. We develop C++ code simulating many bouncing balls.

7) Numerical Analysis. This lesson covers additional important topics related to numerical analysis, including the FTCS and Crank Nicolson methods for unsteady problems, Newton-Raphson linearization, and direct matrix solvers including Gaussian Elimination, LU and Cholsky Decomposition. We also cover topics relevant to signal processing such as Fourier Transform, filtering, least-squares approximation, and Bezier splines, Gaussian quadrature, and sampling from probability distribution functions.

8) Particle Methods. We introduce Knudsen number, collision mean free path, and thermalization. We then introduce a C++ code simulating flow of cold gas over a sphere. The code is subsequently expanded by introducing Direct Simulation Monte Carlo (DSMC) collisions. For homework, students are asked to review a 1D Particle in Cell (PIC) simulating plasma sheath. 

9) Eulerian Methods. We cover topics related to solving partial differential equation (focusing on the Advection-Diffusion model equation) on a fixed grid, including the upwind and central scheme for the advective operator, along with Von Neuman stability analysis. We cover Forward Time Central Space and Crank-Nicolson integration schemes, as well as the Finite Volume Method. We close by introducing the Vorticity-Streamfunction method for solving fluid flows.

10) Code Testing, Documentation, and Multithreading.  We cover uncertainty analysis, convergence studies, unit testing, version control, linear algebra libraries, documentation systems, and LaTeX. We also go over debugging strategies. We then jump into parallel processing by introducing multithreading.

11) Parallel Processing. We continue to learn how to reduce computational time utilizing clusters of interconnected computers (MPI) and graphics cards (GPUs). We discuss parallel efficiency, deadlock, the race condition, and the use of streams for GPU memory transfer. Here we also learn the basic Linux commands needed for remote access.

12) Embedded Systems. We start the lesson by introducing various electronic components such as resistors, capacitors, transistors, diodes, and switches. We also talk about soldering. We then introduce the Arduino platform, and demonstrate how to interface a microcontroller with an external sensor. We then introduce FPGAs and demonstrate how to program them using Verilog and Intel Quartus.

13) Optimization and Machine Learning. We begin by introducing a handful of optimization algorithms including brute force  Monte Carlo search, and gradient descent. Genetic algorithm is then developed in more detail. Neural networks are then introduced. Back propagation is implemented in C++. We close the lesson (and the course) with a TensorFlow tutorial.