Hey guys. I've been assigned this project for my intro to fortran90 class and I have no idea where to begin. Could someone give me a sample code for it?
The following data represents discrete values of a function for which an explicit formula is not known:
1.123400 167.5600
2.246800 137.6441
3.370200 110.2523
4.493600 85.38444
5.617000 63.04068
One can, however, use linear interpolation to approximate the f(x) – value for any given x – value between the smallest and the largest values x – values. First, find the two x – values xi and xi+1 , in the list that bracket the given x – value, and then interpolate to find the corresponding f(x) – value:
f(xi+1) - f(xi)
f(x) = f(xi) + --------------- (x - xi)
xi+1 - xi
(If the value is out of range, print a message.) Test your program with the following x-values: -7.8, 1.1234, 13.65, 22.5, 23.5914, 25, 25.085, and 33.8.
The following data represents discrete values of a function for which an explicit formula is not known:
1.123400 167.5600
2.246800 137.6441
3.370200 110.2523
4.493600 85.38444
5.617000 63.04068
One can, however, use linear interpolation to approximate the f(x) – value for any given x – value between the smallest and the largest values x – values. First, find the two x – values xi and xi+1 , in the list that bracket the given x – value, and then interpolate to find the corresponding f(x) – value:
f(xi+1) - f(xi)
f(x) = f(xi) + --------------- (x - xi)
xi+1 - xi
(If the value is out of range, print a message.) Test your program with the following x-values: -7.8, 1.1234, 13.65, 22.5, 23.5914, 25, 25.085, and 33.8.