The traditional computer science courses for engineering focus on the fundamentals of programming without demonstrating the wide array of practical applications for fields outside of computer science. Thus, the mindset of “Java/Python is for computer science people or programmers, and MATLAB is for engineering” develops. MATLAB tends to dominate the engineering space because it is viewed as a batteries-included software kit that is focused on functional programming. Everything in MATLAB is some sort of array, and it lends itself to engineering integration with its toolkits like Simulink and other add-ins. The downside of MATLAB is that it is proprietary software, the license is expensive to purchase, and it is more limited than Python for doing tasks besides calculating or data capturing.This book is about the Python programming language. Specifically, it is about Python in the context of mechanical and aerospace engineering. Did you know that Python can be used to model a satellite orbiting the Earth? This book assumes a college junior level of mechanical/aerospace engineering understanding. It will use examples like
- Thrust available and thrust required for an aircraft
- Dynamic pressure and how it changes with altitude and velocity
- Plotting different airfoils
- Orbital mechanics and orbital parameters
- Mechanical properties of different aluminum alloys
to show the reader how Python is better than MATLAB for anything that does not require Simulink. Don’t be scared if you don’t understand all of those topics; they are just being used to provide concrete examples for how Python can be used for engineering.In total, there are 10 chapters:
- Intro chapter on how to download Python via Anaconda distribution and getting started with Python syntax
- A very small problem and solution to demonstrate a basic Python program
- Graphing thrust required and thrust available for an A321 at three different altitudes with Matplotlib
- Graphing dynamic pressure as a function of time for a rocket launch with Matplotlib
- Getting and plotting airfoil coordinates with Requests and Matplotlib
- Modeling a satellite’s orbit around Earth with PyAstronomy and Matplotlib
- Introduction to web scraping (Requests and BeautifulSoup4) and exporting data to Excel (Openpyxl)
- Modeling camera shutter effect on an aircraft’s propeller with Tkinter and Numpy
- Creating a GUI to convert units with Tkinter and pint
- Making pdf reports of Python code with Pweave
You can find the completed programs and a very helpful 595 page NSA Python tutorial at the book’s GitHub page at https://www.github.com/alexkenan/pymae/. Read more about the book, including a sample part of Chapter 5, at https://www.alexkenan.com/pymae/
Chapter 1: Introduction to Python Chapter 1.5: FizzBuzz Chapter 2: Graphing Thrust Available and Thrust Required Chapter 3: Graphing Dynamic Pressure during a Rocket Launch Chapter 4: Getting and Plotting Airfoil Coordinates Chapter 5: Modeling a 2-body orbit in 2D and 3D Chapter 6: Unit Conversions Chapter 7: Introduction to Web Scraping Chapter 8: Modeling Camera Shutter Effect Chapter 9: Writing Reports with Pweave The End About the Author Legal Stuff
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.