Anda di halaman 1dari 11

Newton Raphson Method

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
.

Suppose the particle has moved x=1.7 m


in t=1 second. Write c++ codes to find the
rate within accuracy of 0.0001 using secant method.
Given that g=9.8 m/s2.

Newton Raphson (Transcendental) Method


According to the Kronig Penny model, electron experience a periodic potential in a lattice.
Electron in square potential well satisfy following mathematical equation
P

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=

,h= 6 .610 34 J . s,m= 9 . 110 31 Kg,L= 5A o


2

Gauss Elimination Method:


The circuit shown below could be used as a part of a system for charging a car battery.
Assuming that the internal resistance of the generator and the battery are negligible and
applying kirchoff's rules in the circuit following equations are made
4I 2 +15I 3 =12
10I1 + 15 I 3 = 100
I 1 =I 2 +I 3

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

using Trapezoidal rule :

A particle of mass m moving through a fluid is subjected to viscous resistance R, which is a


function of the velocity v. The relationship between the resistance R, velocity v and time t is
given by the equation
t=

m
du
R( u)
.

Suppose that R ( v )=v v for a particular fluid, where R is in newtons and v is in


meter/second. If m = 10 Kg and v(0) =10 m/s, write C++ codes to estimate the time required
for the particle to slow to v = 5 m/s using Trapezoidal rule.
Numerical Integration

using Simpson 1/3 method:

The Fresnel integrals

( 2 t ) dt

s ( x )= sin ( t ) dt
2

c ( x )= cos

and

arises in the study of light diffraction at a rectangular aperature.


Write C++ codes to dtermine the value of c(x) and thus construct the table of values of c(x)
for x ranging from 0 through 2 in increments of 0.5.

Numerical integration

using Simpson's 3/8 rule:

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.

Solution of Differential Equation using Modified Euler method:


In a given circuit Resistance (R=10 Kilo ohm) and a capacitor (C=1F) is applied across a
dc battery of emf E (E=100V). If the key is removed, then capacitor starts discharging.
Differential equation which represents the discharging of capacitor with time is
dq q
=
dt RC

,
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.

Solution of Differential Equation using Second Order Runga Kutta method:


In a given circuit Resistance (R=10 kilo ohm) and a capacitor (C=1F) is applied across a dc
battery of emf E (E=100 V). If the key is pressed, then capacitor starts charging. Differential
equation for the same is given by
dq
q
E
=

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.

Solution of Differential Equation using Fourth order Runga Kutta Method:


According to newton law of cooling the rate of change of temperature of an object is directly
proportional to difference of temperature i.e (T-T0), where T is the temperature of the object
and To is the temperature of the ambient surrounding. Differential equation for the same is
given as
dT
= K ( T T o )
dt

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.

Curve fitting Straight line


Einstein equation for the photoelectric effect can be written as
h=h o +eV

, is the frequency of the incident radiation on the metal, Wo is the work


function of the metal, Vo is the stopping Potential and e represents the charge of electron. A
student performs an experiment on a unknown metal by incidenting light of different
frequency (frequency greater than the threshold frequency) and variation of stopping
potential is observed.
o

(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.

Curve fitting polynomial


Given a table of values for the function as
x
y
1.0

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.

Curve fitting exponential


The absorption of the radition particle emitted by 22Fe is measured using Gieger Counter
when shielded with one or more thin sheets of aluminium. Count rate decreases with
increase in thickness of aluminium.
Aluminium
Thickness
(cm)

Count Rate
(Counts/min)

0.00162

1250

0.00324

800

0.00486

450

0.00810

310

0.00972

165

Write C++ codes to fit an exponential curve to the above data.

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.

Eigenvalue and Eigenvector:


Write C++ codes to find the dominant eigenvalue (upto an accuracy of 0.0001) and its
corresponding eigenvector of the given matrix.

4
5
1

[]

1
x =1
1
[ 0]

Take initial eigenvector to be

14
13
0

0
0
2

Other Questions for Newton Rahson, Bisection and Secant are


(a) In optics, Single slit Diffraction experiment, when a light of wavelength 7000 is incident on a
single slit results in the fringe pattern on the screen. The intensity variation for the fringes obtained
on the screen is given by
sin 2 x
I=I o 2
x
where x represents the distance from the center of the central maxima. Write C++ codes to find the
position of First and second minima using Newton Raphson Method/Secant Method.
(b) tan x = x is a well known equation encountered while solving a boundary value problem in
Schrodinger equation in Quantum Mechanics. Write C++ codes to find to solve the above equation
numerically and find the first positive value of x other than zero. Use Bisection Method/Secant
Method/Newton raphson Method.
(c) Bisection Method: DeSantis, Gironi and Marelli derive a relationship for the compressibility
3
factor of real gases in the form z= ( 1 + y+ y 2 y 3 ) / ( 1 y ) , where y is related to the Van der Waals
volume correction factor. If z=0.892, what is the value of y. Write c++ codes to find the value of y
with an accuracy of 0.0001 using bisection method.
Answer: 1.83929 .... root is between 1.5 and 2
(d)Newton Raphson Method: In determining the minimum cushion pressure needed to break a
given thickness of ice using an air cushion vehicle, Muller derived a mathematical equation
3
h 2
h 4
h2
p3 ( 1 2 ) + 0 . 4 h 2 2 p2 + 4 p
=0
r
3r
3r 2
where p denotes the cushion pressure, h denotes the thickness of the ice field, r the size of the air
cushion, the tensile strength and is related to the width of the ice wedge. Take =0.5, r=40 m
and =150 Pa. Determine the value of p for h=4.2 m. Write C++ codes to determine the cushion
pressure using newton Raphson method with an accuracy of 0.0001.

( )

answer....1.71612
equation after simplification is
((0.75*x*x*x)-(1.23375*x*x)+(0.00607*x)-0.16751)

Numerical Integration

using Simpson 1/3 method:

The Fresnel integrals

( 2 t ) dt and

s ( x )= sin ( t ) dt
2
x

c ( x )=0 cos
x

arises in the study of light diffraction at a rectangular aperature.

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 Simpson's 3/8 rule:

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

The work done by the gas as it expands is given by


W= p dv . Estimate the work done.
(b) Contour Integration are being used to solve some of the improper integral. Plot the function
f(x) =

1
2
2+ x

Write C++ codes to find the value of this improper integral.

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

Observe the graph to find the limit of integration.


(d)
Orthogonal relations in C++ are well known relations for special functions like Legendre
functions or Hermite function. Write C++ codes to find the value of the integral
1

I = 1 P n ( x ) P m ( x ) dx

where n=m=6 and p6 ( x)=


And verify the orthogonality relationship,
1

1 P n ( x ) P m ( x ) dx

2n + 1 n , m

Solution of Coupled Differential Equation using Second


Solve the coupled differential equations

order Runga Kutta Method:

dx
x
= y+ x
dt
3 ,
dy
= x
dt

Given that the initial conditions x(0)=0 and y(0)= -1.


Plot x vs y for 0 t 15 .

Solution of Differential Equation of second order using Second


Method:

order Runga Kutta

The differential equation describing the motion of a pendulum is


2
d
=sin ()
2
dt
.
The Pendulum is released from rest at an angular displacement , i.e (0) = and ' (0) = 0.
Solve the equation for = 0.5 and plot as a function of time in the range of 0 t 8 .

Anda mungkin juga menyukai