Basics of Solving Equations in SymPy

Joshua Siktar
The Startup
Published in
8 min readJan 3, 2021

--

Introduction

Python is without question the programming language I am most comfortable with, and this is largely because it’s in such high demand. I have been in internship positions where the programming language of choice was Python, and so I had to learn how to use it. I also took two programming courses at Carnegie Mellon that were largely about programming in Python. Despite this, it took until my second year of graduate school before I needed the capabilities of solving algebraic and differential equations in a programming language.

While the main focus of my research has been in nonlocal partial differential equations, I picked up a side project a few months ago. The project is a collaboration with another graduate student at the University of Tennessee involving both statistical and analytical reviews of nonlinear disease models (not COVID-19 models, surprisingly enough). I have largely been in charge of the analytical component since that utilizes my strengths better. But eventually, the algebra needed to manipulate our systems of differential equations by hand became so cumbersome, I realized that even if I knew how to do the manipulations by hand, I’d likely make a mistake trying. So, I investigated ways to perform some of the necessary operations computationally, and stumbled across SymPy. After assuring myself that SymPy had the capabilities I needed, I installed the needed packages and got to work.

In this article I’m going to discuss the syntax for some of the tools in SymPy I had…

--

--

Joshua Siktar
The Startup

Math PhD Student University of Tennessee | Academic Sales Engineer | Writer, Educator, Researcher