summaryrefslogtreecommitdiff
path: root/243/CH13/EX13.12/13_12.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /243/CH13/EX13.12/13_12.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 '243/CH13/EX13.12/13_12.sce')
-rwxr-xr-x243/CH13/EX13.12/13_12.sce21
1 files changed, 21 insertions, 0 deletions
diff --git a/243/CH13/EX13.12/13_12.sce b/243/CH13/EX13.12/13_12.sce
new file mode 100755
index 000000000..22cb04766
--- /dev/null
+++ b/243/CH13/EX13.12/13_12.sce
@@ -0,0 +1,21 @@
+//Example No. 13_12
+//Milne-Simpson Method using modifier
+//Pg No. 453
+clear ; close ; clc ;
+
+deff('F = f(y)','F = -y^2 ')
+x = [ 1 ; 1.2 ; 1.4 ; 1.6 ] ;
+y = [ 1 ; 0.8333333 ; 0.7142857 ; 0.625 ] ;
+h = 0.2 ;
+
+for i = 1:2
+ yp = y(i) + 4*h*( 2*f( y(i+1) ) - f( y(i+2) ) + 2*f( y(i+3) ) )/3
+ fp = f(yp) ;
+ yc = y( i+2) + h*(f( y(i+2) ) + 4*f( y(i+3) ) + fp )/3 ;
+ Etc = -(yc - yp)/29
+ y(i+4) = yc + Etc
+ mprintf('\n y%ip = %f\n f%ip = %f \n y%ic = %f \n Modifier Etc = %f \n Modified y%ic = %f \n',i+3,yp,i+3,fp,i+3,yc,Etc,i+3,y(i+4))
+end
+exactanswer = 0.5 ;
+err = exactanswer - y(6) ;
+disp(err,'error = ') \ No newline at end of file