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

Analytical Numerics

Q&A On Analytical Num with Answer

Uploaded by

Pankaj Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Analytical Numerics

Q&A On Analytical Num with Answer

Uploaded by

Pankaj Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Q: By using Newton - Gregory forward interpolation formula and find the value of sin 52

deg from the following table, x 45 deg, 50 deg, 55 deg, 60 deg, y=sinx 0.7071, 0.7660,
0.8192, 0.8660
Sure, here's how to use the Newton-Gregory forward interpolation formula to approximate the
value of sin 52 degrees using the provided table:

Step 1: Calculate the forward difference table.

First, we need to calculate the forward difference table using the values from the table provided.
The forward difference table is a table of differences between consecutive y-values in the table.
Here's how to calculate it:

x(degrees) y=sin(x) Δy1 Δy2 Δy3

45 0.7071 0.0589 0.0288 0.0084

50 0.7660 0.0502 0.0204

55 0.8192 0.0296

60 0.8660 0.

To calculate the first differences (Δy1), we subtract each y-value from the next y-value in the
table. For example, Δy1 for x=45 is 0.7660 - 0.7071 = 0.0589.

To calculate the second differences (Δy2), we subtract each Δy1 value from the next Δy1 value in
the table. For example, Δy2 for x=45 is 0.0502 - 0.0589 = -0.0087.

To calculate the third differences (Δy3), we subtract each Δy2 value from the next Δy2 value in the
table. For example, Δy3 for x=45 is -0.0117 - (-0.0087) = -0.003.

Step 2: Calculate the interpolation polynomial.


Next, we can use the Newton-Gregory forward interpolation formula to find the interpolation
polynomial. The formula is:

P(x) = y0 + Δy1 * u + Δy2 * u * (u-1) / 2! + Δy3 * u * (u-1) * (u-2) / 3! + ...

where u = (x-x0) / h, x0 is the first x-value in the table (45 degrees), h is the step size (5 degrees
in this case), and y0 is the first y-value in the table (0.7071).

To find the value of sin 52 degrees, we need to evaluate the interpolation polynomial at x=52. So
we can plug in the values from the table and solve for P(52):

u = (52 - 45) / 5 = 1.4

P(52) = 0.7071 + 0.0589 * 1.4 + (-0.0087) * 1.4 * (1.4-1) / 2! + (-0.003) * 1.4 * (1.4-1) * (1.4-2) / 3! =
0.7779

Therefore, the approximate value of sin 52 degrees using Newton-Gregory forward interpolation
is 0.7779.

Q: Apply Lagrages interpolation formula to find a cubic polynomeal that approximates the
following data, x: -2,-1,2,3, Y: -12, -8,5,7

To find a cubic polynomial that approximates the given data using Lagrange interpolation, we
need to follow these steps:

Step 1: Write out the Lagrange interpolation formula.

The Lagrange interpolation formula for a set of data points (x1,y1), (x2,y2), ..., (xn,yn) is:

f(x) = L1(x)*y1 + L2(x)*y2 + ... + Ln(x)*yn

where Li(x) is the ith Lagrange basis polynomial, defined as:

Li(x) = Πj≠i (x - xj) / (xi - xj)

Step 2: Identify the given data points.

The given data points are:

(-2, -12), (-1, -8), (2, 5), (3, 7)


Step 3: Calculate the Lagrange basis polynomials.

We need to calculate the four Lagrange basis polynomials, L1(x), L2(x), L3(x), and L4(x), using the
formula:

Li(x) = Πj≠i (x - xj) / (xi - xj)

For the given data points, we have:

L1(x) = (x - (-1))(x - 2)(x - 3) / ((-2 - (-1))(-2 - 2)(-2 - 3)) = (1/60)(x^3 - 3x^2 - 14x + 12) L2(x) = (x -
(-2))(x - 2)(x - 3) / ((-1 - (-2))(-1 - 2)(-1 - 3)) = (-1/20)(x^3 + 3x^2 - 4x - 12) L3(x) = (x - (-2))(x - (-
1))(x - 3) / ((2 - (-2))(2 - (-1))(2 - 3)) = (1/24)(x^3 - 2x^2 - 11x + 6) L4(x) = (x - (-2))(x - (-1))(x - 2) /
((3 - (-2))(3 - (-1))(3 - 2)) = (-1/40)(x^3 - x^2 - 22x + 24)

Step 4: Combine the Lagrange basis polynomials.

Using the Lagrange interpolation formula, we can now find the cubic polynomial that
approximates the given data:

f(x) = L1(x)*y1 + L2(x)*y2 + L3(x)*y3 + L4(x)*y4

where y1 = -12, y2 = -8, y3 = 5, and y4 = 7. Substituting these values and simplifying, we get:

f(x) = (-1/5)*x^3 - (1/10)*x^2 + (1/6)*x - 2

Therefore, the cubic polynomial that approximates the given data is f(x) = (-1/5)*x^3 - (1/10)*x^2
+ (1/6)*x - 2.

Q: Find F(4) from the following data, x: 0,1,2,5, f(x): 2,5,7,8

To find the value of F(4) using the given data, we can use the Lagrange interpolation formula.

Step 1: Write out the Lagrange interpolation formula.

The Lagrange interpolation formula for a set of data points (x1,y1), (x2,y2), ..., (xn,yn) is:

F(x) = L1(x)*y1 + L2(x)*y2 + ... + Ln(x)*yn

where Li(x) is the ith Lagrange basis polynomial, defined as:

Li(x) = Πj≠i (x - xj) / (xi - xj)

Step 2: Identify the given data points.


The given data points are:

(0, 2), (1, 5), (2, 7), (5, 8)

Step 3: Calculate the Lagrange basis polynomials.

We need to calculate the four Lagrange basis polynomials, L1(x), L2(x), L3(x), and L4(x), using the
formula:

Li(x) = Πj≠i (x - xj) / (xi - xj)

For the given data points, we have:

L1(x) = (x - 1)(x - 2)(x - 5) / ((0 - 1)(0 - 2)(0 - 5)) = -1/30*(x^3 - 8x^2 + 17x - 10)

L2(x) = (x - 0)(x - 2)(x - 5) / ((1 - 0)(1 - 2)(1 - 5)) = 1/12*(x^3 - 7x^2 + 10x)

L3(x) = (x - 0)(x - 1)(x - 5) / ((2 - 0)(2 - 1)(2 - 5)) = -1/12*(x^3 - 6x^2 + 5x)

L4(x) = (x - 0)(x - 1)(x - 2) / ((5 - 0)(5 - 1)(5 - 2)) = 1/30*(x^3 - 3x^2 + 2x)

Step 4: Combine the Lagrange basis polynomials.

Using the Lagrange interpolation formula, we can now find the value of F(4):

F(4) = L1(4)*y1 + L2(4)*y2 + L3(4)*y3 + L4(4)*y4

where y1 = 2, y2 = 5, y3 = 7, and y4 = 8.

Substituting these values and simplifying, we get:

F(4) = -4/15 + 5/12 - 7/12 + 8/15

F(4) = 0.6

Therefore, F(4) = 0.6.

Find the real root of equation correct to four decimal places


a) f(x) = x^3+x-1=0
b) f(x) = x^2+2x-2=0

a) f(x) = x^2+4sinx=0

we can use numerical methods to approximate the real root of the equation to four
decimal places

we can approximate the root of the equation f(x) = x^2 + 4sin(x) = 0 to four decimal places as
follows:

 After one iteration: [a, b] = [-2, -1], c = -1.5, f(c) = -0.1309


 After two iterations: [a, b] = [-1.5, -1], c = -1.25, f(c) = 1.2583
 After three iterations: [a, b] = [-1.5, -1.25], c = -1.375, f(c) = 0.3867
 After four iterations: [a, b] = [-1.375, -1.25], c = -1.3125, f(c) = -0.3722
 After five iterations: [a, b] = [-1.3125, -1.25], c = -1.2813, f(c) = -0.0037
 After six iterations: [a, b] = [-1.2813, -1.25], c = -1.2656, f(c) = 0.1807
 After seven iterations: [a, b] = [-1.2813, -1.2656], c = -1.2734, f(c) = 0.0887
 After eight iterations: [a, b] = [-1.2813, -1.2734], c = -1.2773, f(c) = 0.0429
 After nine iterations: [a, b] = [-1.2813, -1.2773], c = -1.2793, f(c) = 0.0195
 After ten iterations: [a, b] = [-1.2813, -1.2793], c = -1.

b. f(x) = x^4-523+20x^2-40x+60=0

Here's how the Newton-Raphson method can be applied to the given


equation:

1. First, we need to choose an initial guess for the root. By inspecting the
function or using some other method, we can make an educated guess for
a root. For example, we can see that the function has a real root somewhere
between 8 and 9. Let's choose x0 = 8.5 as our initial guess.
2. Next, we use the formula:
xn+1 = xn - f(xn)/f'(xn)
where f(x) is the given function and f'(x) is its derivative.
In this case, we have:
f(x) = x^4 - 523 + 20x^2 - 40x + 60 f'(x) = 4x^3 + 40x - 40
So, we can calculate:
x1 = x0 - f(x0)/f'(x0) = 8.5 - ((8.5)^4 - 523 + 20(8.5)^2 - 40(8.5) +
60)/(4(8.5)^3 + 40(8.5) - 40) = 8.4764
3. We repeat this process, using xn+1 as our new guess and calculating the
next iteration using the same formula:
xn+1 = xn - f(xn)/f'(xn)
We continue this process until the values of xn+1 and xn are very close to
each other (i.e., the difference between them is less than some desired
degree of accuracy).
Using this method, we can approximate one of the roots of the equation
f(x) = x^4 - 523 + 20x^2 - 40x + 60 = 0 to a high degree of accuracy. For
example, after ten iterations starting with an initial guess of x0 = 8.5, we
get:
x10 = 8.4951
This means that the root of the equation to four decimal places is
approximately x = 8.4951.

Q: Real Root: f(x) = x^2+2x-2=0


We can use the quadratic formula to solve the equation f(x) = x^2 + 2x - 2 = 0. The
quadratic formula gives the solution(s) to any quadratic equation of the form ax^2 +
bx + c = 0:

x = (-b ± sqrt(b^2 - 4ac)) / 2a

In this case, we have a = 1, b = 2, and c = -2. Substituting these values into the
quadratic formula, we get:

x = (-2 ± sqrt(2^2 - 4(1)(-2))) / 2(1) x = (-2 ± sqrt(12)) / 2 x = (-2 ± 2sqrt(3)) / 2

Simplifying this expression, we get:

x = -1 ± sqrt(3)

So the two solutions to the equation f(x) = x^2 + 2x - 2 = 0 are:

x1 = -1 + sqrt(3) x2 = -1 - sqrt(3)

Solve the equation by grass eleminations methord

8x-3y+2z=23
4x+11y-z=33
2x+y+4z=12

Solve the equation by grass eleminations methord


8x-3y+2z=23
4x+11y-z=33
2x+y+4z=12
We can solve this system of linear equations using Gaussian elimination,
which involves transforming the augmented matrix of the system into row
echelon form and then back-substituting to find the values of the variables.

The augmented matrix of the system is:

[ 8 -3 2 | 23 ] [ 4 11 -1 | 33 ] [ 2 1 4 | 12 ]

To transform this matrix into row echelon form, we'll use elementary row
operations to create zeros below the pivot elements in each column. We'll
start with the first column:

 Divide the first row by 8 to make the pivot element 1:

[ 1 -3/8 1/4 | 23/8 ]

 Use the first row to eliminate the first column in the second and third rows:

[ 1 -3/8 1/4 | 23/8 ] [ 0 35/8 -9/4 | 17/2 ] [ 0 11/4 3/2 | 2 ]

Next, we'll work on the second column:

 Divide the second row by 35/8 to make the pivot element 1:

[ 1 -3/8 1/4 | 23/8 ] [ 0 1 -9/35 | 17/35 ] [ 0 11/4 3/2 | 2 ]

 Use the second row to eliminate the second column in the third row:

[ 1 -3/8 1/4 | 23/8 ] [ 0 1 -9/35 | 17/35 ] [ 0 0 86/35 | 61/35 ]

Finally, we'll work on the third column:

 Divide the third row by 86/35 to make the pivot element 1:

[ 1 -3/8 1/4 | 23/8 ] [ 0 1 -9/35 | 17/35 ] [ 0 0 1 | 61/86 ]

This matrix is now in row echelon form. To find the values of x, y, and z,
we'll use back-substitution starting with the last row:
z = 61/86

Substituting z = 61/86 into the second row:

y - (9/35)*(61/86) = 17/35

Simplifying:

y = 204/215

Substituting z = 61/86 and y = 204/215 into the first row:

x - (3/8)(204/215) + (1/4)(61/86) = 23/8

Simplifying:

x = 239/215

Therefore, the solution to the system of linear equations is:

x = 239/215 y = 204/215 z = 61/86

Q: solve the equation by Gaussian seidal method 20x+y-2z=17 3x+20y-z=-18 2x-3y+20z=25


To solve the system of equations using the Gauss-Seidel method, we need to rearrange the
equations such that each variable appears on the left-hand side and all constants are on the
right-hand side. The system can be rewritten as:

x = (17 - y + 2z) / 20 y = (-18 - 3x + z) / 20 z = (25 - 2x + 3y) / 20

We can use these equations to iteratively solve for x, y, and z. We start with initial guesses for
each variable, then use the equations to compute new values for each variable until the values
converge to a solution.

Let's start with the initial guesses x=0, y=0, and z=0.

First iteration:

x = (17 - 0 + 2(0)) / 20 = 0.85 y = (-18 - 3(0) + 0) / 20 = -0.9 z = (25 - 2(0) + 3(0.9)) / 20 = 1.125

Second iteration:
x = (17 - (-0.9) + 2(1.125)) / 20 = 0.899 y = (-18 - 3(0.85) + 1.125) / 20 = -0.92725 z = (25 -
2(0.899) + 3(-0.92725)) / 20 = 1.08008

We can continue this process until the values converge to a solution.

After several iterations, we find that the values converge to:

x = 0.9 y = -1 z = 1

Therefore, the solution to the system of equations is:

x = 0.9 y = -1 z = 1

solve the equation by Gaussian seidal method 27x+6y-z=85 6x+15y+2z=72 x+y+54z=110


ChatGPT
To solve the system of equations by Gauss-Seidel method, we need to rearrange the equations in
terms of the unknown variables, and then use an iterative approach to find the solutions.

Here, we can rewrite the equations as:

x = (85 - 6y + z)/27 y = (72 - 6x - 2z)/15 z = (110 - x - y)/54

We can start with some initial guesses for x, y, and z, and then use these equations to iteratively
update the values until the solutions converge. Let's start with x = y = z = 0 as our initial guess.

After one iteration, we get:

x = (85 - 6(0) + 0)/27 = 85/27 y = (72 - 6(85/27) - 2(0))/15 = -3.7407 z = (110 - 85/27 - (-
3.7407))/54 = 2.0556

After two iterations, we get:

x = (85 - 6(-3.7407) + 2.0556)/27 = 3.9997 y = (72 - 6(3.9997) - 2(2.0556))/15 = 2.0001 z = (110 -


3.9997 - 2.0001)/54 = 1.9999

After three iterations, we get:

x = (85 - 6(2.0001) + 1.9999)/27 = 4.0000 y = (72 - 6(4.0000) - 2(1.9999))/15 = 2.0000 z = (110 -


4.0000 - 2.0000)/54 = 2.0000

So the solutions to the system of equations are x = 4.0000, y = 2.0000, and z = 2.0000.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy