summaryrefslogtreecommitdiff
path: root/60/CH2/EX2.1
diff options
context:
space:
mode:
Diffstat (limited to '60/CH2/EX2.1')
-rwxr-xr-x60/CH2/EX2.1/ex_1.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/60/CH2/EX2.1/ex_1.sce b/60/CH2/EX2.1/ex_1.sce
new file mode 100755
index 000000000..e4fd2619f
--- /dev/null
+++ b/60/CH2/EX2.1/ex_1.sce
@@ -0,0 +1,20 @@
+//Example 2.1
+
+// Given p(6000)=1/3 , p(6001)=-2/3
+// From p(x)=a0+a1*x , by substituting x=6000 & x=6001
+// we get equations a0+a1*(6000)=1/3 & a0+a1*(6001)=-2/3
+//solving the above equations we get
+a0=6000.3
+a1=-1
+deff('[y]=f(x)','y=6000.3-x')
+f(6000)
+f(6001)
+// y=6000.3-x , equation recovers only only the first digit of the
+ // given function values,a loss of four decimal digits
+ // remedy for such loss of significance is the use of SHIFTED POWER FORM
+ //p(x)=a0 + a1*(x-c) + a2*(x-c)^2 + .......+an*(x-c)^n
+ //if we choose the center c to be 6000
+
+ deff('[y]=p(x)','y=0.33333-(x-6000)')
+ p(6000)
+ p(6001) \ No newline at end of file