next up previous
Next: About this document ...

ESC 251 HW 24 Due: Nov. 6

For programs that use array variables (which will be most of them for the rest of the semester), you should turn on array bounds checking when you compile your program by using the compiling syntax:

    gfortran -fbounds-check  prog.f90
This will ensure that the program stops in the event that you make an array bounds error.

(6 pts) Assume the table values in the data file were generated using an adaptive trapezoidal method. Use the process given in class to estimate the value of the integral of the function. In addition, compute the average value of the hi step sizes.
(9 pts) It is often necessary to measure the magnitude of a vector. There are many ways that this can be done. These methods for measuring the magnidute of a vector are called norms. The 3 most common norms are the 1-norm, the 2-norm and the $\infty$-norm. The are defined as

\Vert x \Vert _1 &=& \sum_{i = 1}^n \vert x_i\vert \\
\Vert x \Vert _{\infty} &=& \max_{i=1,n} \vert x_i\vert \\

where n is the length of vector x. Write a program that will read in the values from the data file into an array variable and compute the 3 norms above. You should use a separate loop for each norm.

next up previous
Next: About this document ...