PROJECT 2: Subroutines
Part 2b
Problem Statement
- Write Subroutines integrate.f and interpolate.f
- integrate.f
- Trapezoidal rule
- Data in are passed through the argument list
as an array
- Data out is passed through the argument list
- interpolate.f
- Quadratic Spline
- Data in are passed through the argument list as an array
- Number of interpolated points (equally-spaced) passed through argument list
- Data out are passed through the argument list as an array
- Test the Subroutines
Write a main program to test the subroutines.
Main.f will
-
input the data points in /home/lockers/wilson/data/data2b.dat
-
-
determine and output 20 equally spaced interpolated points to a file
(link with /home/aeem/lockers/wilson/programs/dgefs.f).
-
-
integrate the interpolated data over the entire interval
NOTE:
Use double precision throughout
Source codes are to be well documented and structured
Submit
- all source codes
- make file
- include files
- input files
- list of interpolated output data
- plot of original data &interpolated data
- on one graph, points only (no lines)
- the full LHS matrix (A) sent to dgefs
- final integrated answer