A previous post used the typical series-expansion-plus-linear-algebra approach for finding finite-difference formulas to derive approximations to the first derivative of any desired order of accuracy. If you’ve ever used that method yourself, you probably know how tedious it is, and that post doesn’t make it look much less so. On top of that, for all … Read More “All Finite-Difference Formulas for All Derivatives” »
Category: Numerics
Posts on numerical analysis/PDE
Ridders’ method is a single-variable root-finding method that is more efficient than the basic regula falsi method. The formula is easy enough to find online (e.g. the first link), but its derivation is not. This post fills in the blanks. Suppose the function $f$ has a zero between $x_L$ and $x_R$, i.e. $f(x_L)f(x_R) < 0$. … Read More “Notes on the Derivation of Ridders’ Method” »
The first derivative of an analytic function can be estimated by: $$\displaystyle h\frac{df}{dx}\Bigg|_{x=0} \approx -\frac{1}{2}f(-h) + \frac{1}{2}f(h) $$ where $h$ is a small distance. This is the common central difference formula; a more accurate but less frequently seen one is: $$\displaystyle h\frac{df}{dx}\Bigg|_{x=0} \approx \frac{1}{12}f(-2h) – \frac{2}{3}f(-h) + \frac{2}{3}f(h) – \frac{1}{12}f(2h) $$ This formula uses two … Read More “Central Difference Formulas” »
Consider the equation for conservation of momentum in an inviscid flow, first in differential form: $$\displaystyle \frac{\partial}{\partial t} (\rho\vec{u}) = -\nabla\cdot(\rho\vec{u}\vec{u}) – \nabla P $$ and then integrated over an arbitrary control volume $\Omega$, using the divergence theorem on the momentum term and the gradient theorem on the pressure term: $$\displaystyle \frac{d}{dt} \int_\Omega \rho\vec{u}\,dx = … Read More “Source of the source: Pressure in the axisymmetric momentum equation” »