LAB4
LAB4
Lab ( 5 )
Name:
Reg No:
Signature:
Objective:
Algorithm:
Assuming that (n-1) values f(a),f(a +h), f(a +2h), … f(a0 +nh) are given for
the function f(x) corresponding to an independent variable of (x) with equal
intervals x= a, a+h, a+2h,…a+nh. According to backward difference operator
, we have:
Example:
Find all the pressure points of the steam for a temperature using " backward
" interpolation formula, and plot the result.
The program:
% Given
h = 10;
x = 140:h:180;
y = [3.685 , 4.854, 6.302, 8.076, 10.225];
d1 = diff(y,1);
d2 = diff(y,2);
d3 = diff(y,3);
d4 = diff(y,4);
plot(T,NGB,'g');
hold off;
Write down the above code and run it. Check that no errors appeared after
you have executed it. Check that the output popped up like the above figure.
1) List out the backward difference table, getting from d1,d2,d3, and d4?
2) What do the circled points represent, list them? What is the order of the
NGB polynomial?
3) How many interpolated points between T = 150 and T = 160, write down
the command generating them, and their corresponding NGB
4) What the hold command do? Is the curve passing through all the circled
points?
Homework:
1. Find the pressure of the steam for a temperature of 1420C , and plot
the result.
2. The following data gives the melting point of an alloy of lead where t is
the temperature in deg-C and p is the percentage of lead in the alloy:
P 40 50 60 70 80 90
Find the melting point of the alloy at 84 percent of lead. And show the
output screen.