Book Image

Mastering SciPy

By : Francisco Javier Blanco-Silva, Francisco Javier B Silva
Book Image

Mastering SciPy

By: Francisco Javier Blanco-Silva, Francisco Javier B Silva

Overview of this book

Table of Contents (16 chapters)
Mastering SciPy
About the Author
About the Reviewers

Symbolic solution of differential equations

Symbolic treatment of a few types of differential equations is coded in the SciPy stack through the module sympy.solvers.ode. At this point, only the following equations are accessible with this method:

  • First order separable

  • First order homogeneous

  • First order exact

  • First order linear

  • First order Bernoulli

  • Second order Liouville

  • Any order linear equations with constant coefficients

In addition to these, other equations might be solvable with the following techniques:

  • A power series solution for the first or second order equations (the latter only at ordinary and regular singular points)

  • The lie group method for the first order equations

Let's see these techniques in action with our one-dimensional examples, y' = y and the Bernoulli equation. Note the method of inputting a differential equation. We write it in the form F(t,y,y') = 0, and we feed the expression F(t,y,y') to the solver (see line 3 that follows). Also, notice how we code derivatives of a function...