hwk3_2011 - MSC321 Homework 3 MSC321 February 10, 2011 1...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: MSC321 Homework 3 MSC321 February 10, 2011 1 Reviews 1. What are the differences between functions and subroutines? 2. How are arguments passed to procedures in FORTRAN? 3. What does the term “dummy argument” refer to and contrast it to an “actual argument” 4. Explain why dummy and actual arguments have to agree on position and data type 5. Explain what an interface block is and why it is useful in programming. 6. What are the differences between an internal procedure and an external procedure? 2 Coordinate transformation The transformations between cartesian coordinates ( x,y ) and polar coordinates ( r,θ ) are ( r = √ x 2 + y 2 θ = tan- 1 y x and its inverse ( x = r cos θ y = r sin θ (1) Write a module with subroutines cart2pol(r,t,x,y) and pol2cart(x,y,r,t) that transform cartesian coordinates x , y into polar coordinates ( r,θ ) and vice versa. Test these subroutines on the 4 points ( ± 1 , ± 1) / √ 2, use the inverse transformation to recover the original points. Use the intrinsic function atan2 to find the angle which should be reported in degrees. 3 Function and derivative evaluation Write a module with a subroutine disp(f,df,x) that calculates the function f ( x ) = x tanh x- 1 / 4 and its derivative f ( x ) = tanh x + x (1- tanh 2 x ) given x . Use this subroutine to calculate these....
View Full Document

This note was uploaded on 01/08/2012 for the course MSC 321 taught by Professor Staff during the Fall '08 term at University of Miami.

Page1 / 3

hwk3_2011 - MSC321 Homework 3 MSC321 February 10, 2011 1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online