summaryrefslogtreecommitdiff
path: root/3843/CH3/EX3.2/Ex3_2.sce
blob: dbc76bcc724e6e742b443a435b12cb7b5c4c1c08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Example 3_2
clc;funcprot(0);
// Given data
d=110/10^3;// The diameter of the cylinder in m
V_1=100;// The volume of the water in cm^3
m=50;// kg
g=9.81;// The acceleration due to gravity in m/s^2
P_atm=1*10^5;// Pa

// Calculation
A=(%pi*d^2)/4;// m^2
P=((m*g)/A)+P_atm;// Pa
V_1=V_1*10^-6;// m^3
v_1=0.001017;// m^3/kg
m=V_1/v_1;// kg
v_2=1.444;// m^3/kg
V_2=m*v_2;// m^3
W=P*(V_2-V_1);// The work done in J
printf("\nThe work done,W=%5.0f J or %2.1f kJ",W,W/10^3);