next up previous
Next: About this document ...

ESC 251 HW 22 Due: Nov. 1

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.

1)
(1 pt each) Write a program that will tabulate each of the functions given. Use a value of n = 10 for each table. Your program should make use of array variables. It should have 3 separate loops; the first should generate and store the x-coordinates, the second should compute the function values and the third should write the table to the screen. You only need to hand in 1 program copy, but include all of your table output.
a)
$f(x) = \displaystyle{x^2e^{-x^2}}$ on $x \in [-2.5,2.5].$
b)
$f(x) = x\cos(x^2)$ on $x \in [-\pi,\pi].$
c)
$f(x) = \tan(x)$ on $x \in [-1.4,1].$
d)
$f(x) = \displaystyle{\frac{x}{1-x^2}}$ on $x \in [4.3,5.3].$




2017-10-30