diff options
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);
|