Professional Documents
Culture Documents
Suppose it was discovered that Professor X of X-MEN had the flu when he died and his core
temperature at the time of his death was 105oF. Detective Jerry made an equation which
relate the body temperature and the time of death as given below
72 +t d ( 1 / k ) + ( 18+ 1 / k ) e
k . t d
=103
where K is a parameter related to temperature and td represents the time of death. Assume
that td = 0 means 9.00 pm. Write c++ codes to determine the time of death with an accuracy
of 0.0001using Newton Raphson method. Given that K=0.3711.
Bisection Method
An object falling vertically through the air is subjected to viscous resistance as well as to the
force of gravity. Assume that an object with mass m=0.25kg is dropped from a height so and
that the height of the object after t seconds is
4mg 4m 2 g
( 1ekt / m )
s ( t ) =so
t+
2
k
k
,
2
where g=9.8m/s and k represents the coefficient of air resistance. Suppose s o = 300 m, m =
0.25kg and k=0.1kg-s/m. Write C++ codes to find, to within accuracy of 0.001 s, the time it
takes this object to hit the ground using bisection method.
Secant Method
A particle starts at rest on a smooth inclined plane whose angle is changing at constant
rate.
d
=< 0
dt
.
At the end of t seconds, the position of
the object is given by
x (t )=
2g e t e t
sin t
2
2
.
sin x
+ cos x=cosy
x
8 2 mE
.L
2
h
where
where m represents the mass of electron, E is the energy, L is the lattice constant and h is
Plank's constant. Writes C++ codes to determine the minimum positive value of x with an
accuracy of 0.0001 using Newton Raphson Method and thus determine the energy
corresponds to the minimum positive value of x. Given that
x=
P= 10, y=
and
.
Write C++ codes to determine the value of each current in each branch of the circuit using
Gauss elimination method.
Gauss-Seidal Method
Given below are three algebric equation.
10 x 1 x 2 +2x 3=6
x 1 +11 x 2 x 3 +3x 4= 25
2 x 1 x 2 +10x 3 x 4=11
3 x 2 x 3 +8x 4=15
.
Writes C++ codes to determine the value of each variable upto an accuracy of 0.0001 using
Gauss Seidal method.
Forward Difference Table and estimate the value near thye beginning of the table:
A thermodynamic student needs the temperature of the saturated steam under a pressure of
6.3 mega Pascals. Table below shows the variation of temperature of steam with pressure.
Pressure (MPa)
Temperature (oC)
4.0
250.40
5.0
263.99
6.0
275.64
7.0
285.88
8.0
295.06
9.0
303.40
Write C++ codes to generate the Forward difference table and hence find the value of
temperature of steam at pressure of 6.3 mega Pascal.
Backward Difference Table and estimate the value near the end of the table:
A thermodynamic student needs the temperature of the saturated steam under a pressure of
8.5 mega Pascals. Table below shows the variation of temperature of steam with pressure.
Pressure (MPa)
Temperature (oC )
4.0
250.40
5.0
263.99
6.0
275.64
7.0
285.88
8.0
295.06
9.0
303.40
Write C++ codes to generate the backward difference table and hence find the value of
temperature of steam at pressure of 8.5 mega Pascal.
Differentiation:
First and the second derivative near the beginning of the table:
The distance travelled by a car in a given time is given in the following table
Time (s)
Distance (m)
10
12
12
15
14
20
16
27
18
37
Write C++ codes to find the velocity and the acceleration at t=12 s.
Differentiation: First and the second derivative near the end of the table:
The distance travelled by a car in a given time is given in the following table
Time (s)
Distance (m)
10
12
12
15
14
20
16
27
18
37
Write C++ codes to find the velocity and the acceleration at t=16 s.
Numerical Integration
m
du
R( u)
.
( 2 t ) dt
s ( x )= sin ( t ) dt
2
c ( x )= cos
and
Numerical integration
Using Newton's second law, it can be shown that the time period, T (time for the one
complete swing), of a simple pendulum with length L and maximum angle of deflection o is
given by
T= 4
L
1
dx
g 1 k 2 sin 2 x
,
where k=sin( o) and g is the acceleration due to gravity. To caliberate the timing
mechanism, a grandfather clock manufacturer needs to know the period of a pendulum with
L=1 m and o=12o . Write C++ codes to to find the period of oscillations of pendulum using
simpson's 3/8th rule.
Solution of Differential Equation using Euler method:
According to radioactive decay law
dN
= N
dt
,
where is decay constant. Solve the differential equation. Given that at t=0 s , N=1000 ,
and =1 s-1. Also plot the variation of the number of nucleon (N) with time. And compare
your result with the standard solution of the differential equation.
,
where q represents the charge on the capacitor. Solve the differential equation and show the
variation of charge with time. Given that initially at t=0 sec, q=1 C.
dt
RC R ,
where q represents the charge on the capacitor. Solve the differential equation and plot the
variation of the charge on capacitor with time. Also compare your result with the standard
solution of the above differential equation. Given that at t = 0 sec, q = 0 C.
Solve the above differential equation and show the variation of temperature (T-T 0) with time.
Also compare your result with the standard solution of the differential equation. Given that
at t=0 sec T= 100oC. T0=20oC and K=1 units.
(Hz) Vo (Volt)
1013
55
0.4
71
1.0
79
1.3
84
1.8
103
2.3
120
3.1
Write C++ codes to estimate the work function of unknown metal.
1.1
1.5
1.3
2.0
1.6
2.5
2.0
3.1
3.4
4.0
4.2
Write C++ codes to fit a second degree polynomial to the above data.
Count Rate
(Counts/min)
0.00162
1250
0.00324
800
0.00486
450
0.00810
310
0.00972
165
Cubic B-spline
Following table shows the data for the speed of sound in water as a function of temperature.
S. No.
Temperature Speed of sound
(oC)
in water (m/s)
1
1402
10
1447
20
1482
30
1509
40
1529
50
1542
60
1551
70
1553
80
1554
10
90
1550
11
100
1543
Write C++ codes to find the value of speed of sound in water at 34oC and 91oC using natural
cubic B-spline fitting method.
4
5
1
[]
1
x =1
1
[ 0]
14
13
0
0
0
2
( )
answer....1.71612
equation after simplification is
((0.75*x*x*x)-(1.23375*x*x)+(0.00607*x)-0.16751)
Numerical Integration
( 2 t ) dt and
s ( x )= sin ( t ) dt
2
x
c ( x )=0 cos
x
Write C++ codes to determine the value of c(x) and thus determine of values of c(x) for
x=0.5 and x=1.0.
Numerical integration
Using Newton's second law, it can be shown that the time period, T (time for the one
complete swing), of a simple pendulum with length L and maximum angle of deflection o is
given by
T= 4
L 2
g 0
1 k 2 sin 2 x
dx
,
where k=sin( o) and g is the acceleration due to gravity. To caliberate the timing
mechanism, a grandfather clock manufacturer needs to know the period of a pendulum with
L=1 m and o=12o . Write C++ codes to to find the period of oscillations of pendulum using
simpson's 3/8th rule.
Problem on Integration:
(a) Numerical Integration using Simpson 1/3 method: Values of the volume (v, measured in
cubic inches) and the pressure (p, measured in pounds per square inch) of a gas as it expands from
volume 1 cubic inch to volume of 2.5 cubic inches are presented in table below.
v
p
1.00
68.7
1.25
55.0
1.50
45.8
1.75
39.3
2.00
34.4
2.25
30.5
2.50
27.5
1
2
2+ x
I =
1
dx
2
2+ x
.
(c)
Dirac Delta function is one of the most important function used in different streams of
Physics. Plot the given delta function
1
f(x)=
e
2 2
(x 2)
2
2
( x+ 3)
Using the above function write C++ codes to find the value of the integration and show that for
=0.1, integral tends to 5.
I = f(x) dx
I = 1 P n ( x ) P m ( x ) dx
1 P n ( x ) P m ( x ) dx
2n + 1 n , m
dx
x
= y+ x
dt
3 ,
dy
= x
dt