Your Perfect Assignment is Just a Click Away
We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

Week 5 MATH2089 Numerical Methods (Lagrange interpolation, least squares)

Week 5 MATH2089 Numerical Methods (Lagrange interpolation, least squares)

Week 5 MATH2089 Numerical Methods

Week 5 (T 1, 2021) This problem set is to be completed and submitted before 9am on the day of your next tutorial (e.g. Wednesday classes should submit this laboratory problems by 9am on Wednesday in week 6). Late submission penalty will apply. Submit all files (*.m file & scan or electronic note) through ‘Week 5 Laboratory problems submission’ on Moodle. Question 1 The amplitude of vibration in the vertical direction of an automobile, after passing over a road bump, is found to be as follows:

Time, ti (sec)

0 0.64 1.28 1.92

Amplitude, ai (mm)

5 2 0.75 0.3

You are required to find an approximate value of the amplitude at specified values of time

using (a) hand calculations and (b) Matlab programming.

• To do hand calculations you are required to perform the following tasks: 1. You are required to develop a Lagrange interpolation polynomial that passes through the

data (4 points) given in the table above. An example is given in Lecture Notes. 2. Use this polynomial to calculate the value of the amplitude at t=0.7 sec.

• To find solution using Matlab you are required to perform the following tasks: 1. Write a function (m-file) in which you define your data for the time and amplitude. In

the same function calculate the amplitude at t=0.7 using Matlab function interp1(x,Y,x0) (description of this function can be found after Question 2). Use interpolation options in the interp1 function to specify linear (default) and spline interpolation (see an example in motor.m).

2. Create vector of data xi in the range from 0 to 2 with the step of 0.1. Calculate two sets of the values for the amplitude at specified values xi using linear and spline interpolation options in the interp1 function.

3. Plot original data (from the table) and two sets of the values for the amplitude calculated at specified values xi. Explain the differences between linear and spline interpolation. Which is more accurate?

Compare solutions obtained using Matlab with you hand calculations. Why do your hand calculations agree with spline interpolation result?

Question 2 A wind tunnel test conducted on an airfoil section yielded the following data between the lift coefficient (CL) and the angle of attack (?):

?, degrees 0 4 8 12 16 20 CL 0.11 0.55 0.95 1.40 1.71 1.38

You are required to develop a suitable polynomial relationship between ? and CL and fit a curve to the data points by the least-squares method using (a) hand calculations and (b) Matlab programming Hint: A quadratic equation (parabola) 20 1 2( )y x a a x a x= + + can be used in this case for curve fitting. The procedure of solution should be as follows: (a) Write a Matlab function to fit a quadratic equation to the data points. Create [A] and [b] according to your hand calculation, and use backslash operator x =

Ab to find a vector of unknowns 0

1

2

a a a

? ? ? ? ? ? ? ? ? ?

(b) Use Matlab functions polyfit( ) and polyval( ). Plot original data (from the table), function 20 1 2( )y x a a x a x= + + with coefficients obtained in (a); and values obtained using polyfit () at the same graph. (Don’t forget to create a vector for the range [0 20]!). Explain the results.

MATLAB FUNCTIONS: yy=interp1(x, y, xx,’linear’) – uses the data of x (values of the independent variable) and y (values of the dependent variable), fits a linear equation using least-squares technique, and gives the interpolated values of y(yy) at the specified values of x(xx). The word ‘linear’ can be replaced by ‘cubic’, ‘spline’, or ‘nearest’ to achieve interpolation based on cubic equation, cubic spline, or nearest value, respectively. If nothing is specified, linear interpolation is implied. p=polyfit(x, y, n) – fits a least-squares polynomial of degree n for the specified set of data x and y. The coefficients of the polynomial are returned through the vector p. The elements of p denote the coefficients of the polynomial starting from that of the highest power of x.

y = polyval(p,x) returns the value of a polynomial of degree n evaluated at x. The input argument p is a vector of length n+1 whose elements are the coefficients in descending powers of the polynomial to be evaluated.

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Homework Free only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Homework Free are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Homework Free is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Homework Free, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

Homework Free Org

Your one stop solution for all your online studies solutions. Hire some of the world's highly rated writers to handle your writing assignments. And guess what, you don't have to break the bank.

© 2020 Homework Free Org