summaryrefslogtreecommitdiff
path: root/23/CH9/EX9.2/Example_9_2.sce
blob: 387ca0cc1812593d96e7e482fcb9e5907b34ea0c (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
clear;
clc;

//To find Approx Value
function[A]=approx(V,n)
  A=round(V*10^n)/10^n;//V-Value  n-To what place
  funcprot(0)
endfunction  

//Example 9.2
//Caption : Program to Find Power Requirement For Various seasons

//Given Values
Qh_Winter=30;//[KW]
Qc_Summer=60;//[KW]
Tc_Winter=283.15;//[K]
Th_Winter=303.15;//[K]
Tc_Summer=278.15;//[K]
Th_Summer=298.15;//[K]

//For WINTER's
//Using Eqn(5.7)
Qc_Winter=Qh_Winter*(Tc_Winter/Th_Winter);
//Using Eqn(9.1)
W_Winter=approx((Qh_Winter-Qc_Winter),2);//[KW]
disp('KW',W_Winter,'Power Requirement for WINTER''s')

//For SUMMER's
//Combining Eqn(9.2) And Eqn(9.3)
W_Summer=approx((Qc_Summer*((Th_Summer-Tc_Summer)/Tc_Summer)),2);
disp('KW',W_Summer,'Power Requirement for SUMMER''s')

//End