blob: fa542d8f7a9218db01435fe0652e8587e1146f11 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// Display mode
mode(0);
// Display warning for floating point exception
ieee(1);
clear;
clc;
disp("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 8")
d=15*10^-2;//diameter of cylinder in m
h=12*10^-2;//manometer height difference in m of mercury
rho=13.6*10^3;//density of mercury in kg/m^3
g=9.81;//acceleration due to gravity in m/s^2
disp("pressure measured by manometer(P) in pa")
disp("p=rho*g*h")
p=rho*g*h
disp("now weight of piston(m*g) = upward thrust by gas(p*%pi*d^2/4)")
disp("mass of piston(m)in kg")
disp("so m=(p*%pi*d^2)/(4*g)")
m=(p*%pi*d^2)/(4*g)
|