CME 102 Python Workbook#

This book is a work in progress

It is not currently being used in any class and things may break at any time.

This Jupyter Book contains a series of Python exercises aimed at introducing you to scientific computing in the context of CME 102: Ordinary Differential Equations for Engineers at Stanford University. The exercises are adapted by Enze Chen, Lecturer in Materials Science and Engineering, from the MATLAB exercises created by Hung Le, Lecturer in the Institute for Computational and Mathematical Engineering. We hope you will find these exercises useful for your studies!

Important note for students

These pages only have Python, corresponding to the original MATLAB exercises in the course. If you’re looking for the MATLAB exercises, please see the course reader and other documents.

Other FAQs#

What do I install?#

Nothing! Unlike the MATLAB exercises, we’ll be doing everything in the cloud. If you like the sound of this, keep reading the Usage tips for instructions on how to complete and submit your work.

What if I want to use Python for a homework problem?#

If you choose to use Python on the homework, you can start with our homework template. This avoids the hassle of managing your local installation and uses the same Google Colab UI as all the examples.

Does it matter which language I learn?#

Not particularly, as the underlying computing principles and computational thinking are the same. Sure, certain tasks may be easier in one language than in the other as they were developed by different scientific communities, but we anticipate that learning one will serve as a solid foundation for learning all others in your future work.

However, if you strongly prefer to optimize your choice of programming language, we suggest you talk to your friends, major department, and professionals in your field to understand which programming language you’re more likely to encounter in the future.

What if I didn’t take previous CME courses with Python?#

That’s OK! We prepared a Python fundamentals notebook that scaffolds some introductory Python exercises, and you can also find the entire CME 100 Python workbook online. However, it’s likely that by the time you’re taking this course, you will have already seen many examples in your other work that can transfer to these Python-based calculations.