summaryrefslogtreecommitdiff
path: root/1670/CH5/EX5.3/5_3.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1670/CH5/EX5.3/5_3.sce
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 '1670/CH5/EX5.3/5_3.sce')
-rwxr-xr-x1670/CH5/EX5.3/5_3.sce29
1 files changed, 29 insertions, 0 deletions
diff --git a/1670/CH5/EX5.3/5_3.sce b/1670/CH5/EX5.3/5_3.sce
new file mode 100755
index 000000000..78764dbde
--- /dev/null
+++ b/1670/CH5/EX5.3/5_3.sce
@@ -0,0 +1,29 @@
+//Example 5.3
+//Factorial Notation Method
+//Page no. 131
+clc;close;clear;
+
+h=0.00000001;h1=0000000.1
+deff('y=f(x)','y=x^3-2*x^2+x-1')
+deff('y=f1(x)','y=x*(x-1)*(x-2)')
+deff('y=f2(x)','y=x*(x-1)')
+for i=0:2
+ A(i+1,1)=f2(i);
+ A(i+1,2)=i;
+ A(i+1,3)=1
+ B(i+1,1)=f(i)-f1(i)
+end
+x=poly(0,'x')
+C=inv(A)*B
+disp(C(3),'+',C(2)*x,'+',C(1)*f2(x),'+',f(x))
+printf('\n\nf(x) = ')
+deff('y=f3(x)','y=C(3)+C(2)*x+C(1)*f2(x)+f(x)')
+disp(f3(x))
+deff('y=f4(x)','y=(f3(x+h)-f3(x))/h') //1st derivative
+disp(f4(x),'dx = ')
+deff('y=f5(x)','y=(f4(x+h1)-f4(x))/h1') //2nd derivative
+disp(f5(x),'d2x = ')
+deff('y=f6(x)','y=(f5(x+h1)-f5(x))/h1') //3rd derivative
+disp(f6(x),'d3x = ')
+deff('y=f7(x)','y=(f6(x+h1)-f6(x))/h1') //4th derivative
+disp(f7(x),'d4x = ') \ No newline at end of file