summaryrefslogtreecommitdiff
path: root/3850/CH26/EX26.2/Ex26_2.sce
blob: dc2ac9fe747c968ebbd2b7e80949af93a502b05f (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
31
32
33
34
35
36
37
38

//To Calculate the Work Done by the Gas

//Example 26.2

clear;

clc;

pA=120*10^3;//pressure (in Pa) of the gas at Point A

pB=120*10^3;//pressure (in Pa) of the gas at Point B

pC=200*10^3;//pressure (in Pa) of the gas at Point C

VA=200*10^-6;//Volume at point A in m^3

VB=450*10^-6;//Volume at point B  in m^3

VC=450*10^-6;//Volume at point C in m^3

delVab=VB-VA;//change in the volume of the gas from point A to B

Wab=pA*delVab;//formula for finding the work done by the gas in the process A to B

printf("The Work done by the gas in the process A to B=%d joule",Wab);

delVbc=VC-VB;//change in the volume of the gas from point B to C

Wbc=(pC-pB)*delVbc;//formula for finding the work done by the gas in the process B to C

printf("\nThe Work done by the gas in the process B to C=%d joule",Wbc);

delVca=VC-VA;//change in the volume of the gas from point C to A

Wca=(0.5*(pC-pA)*delVca)+Wab;//formula for finding the work done by the gas in the process C to A

printf("\nThe Work done by the gas in the process C to A=%d joule",-Wca);