summaryrefslogtreecommitdiff
path: root/797/CH3/EX3.7.s/3_07_solution.sce
blob: 5d4a26d1258fb8293ae3c673eb5c470769605eee (plain)
1
2
3
4
5
6
7
8
9
10
//Soultion 3-07
WD=get_absolute_file_path('3_07_solution.sce');
datafile=WD+filesep()+'3_07_example.sci';
clc;
exec(datafile)
//converting pressures into [Pa]
P_atm = P_atm * 1000;
P_1 = P_1 * 1000;
h_3 = (P_1 - P_atm + rho_water * g *h_1 + rho_oil * g * h_2) / (rho_seawater * g); //pressure eqquilibrium
printf("If mercury is changed to seawater the height of seawater will be %1.2f m", h_3);