Many of the older articles on this site about SymPy solve problems symbolically: an equation gets a closed formula, a derivative comes out exact, an infinite series converges to a clean expression. It is elegant mathematics and, away from the blackboard, incomplete. The vast majority of the equations, integrals, and differential equations that show up in real problems in physics, chemistry, and engineering have no closed-form solution, and much of the data we need to differentiate has no formula behind it at all, just a table of measurements. Newton’s method, a finite difference, a numerical quadrature: these are the tools that solve what exact algebra can’t reach. This series shows how.
Why Does This Series Matter? #
- As soon as an equation gains a nonlinear term, a realistic boundary condition, or more than one coupled variable, the chance of an exact formula existing collapses, and the numerical route becomes the only practical way out.
- NumPy and SciPy are the standard pair for scientific computing in Python, used in industry, research, and teaching.
- Knowing when (and why) to swap
sympy.solveforscipy.optimize.brentq, or an exact integral for a numerical grid, is a practical skill that few courses teach directly. - Each article starts from a real problem: planetary orbits, solution pH, structural beams, nuclear magnetic resonance. The series avoids artificial textbook equations whenever a genuine example serves just as well.
The Series Map #
Each block of the series stems from a concrete limitation of symbolic algebra. The diagram below shows, for each one, the numerical tool that solves it and where it is presented:
flowchart LR
A1["Equation with no
closed form"] --> B1["scipy.optimize
brentq · newton · root"] --> C1["Block 1
3 articles"]
A2["Data with no
formula behind it"] --> B2["numpy.polynomial
fit · Chebyshev"] --> C2["Block 2
2 articles"]
A3["Derivative and integral
that don't close"] --> B3["gradient · quad
solve_ivp"] --> C3["Block 3
3 articles"]
A4["Minimum subject
to constraints"] --> B4["minimize · SLSQP
curve_fit"] --> C4["Block 4
3 articles"]
A5["Signal measured
over time"] --> B5["numpy.fft
rfft · ifft"] --> C5["Block 5
2 articles"]
What You Will Learn #
The series has 13 articles, organized into the five thematic blocks above, each one solving a type of problem that SymPy can’t close:
Block 1: Solving Equations With No Closed Form #
Three articles to build the foundations of root finding with
scipy.optimize and apply them to real problems in physics, chemistry, and
engineering, from Kepler’s equation to the Colebrook friction factor.
→ Solving Equations Numerically with SciPy → Orbits and Trajectories: Numerical Equations in Physics → From Chemistry to Engineering: Numerical Equations in Real Systems
Block 2: Polynomials: Manipulating and Fitting #
Two articles on numpy.polynomial: first as a known object (roots,
derivative, integral), then as the result of fitting noisy experimental
data, including Runge’s phenomenon and the ill-conditioning of Wilkinson’s
polynomial.
→ Polynomials with NumPy → Curve Fitting with NumPy
Block 3: Numerical Calculus: Differentiating, Integrating, Solving #
Three articles on calculus when there is no formula: differentiating data
that has no expression behind it, integrating functions that have no
elementary antiderivative, and solving differential equations, from the
nonlinear pendulum to stiff systems, with scipy.integrate.solve_ivp.
→ Numerical Derivatives with SciPy → Numerical Integration with SciPy → Differential Equations with SciPy
Block 4: Optimization #
Three articles on scipy.optimize: the fundamentals (constraints, bounds,
local × global minima), four real applications, from a chemical reactor to
the production mix of a plant, and, closing the block, fitting nonlinear
models to experimental data, which is optimization disguised as curve
fitting, with the parameter uncertainties that come along with it.
→ Optimization with SciPy → Applied Optimization with SciPy → Nonlinear Fitting and Uncertainties with SciPy
Block 5: Fourier and FFT #
Two articles close the series: from the symbolic Fourier series to the fast Fourier transform in practice, with its two classic artifacts (aliasing and spectral leakage), through to real applications in nuclear magnetic resonance, mechanical vibration, and audio.
→ From the Fourier Series to the FFT with NumPy → Applied FFT: From Magnetic Resonance to Audio
Who Is This Series For? #
The series is for those who already have some familiarity with Python and calculus-level mathematics (derivatives, integrals, differential equations at an introductory level) and want to learn how to computationally attack the problems that symbolic manipulation doesn’t solve.
You don’t need to have used NumPy or SciPy before: each tool is introduced in the context of the problem it solves, with a direct comparison against the symbolic route whenever possible.
Prerequisites #
Several articles revisit examples and results already published in this site’s SymPy series. It is worth knowing, although not strictly necessary:
- Introduction to SymPy: first contact with the computer algebra package
- Derivatives with SymPy, Optimization with SymPy, and Infinite Series with SymPy: revisited directly at several points in this series
If you don’t know SymPy yet, that’s fine: each revisit comes with its context restated, without requiring you to read the original article.
Quick Reference Table #
| # | Article | What It Solves |
|---|---|---|
| 1 | Numerical Equations | Root criterion, brentq/newton/fsolve |
| 2 | Orbits and Trajectories | Kepler’s equation, projectile with drag |
| 3 | Chemistry and Engineering | pH, van der Waals, friction factor |
| 4 | Polynomials | Polynomial, roots, ill-conditioning |
| 5 | Curve Fitting | Regression, Runge’s phenomenon, splines |
| 6 | Numerical Derivatives | Finite differences, numpy.gradient |
| 7 | Numerical Integration | quad, simpson, functions with no antiderivative |
| 8 | Differential Equations | solve_ivp, nonlinear pendulum, stiffness |
| 9 | Optimization | minimize, SLSQP, constraints |
| 10 | Applied Optimization | Reactor, projectile, beam, production mix |
| 11 | Nonlinear Fitting | curve_fit, parameter uncertainty |
| 12 | Fourier and FFT | fft, aliasing, Gibbs phenomenon |
| 13 | Applied FFT | NMR, vibration, audio |
Ready to start? The first article begins with a simple problem, an equation that no formula closes, to build, from scratch, the criterion that decides when it is worth giving up the search for an exact solution: Solving Equations Numerically with SciPy.