To start: what are partial differential equations (PDEs) and why do they matter? PDEs describe how variables change over time or space, and they come in all shapes and sizes from the simple heat equation that describes how temperature changes in a room to the complex Navier-Stokes equations that govern fluid dynamics.
But here’s the thing: solving these equations analytically is often impossible (or at least impractical) for anything more than a toy problem. That’s where numerical methods come in they allow us to approximate solutions using computers, which can handle much larger and more complex problems than we ever could by hand.
So how do we go about solving PDEs numerically? Well, there are many different approaches, but one of the most popular is called finite difference methods (FDM). FDM involves breaking up a continuous problem into discrete points on a grid, and then approximating derivatives using simple arithmetic operations.
For example, let’s say we want to solve the heat equation:
u_t = k u_{xx} + f(x, t)
where u is temperature, x is position, t is time, and k is a constant that describes how quickly heat diffuses through the material. To approximate this using FDM, we might start by dividing our domain into a grid of points:
0 1 2 … n-1
^ |
x_i <---> t = 0
Next, we’ll choose some time steps (dt) and space steps (dx), and then use these to calculate the values of u at each point in our grid. For example:
0 1 2 … n-1
^ |
x_i <---> t = dt
To approximate the derivative with respect to time, we’ll take the difference between the value of u at two adjacent points and divide by the time step:
u_{t} = (u(x_i, t+dt) u(x_i, t)) / dt
And to approximate the second-order derivative with respect to space, we’ll take the difference between the value of u at two adjacent points and divide by the square of the space step:
u_{xx} = (u(x_i+dx, t) 2u(x_i, t) + u(x_i-dx, t)) / dx^2
Putting it all together, we get a system of equations that looks like this:
0 1 2 … n-1
^ |
x_i <---> t = dt
u_{t} = k (u(x_i+dx, t) 2u(x_i, t) + u(x_i-dx, t)) / dx^2 + f(x_i, t)
And that’s it! By solving this system of equations at each point in our grid, we can approximate the solution to the heat equation over time.
Of course, there are many other numerical methods for solving PDEs besides FDM some more sophisticated than others. But no matter which method you choose, one thing is certain: solving PDEs numerically requires a lot of math and a whole lotta computer power. So if you’re feeling overwhelmed by all this talk about derivatives and grids and time steps, just remember that we’re in good company even the most brilliant mathematicians have been known to get lost in these calculations from time to time!