interpolate()

To provide the ability to interpolate between the values produced by rk4p480(), write a function of the following form in ``p480.c'':

void interpolate(double f[],int N)

Output:

Input:

Your function should interpolate the odd values of f[] from the even values according to the formula

\begin{displaymath}
f_k=0.0625 (-f_{k-3}+9*(f_{k-1}+f_{k+1})-f_{k+3}).
\end{displaymath}

For the special endpoint cases, k=1 and k=N-1, you may take $f_{-2}\equiv 0$ and $f_{N+2} \equiv 0$, respectively.



Tomas Arias 2007-02-27