From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 1670/CH5/EX5.24/5_24.sce | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 1670/CH5/EX5.24/5_24.sce (limited to '1670/CH5/EX5.24') diff --git a/1670/CH5/EX5.24/5_24.sce b/1670/CH5/EX5.24/5_24.sce new file mode 100755 index 000000000..c848c6060 --- /dev/null +++ b/1670/CH5/EX5.24/5_24.sce @@ -0,0 +1,28 @@ +//Example 5.24 +//Central Difference Derivatives +//Page no. 160 +clc;close;clear; +printf(' x\t\t y\t\t d\t\t d2\t\t d3\t\t d4\n') +printf('---------------------------------------------------------------------------------------------') +h=0.01;s=0.5; +deff('y=f1(x,p)','y=z(x,2)+p*z(x,3)+p*(p-1)*(z(x,4)+z(x-1,4))/4') +z=[0.01,98.4342;0.02,48.4392;0.03,31.7775;0.04,23.4492;0.05,18.4542]; +for i=3:6 + for j=1:7-i + z(j,i)=z(j+1,i-1)-z(j,i-1) + end +end +printf('\n') +for i=1:5 + for j=1:6 + if z(i,j)==0 then + printf(' \t') + else + printf('%.7f\t',z(i,j)) + end + end + printf('\n') +end +x00=0.03;x01=0.0341; +p=(x01-x00)/h +printf('\n\nf(0.0341) = %g',f1(3,p)) \ No newline at end of file -- cgit