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 /1332/CH19/EX19.3 | |
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 '1332/CH19/EX19.3')
-rwxr-xr-x | 1332/CH19/EX19.3/19_3.pdf | bin | 0 -> 6293 bytes | |||
-rwxr-xr-x | 1332/CH19/EX19.3/19_3.sce | 29 |
2 files changed, 29 insertions, 0 deletions
diff --git a/1332/CH19/EX19.3/19_3.pdf b/1332/CH19/EX19.3/19_3.pdf Binary files differnew file mode 100755 index 000000000..b307c53ee --- /dev/null +++ b/1332/CH19/EX19.3/19_3.pdf diff --git a/1332/CH19/EX19.3/19_3.sce b/1332/CH19/EX19.3/19_3.sce new file mode 100755 index 000000000..7d95b8dda --- /dev/null +++ b/1332/CH19/EX19.3/19_3.sce @@ -0,0 +1,29 @@ +//Example 19.3
+//Simple Explicit Method
+//Page no. 658
+clc;clear;close;
+
+c=-2;dt=0.07;dx=0.2;
+r=abs(c)*dt/dx;
+printf('\n x\ti\t|\tj -->\t')
+for i=0:6
+ printf(' %i\t',i)
+end
+printf('\n |\t|\t|\tt -->\t')
+for i=0:6
+ printf('%.3f\t',i*dt)
+end
+printf('\n---------------------------------------------------------------------------------------')
+for j=1:6
+ printf('\n %.1f\t%i\t|\t\t',(j-1)*dx,j-1)
+ for i=1:7
+ if i==1 then
+ u(j,i)=0;
+ elseif j==1 then
+ u(j,i)=1
+ else
+ u(j,i)=(1-r)*u(j,i-1)+r*u(j-1,i-1)
+ end
+ printf('%.3f\t',u(j,i))
+ end
+end
\ No newline at end of file |