Methods of approximation

90 Views Asked by At

I am trying to approximate a point using the dataset below, this hypothetical sample shows fuel consumption at different speeds, suppose I would like to approximate fuel consumption at $80\,\mathrm{km}$ or $120\,\mathrm{km}$, I've read several tutorials on linear approximation but I only seem to confuse this more as I am not sure what the computed $\Delta$ should be when the rate of change is not a constant.

$$ \begin{array}{|c|c|c|c|} \hline \text{speed} & 50\,\mathrm{km} & 100\,\mathrm{km} & 150\,\mathrm{km} & 200\,\mathrm{km} \\ \hline \text{gas} & 12\,\mathrm{l} & 32\,\mathrm{l} & 56\,\mathrm{l} & 81\,\mathrm{l} \\ \hline \end{array} $$

2

There are 2 best solutions below

1
On BEST ANSWER

Just use linear interpolation in the appropriate interval: $[50,100]$ for $80$ and $[100,150]$ for $120$.

For instance, $$ f(80) = f(50) + (f(100-f(50))\frac{80-50}{100-50} $$

0
On

When the rate of change is not a constant, you may want to model your data with a polynomial that is not linear, so it has an order greater than one.

Since the values of $x$ are equally spaced, Newton's method is well suited to find this interpolating polynomial $p(x)$. To fit four points, a third order polynomial will suffice.

We shall normalize the values of $x$ using $\dfrac{x}{50}$ instead, so as to work with small numbers.

Let us compute the first differences of $y$: $32-12, 56-32, 81-56$

$$20, 24, 25,$$

second differences $\dfrac{24-20}{2}, \dfrac{25-24}{2}$

$$2, \dfrac{1}{2}$$

and third difference $\dfrac{\dfrac{1}{2}-2}{3}$

$$ -\frac{1}{2}$$

to build the normalized polynomial $$\begin{align} p_n(x)&=12+20(x-1)+2(x-1)(x-2)-\frac{1}{2}(x-1)(x-2)(x-3)\\ &=-\frac{1}{2}x^3+5x^2+\frac{17}{2}x-1\\ \end{align}$$

and then undo the normalization with

$$p(x)=p_n\left(\frac{x}{50}\right),$$

so

$$p(x)=-\frac{1}{250000}x^3+\frac{1}{500}x^2+\frac{17}{100}x-1$$

We may want to check now that the polynomial is correct, so $p(50)=12, p(100)=32, p(150)=56$ and $p(200)=81$.

Finally, an estimated value of the function for $x=80$ is found to be $$p(80)=-\frac{1}{250000}80^3+\frac{1}{500}80^2+\frac{17}{100}80-1=\frac{2919}{125}=23.352l$$