python, the language of science and engineering for engineers
TRANSCRIPT
Boey Pak Cheong B. Sc. (Hons)[email protected]://pytechresources.comSpecialized in Python Training
Since 2006
Learning to write programs stretches your mind, and helps you think better, creates a way of thinking about things that I think is helpful in all domains
Bill Gates, Microsoft Cofounder
“
”
What is Python?
● A programming language● Interpreted● Object-oriented● High-level
● Developed by Guido van Rossum from 1989
● Cross-platform● Open-source, freely distributable
Python 2 or 3
● Python 2 or 3 ?● Python 2.x is legacy, Python 3.x is the
present and future of the language.● Where can I get Python from?
● Python Official Website– Standard Python installation
● Third Party Packagers– Anaconda– Enthought Canopy
Who uses Python?
Engineering Companies Using Python
Saving Energy with PythonSMS Siemag AG
Lift off with PythonDLR German Aerospace Center
VAMPzero: Aircraft Conceptual Design with Python
● Johnson Space Center● Integrated Planning System
– Uses Python as standard scripting language
● modular collection of tools for assisting shuttle pre-mission planning
● For more info visit : https://www.python.org/about/success/usa/
Why Python?
● Easy to learn● Simple, clean syntax● As readable as English
● Write less code● 3 to 5 time shorter than Java● 5 to 10 times shorter than C++
● Higher productivity
Why Python? (2)
● Impressive Standard Libraries● Extensive Third Party Libraries● Excellent Documentation● Powerful & Versatile
● Build websites● Analyze and visualize data● Scientific and numeric computing
Why Python? (3)
● Free & Open-source● Great community
Job Trends from Indeed.com
Some other considerations
● TIOBE index – October 2016● Python – 5th Position● Fortran – 28th Position
● Intel released its Python distribution in 2016
Fortran Vs Python
● Fortran● Heavily optimized static typed compiler● World's oldest yet still used language
● Python● Dynamic typed interpreted language● Created 1990
Fortran Vs Python (2)
● Fortran● Synonymous with scientific computing● Only real alternative was C++● Including C, only languages supported by
Intel– Until their Python came along
● Huge amount of scientific and engineering code written in Fortran– And still in use
Fortran Vs Python (3)
● Computer processing time vs programming time
● Much easier to learn Python● Faster to develop code using Python
1960/70's (Fortran days) Today
Computer Processing Time
Expensive Cheap
Programming Time Relatively Cheap Expensive
Fortran Vs Python (4)
● Compared with Fortran, the core Python arrays (lists) are not fast
● But Python with SciPy and NumPy is a game changer
● >90,000 Python packages in pypi● Scientific/Engineering Category
● > 5500 packages● In 16 sub-categories
Fortran Vs PythonConclusion
● Fortran will still be around for some years● Existing software needs maintenance
● But for new software ...● Python is a good alternative
– Easy to learn– Free, open-source– Numerous packages– Strong community
What can you do with Python?
● Python by itself not suitable for typical engineering calculations
● You also need the numeric, scientific and plotting libraries● NumPy● SciPy● Matplotlib
● Anaconda and Enthought Canopy distributions provide all
● Some engineering calculations you can do ● Linear algebra● Root finding (non-linear algebra)● Linear or nonlinear regression● Integration and ordinary differential
equations● statistics● plotting
Example Jupyter Notebooks
● Quickstart Python Tutorial ● Using the integrate module from scipy● Digital Signal Processing