summaryrefslogtreecommitdiff
path: root/1673/CH3/EX3.10
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1673/CH3/EX3.10
downloadScilab-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.10')
-rwxr-xr-x1673/CH3/EX3.10/3_10.sce40
1 files changed, 40 insertions, 0 deletions
diff --git a/1673/CH3/EX3.10/3_10.sce b/1673/CH3/EX3.10/3_10.sce
new file mode 100755
index 000000000..39678ff78
--- /dev/null
+++ b/1673/CH3/EX3.10/3_10.sce
@@ -0,0 +1,40 @@
+//practical interpolation
+//example 3.10
+//page 97
+clc;clear;close;
+x=[0.61 0.62 0.63 0.64 0.65 0.66 0.67];
+y=[1.840431 1.858928 1.877610 1.896481 1.915541 1.934792 1.954237];
+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
+d=[d1(1) d2(1) d3(1) d4(1)];
+x0=0.644;
+p=(x0-x(4))/h;
+y_x=y(4);
+y_x=y_x+p*(d1(3)+d1(4))/2+p^2*(d2(2))/2;//stirling formula
+printf(' the value at %f by stirling formula is : %f\n\n',x0,y_x);
+y_x=y(4);
+y_x=y_x+p*d1(4)+p*(p-1)*(d2(3)+d2(4))/2;
+printf(' the value at %f by bessels formula is : %f\n\n',x0,y_x);
+y_x=y(4);
+q=1-p;
+y_x=q*y(4)+q*(q^2-1)*d2(3)/2+p*y(5)+p*(q^2-1)*d2(4)/2;
+printf(' the value at %f by everrets formula is : %f\n\n',x0,y_x);