Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Background: Polynomial interpolation consists of determining the unique (n-1order polynomial that fits n data points. Such polynomials have the general form: Where the p's are
Background: Polynomial interpolation consists of determining the unique (n-1order polynomial that fits n data points. Such polynomials have the general form: Where the p's are unknown constant coefficients. If we have n pairs of datasets that passes through the polynomial, f(x), a straightforward way for computing the constant coefficients is substituting the given pairs into the equation and generate the n linear algebraic equations, as a function of the coefficients pl p2....pn The resulting linear equation looks y1 y2 2 1P The coefficient matrix is known to be ill-conditioned (cf 11.22 for matrix condition). Assignment: Write a function that solve for the coefficients of an nh order polynomial equation. The accuracy of these coefficients depends on the condition number (see Case Study 11.3). Use VPA0) (Variable Precision Arithmetic) to limit the accuracy of your output. You may use length) to determine the number of data point (n). function [p] = myPolyInv (x, y) % solve for the coefficients of an nth order polynomial interpolation % inputs x = vector of x input points y = vector of y input points, x and y have the same dimension % output p = coefficients pl to pn with the available accuracy [c] myCondition (A); % A= coefficient matrix end % end of function Write a sub function, myCondition, to calculate the matrix condition number based on the coefficient matrix and inverse matrix calculated by using a second sub function, mylnverse. For this assignment, use the Frobenius norm to determine the condition number. You may not use the Matlab built-in functions for Background: Polynomial interpolation consists of determining the unique (n-1order polynomial that fits n data points. Such polynomials have the general form: Where the p's are unknown constant coefficients. If we have n pairs of datasets that passes through the polynomial, f(x), a straightforward way for computing the constant coefficients is substituting the given pairs into the equation and generate the n linear algebraic equations, as a function of the coefficients pl p2....pn The resulting linear equation looks y1 y2 2 1P The coefficient matrix is known to be ill-conditioned (cf 11.22 for matrix condition). Assignment: Write a function that solve for the coefficients of an nh order polynomial equation. The accuracy of these coefficients depends on the condition number (see Case Study 11.3). Use VPA0) (Variable Precision Arithmetic) to limit the accuracy of your output. You may use length) to determine the number of data point (n). function [p] = myPolyInv (x, y) % solve for the coefficients of an nth order polynomial interpolation % inputs x = vector of x input points y = vector of y input points, x and y have the same dimension % output p = coefficients pl to pn with the available accuracy [c] myCondition (A); % A= coefficient matrix end % end of function Write a sub function, myCondition, to calculate the matrix condition number based on the coefficient matrix and inverse matrix calculated by using a second sub function, mylnverse. For this assignment, use the Frobenius norm to determine the condition number. You may not use the Matlab built-in functions for
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started