diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /1553/CH19/EX19.7 | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '1553/CH19/EX19.7')
-rw-r--r-- | 1553/CH19/EX19.7/19Ex7.sce | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/1553/CH19/EX19.7/19Ex7.sce b/1553/CH19/EX19.7/19Ex7.sce new file mode 100644 index 000000000..59591f9ed --- /dev/null +++ b/1553/CH19/EX19.7/19Ex7.sce @@ -0,0 +1,26 @@ +//chapter 19 Ex 7
+
+clc;
+clear;
+close;
+dUp1=40; dDown1=55; dUp2=30; dDown=44;
+t1=13; t2=10;
+//let rate upstream be x km/hr and downstream be y km/hr
+//Equations are : 40/x+55/y=13 & 30/x+44/y=10
+x=poly(0,'x');
+y=(-55*x)/(40-13*x); //equation 1
+y=(-44*x)/(30-10*x); //equation 2
+for x=1:99
+ if(x~=3) //since denominator becomes 0
+ if (-55*x)/(40-13*x) ==(-44*x)/(30-10*x)
+ mprintf("x=%i \n ",x);
+ break
+ end
+ end
+end
+
+y=(-55*x)/(40-13*x);
+
+rStill=(x+y)/2;
+rCurrent=(y-x)/2;
+printf("The speed in still water is %d km/hr and rate of current is %d km/hr",rStill,rCurrent);
|