Skip to content

Commit

Permalink
Merge pull request TanabeLab#13 from TanabeLab/jos3-dev-0.4.0
Browse files Browse the repository at this point in the history
Jos3 dev 0.4.0
  • Loading branch information
yoshito-takahashi authored Aug 17, 2022
2 parents 4b282c7 + bc2a13b commit 50f9ba8
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 74 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dist/
build/
jos3.egg-info/
.eggs/
*.csv
*.csv
test.py
2 changes: 1 addition & 1 deletion src/jos3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
from jos3.jos3 import *
__version__ = '0.3.1'
__version__ = '0.4.0'
14 changes: 7 additions & 7 deletions src/jos3/construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def bsa_rate(height=1.72, weight=74.43, equation="dubois",):
equation : str, optional
The equation name (str) of bsa calculation. Choose a name from "dubois",
"takahira", "fujimoto", or "kurazumi". The default is "dubois".
Returns
-------
bsa_rate : float
Expand Down Expand Up @@ -240,14 +240,14 @@ def conductance(height=1.72, weight=74.43, equation="dubois", fat=15,):
cdt_ms_fat[0] = 13.222
cdt_fat_sk[0] = 16.008
cdt_cr_ms[4] = 3.0813 # Pelvis
cdt_ms_fat[4] = 0.3738
cdt_ms_fat[4] = 10.3738
cdt_fat_sk[4] = 41.4954

# vessel to core
# The shape is a cylinder.
# It is assumed that the inner is vascular radius, 2.5mm and the outer is
# It is assumed that the inner is vascular radius, 2.5mm and the outer is
# stolwijk's core radius.
# The heat transer coefficient of the core is assumed as the Michel's
# The heat transer coefficient of the core is assumed as the Michel's
# counter-flow model 0.66816 [W/(m・K)].
cdt_ves_cr = np.array([
0, 0, 0, 0, 0,
Expand Down Expand Up @@ -321,8 +321,8 @@ def conductance(height=1.72, weight=74.43, equation="dubois", fat=15,):
def capacity(height=1.72, weight=74.43, equation="dubois", age=20, ci=2.59):
"""
Calculate the thermal capacity [J/K].
The values of vascular and central blood capacity have been derived from
The values of vascular and central blood capacity have been derived from
Yokoyama's model.
The specific heat of blood is assumed as 1.0 [kcal/L.K].
Expand Down Expand Up @@ -369,7 +369,7 @@ def capacity(height=1.72, weight=74.43, equation="dubois", age=20, ci=2.59):

# core [Wh/K]
cap_cr = np.array([
1.7229, 0.564, 10.2975, 9.3935, 13.834,
1.7229, 0.564, 10.2975, 9.3935, 4.488,
1.6994, 1.1209, 0.1536, 1.6994, 1.1209, 0.1536,
5.3117, 2.867, 0.2097, 5.3117, 2.867, 0.2097,])

Expand Down
130 changes: 65 additions & 65 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,73 +21,73 @@
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()
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 = 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))
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))
# 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=["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))
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))

0 comments on commit 50f9ba8

Please sign in to comment.