In this chapter, we will review two basic operations that are fundamental to the development of Numerical Mathematics: the search of zeros and extrema of real-valued functions.

Let's revisit Runge's example from Chapter 2, *Interpolation and Approximation*, where we computed a Lagrange interpolation of Runge's function using eleven equally spaced nodes in the interval from `-5`

to `5`

:

In [1]: import numpy as np, matplotlib.pyplot as plt; \...: from scipy.interpolate import BarycentricInterpolatorIn [2]: def f(t): return 1. / (1. + t**2)In [3]: nodes = np.linspace(-5, 5, 11); \...: domain = np.linspace(-5, 5, 128); \...: interpolant = BarycentricInterpolator(nodes, f(nodes))In [4]: plt.figure(); ...

Start Free Trial

No credit card required