Differential Equations
I am working through this differential equations book, using python to do as much of the work as possible. (Differential Equations with Boundary-Value Problems, D.G. Zill and M.R. Cullen, 7th Ed.)
Below are my python jupyter notebooks with solutions to the (odd numbered) problems from each chapter.
This was my first expedition with python's sympy (SYMbolic [math] PYthon), and I also learned quite a bit about general python and plotting in both sympy and matplotlib along the way. For each problem set, I've also tried to list some key features of the code in each jupyter notebook.
Click the "Exercises #.#" headings to download the associated jupyter notebook. The blurbs under each of these headings are the main keywords or most interesting features of that exercise set.
Disclaimer: My math terminology on this page is very loose. To use any of these materials, you will either need your own understanding of differential equations or (and) the Zill book alongside.
I use this "template" file by duplicating and renaming it to start a new set of exercises. This file has lots of tips, hints, and starter code that I have found frequently useful when solving the exercise sets below. Click the ".ipynb" to download the python/jupyter notebook, or click ".html" just to get a quick look at what's in the template.
If you download any of the exercise sets below, you will notice features of this template file duplicated in most of them.
Very basic sympy usage: setting up variables, solving derivatives analytically, some plotting via sympy. Nothing too interesting in this problem set that isn't covered better in later exercises. Solutions? Yes. Novice python usage? Probably also yes.
Very basic sympy usage: setting up variables, solving derivatives analytically, some plotting via sympy. Nothing too interesting in this problem set (either) that isn't covered better in later exercises. Solutions? Yes. Novice python usage? Probably also yes.
Solving for particular solutions given boundary values/initial conditions.
Plotting solution curves the easy way, with sympy! (Read: "matplotlib not needed!!!") Solution families, stable solutions, transient solutions. Implicit function graph, piecewise function, polar function (does use matplotlib).
Dealing with exact differentials, tests for exact differentials, etc. I wrote my own function, called solve_exact_diff(M, N), that checks if the differential equation is "exact," and if so, solves the equation by two methods (integrating M and also integrating N). There's probably already a python/sympy solver/function for this type of problem, but it's always a healthy exercise to see how good of an algorithm you can write on your own. (Mine is very basic, and uses other, simpler python functions.)
Solving homogeneous equations via u, v substitutions. Using python/sympy "hints" in the dsolve() function. (Before I learned "hints," I wrote my own Frankenstein-ish partially-functioning solver for homogeneous equations in this notebook... turns out python can do it all in 1-2 lines.)
Introduction to numerical solvers. Simple coding of Euler's method and playing with step sizes.