Assignment No2
Assignment No2
Solve and practice all exercises given here and submit the following before 15 Oct, 2024.
Ex.1. The breaking strength of a certain kind of polyester thread depends on its thickness, as shown
in the data given below.
Guess the relation between thickness and strength. Plot the strength on the y-axis and a suitable
power of thickness on the x-axis. Determine the parameters of the best-fit line. If you want to avoid
guessing the relation, plot the thickness versus strength graph in MATLAB and make the scale
logarithmic on both the x- and y-axes by clicking on the ‘property editor’ in the ‘view’ tab of the
figure window (where your graph is plotted).
Ex.2. If Ln(x) is the Lagrange interpolation of degree n and Pn(x) is Newton’s interpolation
polynomial (also of degree n) for a function f(x), which one of them will have a smaller error (or
will they have same error), when they are used to interpolate and determine the value of the
function at a point x. The same set of n+1 points (xo,x1,…,xn) was used to determine both of the
interpolation polynomials.
Ex.3. Suppose that you are trying to find the value of exp(x) by interpolation using the values of
this function at three points: xo, x1, and x2. You can use the Lagrange interpolation polynomial.
Alternatively, you can use the series expansion for exp(x), exp(x) = 1+ x + x 2 /2 + … and truncate
it to a quadratic polynomial. Does the quadratic Lagrange interpolation polynomial have any
advantage, compared to the series expansion mentioned above?
Ex.4. Write a program to calculate the value of a function at a particular x using the Lagrange
interpolation polynomial, given the value of the function at n + 1 points.
Ex.5. Write a program to construct the divided difference table and hence interpolate and arrive at
the value of a function at a particular x using Newton’s form of the polynomial.
Ex.6. Given that ln(9) = 2.1972 and ln(9.5) = 2.2513, obtain the value of ln(9.3) using Lagrange
interpolation. Obtain a numerical estimate for the error that arises when this Lagrange interpolation
polynomial is used.
Ex.7. Given the four points (2,1), (4,3), (3,5), and (8,9), find the cubic Newton’s polynomial that
passes through them. Use this polynomial to find the value of y for x = 5.
Ex.8. Use above data and Newton’s polynomial to find value at x=5 without obtaining expression
for the polynomial.
Ex.9. Use data in Ex.7. and use Least square fitting to obtain cubic polynomial. Use this
polynomial to find the value of y at x = 5. Compare the polynomial and the results with that
obtained in
a) Ex.7.
b) Ex 8.
Ex.10. Suppose you are given a table of values (more than 2) of a function f(x) versus x. Which of
the following procedures is likely to yield more accurate numerical value for the first derivative of
the function for one of the tabulated values, say x1?
(a) Use the forward difference formula to compute the first derivative at x 1.
(b) Fit the given data to a polynomial p(x), then differentiate p(x) to obtain the derivative at x 1
Ex. 11. Apply the program developed in Ex.4 to study the quality of the interpolation to functions
( ) .
𝑓(𝑥) = 𝑠𝑖𝑛(𝑥 ), 𝑓(𝑥) = 𝑒 and 𝑓(𝑥) = , initially taking 5 uniform points in
( – . ) .
the interval [0.0, 5.0]. Take 10 points and compare the results. Take points accurate upto 3 decimal
places.
Ex. 12. Apply the program developed in Ex.5 to solve Ex. 11. Take points accurate upto 4 decimal
places.