The Numerical Solution of Differential Equation using the Shooting Method

Boundary value problems (BVPs) for ordinary differential equations arise naturally in many areas of physics, engineering, and applied mathematics. Classical examples include the vibration of strings, heat conduction in solids, and quantum mechanical bound states. Unlike initial value problems (IVPs), where all conditions are specified at a single point, BVPs impose constraints at different points of the domain, making them significantly more challenging to solve both analytically and numerically.

The shooting method is one of the most intuitive and historically rooted techniques for tackling such problems. Its central idea is simple: transform a boundary value problem into an initial value problem by guessing the missing initial conditions, then iteratively refine this guess until the solution satisfies the boundary conditions at the other end. The method is often illustrated through a ballistic analogy—one “shoots” from the initial point and adjusts the trajectory until the target is hit. Although the shooting method was formalized only in the 20th century, its conceptual foundations can be traced back much earlier. The study of differential equations in the 18th and 19th centuries by mathematicians such as Leonhard Eulerand Joseph-Louis Lagrange already revealed the difficulty of boundary value problems in mechanics and astronomy. At that time, analytical solutions were often unavailable, and practitioners relied on approximation strategies that implicitly resembled “trial-and-error” approaches. A decisive step toward the modern shooting method came with the development of reliable numerical solvers for initial value problems around 1900, notably through the work of Carl Runge and Martin Kutta. Their methods provided the computational backbone needed to integrate differential equations accurately from a given starting point. This made it feasible to implement the idea of repeatedly “shooting” with different initial guesses. The method gained wider recognition and systematic treatment in the mid-20th century, alongside the emergence of numerical analysis as a distinct discipline. Influential mathematicians such as Richard Courant contributed to the theoretical understanding of boundary value problems, while the increasing availability of digital computers transformed the shooting method into a practical and widely used computational tool.

Today, the shooting method remains a cornerstone in the teaching of numerical methods due to its conceptual clarity and direct connection to physical intuition. While more robust techniques—such as finite difference and finite element methods—are often preferred for complex or stiff problems, the shooting method continues to play an important role in applications ranging from classical mechanics to quantum physics, where it is frequently used to determine eigenvalues and admissible solutions.

In this blog, I will give an example of the application of the method to the solution of the Thomas-Fermi and Thomas-Fermi-Dirac equations.

Continue reading

Understanding the Discrete Fourier Transform in Signal Analysis

In previous posts on this blog I have already introduced the Fourier series and the Fourier transform, following their historical development from Joseph Fourier’s original work on heat conduction to their modern role in physics, engineering, and signal analysis. Rather than repeating that material here, I will take it as a starting point.

When we look at a signal — a sound wave, a vibration, or even a curve drawn by hand — we usually perceive it as a function of time or space. However, very often the most relevant information is not immediately visible in this representation. It is hidden in the frequencies that compose the signal, and in how strongly each of them contributes.

This is precisely the idea behind the Discrete Fourier Transform (DFT): to decompose a discrete signal into a finite sum of harmonic components, each characterized by an amplitude and a phase. Conceptually, the DFT is not a new theory, but a practical bridge between the continuous Fourier framework and the realities of digital data, measurements, and numerical simulations.

Rather than starting from abstract formulas, in this post I adopt a visual and experimental approach. The discussion is supported by an interactive program that allows one to draw an arbitrary signal and explore its harmonic content, and by a practical electronics project where Fourier analysis is applied to real sound and noise signals.

Continue reading

Christmas 2025: Growing Christmas Trees from Factorials

Christmas is a time for traditions, decorations, and—at least for some of us—quiet moments spent playing with ideas. In that spirit, this post is a small seasonal diversion: a recreational exploration of large factorial numbers, their historical computation, and an unusual way to see them. The inspiration comes from an old but delightful article by the great recreational mathematician  Martin Gardner, titled “In which a computer prints out mammoth polygonal factorials” (Scientific American, August 1967), in which he discusses the astonishing growth of the function

n! = 1 \cdot 2 \cdot 3 \cdots n

and the surprising difficulty computers once faced when trying to compute it for even modest values of n.

In this post, I will briefly describe the Smith bin algorithm for computing large factorials and present the result for the number 2025, arranged in a geometric form. After all, if numbers are going to grow explosively, why not let them grow into Christmas trees for 2025?

Continue reading

Easter 2025: Exploring Egg-Shaped Billiards

It has become a recurrent habit for me to write a blog on the shape of eggs to wish you a Happy Easter. Not repeating oneself and finding a new interesting topic is a brainstorming exercise of lateral thinking and a systematic search in literature to find an interesting connection. This year, I wanted to explore an idea that has been lurching in my mind for some time for other reasons: billiards.

I used to play snooker from time to time with some old friends. I am a far cry from being even an amateur in the billiard games, but I had a lot of fun verifying the laws of mechanics on a green table. I soon discovered that studying the dynamics of bouncing collision of an ideal cue ball in billiards of different shapes keeps brilliant mathematicians and physicists engaged in recreational academic studies and important theoretical implications.

Continue reading