summaryrefslogtreecommitdiff
path: root/964/CH26/EX26.1
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /964/CH26/EX26.1
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 '964/CH26/EX26.1')
-rwxr-xr-x964/CH26/EX26.1/26_1.sce40
-rwxr-xr-x964/CH26/EX26.1/26_1_1.jpegbin0 -> 34007 bytes
-rwxr-xr-x964/CH26/EX26.1/26_1_2.jpegbin0 -> 24619 bytes
3 files changed, 40 insertions, 0 deletions
diff --git a/964/CH26/EX26.1/26_1.sce b/964/CH26/EX26.1/26_1.sce
new file mode 100755
index 000000000..0af6c6d95
--- /dev/null
+++ b/964/CH26/EX26.1/26_1.sce
@@ -0,0 +1,40 @@
+clc;
+clear;
+function yp=f(t,y)
+ yp=-1000*y+3000-2000*exp(-t)
+endfunction
+y0=0;
+//explicit euler
+h1=0.0005;
+y1(1)=y0;
+count=2;
+t=0:0.0001:0.006
+for i=0:0.0001:0.0059
+ y1(count)=y1(count-1)+f(i,y1(count-1))*h1
+ count=count+1;
+end
+plot(t,y1)
+h2=0.0015;
+y2(1)=y0;
+count=2;
+t=0:0.0001:0.006
+for i=0:0.0001:0.0059
+ y2(count)=y2(count-1)+f(i,y2(count-1))*h2
+ count=count+1;
+end
+plot(t,y2,'.-')
+xtitle("y vs t","t","y")
+h=legend(["h-0.0005","h=0.0015"])
+clf();
+//implicit order
+h3=0.05;
+y3(1)=y0;
+count=2;
+t=0:0.01:0.4
+for j=0:0.01:0.39
+ y3(count)=(y3(count-1)+3000*h3-2000*h3*exp(-(j+0.01)))/(1+1000*h3)
+ count=count+1;
+end
+
+plot(t,y3)
+xtitle("y vs t","t","y")
diff --git a/964/CH26/EX26.1/26_1_1.jpeg b/964/CH26/EX26.1/26_1_1.jpeg
new file mode 100755
index 000000000..29a2401f8
--- /dev/null
+++ b/964/CH26/EX26.1/26_1_1.jpeg
Binary files differ
diff --git a/964/CH26/EX26.1/26_1_2.jpeg b/964/CH26/EX26.1/26_1_2.jpeg
new file mode 100755
index 000000000..33d1479ac
--- /dev/null
+++ b/964/CH26/EX26.1/26_1_2.jpeg
Binary files differ