0% found this document useful (0 votes)
449 views

Semester III BCA3010 Computer Oriented Numerical Methods

The document solves a system of equations using matrix inversion and finds the eigenvalues and eigenvectors of a matrix. It then finds a cubic polynomial that satisfies given values and uses Simpson's 1/3rd rule to approximate an integral. Finally, it uses Picard's method of successive approximations to find successive approximations to the solution of an initial value problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
449 views

Semester III BCA3010 Computer Oriented Numerical Methods

The document solves a system of equations using matrix inversion and finds the eigenvalues and eigenvectors of a matrix. It then finds a cubic polynomial that satisfies given values and uses Simpson's 1/3rd rule to approximate an integral. Finally, it uses Picard's method of successive approximations to find successive approximations to the solution of an initial value problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Question 1- Solve the system of equation by matrix inversion

method
x+y+z=1
x + 2y + 3z = 6
x + 3y + 4z = 6
Answer:
The given equation can be written as
AX=B
X => A-1 B

(*)

Where

B=

Det

= 1(8 - 9) 1 (4 - 3) + 1 (3 2) = -1 0

A-1 exists
A-1 =

1
adj A
det A

First let us find adj. A


Cofactor of a11 = 1 = (-1) 1+1
Cofactor of a12 = 1 = (-1) 1+2
Cofactor of a13 = 1 = (-1) 1+3
Cofactor of a21 = 1 = (-1) 2+1
Cofactor of a22 = 1 = (-1) 2+2
Cofactor of a23 = 1 = (-1) 2+3
Cofactor of a31 = 1 = (-1) 3+1
Cofactor of a32 = 1 = (-1) 3+2
Cofactor of a33 = 1 = (-1) 3+3

ROLL # 1505007223 BCA 3010

Cofactor of A =

Adjoint of A
A-1 =

1 1 1
1 3 2

1 2 1

1 1 1
1 3 2

1 2 1

1 1 1
1 3 2

1 2 1

1
1
adj A=
det A
1

1 1
1
1 3 2

1 2 1

So from (*) we have

X=

1 1 1 1
1
1 3 2 6 5

1 2 1 6 5

ROLL # 1505007223 BCA 3010

Question 2- Find all eigen values and the corresponding eigen


vectors of the matrix
8 6 2
6 7 4

2 4 3
A=
Answer:

| AI |=0
The characteristic equation of A is
8 6
6 7

That is

2
4
3

where

0 0
0 0

0 0

Expanding we get

(8 -

That is,

)[(7- )(3- ) 16 ] + 6 [ -6 (3- ) + 8] + 2 [24 2 (7- )] = 0

+ 18
3

Therefore,

+ 18
- 3) (

45
2

45

=0

= 0 on simplification.

- 15) = 0

= 0, 3, 15 are the eigen values of A.

If x,y,z be the components of an eigen vector corresponding to the eigen


value

(A -

, the we have

8
6

I) X =

2
4

7
y

4 3 z

ROLL # 1505007223 BCA 3010

0
0
0

That is,
(8- ) x 6y + 2z

= 0

-6x + (7- ) y 4z = 0
2x 4y + (3-)z

= 0

Case I: Let = 0 we have


8x 6y + 2z
-6x + 7y 4z
2x 4y + 3z

= 0
= 0
= 0

(i)
(ii)
(iii)

Applying the rule of cross multiplication for (i) and (ii)


x
6

y
8

6 4

z
8

x
y
z

24 14 32 12 56 36
x
y
z
x y z

or
10 20 20 1 2 2

Therefore (x, y, z) are proportional to (1, 2, 2) and we can write x = 1k, y =


2k, z = 2k where k ( 0) is an arbitrary constant. However it is enough to
keep the values of (x, y, z) in the simplest form x = 1, y = 2, z = 2 (putting k
= 1). These values satisfy all the equations simultaneously.

Thus the eigen vector X1 corresponding to the eigen value = 0 is


Case II: Let = 3 and the corresponding equations are
5x 6y + 2z = 0
6x + 4y 4z = 0
2x 4y = 0

1

2
2

(iv)
(v)
(vi)

From (iv) and (v) we have


x
6 2
4 4

y
5
2
6 4

z
5 6
6 4

ROLL # 1505007223 BCA 3010

That is,

That is,

x y
z

16 8 16
x y
z

2
1
2

Thus X2 =

1
2

is the eigen vector corresponding to = 3

Case III: Let = 15 and the associated equations are


-7x 6y + 2z = 0
6x - 8y 4z = 0
2x 4y - 12z = 0

(vii)
(viii)
(ix)

From (vii) and (viii) we have


x
y
z

40 40 20

That is,

x
y
z

2 2 1

2
Thus X3 =

is the eigen vector corresponding to = 15.

There for = 0, 3, 15 are the eigen values of A, and


the corresponding eigen vectors.

ROLL # 1505007223 BCA 3010

1

2
2

1
2

and

2
1

are

Question 3- Find the cubic polynomial which takes the following


values y(0) = 1, y(1) = 0, y(2) = 1 and y(3) = 10. Hence or
otherwise, obtain y (0.5)
Answer:
Here x0 = 0, x1 = 1, x2 =2, x3 = 3 and y0 = 1, y1 = 0, y2 = 1, y3 = 10.
We form the difference table
x
x0 =
x1 =
x2 =
x3 =

y
y0 = 1
y1 = 0
y2 = 1
y3 = 10

0
1
2
3

y0 = -1
y1 = 1
y2 = 9

2y0 = 2
2y1 = 8

3y0 = 6

From the above table we have


X0 = 0, y0 = 1, y0 = -1, 2y0 = 2, 3y0 = 6
Using Newton forward difference formula
y ( x ) = y 0+ p y 0+

p( p1) 2
p ( p1 ) ( p2) 3
y 0+
+ y 0 where x =x0 + ph
2!
3!

Here h = 1, x0 = 0, therefore p = x
y ( x )=1+ x (1 )+

x ( x1 )
x ( x 1 )( x2 )
2+
6
1.2
1.2 .3

1x + ( x 2x ) + ( x 33 x 2+2 x )

y ( x )=x 3 2 x 2 +1
which is the polynomial from which we obtained the above tabular values.
To compute y(0.5)
Here x0 + ph = x = 0.5
p=0.5 since x0 =0h=1

1+ 0.5 (1 ) +

y ( 0.5 )= y 0 + p y 0 +

p ( p1 ) 2
p ( p1 )( p2 ) 3
y0 +
y0
2!
3!

( 0.5 ) ( 0.51 ) ( 0.5 ) ( 0.51 )( 0.52 )


2+
6
2
6

0.625

which is the same value as that obtained by substituting x = 0.5 in the cubic
polynomial.
ROLL # 1505007223 BCA 3010

ROLL # 1505007223 BCA 3010

Question 4 Find the approximate value of

cos

by Simpsons

1
rd
3

rule by dividing

[ ]
0,

into 6 equal parts.

Answer:
Here a = 0, b =

2 , n = 6,

0
ba 2

h=
=
= 15
n
6
12

Length of each part,

The values of

and the corresponding values of y =

cos correct to

four decimal place are tabulated.


0

12

2
12

3
12

4
12

5
12

6
12

y0

y1

y2

y3

y4

y5

y6

1.0000

0.9828

0.9306

0.8409

0.7071

0.5087

0.0000

y= cos

By Simpsons
6

1
rd rule
3

for n = 6 given by

yd = 3 [ ( y 0 + y 6 ) + 4 ( y 1 + y 3+ y 5 ) +2 ( y 2+ y 4 ) ]
0

cos d= 12x 3 [ ( 1+ 0 ) +4 ( 0.9828+0.8409+0.5087 )+ 2 ( 0.9306+ 0.7071 ) ]

1.1873

Therefore

cos d=1.1873
0

ROLL # 1505007223 BCA 3010

ROLL # 1505007223 BCA 3010

Question 5- Use Picards method of successive approximations to


y 1 , y 2 , y3

find

to the solution of the initial value problem

given that y = 2 for x = 0. Use

y3

'

y=

dy
=y,
dx

to estimate the value of y (0.8).

Answer:
On comparing

y'=

dy
=y,
dx

and

y 0=2, x 0=0

y 2= y 0 + f ( x , y 1 ) dx

2+ y 1 dx

to eq(1), we get

f ( x , y )= y

So first approximation will be


x

y 1= y 0 + f ( x , y 0 ) dx
x0

2+ y 0 dx

2+ 2 dx

2+2 ( x )0x

2+2 x

x0

x
0

2+ ( 2+2 x ) dx

2+(2+ x 2)0x =2+2 x+2 x 2

y 3= y 0 + f ( x , y 2 ) dx
x0

x
2
2+ ( 2+2 x +2 x ) dx
x0

x3
2+2 x +2 x +
3
2

At

x=0.8
3

(0.8)
y 3=2+2 ( 0.8 ) +( 0.8) +
=4.41
3
2

ROLL # 1505007223 BCA 3010

10

Question 6: Solve x

y +y=0, y' (1)=0, y(2)=1, h= {1} over {2}

Answer:
x 0=1, x 1=1.5, x 2=2
y 0= y ( x 0 )= y ( 1 )=?
y 1= y ( x 1) = y ( 1.5 )=?
y 2= y ( 2 )=1
y 0 =( y ' ( x0 ) )
'

We have
xi

y i +12 y i+ y i1
h2

+ y i =0

4 x i ( y i+12 y i + y i1 ) + y i=0 ( 1 )
Put

i=0 ( 1 ) ,

4 x 0 ( y 12 y 0 + y1 ) + y 0=0

Also,

y 'i=

y i+1 y i1
= y i+1 y i1
2h

Take i=0, we get,

y 0= y 1 y1

y1= y 1 y'0= y 1 ( since y '0=0 )


Therefore

4 ( y 12 y 0+ y 1) + y 0=0

8 y 17 y 0 =0 ( 2 ) Put i=1,

ROLL # 1505007223 BCA 3010

11

4 x 1 ( y 22 y 1+ y 0 ) + y 1=0
6 ( y 22 y 1 + y 0 ) + y 1=0
6 y 211 y 1 +6 y 0=0
11 y 1 +6 y 0 =6 (3 )

Solving (2) and (3),

y 0=

48
42
=1.6552, y 1= =1.4482
29
29

ROLL # 1505007223 BCA 3010

12

You might also like