INTERNAL ASSIGNMENT
NAME DHANANJAY
ROLL NO 2214504860
SEMESTER
III
COURSE CODE & NAME
DCA2101 &
Computer Oriented Numerical Methods
SESSION SEPTEMBER 2022
Set I
Question .1.a.) Show that
𝟏
(a) 𝜹𝝁 = (∆ + 𝜵)
𝟐
Answer.:- The Laplacian operator in Cartesian coordinates is given by .:-
𝜕2 𝜕2 𝜕2
∆= 𝛻 2 = + +
𝜕𝑥 2 𝜕𝑦 2 𝜕𝑧 2
The gradient operator in Cartesian coordinates is .:-
𝜕 𝜕 𝜕
∆= 𝑖̂ + 𝑗̂ + 𝑘̂
𝜕𝑥 𝜕𝑦 𝜕𝑧
The Kronecker delta , 𝛿, is defined as
1 𝑖𝑓 𝑖 = 𝑗
𝛿𝑖𝑗 = {
0 𝑖𝑓 𝑖 ≠ 𝑗
Now , let’s evaluate 𝛿µ in terms of ∆ 𝑎𝑛𝑑 𝛻 .:-
1
𝛿𝜇 = (∆ + 𝛻)
2
In Cartesian coordinates , Kronecker delta µ = µ is 1 , and for µ ≠ µ is 0 .
Let’s consider the components of 𝛿µ .:-
When µ = µ :
𝛿µµ = 1
When µ = µ :
𝛿µµ = 0
1
Therefore , the expression 𝛿𝜇µ = (∆ + 𝛻) doesn’t hold true for arbitrary µ .
2
(b) ∆ − 𝜵 = ∆𝜵
Answer.:- Given ∆ − 𝛻 = ∆𝛻
Let's use the definition of the Laplacian and gradient operators:
𝜕2 𝜕2 𝜕2
The Laplacian operator in Cartesian coordinates is ∆= 𝛻 2 = 𝜕𝑥 2 + 𝜕𝑦2 + 𝜕𝑧2 .
𝜕 𝜕 𝜕
The gradient operator in Cartesian coordinates is ∆= 𝑖̂ + 𝑗̂ + 𝑘̂ .
𝜕𝑥 𝜕𝑦 𝜕𝑧
Substitute these definitions into the equation:
𝛻 2 = 𝛻 = 𝛻(𝛻)
Let's solve this step by step:
𝜕2 𝜕2 𝜕2
𝛻 2 = 𝜕𝑥 2 + 𝜕𝑦2 + 𝜕𝑧2 .
𝜕 𝜕 𝜕 𝜕 𝜕 𝜕
𝛻(𝛻) = ( 𝑖̂ + 𝑗̂ + 𝑘̂ ) ( 𝑖̂ + 𝑗̂ + 𝑘̂ )
𝜕𝑥 𝜕𝑦 𝜕𝑧 𝜕𝑥 𝜕𝑦 𝜕𝑧
𝜕 𝜕 𝜕 𝜕 𝜕 𝜕 𝜕 𝜕 𝜕 𝜕 𝜕 𝜕 𝜕 𝜕 𝜕
𝛻(𝛻) = ( 𝑖̂) + ( 𝑗̂)+ ( 𝑘̂ )+ ( 𝑖̂) + ( 𝑗̂)+ ( 𝑘̂ ) + ( 𝑖̂) +
𝜕𝑥 𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑥 𝜕𝑧 𝜕𝑦 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝜕𝑦 𝜕𝑧 𝜕𝑧 𝜕𝑥 𝜕𝑧
𝜕 𝜕 𝜕
( 𝜕𝑦 𝑗̂)+ 𝜕𝑧 ( 𝜕𝑧 𝑘̂ )
It appears that 𝛥 − 𝛻 is not equal to 𝛥 𝛻 based on thew definitions of the Laplacian and gradient
operators . The result dose not simplify to the from 𝛥 − 𝛻 = 𝛥 𝛻.
Therefore ,
As it stands , the equation 𝜟 − 𝜵 = 𝜟 𝜵 dose not hold true .
Question .2.) Solve the system of equation by Gauss Elimination’s method
𝟐𝒙 + 𝒚 + 𝟒𝒛 = 𝟏𝟐
𝟒𝒙 + 𝟏𝟏𝒚 − 𝒛 = 𝟑𝟑
𝟖𝒙 − 𝟑𝒚 + 𝟐𝒛 = 𝟐𝟎.
Answer.:- The given system of equations is:
1. 2𝑥 + 𝑦 + 4𝑧 = 12
2. 4𝑥 + 11𝑦 − 𝑧 = 33
3. 8𝑥 − 3𝑦 + 2𝑧 = 20
Let's start by representing this system as an augmented matrix:
2 1 4 12
(2 11 −1 33 )
8 −3 2 20
Now, let's perform row operations to bring this matrix to row-echelon form:
R2 = R2 - 2 * R1
R3 = R3 - 4 * R1
2 1 12 12
(0 9 9 33 )
0 0 −21 - 21
Now, let's solve for z from the last row:
-21 z = -21
z=1
Substituting z =1 into the second row:
9y -9=9
9 y 18
Y=2
Finally , substituting z = 1 y = 2 into the first row :
2 x + 2 + 4 = 12
2x=6
X=3
Therefore ,
The solution to the system of equations is x = 3 , y = 2 , and z = 1 .
Question .3.) Find the equation of the best fitting straight line for the data:
X 1 3 4 6 8 9 11 14
Y 1 2 4 4 5 7 8 9
Answer.:-
Given data:
X: 1, 3, 4, 6, 8, 9, 11, 14
Y: 1, 2, 4, 4, 5, 7, 8, 9
Calculations:
n=8
∑ 𝑥 = 1 + 3 + 4 + 6 + 8 + 9 + 11 + 14 = 56
∑ 𝑦 = 1 + 2 + 4 + 4 + 5 + 7 + 8 + 9 = 40
∑ 𝑥 𝑦 = (1 ∗ 1) + (3 ∗ 2) + (4 ∗ 4) + (6 ∗ 4) + (8 ∗ 5) + (9 ∗ 7) + (11
∗ 8) + (14 ∗ 9) = 416
∑ 𝑥 2 = (12 ) + (32 ) + (42 ) + (62 ) + (82 ) + (92 ) + (112 ) + (142 ) = 494
Now, let's calculate the slope (m) using the formula:
(8 × 416) − ( 56 × 40) 3328 − 2240 1088 34 17
𝑚= 2
= = = =
(8 × 494 ) − (56) 3952 − 3136 816 26 13
Next, calculate the y-intercept (c):
17 952
40 − 13 × 56 40 − 13 120
𝑐= =
8 8 13
Therefore,
The equation of the best-fitting straight line for this data set is:
𝟏𝟕 𝟏𝟐𝟎
𝒚 = 𝒙 +
𝟏𝟑 𝟏𝟑
Set - II
Question .4.) Evaluate f (15), given the following table of values:
x 10 20 30 40 50
y = f (x) 46 66 81 93 101
Answer.:-
Given the points (x, y):
(10, 46) and (20, 66)
The formula for linear interpolation between two points is:
(𝑥 − 𝑥0 ). (𝑓(𝑥1 ) − 𝑓(𝑥0 ))
𝑓(𝑥) = 𝑓(𝑥0 )
𝑥1 − 𝑥0
Where .:-
𝑥0 𝑎𝑛𝑑 𝑓(𝑥0 ) 𝑎𝑟𝑒 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒𝑠 𝑎𝑡 𝑡ℎ𝑒 𝑝𝑜𝑖𝑛𝑡 𝑏𝑒𝑓𝑜𝑟𝑒 𝑡ℎ𝑒 𝑡𝑎𝑟𝑔𝑒𝑡 𝑣𝑎𝑙𝑢𝑒 ( 𝑖𝑛 𝑡ℎ𝑖𝑠 𝑐𝑎𝑠𝑒, 𝑥
= 10 𝑎𝑛𝑑 𝑓(𝑥) = 46 )
𝑥1 𝑎𝑛𝑑 𝑓(𝑥1 ) 𝑎𝑟𝑒 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒𝑠 𝑎𝑡 𝑡ℎ𝑒 𝑝𝑜𝑖𝑛𝑡 𝑏𝑒𝑓𝑜𝑟𝑒 𝑡ℎ𝑒 𝑡𝑎𝑟𝑔𝑒𝑡 𝑣𝑎𝑙𝑢𝑒 ( 𝑖𝑛 𝑡ℎ𝑖𝑠 𝑐𝑎𝑠𝑒, 𝑥
= 20 𝑎𝑛𝑑 𝑓(𝑥) = 66 )
𝑎𝑛𝑑 𝑓(𝑥) = 66) ,
𝑎𝑛𝑑 𝑥 𝑖𝑠 𝑡ℎ𝑒 𝑡𝑎𝑟𝑔𝑒𝑡 𝑣𝑎𝑙𝑢𝑒 ( 𝑖𝑛 𝑡ℎ𝑖𝑠 𝑐𝑎𝑠𝑒 , 𝑥 = 15 ) .
𝑙𝑒𝑡’𝑠 𝑝𝑙𝑢𝑔 𝑖𝑛 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒𝑠 . : −
(15 − 10). (66 − 46)
𝑓(15) = 46 +
20 − 10
5.20
𝑓(15) = 46 +
10
𝑓(15) = 46 + 10
𝑓(15) = 56
So ,
Based on linear interpolation from the given table , 𝒇(𝟏𝟓) = 𝟓𝟔
Question .5.) Use Taylor’s series method to solve the initial value problem:
𝒅𝒚
= 𝒙𝟐 + 𝒚𝟐 𝒇𝒐𝒓 𝒙 = 𝟎. 𝟐𝟓 𝒂𝒏𝒅 𝟎. 𝟓 𝒈𝒊𝒗𝒆𝒏 𝒕𝒉𝒂𝒕 𝒚 (𝟎) = 𝟏 .
𝒅𝒙
Answer.:-
The differential equation given is:
𝑑𝑦
= 𝑥2 + 𝑦2
𝑑𝑥
Given the initial condition y (0) = 1 , we’ll start by finding the Taylor series expansion for y (x)
around x = 0 :-
Let 𝑦(𝑥) = 𝑦0 + 𝑦1 𝑥 + 𝑦2 𝑥 2 + 𝑦3 𝑥 3 + ………..
𝑑𝑦
= 𝑦1 + 2𝑦2 𝑥 + 3𝑦3 𝑥 2 . . . . . . . . ..
𝑑𝑥
Using the given differential equation, we get:
𝑦1 + 2𝑦2 𝑥 + 3𝑦3 𝑥 2 + ………..𝑥 2 + (𝑦0 + 𝑦1 𝑥 + 𝑦2 𝑥 2 + 𝑦3 𝑥 3 + . . . . . )2
To solve for the coefficients, equate the corresponding powers of x on both sides of the
equation.
At x = 0 :
𝑦1 = 02 + 𝑦02 (𝑢𝑠𝑖𝑛𝑔 𝑡ℎ𝑒 𝑖𝑛𝑡𝑖𝑎𝑙 𝑐𝑜𝑛𝑑𝑖𝑡𝑖𝑜𝑛 𝑦(0) = 1
So , y1 = 1 .
At x = 0 :
𝑦1 = 2y2(0)= 02
So , y2 = 0 .
We've found the first two coefficients. Now, we can express y(x) using the Taylor series
expansion:
Substituting the values we found:
y (x) = 1 + x
Now, we'll use this approximation to find the values of Y AT X = 0.25 and x = 0.5 :
Y ( 0 . 25) = 1 + 0.25 = 1.25
Y ( 0.5) = 1 + 0.5 = 1.5
So, using Taylor's series method, the approximated values of y at x = 0.25 and x = 0.5
are 1.25 and 1.5 respectively , based on the first – order Taylor series expansion around
x=0.
Question .6.) Apply Runge-Kutta fourth order method to find an approximate
𝒅𝒚
value of y when x = 0.1 given that = 𝒙𝟐 − 𝒚, 𝒚(𝟎) = 𝟏.
𝒅𝒙
Answer .:-
𝑑𝑦
Given the initial condition 𝑑𝑥 = 𝑥 2 − 𝑦, 𝑦(0) = 1, we need to solve for y at x = 0.1
The fourth-order Runge-Kutta method involves the following steps:
1. Define the step size , h .
2. Using following formulas to iterate and approximate y :
𝑘1 = ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )
ℎ 𝑘1
𝑘2 = ℎ𝑓(𝑥𝑛 + , 𝑦𝑛 + )
2 2
ℎ 𝑘2
𝑘3 = ℎ𝑓(𝑥𝑛 + , 𝑦𝑛 + )
2 2
𝑘4 = ℎ𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘3)
1
𝑦𝑛 + 1 = 𝑦𝑛 + (𝑘1 + 2𝑘2 + 2𝑘3 + 2𝑘4 )
6
𝑤ℎ𝑒𝑟𝑒 . : −
h is the step size .
𝑥𝑛 and 𝑦𝑛 are the known x and y values at the current step .
F(x,y) is the differential equation : x2 – y .
Let's implement this algorithm to find the approximate value of y when x = 0.1 we’ll
start with h = 0.1 for this example .
Let me recompute the solution using the fourth-order Runge-Kutta method.
𝑑𝑦
Given the differential equation = 𝑥 2 − 𝑦 and the initial condition y(0) = 1 , we want
𝑑𝑥
to find the approximate value of y at x = 0.1 .
1. Define the function f(x,y) based on the given differential equation .:-
2. Using the following formulas to iterate and approximate y :
𝑘1 = ℎ . 𝑓(𝑥𝑛 , 𝑦𝑛 )
ℎ 𝑘1
𝑘2 = ℎ . 𝑓(𝑥𝑛 + , 𝑦𝑛 + )
2 2
ℎ 𝑘2
𝑘3 = ℎ . 𝑓(𝑥𝑛 + , 𝑦𝑛 + )
2 2
𝑘4 = ℎ . 𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘3)
1
𝑦𝑛 + 1 = 𝑦𝑛 + (𝑘1 + 2𝑘2 + 2𝑘3 + 2𝑘4 )
6
Let's compute the approximate value of y at x 0.1 using the given method and
initial conditions .
Let's use the fourth-order Runge-Kutta method to approximate the value of y
where x = 0.1 for the given differential equation :-
𝑑𝑦
= 𝑥2 − 𝑦
𝑑𝑥
with the initial condition y (0) = 1.
The fourth-order Runge-Kutta method involves iterative steps. We'll use a step
size h and perform calculations to approximate y at x = 0.1. The
formulas for the method are:
1. 𝑘1 = ℎ . 𝑓(𝑥𝑛 , 𝑦𝑛 )
ℎ 𝑘1
2. 𝑘2 = ℎ . 𝑓(𝑥𝑛 + 2 , 𝑦𝑛 + )
2
ℎ 𝑘2
3. 𝑘3 = ℎ . 𝑓(𝑥𝑛 + 2 , 𝑦𝑛 + )
2
4. 𝑘4 = ℎ . 𝑓(𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘3)
Where f( x, y ) = x2 y , and then :
𝟏
𝒚𝒏 + 𝟏 = 𝒚𝒏 (𝒌𝟏 + 𝟐𝒌𝟐 + 𝟐𝒌𝟑 + 𝟐𝒌𝟒 )
𝟔