diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /243/CH13/EX13.2/13_02.sce | |
download | Scilab-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.2/13_02.sce')
-rwxr-xr-x | 243/CH13/EX13.2/13_02.sce | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/243/CH13/EX13.2/13_02.sce b/243/CH13/EX13.2/13_02.sce new file mode 100755 index 000000000..5048d067b --- /dev/null +++ b/243/CH13/EX13.2/13_02.sce @@ -0,0 +1,20 @@ +//Example No. 13_02
+//Recursive Taylor Method
+//Pg No. 415
+clear ; close ; clc ;
+
+deff('F = f(x,y)','F = x^2 + y^2')
+deff('D2Y = d2y(x,y)','D2Y = 2*x + 2*y*f(x,y)');
+deff('D3Y = d3y(x,y)','D3Y = 2 + 2*y*d2y(x,y) + 2*f(x,y)^2');
+deff('D4Y = d4y(x,y)','D4Y = 6*f(x,y)*d2y(x,y) + 2*y*d3y(x,y) ');
+h = 0.2 ;
+deff('Y = y(x,y)','Y = y + f(x,y)*h + d2y(x,y)*h^2/2 + d3y(x,y)*h^3/6 + d4y(x,y)*h^4/factorial(4)');
+x0 = 0;
+y0 = 0 ;
+for i = 1:2
+ y_(i) = y(x0,y0)
+ printf(' Iteration-%i\n\n dy(0) = %f\n d2y(0) = %f\n d3y(0) = %f\n d4y(0) = %f\n ',i,f(x0,y0),d2y(x0,y0),d3y(x0,y0),d4y(x0,y0))
+ x0 = x0 + i*h
+ y0 = y_(i)
+ printf('y(0) = %f\n\n',y_(i))
+end
|