diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /1673/CH3/EX3.12 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '1673/CH3/EX3.12')
-rwxr-xr-x | 1673/CH3/EX3.12/3_12.sce | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/1673/CH3/EX3.12/3_12.sce b/1673/CH3/EX3.12/3_12.sce new file mode 100755 index 000000000..c0273f306 --- /dev/null +++ b/1673/CH3/EX3.12/3_12.sce @@ -0,0 +1,36 @@ +//practical interpolation
+//example 3.12
+//page 99
+clc;clear;close;
+x=[1.72 1.73 1.74 1.75 1.76 1.77 1.78];
+y=[0.1790661479 0.1772844100 0.1755204006 0.1737739435 0.1720448638 0.1703329888 0.1686381473];
+h=0.01//interval between values of x
+c=1;
+for i=1:6
+ d1(c)=y(i+1)-y(i);
+ c=c+1;
+end
+c=1;
+for i=1:5
+ d2(c)=d1(i+1)-d1(i);
+ c=c+1
+end
+c=1;
+for i=1:4
+ d3(c)=d2(i+1)-d2(i);
+ c=c+1;
+end
+c=1;
+for i=1:3
+ d4(c)=d3(i+1)-d3(i);
+ c=c+1;
+end
+x0=1.7475;
+y_x=y(3);
+p=(x0-x(3))/h;
+y_x=y_x+p*d1(3)+p*(p-1)*((d2(2)+d2(3))/2)/2;
+printf(' the value at %f by bessels formula is : %0.10f\n\n',x0,y_x);
+y_x=y(4);
+q=1-p;
+y_x=q*y(3)+q*(q^2-1)*d2(2)/6+p*y(4)+p*(p^2-1)*d2(2)/6;
+printf(' the value at %f by everrets formula is : %0.10f\n\n',x0,y_x);
\ No newline at end of file |