During the rocket campaign we will be using the programming language Python to process and analyze the recorded data, and ahead of the campaign we will use it to simulate the rocket trajectory. A full course in Python programming is outside the scope of this article, but here we have gathered some useful resources (all links open in a new tab):
- For beginners, the official Python page has a wiki-page with some online resources and suggested reading. We will be using Python 3.
- For those familiar with MATLAB, Perl, Java, C or similar, programming in Python is mostly just a matter of getting used to another syntax. Examples include: lines need not be terminated with semicolons; whitespace indentation is used to delimit blocks, rather than curly brackets or keywords; and variables are not directly assigned a type. However, as detailed by Trey Hunner, Python has a somewhat idiosyncratic approach to for-loops.
- We will be using the free open-source distribution Anaconda to write, compile and run our code, but you are free to use whatever integrated development environment (IDE) or editor you might choose.
- Numfys.net is an excellent resource for numerical physics projects written in Python. The site is run by the Department of Physics at NTNU (Norwegian University of Science and Technology).
Lastly, some references to popular libraries:
- Math. Provides common mathematical constants like pi and e ( and Euler’s constant, respectively), as well as the trigonometric functions, logarithms and the square root.
- Matplotlib, useful for plotting.
- NumPy. Introduces multidimensional arrays into Python, and extends the definition of many functions from the math-library to accept arrays as arguments.
- SciPy.Integrate, useful for numerical calculations.
This article is part of a pre-course program used by NAROM in Fly a Rocket! and similar programs.