From f35ea80659b6a49d1bb2ce1d7d002583f3f40947 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:38:01 +0530 Subject: updated the code --- 557/CH2/EX2.10/10.sce | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to '557/CH2') diff --git a/557/CH2/EX2.10/10.sce b/557/CH2/EX2.10/10.sce index 7756eae0d..68ce7f130 100755 --- a/557/CH2/EX2.10/10.sce +++ b/557/CH2/EX2.10/10.sce @@ -1,24 +1,24 @@ -clc ;funcprot(0); -//Example 2.10 - -//Initializing the variables -phi = 30; //30 degree -h = 1.2 ; // Height of tank -l = 2; // Length of tank - -//Calculations -function[Theta]=SurfaceAngle(a,phi) - Theta = atand(-a*cosd(phi)/(g+a*sind(phi))); -endfunction - -//case (a) a = 4 -disp(tand(SurfaceAngle(4,phi)),"Tan of Angle between surface of fluid and horizontal :"); -disp(180 + SurfaceAngle(4,phi),"ThetaA (degree):"); - -//Case (b) a = - 4.5 -tanThetaR = tand(SurfaceAngle(-4.5,phi)); -disp(tanThetaR,"Tan of Angle between surface of fluid and horizontal :"); -disp(SurfaceAngle(-4.5,phi),"ThetaR (degree):"); - -Depth = h - l*tanThetaR/2; +clc ;funcprot(0); +//Example 2.10 + +//Initializing the variables +phi = 30; //30 degree +h = 1.2 ; // Height of tank +l = 2; // Length of tank +g = 9.81; +//Calculations +function[Theta]=SurfaceAngle(a,phi) + Theta = atand(-a*cosd(phi)/(g+a*sind(phi))); +endfunction + +//case (a) a = 4 +disp(tand(SurfaceAngle(4,phi)),"Tan of Angle between surface of fluid and horizontal :"); +disp(180 + SurfaceAngle(4,phi),"ThetaA (degree):"); + +//Case (b) a = - 4.5 +tanThetaR = tand(SurfaceAngle(-4.5,phi)); +disp(tanThetaR,"Tan of Angle between surface of fluid and horizontal :"); +disp(SurfaceAngle(-4.5,phi),"ThetaR (degree):"); + +Depth = h - l*tanThetaR/2; disp(Depth,"Maximum Depth of tank (m):"); \ No newline at end of file -- cgit