Swipe to navigate through the chapters of this book
Equations wherein the unknown quantity is a function, rather than a variable, and that involve derivatives of the unknown function, are known as differential equations. An ordinary differential equation is the special case where the unknown function has only one independent variable with respect to which derivatives occur in the equation. If, on the other hand, derivatives of more than one variable occur in the equation, then it is known as a partial differential equation, and that is the topic of Chapter 11. Here we focus on ordinary differential equations (in the following abbreviated as ODEs), and we explore both symbolic and numerical methods for solving this type of equations in this chapter. Analytical closed-form solutions to ODEs often do not exist, but for many special types of ODEs there are analytical solutions, and in those cases there is a chance that we can find solutions using symbolic methods. If that fails, we must, as usual, resort to numerical techniques.
Please log in to get access to this content
In the current version of SymPy, the ics keyword argument is only recognized by the power-series solver in dsolve. Solvers for other types of ODEs ignore the ics argument, and hence the need for the apply_ics function we defined and used earlier in this chapter.
Or “white-box” solver, since SymPy is open source and the inner workings of dsolve is readily available for inspection.
Recall that any ODE problem can be written as a system of first-order ODEs on this standard form.
More information about ODEPACK is available at http://computation.llnl.gov/casc/odepack .
The VODE and ZVODE solvers are available at netlib: http://www.netlib.org/ode .
In this particular case, with a scalar ODE, we could also use the ’math’ argument, which produces a scalar function using functions from the standard math library, but more frequently we will need array-aware functions, which we obtain by using the ’numpy’ argument to sympy.lambdify.
See http://scienceworld.wolfram.com/physics/DoublePendulum.html for details.
- Ordinary Differential Equations
- Sequence number
- Chapter number
- Chapter 9