summaryrefslogtreecommitdiff
path: root/2471/CH1/EX1.2/Ex1_2.sce
blob: 2824a4c1139931476f984f16224c3d45642b8056 (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
clear ;
clc;
// Example 1.2
printf('Example 1.2\n\n');
printf('Page No. 09\n\n');
// Solution 

// Given
Eo1= 1.775*10^9;// Annular energy consumption of oil in Btu
Btu= 1055;// 1 Btu = 1055 Joules
Eo= Eo1*Btu;// Annular energy consumption of oil in Joules
Eg1= 5*10^3;// Annular energy consumption of gas in Therms
Th= 1055*10^5;//  1 Th = 1055*10^3 Joules
Eg= Eg1*Th;// Annular energy consumption of gas in Joules
Ee1= 995*10^3;// Annular energy consumption of electricity in KWh
KWh= 3.6*10^6;// 1 KWh = 3.6*10^6 Joules
Ee= Ee1*KWh;// Annular energy consumption of electricity in Joules
Et= ( Eo + Eg + Ee);// Total energy consumption
P1= (Eo/Et)*100; // percentage of oil consumption
P2= (Eg/Et)*100; // percentage of gas consumption
P3= (Ee/Et)*100; // percentage of electricity consumption
printf('percentage of oil consumption is %3.1f \n',P1)
printf('percentage of gas consumption is %3.1f \n',P2)
printf('percentage of electricity consumption is %3.1f \n',P3)