Fortran90 Program - Mathematics and Computing - Old Exam Paper, Exams of Mathematics for Computing

Main points of this past exam are: Fortran90 Program, Normal Distribution, Number of Occurrences, Binomial Distribution, Taylor Series, Mean Length of Sample, Standard Deviation, Percentage of Blocks, Find Vector

Typology: Exams

2012/2013

Uploaded on 03/27/2013

ashis
ashis 🇮🇳

4.3

(29)

90 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Cork Institute of Technology
Bachelor of Engineering in Civil Engineering - Award
(NFQ – Level 7)
Autumn 2009
Mathematics & Computing – old syllabus
(Time: 3 Hours)
Any FIVE questions are to be answered.
Examiners:
Mr J Lapthorne
Mr J Kindregan
Ms J English
Mr T O Leary
Section A
1 (a) List the order of precedence of the arithmetic operators. (2 marks)
(b) What is the output of the following Fortran90 program?
NOTE: Trace your working so that partial credit may be given for incomplete or
incorrect work.
PROGRAM q1_b
implicit none
integer::limit = 6
integer::a, b
do a = limit,0, -1
do b = limit, 0, -1
if( (0 == a) .or. (limit == a) )then
write(*,'(i1)',advance='no')a
else if( (b - a == 0))then
write(*,'(i1)',advance='no')a
else if( (b + a == limit))then
write(*,'(i1)',advance='no')b
else
write(*,'(a)',advance='no')'#'
end if
end do
pf3
pf4
pf5
pf8

Partial preview of the text

Download Fortran90 Program - Mathematics and Computing - Old Exam Paper and more Exams Mathematics for Computing in PDF only on Docsity!

Cork Institute of Technology

Bachelor of Engineering in Civil Engineering - Award

(NFQ – Level 7)

Autumn 2009

Mathematics & Computing – old syllabus

(Time: 3 Hours)

Any FIVE questions are to be answered. Examiners: Mr J Lapthorne Mr J Kindregan Ms J English Mr T O Leary

Section A

1 (a) List the order of precedence of the arithmetic operators. (2 marks)

(b) What is the output of the following Fortran90 program?

NOTE: Trace your working so that partial credit may be given for incomplete or incorrect work.

PROGRAM q1_b implicit none integer::limit = 6 integer::a, b do a = limit,0, - do b = limit, 0, - if( (0 == a) .or. (limit == a) )then write(,'(i1)',advance='no')a else if( (b - a == 0))then write(,'(i1)',advance='no')a else if( (b + a == limit))then write(,'(i1)',advance='no')b else write(,'(a)',advance='no')'#' end if end do

(8 marks)

(c) Write a program that will read in the coordinates of two points ( x 1 , y 1 )and ( x 2 , y 2 )and

calculate the distance between them. The program should allow more than one set of data to be entered if the user wishes.

Note : The distance between the two points (x^1 ,y 1 ) and (x 2 ,y 2 ) is given by

(x -x ) +(y -y ) 1 2 2 1 2 2

and the sqrt( ) function returns the square root of a real. (10 marks)

2 (a) What is the output of the following Fortran90 program? NOTE: Trace your working so that partial credit may be given for incomplete or incorrect work.

marks)

PROGRAM q2_a implicit none integer::thisOne, thatOne thisOne = 12 thatOne = 2 do write(, '(i5)', advance= 'no')thisOne if(mod(thatOne, 5) == 0)then print end if if(thisOne == 1)exit if(mod(thisOne, 2) == 0)then thisOne = thisOne / 2 else thisOne = thisOne * 3 + 1 end if thatOne = thatOne + 1 d d

Enter an option (0 to see menu): 4 (12 marks)

  1. (a) A light beam of span 5m is simply supported at its endpoints. At the point x=3m there is a load of 72kN. Express the Bending Moment M in terms of a step function. By solving the differential equation EI (^) dxd y 2 M

2 = y(0)=y(5)= find the deflection y at any point on the beam. (9 marks)

(b) A light beam of span 6m has both ends embedded in walls. Between the points x=2m and x=6m there is a U.D.L. of 36kNm-1^. Express the Bending Moment M in terms of step function. Solve the differential equation

EI (^) dxd y 2 M

2

to find the deflection y at any point on the beam. (8 marks)

(c) By using Euler’s Method or the Three Term Taylor Method with a step h=0.1 estimate the value of y at x=1.1 where dy (^) 3y dx =^ y(1)= Note:

2 k+1 k k k y =y +hy + h y ′ (^) 2! ′′ (4 marks)

  1. Select any three of parts (a) to (d) (a) Solve the differential equation 2 2

d x 3 dx 2x 20 x(0)=x (0)= dt +^ dt +^ =^ ′.^ (8 marks)

(b) Find the general solution of the differential equation 2 2

d x 2 dx x 4t dt +^ dt+^ =^.^ (6 marks)

(c) Find the general solution of the differential equation 2 2

d y (^) +2 dx 40cos4t dt dt =^ (7 marks)

(d) Solve the differential equation

dx (^) 2x 4 dt −^ =^ x(0)=0^ (5 marks)

  1. (a) Find the first two non vanishing terms of a Maclaurin Series and the first three terms of a

Taylor Series expansion of f(x)=ln(secx) about the point x= π 4.

Note: 2cos 2 A=1+cos2A sin2A=2sinAcosA secA =cosA^1

sin π^1 tan π^1 cos π 0 cos 0 1 tan 0 0 2 4 2

. (9 marks)

(b) Find the Taylor series expansion of f(x,y)=exp(3x-y) about the values x=1,y=3. Note : A Taylor Series expansion of f(x,y) about values x=a and y=b is given by

f(x, y) f(a,b) (x a)f (y b)f (x2!a) f (x a)(y b)f (y2!b) fyy ....

2 xx xy

2 x y + = + − + − + − + − − + − (6 marks)

(c) In estimating a quantity V the formula V= 2x 2x-y is used. Find the partial derivatives of V with respect to x and to y. Hence estimate the value of V where the values of x and y were measured as 2 and 3 with maximum errors of 0.01 and 0.02, respectively. (5 marks)

  1. (a) Find the inverse of the matrix A below. If they exist find the matrices BC and CB.

A =

B = (1 2) =^   ^11

C (9 marks)

(b) Solve the set of equations below can be solved by using Gaussian Elimination with partial pivoting (correct to two places of decimal). Also solve this set of equations by using Gaussian Elimination without partial pivoting or by using Cramers Rule.

Calculate the probability that the mean length of a sample of 16 blocks will be greater than 449.4mm. (6 marks)

(c) To monitor the breaking strength of precast concrete 6 samples of size 3were taken and the measurements are recorded below.

Sample No 1 2 3 4 5 6 Mean 54.7 55.3 54.9 55.0 55.2 54. Range 0.5 0.4 0.5 0.4 0.4 0.

Set up and plot a control chart for samples means. Include on the chart the mean values of the samples above and comment on the control of the process. (7 marks)

.S TANDARD DERIVATIVES & INTEGRALS

f(x) f^ ′ (x)^ a=constant x n nx n−^1 sinx cosx cosx -sinx secx secxtanx tanx sec^2 x e ax^ ae ax uv dx vdu dx u dv+

v

u

v^2 dx

udv dx v du−

f(x) ∫ f(x)dx^ a=constant

xn n 1

x n^1

x

(^1) ln x

TAYLOR S ERIES

(x a)^2 f(x) = f(a) + (x − a)f (a)′^ + −2! f (a)′′ +..

.B INOMIAL DISTRIBUTION P(r)= (^)  

r

N (^) p r (^) qN-r (^) where p+q=

POISSON DISTRIBUTION P(r)= λ^ r!e

r −λ where λ is the mean number of occurrences

Normal Distribution z= x-μ σ z= x-μ σ/ n