You are on page 1of 2

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, PILANI-HYDERABAD CAMPUS

FIRST SEMESTER 20152016

Comprehensive Examination (Closed Book)


Course No: PHY F313
Course Title: COMPUTATIONAL PHYSICS
Date: 5th December, 2015

Total Marks: 120


Weightage: 40%
Max. Time: 180 mins

1. Derive an expression for the first derivative of a function f(x) in terms of finite
differences between values of the function at various points. The error in the
expression should be of the order of h2 where h is the distance between two
neighbouring points.
(10)
2. A 20 foot ladder is placed in a straight corridor such that the bottom of the ladder
is touching the bottom of the left wall and the top of the ladder is leaning on the
right side wall. Further down the corridor, a 30 foot ladder is placed such that the
bottom of this ladder is touching the bottom of the right wall and the top of the
ladder is leaning on the left side wall. The point where the two ladders cross (as
seen by someone further down the corridor) is 10 feet above the ground.
a) From the information given above, derive an equation which can be used to
determine the width of the corridor. Show all the steps used in deriving the
equation including the figure which represents the situation described above.
Note: Do not try to simplify the equation.
b) Give two initial guesses for the root (width of the corridor) for solving the
equation in part (a) by the bisection method. (You are not required to obtain the
root).
c) Using the two values which you have given in part (b), determine the
approximate width of the corridor (i.e, implement one iteration of the bisection
method).
(15+6+4)

sin x
x dx
3. Evaluate the integral
using the 3-point Gauss-Legendre quadrature
rule. Show all the steps involved in the calculation.
(20)
4. Study the program given below:
Line number command
1
x0=0;
2
h=0.0001;
3
x1=x0+h;
4
x2=x0+2*h;
5
n=3/2;
6
eta=30.7333333333;
7
g=0;
8
while x0<1000
9
f0=(x0^n)/(1+exp(x0-eta));
10
f1=(x1^n)/(1+exp(x1-eta));
11
f2=(x2^n)/(1+exp(x2-eta));
12
g=g+(h/3)*(f0+4*f1+f2);
13
end
a) What is the program trying to compute?
b) Which numerical method is being used in the computation?

c) Point out any errors in the program which will give rise to an incorrect output.
d) Specify the corrections which have to be incorporated in this program so as to
yield the desired output. Also specify the line numbers where the corrections
have to be incorporated.
(2+2+6+10)

5. Determine all the fixed points of the differential equation:


the stability of these fixed points.
xn 1
6. Determine all the fixed points of the map
fixed points.

dx
x3 3x 2 2 x
dt

. Analyze
(15)

2 xn
1 xn
. Analyze the stability of these
(15)

7. John Von Neumann had suggested the following method (known as middle square
method) for generating sequences of four digit random numbers.
Take a 4 digit random number as seed and square it. If the resulting number is less
than 8 digits, add leading zeros. The middle 4 digits of this number would be the next
random number in the sequence. The process is iterated to generate the remaining
numbers in the sequence.
To make this problem easier, assume that we are using the middle square method to
generate a sequence of 2 digit random numbers, i.e, a 2 digit number is taken, then
squared and leading zeros are added (i.e, zeros are added in the thousands place and if
required in the hundreds place).
What would be the disadvantage of this method? You can generate a sequence which
illustrates the shortcoming of this method. How would you generate the seed for this
random number generator, if you are implementing it on a computer?
(10+5)

You might also like