-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtest.py
93 lines (83 loc) · 2.05 KB
/
test.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# -*- coding: utf-8 -*-
import sys
import os
sys.path.append(os.path.dirname(__file__) + "/src")
import jos3
from jos3 import JOS3
if __name__ == "__main__":
mod = JOS3(ex_output="all")
mod.PAR = 2
mod.To = 40
mod.RH = 70
mod.Va = 2
mod.Icl = 0.6
mod.simulate(60)
d = mod.dict_results()
# for k in d.keys():
# print(jos3.remove_bodyname(k))
mod.to_csv(folder="E:/desktop")
mod = JOS3()
print("\nNeutral")
print("TcrHead: {:.3f} [oC]".format(mod.Tcr[0]))
print("TskMean: {:.3f} [oC]".format(mod.TskMean))
mod = JOS3()
mod.PAR = 2
mod.To = 40
mod.RH = 70
mod.Va = 2
mod.Icl = 0.6
mod.simulate(60)
print("\nAfter Hot Exposure")
print("TcrHead: {:.3f} [oC]".format(mod.Tcr[0]))
print("TskMean: {:.3f} [oC]".format(mod.TskMean))
mod = JOS3()
mod.PAR = 1.2
mod.To = 10
mod.RH = 20
mod.Va = 3
mod.Icl = 0.1
mod.simulate(60)
print("\nAfter Cold Exposure")
print("TcrHead: {:.3f} [oC]".format(mod.Tcr[0]))
print("TskMean: {:.3f} [oC]".format(mod.TskMean))
# Measure calculation time
import time
stime = time.time()
mod = JOS3()
mod.To = 30
mod.simulate(60)
mod.To = 20
mod.simulate(60)
mod.To = 40
mod.simulate(60)
mod.To = 10
mod.simulate(60)
etime = time.time()
print("Default output")
print("Calculation time {:.2f} [sec]".format(etime-stime))
stime = time.time()
mod = JOS3(ex_output=["BFsk", "BFcr", "Emax"])
mod.To = 30
mod.simulate(60)
mod.To = 20
mod.simulate(60)
mod.To = 40
mod.simulate(60)
mod.To = 10
mod.simulate(60)
etime = time.time()
print("Extra output")
print("Calculation time {:.2f} [sec]".format(etime-stime))
stime = time.time()
mod = JOS3(ex_output="all")
mod.To = 30
mod.simulate(60)
mod.To = 20
mod.simulate(60)
mod.To = 40
mod.simulate(60)
mod.To = 10
mod.simulate(60)
etime = time.time()
print("All output")
print("Calculation time {:.2f} [sec]".format(etime-stime))