summaryrefslogtreecommitdiff
path: root/75/CH3
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /75/CH3
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 '75/CH3')
-rwxr-xr-x75/CH3/EX3.1/ex_1.sce5
-rwxr-xr-x75/CH3/EX3.2/ex_2.sce8
-rwxr-xr-x75/CH3/EX3.3/ex_3.sce10
-rwxr-xr-x75/CH3/EX3.4/ex_4.sce35
-rwxr-xr-x75/CH3/EX3.6/ex_6.sce18
-rwxr-xr-x75/CH3/EX3.7/ex_7.sce14
-rwxr-xr-x75/CH3/EX3.8/ex_8.sce50
7 files changed, 140 insertions, 0 deletions
diff --git a/75/CH3/EX3.1/ex_1.sce b/75/CH3/EX3.1/ex_1.sce
new file mode 100755
index 000000000..ec4bd7a4a
--- /dev/null
+++ b/75/CH3/EX3.1/ex_1.sce
@@ -0,0 +1,5 @@
+ // PG (134)
+
+X = [0, -1, 1]
+Y = [1, 2, 3]
+lagrange(X,Y)
diff --git a/75/CH3/EX3.2/ex_2.sce b/75/CH3/EX3.2/ex_2.sce
new file mode 100755
index 000000000..83c378563
--- /dev/null
+++ b/75/CH3/EX3.2/ex_2.sce
@@ -0,0 +1,8 @@
+ // PG (136)
+
+
+
+X=[0]
+Y=[1]
+deff('[y]=f(x)','y=log10(x)')
+p=lagrange(X,Y)
diff --git a/75/CH3/EX3.3/ex_3.sce b/75/CH3/EX3.3/ex_3.sce
new file mode 100755
index 000000000..801f9a7e3
--- /dev/null
+++ b/75/CH3/EX3.3/ex_3.sce
@@ -0,0 +1,10 @@
+ // PG (137)
+
+X=[0,-1]
+Y=[1,2]
+deff('[y]=f(x)','y=log(x)')
+deff('[y]=fp(x)','y=1/x')
+deff('[y]=fpp(x)','y=-1/(x)^2')
+p = lagrange(X,Y)
+// E = f(x)-p
+e = 0.00005 // for a four-place logarithmic table
diff --git a/75/CH3/EX3.4/ex_4.sce b/75/CH3/EX3.4/ex_4.sce
new file mode 100755
index 000000000..56f24481d
--- /dev/null
+++ b/75/CH3/EX3.4/ex_4.sce
@@ -0,0 +1,35 @@
+ // PG (140)
+
+X = [2.0,2.1,2.2,2.3,2.4]
+X1 = X(1,1)
+X2 = X(1,2)
+X3 = X(1,3)
+X4 = X(1,4)
+X5 = X(1,5)
+deff('[y]=f(x)','y=sqrt(x)')
+Y = [f(X1) f(X2) f(X3) f(X4) f(X5)]
+Y1 = Y(1,1)
+Y2 = Y(1,2)
+Y3 = Y(1,3)
+Y4 = Y(1,4)
+Y5 = Y(1,5)
+
+// Difference
+
+// f[X1,X2]
+(f(X2) - f(X1))*10
+// f[X2,X3]
+(f(X3) - f(X2))*10
+// f[X3,X4]
+(f(X4) - f(X3))*10
+// f[X4,X5]
+(f(X5) - f(X4))*10
+
+// D^2 * f[Xi]
+
+((f(X3)-f(X2)) - (f(X2)-f(X1))) * 50
+((f(X4)-f(X3)) - (f(X3)-f(X2))) * 50
+((f(X5)-f(X4)) - (f(X4)-f(X3))) * 50
+
+
+
diff --git a/75/CH3/EX3.6/ex_6.sce b/75/CH3/EX3.6/ex_6.sce
new file mode 100755
index 000000000..4e3b01821
--- /dev/null
+++ b/75/CH3/EX3.6/ex_6.sce
@@ -0,0 +1,18 @@
+ // PG (142)
+
+// Values of Bessel Function Jo(x)
+
+// x Jo(x)
+
+// 2.0 0.2238907791
+// 2.1 0.1666069803
+// 2.2 0.1103622669
+// 2.3 0.0555397844
+// 2.4 0.0025076832
+// 2.5 -0.0483837764
+// 2.6 -0.0968049544
+// 2.7 -0.1424493700
+// 2.8 -0.1850360334
+// 2.9 -0.2243115458
+
+// Calculate the value of x for which Jo(x) = 0.1 \ No newline at end of file
diff --git a/75/CH3/EX3.7/ex_7.sce b/75/CH3/EX3.7/ex_7.sce
new file mode 100755
index 000000000..5a6d41a18
--- /dev/null
+++ b/75/CH3/EX3.7/ex_7.sce
@@ -0,0 +1,14 @@
+ // PG (144)
+
+deff('[y]=f(x)','y=sqrt(x)')
+funcprot(0)
+deff('[y]=fp(x)','y=0.5/sqrt(x)')
+funcprot(0)
+deff('[y]=fpp(x)','y=-0.25*x^(-3/2)')
+funcprot(0)
+deff('[y]=fppp(x)','y=3*x^(-2.5)/8')
+deff('[y]=fpppp(x)','y=-15*x^(-7/2)/16')
+
+// f[2.0,2.1,.....2.4] = -0.002084
+
+fpppp(2.3103)/factorial(4) \ No newline at end of file
diff --git a/75/CH3/EX3.8/ex_8.sce b/75/CH3/EX3.8/ex_8.sce
new file mode 100755
index 000000000..fcf4c5ed3
--- /dev/null
+++ b/75/CH3/EX3.8/ex_8.sce
@@ -0,0 +1,50 @@
+ // PG (150)
+
+X = [2.0,2.1,2.2,2.3,2.4]
+X1 = X(1,1)
+X2 = X(1,2)
+X3 = X(1,3)
+X4 = X(1,4)
+X5 = X(1,5)
+deff('[y]=f(x)','y=sqrt(x)')
+Y = [f(X1) f(X2) f(X3) f(X4) f(X5)]
+Y1 = Y(1,1)
+Y2 = Y(1,2)
+Y3 = Y(1,3)
+Y4 = Y(1,4)
+Y5 = Y(1,5)
+
+// Difference
+
+// f[X1,X2]
+(f(X2) - f(X1))
+// f[X2,X3]
+(f(X3) - f(X2))
+// f[X3,X4]
+(f(X4) - f(X3))
+// f[X4,X5]
+(f(X5) - f(X4))
+
+// D^2 * f[Xi]
+
+((f(X3)-f(X2)) - (f(X2)-f(X1)))
+((f(X4)-f(X3)) - (f(X3)-f(X2)))
+((f(X5)-f(X4)) - (f(X4)-f(X3)))
+
+// D^3 * f[Xi]
+
+((f(X4)-f(X3)) - (f(X3)-f(X2))) - ((f(X3)-f(X2)) - (f(X2)-f(X1)))
+((f(X5)-f(X4)) - (f(X4)-f(X3))) - ((f(X4)-f(X3)) - (f(X3)-f(X2)))
+
+// D^4 * f[Xi]
+
+(((f(X5)-f(X4)) - (f(X4)-f(X3))) - ((f(X4)-f(X3)) - (f(X3)-f(X2)))) - (((f(X4)-f(X3)) - (f(X3)-f(X2))) - ((f(X3)-f(X2)) - (f(X2)-f(X1))))
+
+mu = 1.5;
+x = 2.15;
+
+p1 = f(X1) + mu * (f(X2) - f(X1))
+p2 = p1 + mu*(mu-1)*((f(X3)-f(X2)) - (f(X2)-f(X1)))/2
+
+// Similarly, p3 = 1.466288
+// p4 = 1.466288 \ No newline at end of file