summaryrefslogtreecommitdiff
path: root/3819/CH2/EX2.20/Ex2_20.sce
blob: a919cae1f8fa2db172512132edf7b801eb27654b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// A Textbook of Fluid Mecahnics and Hydraulic Machines - By R K Bansal
// Chapter 2 - Pressure and its measurements
// Problem 2.20

//Given Data Set in the Problem
dens=1000
g=9.81
SG1=1.2
SG2=1.0
dens1=SG1*dens
dens2=SG2*dens
SG_oil=0.7
dens_oil=SG_oil*dens
p=poly(0,"p")
pA=p
pB=p
x1=30/100

//calculations 
//equating pressure in left and rght limbs ,we get;
function [f]=F(h)
    f=(pA-dens1*g*x1-dens_oil*g*h)-(pB-dens2*g*(h+x1))
endfunction
h=10;
y=fsolve(h,F)
mprintf("The reading h is %f cm\n",y*100)