-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoomType1.java
More file actions
45 lines (31 loc) · 949 Bytes
/
RoomType1.java
File metadata and controls
45 lines (31 loc) · 949 Bytes
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
39
40
41
42
43
44
45
class RoomType1 {
/*@ specification RoomType1 {
double roomLength;
double roomWidth;
double roomHeight;
double windowUvalue;
double windowArea;
windowArea=roomWidth*roomHeight;
double initialTemperature;
double c;
double outdoorTemperature;
double heatFlow;
double temperature;
double density;
double airM;
airM=(roomLength*roomHeight*roomWidth)*density;
double initstate;
initstate=initialTemperature;
double state, nextstate, finalstate;
state, outdoorTemperature, windowUvalue, windowArea, heatFlow, airM, c-> nextstate {compute};
state = temperature;
}@*/
double compute(double rt, double ot, double wU, double wA, double heatFlow, double airM, double c ) {
double t=0;
double qL= wU*wA*(rt-ot);
double deltaT=(60*(heatFlow-qL)/(airM*c));
t=rt+deltaT;
//System.out.println("\t rt="+temperature+"\t hf="+heatFlow+"\t l="+qL+"\t dT="+deltaT);
return t;
}
}