next up previous
Next: About this document ...

ESC 251 HW 9 Due: Sep. 22

1)
(3 pts) A freely hanging cable forms the shape of a hyperbolic cosine curve of the form

\begin{displaymath}y = a\,\mbox{cosh}\left(\frac{x}{a}\right) \end{displaymath}

where $a = \displaystyle{\frac{T}{w}}.$ T is the tension in the cable and w is the weight per unit length of the cable. Write a program that will read in values of T,w,x and print out the value of y. Test your program using the values T = 750.4, w = 1.3, x = 12.2
2)
(4 pts) Write a program that will read in a set of coordinates (x1,y1) and (x2,y2) and determine the slope and y-intercept of the line between them. Test your program for the points (-2,3) and (5,-5). Also, devise a test case for which your program will fail.
3)
a)
(2 pts) Suppose y is a double precision variable. If you try to compute
y = ACOS(2.3d0)
the compiler will generate an error. Why? Don't just state the error message you get; you should explain why this makes no sense mathematically.
b)
(2 pts) If y is double precision. If you compute
y = ATAN(2.3d0)
this will work. Why? Again, don't just state the error message you get; you should explain why this calculation is feasible.
4)
(6 pts) Given a set of coordinates (x,y) in the x-y plane, the polar form of the coordinates is given by $(r,\theta)$ where

\begin{displaymath}r = \sqrt{x^2 + y^2},\quad \theta = \tan^{-1}\left( \frac{y}{x}
\right).\end{displaymath}

Write an F90 program that will ask the user to input a set of rectangular coordinates, (x,y) and output the coordinates in polar form. The polar angle should be printed out in degrees. Test your program using the rectangular coordinates (-1,1), (-4,-2), (0,-3).



next up previous
Next: About this document ...
2017-09-20