Homework 14 Solution

Homework 14 Solution - Lecture 14 MEEN 357 Homework...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 14 MEEN 357 Homework Solution 1 Lecture-14-Homework-Solution-2009.doc RMB 1. Problem 15.5 of the textbook. Solution : You are given the data x 1 2 2.5 3 4 5 () f x 0 5 7 6.5 2 0 Part a): You are asked to use Newton’s interpolation polynomial determine the interpolated value at 3.4 x = for three cases 1) linear interpolation, 2) quadratic interpolation and 3) cubic interpolation. Solution: One mfile will be used to generate the three answers to Part a). The script %Problem 15.1 clc,clear all %Need value at x=3.4 %PART a)Linear Interpolation x=[3,4]; y=[6.5,2]; %You have two easy ways to solve. %Use function file newtona.m and polyval [b,P]=newtona(x,y); yint_a=polyval(P,3.4) %Use function file in book that we did not cover yint_a=Newtint(x,y,3.4) %PART b)Quadratic Interpolation. You need three points. %There are two cases as follows %Two points in front of x=3.4, one point behind x1=[3,4,5]; y1=[6.5,2,0]; %Two points behind x=3.4, one point in front x2=[2.5,3,4]; y2=[7,6.5,2]; %Each can be worked by the two methods above %Use function file newtona.m and polyval [b,P]=newtona(x1,y1); yint_b1=polyval(P,3.4) %Use function file in book that we did not cover yint_b1=Newtint(x1,y1,3.4) %Use function file newtona.m and polyval [b,P]=newtona(x2,y2); yint_b2=polyval(P,3.4) %Use function file in book that we did not cover yint_b2=Newtint(x2,y2,3.4) %PART c) Cubic Interpolation. You need four points. %There are again two cases %Two points in front of x=3.4, two behind
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 14 MEEN 357 Homework Solution 2 Lecture-14-Homework-Solution-2009.doc RMB x1=[2.5,3,4,5]; y1=[7,6.5,2,0]; %One point in front of x=3.4, three behind x2=[2,2.5,3,4];
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/28/2010 for the course MEEN 357 taught by Professor Anamalai during the Fall '07 term at Texas A&M.

Page1 / 5

Homework 14 Solution - Lecture 14 MEEN 357 Homework...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online