summaryrefslogtreecommitdiff
path: root/1670/CH7/EX7.1/7_1.sce
diff options
context:
space:
mode:
Diffstat (limited to '1670/CH7/EX7.1/7_1.sce')
-rwxr-xr-x1670/CH7/EX7.1/7_1.sce12
1 files changed, 12 insertions, 0 deletions
diff --git a/1670/CH7/EX7.1/7_1.sce b/1670/CH7/EX7.1/7_1.sce
new file mode 100755
index 000000000..45238c2cc
--- /dev/null
+++ b/1670/CH7/EX7.1/7_1.sce
@@ -0,0 +1,12 @@
+//Example 7.1
+//Differentiation
+//Page no. 230
+clc;close;clear;
+deff('y=f(x)','y=sin(x)')
+deff('y=f1(x,h)','y=(f(x+h)-f(x-h))/(2*h)')
+deff('y=f2(x,h)','y=(-f(x+2*h)+8*f(x+h)-8*f(x-h)+f(x-2*h))/(12*h)')
+h=0.01;x=0.5
+d=f1(x,h)
+d1=f2(x,h)
+printf('Centred Formula of Order O(h2) = %g\n',d)
+printf('\n Centred Formula of Order O(h4) = %g',d1) \ No newline at end of file