PyME Preface
Preface¶
I need to build a bookshelf. Downside, I'm an engineer. So I'm going to over engineer it. Those cheap plastic ones sag under my ME books and my wife's volumes and volumes of medical books. Right now they're on an overengineered prototype made out of 2x6s. I've done the lab tests to show a simply made Ibeam can support ~200 lbs.
[The way I learned this stuff the first time was by programming it. My TI89 was the centerpiece of my studying. Redoing junior level engineering in TIBASIC makes you breakdown the equation into how it actually works.
For Design of Experiments class I once half wrote the most basic parts of SAS/R in TIBASIC.]
So to self audit my Mechanics of Materials (Purdue ME323) course I decided to do what I did last time. This time with the sexyiest hammer in my toolbox.
I will assume the reader has a basic understanding of Python. If you have 13 hours, code academy is a perfect place to start.. If nothing else, you should be to download the source notebook (Upper right corner of the page).
[0]. Dr Stamper, one of the best professors I ever had, would sometimes spend more of class talking about not Statics than statics. Looking back, I probably learned more about working at large corporations that year than Statics. It's why vector math is important. If you can do matrix math, Statics is a sophomore highstool level math class. $\sum F=0$ $\sum M=0$
#¶
The quick jump from python to 3xx me courses. My TI89 had a certain set of features, features I have grown accustomed to over a very long career. Features that would make me a nightmare for me to live without. Take my word for it that Python is heads and shoulders a more complete language than TIBASIC. however it has a lot of things that basic Python doesn't. So as a start, lets bring Python up to (almost) what I did on the TI89.

A good set of units. Units being correct has saved my butt on tests more times than I can count. If you get a units error you likely have the wrong equation. It's also saved my butt in the real world too.
Thankfully someone else has written a pretty good library. Pint is Python package to define, operate and manipulate physical quantities: the product of a numerical value and a unit of measurement. It allows arithmetic operations between them and conversions from and to different units. It is BSD licensed.
[Aside: No engineering student should ever. Ever. Ever learn English units again. For the sake of my sanity and yours, I will avoid them. For the love of all that is sensible we should never crash something into another planet because we screwed up units, let alone English units.
The output from the SM_FORCES application code as required by a MSOP Project Software Interface Specification (SIS) was to be in metric units of Newtonseconds (Ns). Instead, the data was reported in English units of poundseconds (lbfs).  Mars Climate Orbiter Mishap Investigation Phase I Report]

You need to do matrix algebra. Matrix math with statics & dynamics makes life easy. Thankfully some smart people back in the days of Fortran wrote some: BLAS Since then we've just been adding wrappers to it. It's at the heart of pretty much any engineering program today. For Python that wrapper is NumPy. It is BSD licensed.

We need a way to do symbolic math. TI89 can do symbolic math, write the equations and forget about rearranging/transcription errors. For that there is SymPy. It is BSD licensed.

We need a way to display results. For equations Jupyter notebook can handle $\LaTeX$. [If you aren't exactly sure how to draw a symbol there's always Detexify and "how do I _ in LaTeX" on google.]
For graphs there is matplotlib. A python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. It will even let you
#1
import pint
#2
import numpy
#3 Symbolic links.
import sympy
#4 Display.
from IPython.display import Latex # Display latex from Python windows.
import matplotlib # Plotting.
%matplotlib inline
It turns out someone else had a similar list and made a shortcut. %pylab
So for all projects we'll start with what the TI89 can do and add packages as the course requires.