summaryrefslogtreecommitdiff
path: root/3819/CH4/EX4.6/Ex4_6.sce
blob: a5ed04afab391d1e6f6c920d2a14062ef72ca60c (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
27
28
29
30
// A Textbook of Fluid Mecahnics and Hydraulic Machines - By R K Bansal
// Chapter 4-Buoyancy and Floatation
// Problem 4.6

//Given Data Set in the Problem
dens=1000
g=9.81
sg=0.8
theta=135
d=15
P=9.81
OB=50
OD=35

//calculations
//Let h is the depth
h=OB*sin((180-theta)*%pi/180)-(OD)          //in cms
//volume of oil displaced
v_disp=2/3*%pi*(d/2)^3+h*%pi*(d/2)^2
F_buoy=sg*dens*g*v_disp*10^-6
//taking moment about the hinge
//P*20=(F_buoy-W_float)*(OB*cos 45)
function[f] = F(W)
    f = P*20-(F_buoy-W)*(OB*cos((180-theta)/180*%pi))
endfunction
W= 10;
W = fsolve(W,F)
//Weight of the float
mprintf("The weight of the float is %f N\n",W)