Docsity

Recurrence Relation - Engineering Computing (Fortran) - Old Exam Paper, Exams of Materials science

Toggle sidebar
bg1
Semester I Examinations 2007/ 2008
Exam Code(s) 1BM121, 1BG121, 1EG121
Exam(s) First Year Engineering
(Mechanical, Biomedical, Undenominated)
Module Code(s) ME114
Module(s) Engineering Computing I (Fortran)
Paper No. 1
Repeat Paper -
External Examiner(s) Professor J. Fitzpatrick
Internal Examiner(s) Professor P.J. Nolan
* Dr. J.A. Eaton
Instructions:
• Answer 3 questions.
• All questions carry equal marks.
• Attached are the following information:
— List of Fortran intrinsic procedures
Duration 2 hours
No. of Pages 6
Department(s) Mechanical and Biomedical Engineering
Course Co-ordinator(s)
Requirements:
MCQ -
Handout -
Statistical/ Log Tables -
Cambridge Tables -
Graph Paper -
Log Graph Paper -
Other Materials -
pf3
pf4
pf5

Partial preview of the text

Download Recurrence Relation - Engineering Computing (Fortran) - Old Exam Paper and more Exams Materials science in PDF only on Docsity!

Semester I Examinations 2007/ 2008

Exam Code(s) (^) 1BM121, 1BG121, 1EG Exam(s) (^) First Year Engineering

(Mechanical, Biomedical, Undenominated)

Module Code(s) (^) ME Module(s) (^) Engineering Computing I (Fortran)

Paper No. (^1) Repeat Paper -

External Examiner(s) (^) Professor J. Fitzpatrick Internal Examiner(s) (^) Professor P.J. Nolan

  • Dr. J.A. Eaton

Instructions: (^) • Answer 3 questions.

  • All questions carry equal marks.
  • Attached are the following information: — List of Fortran intrinsic procedures

Duration 2 hours No. of Pages (^) 6 Department(s) (^) Mechanical and Biomedical Engineering Course Co-ordinator(s)

Requirements : MCQ - Handout - Statistical/ Log Tables - Cambridge Tables - Graph Paper - Log Graph Paper - Other Materials -

  1. (a) Describe the possible uses of the MODULE facility in Fortran 95. Use sketches and code samples, as appropriate, to illustrate your answers. (5 points)

(b) In a chemical process the partial pressures of the gases I2 and He in a mixture of gases are required. p(I2) and p(He) denote the partial pressures of I2 and He, respectively, and they are determined by a parameter z that is obtained as the solution to the following equation:

99.72 z^4 + 2.87 * 10 -7 z^2 + 6.67 * 10 -10 z - 760.0 = 0. with p(I2) = 5.23 * 10 -10 z (N/m^2 ) , p(He) = 98.64 z^4 (N/m^2 )

Draw a flowchart and write a Fortran 90 programme to determine the parameter z using the method of false position, and then evaluate p(I2) and p(He). Declare the coefficients within the code, and use the normalised error in the calculations. The progamme should request initial guesses and an error tolerance from the user. (15 points)

  1. (a) The power series expansion for cos(x) is :

cos( ) 1

2 4 6 8 = − + − + +

x x x x x

Briefly explain what a recurrence relation is, and, by deriving the recurrence relation for this series, show how it can lead to programming efficiency. (4 points)

(b) Draw a flowchart and write a Fortran 95 programme to evaluate cos (x) using a recurrence relation. The result should be computed accurate to 0.1%, and the summation should be terminated after a maximum number of terms Nmax specified by the user. Read values for x and Nmax from an input file, and write the results to an output file. Include a repeat option. (16 points)

  1. (a) Derive the formula for approximating the roots of f ( x )= 0 using the Newton-Raphson method. (8 points)

(b) The extension δ in a solid rod subjected to a tensile force P is given by the equation:

c

P = a ( 1 + b δ)

Draw a flowchart and write a Fortran 95 programme to evaluate δ for a given value of P. Employ the Newton-Raphson method. The programme should read values for the initial estimate

P , a , b , c ,

δ 0 , the tolerance and the maximum allowed number of iterations from an input

file. The programme should write results consisting of the final extension, the number of iterations used and the error to an output file. Include a repeat option. (12 points)