The LS30 Sagemath Cookbook
By Daniel Sun
The LS30 Sagemath Cookbook is intended to provide a bunch of short, easy-to-digest 'recipes' for doing common tasks and operations in sagemath/python. Just like a collection of recipes, you should first start out by copying these verbatim and then over time, gradually gaining understanding by tweaking them here and there until eventually you can write your own code independently.
Objectives:
Provide reference implementations of common tasks
Serve as a guide to sagemath/python
Emphasize student understanding/simplicity over efficiency
As this book is more of a 'cookbook' and not a novel, it is not necessarily meant to be read from start to finish. More complex topics might come up in earlier chapters, although they will tend to be shifted towards the end of the material. This helps to keep the cookbook organized.
Chapters
Python
lists, srange and zip
for/while loops
if/else
functions
Sagemath
symbolic variables
symbolic functions
interactive plots
animations
show vs. print
LS30A-related items
iteration
solving differential equations (desolve_odeint)
plotting a timeseries
plotting a trajectory
plotting a vector field
LS30B-related items
derivatives
linear algebra
solve command