jsthermalcomfort 0.1.5 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/README.md +35 -22
  2. package/lib/cjs/jos3_functions/JOS3Defaults.js +34 -0
  3. package/lib/cjs/jos3_functions/bfb_rate.js +75 -0
  4. package/lib/cjs/jos3_functions/bsa_rate.js +27 -0
  5. package/lib/cjs/jos3_functions/capacity.js +102 -0
  6. package/lib/cjs/jos3_functions/conductance.js +180 -0
  7. package/lib/cjs/jos3_functions/local_bsa.js +64 -0
  8. package/lib/cjs/jos3_functions/matrix.js +351 -0
  9. package/lib/cjs/jos3_functions/thermoregulation/ava_blood_flow.js +84 -0
  10. package/lib/cjs/jos3_functions/thermoregulation/basal_met.js +54 -0
  11. package/lib/cjs/jos3_functions/thermoregulation/clo_area_factor.js +13 -0
  12. package/lib/cjs/jos3_functions/thermoregulation/conv_coef.js +136 -0
  13. package/lib/cjs/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.js +95 -0
  14. package/lib/cjs/jos3_functions/thermoregulation/dry_r.js +56 -0
  15. package/lib/cjs/jos3_functions/thermoregulation/error_signals.js +64 -0
  16. package/lib/cjs/jos3_functions/thermoregulation/evaporation.js +104 -0
  17. package/lib/cjs/jos3_functions/thermoregulation/fixed_hc.js +51 -0
  18. package/lib/cjs/jos3_functions/thermoregulation/fixed_hr.js +52 -0
  19. package/lib/cjs/jos3_functions/thermoregulation/local_mbase.js +79 -0
  20. package/lib/cjs/jos3_functions/thermoregulation/local_q_work.js +57 -0
  21. package/lib/cjs/jos3_functions/thermoregulation/nonshivering.js +104 -0
  22. package/lib/cjs/jos3_functions/thermoregulation/operative_temp.js +51 -0
  23. package/lib/cjs/jos3_functions/thermoregulation/rad_coef.js +83 -0
  24. package/lib/cjs/jos3_functions/thermoregulation/resp_heat_loss.js +23 -0
  25. package/lib/cjs/jos3_functions/thermoregulation/shivering.js +143 -0
  26. package/lib/cjs/jos3_functions/thermoregulation/skin_blood_flow.js +84 -0
  27. package/lib/cjs/jos3_functions/thermoregulation/sum_bf.js +59 -0
  28. package/lib/cjs/jos3_functions/thermoregulation/sum_m.js +75 -0
  29. package/lib/cjs/jos3_functions/thermoregulation/wet_r.js +62 -0
  30. package/lib/cjs/jos3_functions/validate_body_parameters.js +31 -0
  31. package/lib/cjs/jos3_functions/weight_rate.js +30 -0
  32. package/lib/cjs/models/JOS3.js +963 -0
  33. package/lib/cjs/models/a_pmv.js +13 -8
  34. package/lib/cjs/models/adaptive_ashrae.js +5 -6
  35. package/lib/cjs/models/adaptive_en.js +3 -4
  36. package/lib/cjs/models/ankle_draft.js +3 -4
  37. package/lib/cjs/models/at.js +10 -6
  38. package/lib/cjs/models/athb.js +19 -13
  39. package/lib/cjs/models/clo_tout.js +10 -5
  40. package/lib/cjs/models/cooling_effect.js +15 -10
  41. package/lib/cjs/models/discomfort_index.js +2 -3
  42. package/lib/cjs/models/e_pmv.js +12 -7
  43. package/lib/cjs/models/heat_index.js +10 -8
  44. package/lib/cjs/models/humidex.js +1 -2
  45. package/lib/cjs/models/index.js +33 -27
  46. package/lib/cjs/models/net.js +11 -7
  47. package/lib/cjs/models/pet_steady.js +26 -17
  48. package/lib/cjs/models/phs.js +119 -56
  49. package/lib/cjs/models/pmv.js +2 -3
  50. package/lib/cjs/models/pmv_ppd.js +6 -6
  51. package/lib/cjs/models/pmv_ppd_ashrae.js +50 -0
  52. package/lib/cjs/models/pmv_ppd_iso.js +51 -0
  53. package/lib/cjs/models/set_tmp.js +12 -8
  54. package/lib/cjs/models/solar_gain.js +11 -13
  55. package/lib/cjs/models/two_nodes.js +7 -5
  56. package/lib/cjs/models/use_fans_heatwave.js +1 -2
  57. package/lib/cjs/models/utci.js +3 -4
  58. package/lib/cjs/models/vertical_tmp_grad_ppd.js +7 -8
  59. package/lib/cjs/models/wbgt.js +10 -6
  60. package/lib/cjs/models/wc.js +1 -2
  61. package/lib/cjs/psychrometrics/enthalpy.js +1 -2
  62. package/lib/cjs/psychrometrics/p_sat.js +1 -2
  63. package/lib/cjs/psychrometrics/p_sat_torr.js +2 -3
  64. package/lib/cjs/psychrometrics/psy_ta_rh.js +1 -2
  65. package/lib/cjs/psychrometrics/t_dp.js +1 -2
  66. package/lib/cjs/psychrometrics/t_mrt.js +2 -3
  67. package/lib/cjs/psychrometrics/t_o.js +2 -3
  68. package/lib/cjs/psychrometrics/t_wb.js +1 -2
  69. package/lib/cjs/supa.js +73 -0
  70. package/lib/cjs/types/jos3_functions/JOS3Defaults.d.ts +27 -0
  71. package/lib/cjs/types/jos3_functions/JOS3Defaults.d.ts.map +1 -0
  72. package/lib/cjs/types/jos3_functions/bfb_rate.d.ts +13 -0
  73. package/lib/cjs/types/jos3_functions/bfb_rate.d.ts.map +1 -0
  74. package/lib/cjs/types/jos3_functions/bsa_rate.d.ts +15 -0
  75. package/lib/cjs/types/jos3_functions/bsa_rate.d.ts.map +1 -0
  76. package/lib/cjs/types/jos3_functions/capacity.d.ts +19 -0
  77. package/lib/cjs/types/jos3_functions/capacity.d.ts.map +1 -0
  78. package/lib/cjs/types/jos3_functions/conductance.d.ts +13 -0
  79. package/lib/cjs/types/jos3_functions/conductance.d.ts.map +1 -0
  80. package/lib/cjs/types/jos3_functions/local_bsa.d.ts +19 -0
  81. package/lib/cjs/types/jos3_functions/local_bsa.d.ts.map +1 -0
  82. package/lib/cjs/types/jos3_functions/matrix.d.ts +63 -0
  83. package/lib/cjs/types/jos3_functions/matrix.d.ts.map +1 -0
  84. package/lib/cjs/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts +33 -0
  85. package/lib/cjs/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts.map +1 -0
  86. package/lib/cjs/types/jos3_functions/thermoregulation/basal_met.d.ts +13 -0
  87. package/lib/cjs/types/jos3_functions/thermoregulation/basal_met.d.ts.map +1 -0
  88. package/lib/cjs/types/jos3_functions/thermoregulation/clo_area_factor.d.ts +9 -0
  89. package/lib/cjs/types/jos3_functions/thermoregulation/clo_area_factor.d.ts.map +1 -0
  90. package/lib/cjs/types/jos3_functions/thermoregulation/conv_coef.d.ts +16 -0
  91. package/lib/cjs/types/jos3_functions/thermoregulation/conv_coef.d.ts.map +1 -0
  92. package/lib/cjs/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts +37 -0
  93. package/lib/cjs/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts.map +1 -0
  94. package/lib/cjs/types/jos3_functions/thermoregulation/dry_r.d.ts +12 -0
  95. package/lib/cjs/types/jos3_functions/thermoregulation/dry_r.d.ts.map +1 -0
  96. package/lib/cjs/types/jos3_functions/thermoregulation/error_signals.d.ts +27 -0
  97. package/lib/cjs/types/jos3_functions/thermoregulation/error_signals.d.ts.map +1 -0
  98. package/lib/cjs/types/jos3_functions/thermoregulation/evaporation.d.ts +46 -0
  99. package/lib/cjs/types/jos3_functions/thermoregulation/evaporation.d.ts.map +1 -0
  100. package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hc.d.ts +5 -0
  101. package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hc.d.ts.map +1 -0
  102. package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hr.d.ts +9 -0
  103. package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hr.d.ts.map +1 -0
  104. package/lib/cjs/types/jos3_functions/thermoregulation/local_mbase.d.ts +14 -0
  105. package/lib/cjs/types/jos3_functions/thermoregulation/local_mbase.d.ts.map +1 -0
  106. package/lib/cjs/types/jos3_functions/thermoregulation/local_q_work.d.ts +12 -0
  107. package/lib/cjs/types/jos3_functions/thermoregulation/local_q_work.d.ts.map +1 -0
  108. package/lib/cjs/types/jos3_functions/thermoregulation/nonshivering.d.ts +16 -0
  109. package/lib/cjs/types/jos3_functions/thermoregulation/nonshivering.d.ts.map +1 -0
  110. package/lib/cjs/types/jos3_functions/thermoregulation/operative_temp.d.ts +13 -0
  111. package/lib/cjs/types/jos3_functions/thermoregulation/operative_temp.d.ts.map +1 -0
  112. package/lib/cjs/types/jos3_functions/thermoregulation/rad_coef.d.ts +10 -0
  113. package/lib/cjs/types/jos3_functions/thermoregulation/rad_coef.d.ts.map +1 -0
  114. package/lib/cjs/types/jos3_functions/thermoregulation/resp_heat_loss.d.ts +27 -0
  115. package/lib/cjs/types/jos3_functions/thermoregulation/resp_heat_loss.d.ts.map +1 -0
  116. package/lib/cjs/types/jos3_functions/thermoregulation/shivering.d.ts +27 -0
  117. package/lib/cjs/types/jos3_functions/thermoregulation/shivering.d.ts.map +1 -0
  118. package/lib/cjs/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts +15 -0
  119. package/lib/cjs/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts.map +1 -0
  120. package/lib/cjs/types/jos3_functions/thermoregulation/sum_bf.d.ts +15 -0
  121. package/lib/cjs/types/jos3_functions/thermoregulation/sum_bf.d.ts.map +1 -0
  122. package/lib/cjs/types/jos3_functions/thermoregulation/sum_m.d.ts +39 -0
  123. package/lib/cjs/types/jos3_functions/thermoregulation/sum_m.d.ts.map +1 -0
  124. package/lib/cjs/types/jos3_functions/thermoregulation/wet_r.d.ts +13 -0
  125. package/lib/cjs/types/jos3_functions/thermoregulation/wet_r.d.ts.map +1 -0
  126. package/lib/cjs/types/jos3_functions/validate_body_parameters.d.ts +12 -0
  127. package/lib/cjs/types/jos3_functions/validate_body_parameters.d.ts.map +1 -0
  128. package/lib/cjs/types/jos3_functions/weight_rate.d.ts +20 -0
  129. package/lib/cjs/types/jos3_functions/weight_rate.d.ts.map +1 -0
  130. package/lib/cjs/types/models/JOS3.d.ts +385 -0
  131. package/lib/cjs/types/models/JOS3.d.ts.map +1 -0
  132. package/lib/cjs/types/models/a_pmv.d.ts +15 -4
  133. package/lib/cjs/types/models/a_pmv.d.ts.map +1 -1
  134. package/lib/cjs/types/models/at.d.ts +14 -3
  135. package/lib/cjs/types/models/at.d.ts.map +1 -1
  136. package/lib/cjs/types/models/athb.d.ts +14 -3
  137. package/lib/cjs/types/models/athb.d.ts.map +1 -1
  138. package/lib/cjs/types/models/clo_tout.d.ts +13 -2
  139. package/lib/cjs/types/models/clo_tout.d.ts.map +1 -1
  140. package/lib/cjs/types/models/cooling_effect.d.ts +15 -4
  141. package/lib/cjs/types/models/cooling_effect.d.ts.map +1 -1
  142. package/lib/cjs/types/models/e_pmv.d.ts +15 -4
  143. package/lib/cjs/types/models/e_pmv.d.ts.map +1 -1
  144. package/lib/cjs/types/models/heat_index.d.ts +14 -3
  145. package/lib/cjs/types/models/heat_index.d.ts.map +1 -1
  146. package/lib/cjs/types/models/humidex.d.ts.map +1 -1
  147. package/lib/cjs/types/models/index.d.ts +60 -54
  148. package/lib/cjs/types/models/index.d.ts.map +1 -1
  149. package/lib/cjs/types/models/net.d.ts +14 -3
  150. package/lib/cjs/types/models/net.d.ts.map +1 -1
  151. package/lib/cjs/types/models/pet_steady.d.ts +17 -3
  152. package/lib/cjs/types/models/pet_steady.d.ts.map +1 -1
  153. package/lib/cjs/types/models/phs.d.ts +34 -21
  154. package/lib/cjs/types/models/phs.d.ts.map +1 -1
  155. package/lib/cjs/types/models/pmv.d.ts +1 -1
  156. package/lib/cjs/types/models/pmv_ppd.d.ts +1 -1
  157. package/lib/cjs/types/models/pmv_ppd.d.ts.map +1 -1
  158. package/lib/cjs/types/models/pmv_ppd_ashrae.d.ts +59 -0
  159. package/lib/cjs/types/models/pmv_ppd_ashrae.d.ts.map +1 -0
  160. package/lib/cjs/types/models/pmv_ppd_iso.d.ts +59 -0
  161. package/lib/cjs/types/models/pmv_ppd_iso.d.ts.map +1 -0
  162. package/lib/cjs/types/models/set_tmp.d.ts +14 -3
  163. package/lib/cjs/types/models/set_tmp.d.ts.map +1 -1
  164. package/lib/cjs/types/models/solar_gain.d.ts +3 -3
  165. package/lib/cjs/types/models/solar_gain.d.ts.map +1 -1
  166. package/lib/cjs/types/models/two_nodes.d.ts +3 -0
  167. package/lib/cjs/types/models/two_nodes.d.ts.map +1 -1
  168. package/lib/cjs/types/models/utci.d.ts +4 -1
  169. package/lib/cjs/types/models/utci.d.ts.map +1 -1
  170. package/lib/cjs/types/models/vertical_tmp_grad_ppd.d.ts +5 -5
  171. package/lib/cjs/types/models/wbgt.d.ts +15 -4
  172. package/lib/cjs/types/models/wbgt.d.ts.map +1 -1
  173. package/lib/cjs/types/models/wc.d.ts.map +1 -1
  174. package/lib/cjs/types/supa.d.ts +25 -0
  175. package/lib/cjs/types/supa.d.ts.map +1 -0
  176. package/lib/cjs/types/utilities/utilities.d.ts.map +1 -1
  177. package/lib/cjs/utilities/utilities.js +16 -16
  178. package/lib/esm/jos3_functions/JOS3Defaults.js +32 -0
  179. package/lib/esm/jos3_functions/bfb_rate.js +36 -0
  180. package/lib/esm/jos3_functions/bsa_rate.js +21 -0
  181. package/lib/esm/jos3_functions/capacity.js +96 -0
  182. package/lib/esm/jos3_functions/conductance.js +141 -0
  183. package/lib/esm/jos3_functions/local_bsa.js +25 -0
  184. package/lib/esm/jos3_functions/matrix.js +311 -0
  185. package/lib/esm/jos3_functions/thermoregulation/ava_blood_flow.js +45 -0
  186. package/lib/esm/jos3_functions/thermoregulation/basal_met.js +48 -0
  187. package/lib/esm/jos3_functions/thermoregulation/clo_area_factor.js +10 -0
  188. package/lib/esm/jos3_functions/thermoregulation/conv_coef.js +97 -0
  189. package/lib/esm/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.js +56 -0
  190. package/lib/esm/jos3_functions/thermoregulation/dry_r.js +20 -0
  191. package/lib/esm/jos3_functions/thermoregulation/error_signals.js +28 -0
  192. package/lib/esm/jos3_functions/thermoregulation/evaporation.js +63 -0
  193. package/lib/esm/jos3_functions/thermoregulation/fixed_hc.js +12 -0
  194. package/lib/esm/jos3_functions/thermoregulation/fixed_hr.js +13 -0
  195. package/lib/esm/jos3_functions/thermoregulation/local_mbase.js +40 -0
  196. package/lib/esm/jos3_functions/thermoregulation/local_q_work.js +21 -0
  197. package/lib/esm/jos3_functions/thermoregulation/nonshivering.js +65 -0
  198. package/lib/esm/jos3_functions/thermoregulation/operative_temp.js +15 -0
  199. package/lib/esm/jos3_functions/thermoregulation/rad_coef.js +44 -0
  200. package/lib/esm/jos3_functions/thermoregulation/resp_heat_loss.js +20 -0
  201. package/lib/esm/jos3_functions/thermoregulation/shivering.js +102 -0
  202. package/lib/esm/jos3_functions/thermoregulation/skin_blood_flow.js +45 -0
  203. package/lib/esm/jos3_functions/thermoregulation/sum_bf.js +23 -0
  204. package/lib/esm/jos3_functions/thermoregulation/sum_m.js +39 -0
  205. package/lib/esm/jos3_functions/thermoregulation/wet_r.js +23 -0
  206. package/lib/esm/jos3_functions/validate_body_parameters.js +25 -0
  207. package/lib/esm/jos3_functions/weight_rate.js +24 -0
  208. package/lib/esm/models/JOS3.js +923 -0
  209. package/lib/esm/models/a_pmv.js +11 -5
  210. package/lib/esm/models/adaptive_ashrae.js +3 -3
  211. package/lib/esm/models/ankle_draft.js +2 -2
  212. package/lib/esm/models/at.js +9 -4
  213. package/lib/esm/models/athb.js +17 -10
  214. package/lib/esm/models/clo_tout.js +9 -3
  215. package/lib/esm/models/cooling_effect.js +14 -8
  216. package/lib/esm/models/e_pmv.js +10 -4
  217. package/lib/esm/models/heat_index.js +9 -6
  218. package/lib/esm/models/index.js +33 -27
  219. package/lib/esm/models/net.js +10 -5
  220. package/lib/esm/models/pet_steady.js +24 -14
  221. package/lib/esm/models/phs.js +118 -54
  222. package/lib/esm/models/pmv_ppd.js +3 -2
  223. package/lib/esm/models/pmv_ppd_ashrae.js +47 -0
  224. package/lib/esm/models/pmv_ppd_iso.js +48 -0
  225. package/lib/esm/models/set_tmp.js +11 -6
  226. package/lib/esm/models/solar_gain.js +9 -10
  227. package/lib/esm/models/two_nodes.js +4 -1
  228. package/lib/esm/models/utci.js +2 -2
  229. package/lib/esm/models/vertical_tmp_grad_ppd.js +6 -6
  230. package/lib/esm/models/wbgt.js +9 -4
  231. package/lib/esm/supa.js +62 -0
  232. package/lib/esm/types/jos3_functions/JOS3Defaults.d.ts +27 -0
  233. package/lib/esm/types/jos3_functions/JOS3Defaults.d.ts.map +1 -0
  234. package/lib/esm/types/jos3_functions/bfb_rate.d.ts +13 -0
  235. package/lib/esm/types/jos3_functions/bfb_rate.d.ts.map +1 -0
  236. package/lib/esm/types/jos3_functions/bsa_rate.d.ts +15 -0
  237. package/lib/esm/types/jos3_functions/bsa_rate.d.ts.map +1 -0
  238. package/lib/esm/types/jos3_functions/capacity.d.ts +19 -0
  239. package/lib/esm/types/jos3_functions/capacity.d.ts.map +1 -0
  240. package/lib/esm/types/jos3_functions/conductance.d.ts +13 -0
  241. package/lib/esm/types/jos3_functions/conductance.d.ts.map +1 -0
  242. package/lib/esm/types/jos3_functions/local_bsa.d.ts +19 -0
  243. package/lib/esm/types/jos3_functions/local_bsa.d.ts.map +1 -0
  244. package/lib/esm/types/jos3_functions/matrix.d.ts +63 -0
  245. package/lib/esm/types/jos3_functions/matrix.d.ts.map +1 -0
  246. package/lib/esm/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts +33 -0
  247. package/lib/esm/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts.map +1 -0
  248. package/lib/esm/types/jos3_functions/thermoregulation/basal_met.d.ts +13 -0
  249. package/lib/esm/types/jos3_functions/thermoregulation/basal_met.d.ts.map +1 -0
  250. package/lib/esm/types/jos3_functions/thermoregulation/clo_area_factor.d.ts +9 -0
  251. package/lib/esm/types/jos3_functions/thermoregulation/clo_area_factor.d.ts.map +1 -0
  252. package/lib/esm/types/jos3_functions/thermoregulation/conv_coef.d.ts +16 -0
  253. package/lib/esm/types/jos3_functions/thermoregulation/conv_coef.d.ts.map +1 -0
  254. package/lib/esm/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts +37 -0
  255. package/lib/esm/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts.map +1 -0
  256. package/lib/esm/types/jos3_functions/thermoregulation/dry_r.d.ts +12 -0
  257. package/lib/esm/types/jos3_functions/thermoregulation/dry_r.d.ts.map +1 -0
  258. package/lib/esm/types/jos3_functions/thermoregulation/error_signals.d.ts +27 -0
  259. package/lib/esm/types/jos3_functions/thermoregulation/error_signals.d.ts.map +1 -0
  260. package/lib/esm/types/jos3_functions/thermoregulation/evaporation.d.ts +46 -0
  261. package/lib/esm/types/jos3_functions/thermoregulation/evaporation.d.ts.map +1 -0
  262. package/lib/esm/types/jos3_functions/thermoregulation/fixed_hc.d.ts +5 -0
  263. package/lib/esm/types/jos3_functions/thermoregulation/fixed_hc.d.ts.map +1 -0
  264. package/lib/esm/types/jos3_functions/thermoregulation/fixed_hr.d.ts +9 -0
  265. package/lib/esm/types/jos3_functions/thermoregulation/fixed_hr.d.ts.map +1 -0
  266. package/lib/esm/types/jos3_functions/thermoregulation/local_mbase.d.ts +14 -0
  267. package/lib/esm/types/jos3_functions/thermoregulation/local_mbase.d.ts.map +1 -0
  268. package/lib/esm/types/jos3_functions/thermoregulation/local_q_work.d.ts +12 -0
  269. package/lib/esm/types/jos3_functions/thermoregulation/local_q_work.d.ts.map +1 -0
  270. package/lib/esm/types/jos3_functions/thermoregulation/nonshivering.d.ts +16 -0
  271. package/lib/esm/types/jos3_functions/thermoregulation/nonshivering.d.ts.map +1 -0
  272. package/lib/esm/types/jos3_functions/thermoregulation/operative_temp.d.ts +13 -0
  273. package/lib/esm/types/jos3_functions/thermoregulation/operative_temp.d.ts.map +1 -0
  274. package/lib/esm/types/jos3_functions/thermoregulation/rad_coef.d.ts +10 -0
  275. package/lib/esm/types/jos3_functions/thermoregulation/rad_coef.d.ts.map +1 -0
  276. package/lib/esm/types/jos3_functions/thermoregulation/resp_heat_loss.d.ts +27 -0
  277. package/lib/esm/types/jos3_functions/thermoregulation/resp_heat_loss.d.ts.map +1 -0
  278. package/lib/esm/types/jos3_functions/thermoregulation/shivering.d.ts +27 -0
  279. package/lib/esm/types/jos3_functions/thermoregulation/shivering.d.ts.map +1 -0
  280. package/lib/esm/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts +15 -0
  281. package/lib/esm/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts.map +1 -0
  282. package/lib/esm/types/jos3_functions/thermoregulation/sum_bf.d.ts +15 -0
  283. package/lib/esm/types/jos3_functions/thermoregulation/sum_bf.d.ts.map +1 -0
  284. package/lib/esm/types/jos3_functions/thermoregulation/sum_m.d.ts +39 -0
  285. package/lib/esm/types/jos3_functions/thermoregulation/sum_m.d.ts.map +1 -0
  286. package/lib/esm/types/jos3_functions/thermoregulation/wet_r.d.ts +13 -0
  287. package/lib/esm/types/jos3_functions/thermoregulation/wet_r.d.ts.map +1 -0
  288. package/lib/esm/types/jos3_functions/validate_body_parameters.d.ts +12 -0
  289. package/lib/esm/types/jos3_functions/validate_body_parameters.d.ts.map +1 -0
  290. package/lib/esm/types/jos3_functions/weight_rate.d.ts +20 -0
  291. package/lib/esm/types/jos3_functions/weight_rate.d.ts.map +1 -0
  292. package/lib/esm/types/models/JOS3.d.ts +385 -0
  293. package/lib/esm/types/models/JOS3.d.ts.map +1 -0
  294. package/lib/esm/types/models/a_pmv.d.ts +15 -4
  295. package/lib/esm/types/models/a_pmv.d.ts.map +1 -1
  296. package/lib/esm/types/models/at.d.ts +14 -3
  297. package/lib/esm/types/models/at.d.ts.map +1 -1
  298. package/lib/esm/types/models/athb.d.ts +14 -3
  299. package/lib/esm/types/models/athb.d.ts.map +1 -1
  300. package/lib/esm/types/models/clo_tout.d.ts +13 -2
  301. package/lib/esm/types/models/clo_tout.d.ts.map +1 -1
  302. package/lib/esm/types/models/cooling_effect.d.ts +15 -4
  303. package/lib/esm/types/models/cooling_effect.d.ts.map +1 -1
  304. package/lib/esm/types/models/e_pmv.d.ts +15 -4
  305. package/lib/esm/types/models/e_pmv.d.ts.map +1 -1
  306. package/lib/esm/types/models/heat_index.d.ts +14 -3
  307. package/lib/esm/types/models/heat_index.d.ts.map +1 -1
  308. package/lib/esm/types/models/humidex.d.ts.map +1 -1
  309. package/lib/esm/types/models/index.d.ts +60 -54
  310. package/lib/esm/types/models/index.d.ts.map +1 -1
  311. package/lib/esm/types/models/net.d.ts +14 -3
  312. package/lib/esm/types/models/net.d.ts.map +1 -1
  313. package/lib/esm/types/models/pet_steady.d.ts +17 -3
  314. package/lib/esm/types/models/pet_steady.d.ts.map +1 -1
  315. package/lib/esm/types/models/phs.d.ts +34 -21
  316. package/lib/esm/types/models/phs.d.ts.map +1 -1
  317. package/lib/esm/types/models/pmv.d.ts +1 -1
  318. package/lib/esm/types/models/pmv_ppd.d.ts +1 -1
  319. package/lib/esm/types/models/pmv_ppd.d.ts.map +1 -1
  320. package/lib/esm/types/models/pmv_ppd_ashrae.d.ts +59 -0
  321. package/lib/esm/types/models/pmv_ppd_ashrae.d.ts.map +1 -0
  322. package/lib/esm/types/models/pmv_ppd_iso.d.ts +59 -0
  323. package/lib/esm/types/models/pmv_ppd_iso.d.ts.map +1 -0
  324. package/lib/esm/types/models/set_tmp.d.ts +14 -3
  325. package/lib/esm/types/models/set_tmp.d.ts.map +1 -1
  326. package/lib/esm/types/models/solar_gain.d.ts +3 -3
  327. package/lib/esm/types/models/solar_gain.d.ts.map +1 -1
  328. package/lib/esm/types/models/two_nodes.d.ts +3 -0
  329. package/lib/esm/types/models/two_nodes.d.ts.map +1 -1
  330. package/lib/esm/types/models/utci.d.ts +4 -1
  331. package/lib/esm/types/models/utci.d.ts.map +1 -1
  332. package/lib/esm/types/models/vertical_tmp_grad_ppd.d.ts +5 -5
  333. package/lib/esm/types/models/wbgt.d.ts +15 -4
  334. package/lib/esm/types/models/wbgt.d.ts.map +1 -1
  335. package/lib/esm/types/models/wc.d.ts.map +1 -1
  336. package/lib/esm/types/supa.d.ts +25 -0
  337. package/lib/esm/types/supa.d.ts.map +1 -0
  338. package/lib/esm/types/utilities/utilities.d.ts.map +1 -1
  339. package/package.json +21 -12
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  | **build** | [![build](https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/build.yml/badge.svg)][build_link] |
6
6
  | **tests** | [![test](https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/test.yml/badge.svg)][test_link] |
7
7
  | **page deployment** | [![page deployment](https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/pages/pages-build-deployment/badge.svg)][deploy_link] |
8
- | **snyk security** | [![synk](https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/snyk.yml/badge.svg)][synk_link] |
8
+ | **snyk security** | [![snyk](https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/snyk.yml/badge.svg)][snyk_link] |
9
9
  | **license** | [![license](https://custom-icon-badges.demolab.com/github/license/denvercoder1/custom-icon-badges?logo=law)](https://github.com/FedericoTartarini/jsthermalcomfort/blob/main/LICENSE) |
10
10
  | **npm version** | [![npm](https://img.shields.io/npm/v/jsthermalcomfort?style=plastic&logo=npm&logoColor=rgb)][npm_link] |
11
11
 
@@ -14,16 +14,16 @@ Package to calculate thermophysiological, thermal comfort, thermal stress indice
14
14
  Please cite us if you use this package: [Tartarini, F., Schiavon, S., 2020. pythermalcomfort: A Python package for thermal comfort research. SoftwareX 12, 100578. https://doi.org/10.1016/j.softx.2020.100578](https://www.sciencedirect.com/science/article/pii/S2352711020302910)
15
15
 
16
16
  - Free software: MIT license
17
- - Authors: [Omar Jesus Acuache Briceno](https://www.linkedin.com/in/omar-acuache), [Ruoshui Chen](https://github.com/ChristinChen233), [Jingyu Lu](https://github.com/Lu-Whale), [Yuchen Mu](https://github.com/YuchenMu), [Jordan Ocokoljic](https://github.com/JordanOcokoljic), [Santiago Zaldivar del Alba​](https://github.com/szaldivar), [Federico Tartarini](https://www.linkedin.com/in/federico-tartarini/), [Stefano Schiavon](https://www.linkedin.com/in/stefanoschiavon/), [Ollie Jay](https://www.linkedin.com/in/ollie-jay-793a1b11/)
17
+ - Authors: [Federico Tartarini](https://www.linkedin.com/in/federico-tartarini/), [Omar Jesus Acuache Briceno](https://www.linkedin.com/in/omar-acuache), [Ruoshui Chen](https://github.com/ChristinChen233), [Jingyu Lu](https://github.com/Lu-Whale), [Yuchen Mu](https://github.com/YuchenMu), [Jordan Ocokoljic](https://github.com/JordanOcokoljic), [Santiago Zaldivar del Alba​](https://github.com/szaldivar), [Stefano Schiavon](https://www.linkedin.com/in/stefanoschiavon/), [Ollie Jay](https://www.linkedin.com/in/ollie-jay-793a1b11/)
18
18
 
19
19
  [docs_link]: https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/test_docs.yml
20
20
  [build_link]: https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/build.yml
21
21
  [test_link]: https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/test.yml
22
22
  [deploy_link]: https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/pages/pages-build-deployment
23
- [synk_link]: https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/snyk.yml
23
+ [snyk_link]: https://github.com/FedericoTartarini/jsthermalcomfort/actions/workflows/snyk.yml
24
24
  [npm_link]: https://www.npmjs.com/package/jsthermalcomfort
25
25
 
26
- # Documentation
26
+ # Official Documentation Website
27
27
 
28
28
  [https://federicotartarini.github.io/jsthermalcomfort/](https://federicotartarini.github.io/jsthermalcomfort/)
29
29
 
@@ -35,7 +35,7 @@ npm install jsthermalcomfort
35
35
 
36
36
  If you want to use jsthermalcomfort package without installing it on your local machine, you can import with:
37
37
 
38
- [`https://cdn.jsdelivr.net/gh/FedericoTartarini/jsthermalcomfort/lib/esm/`](https://cdn.jsdelivr.net/gh/FedericoTartarini/jsthermalcomfort/lib/esm/)
38
+ [`https://cdn.jsdelivr.net/npm/jsthermalcomfort/lib/esm/`](https://cdn.jsdelivr.net/npm/jsthermalcomfort/lib/esm/)
39
39
 
40
40
  Example:
41
41
 
@@ -44,7 +44,7 @@ import {
44
44
  models,
45
45
  utilities,
46
46
  pschymetrics,
47
- } from "https://cdn.jsdelivr.net/gh/FedericoTartarini/jsthermalcomfort/lib/esm/index.js";
47
+ } from "https://cdn.jsdelivr.net/npm/jsthermalcomfort/lib/esm/index.js";
48
48
  ```
49
49
 
50
50
  You can also import it in the website directly, and caution that you need to mark the script as module:
@@ -55,13 +55,13 @@ You can also import it in the website directly, and caution that you need to mar
55
55
  models,
56
56
  utilities,
57
57
  pschymetrics,
58
- } from "https://cdn.jsdelivr.net/gh/FedericoTartarini/jsthermalcomfort/lib/esm/index.js";
58
+ } from "https://cdn.jsdelivr.net/npm/jsthermalcomfort/lib/esm/index.js";
59
59
  </script>
60
60
  ```
61
61
 
62
62
  # Examples and Tutorials
63
63
 
64
- ## [Examples](https://github.com/FedericoTartarini/jsthermalcomfort/tree/main/docs/examples) files on how to use some of the functions
64
+ We developed a few [examples](https://github.com/FedericoTartarini/jsthermalcomfort/tree/main/docs/examples) files on how to use some of the functions.
65
65
 
66
66
  Here is a list of examples running in the browser:
67
67
 
@@ -98,19 +98,18 @@ If you are proposing a feature:
98
98
  - Keep the scope as narrow as possible, to make it easier to implement.
99
99
  - Remember that this is a volunteer-driven project, and that code contributions are welcome :)
100
100
 
101
- ## Development
101
+ ## Local development
102
102
 
103
103
  To set up jsthermalcomfort for local development:
104
104
 
105
105
  1. Fork jsthermalcomfort (look for the “Fork” button).
106
- 2. Clone your fork locally. Fetch and pull all the updates from the master branch before you do anything:
106
+ 2. Clone your fork locally. Fetch and pull all the updates from the main branch before you do anything:
107
107
 
108
108
  ```bash
109
109
  git clone git@github.com:FedericoTartarini/jsthermalcomfort.git
110
110
  ```
111
111
 
112
112
  3. Create a branch for local development. The naming rule for new branch are, as follows:
113
-
114
113
  - If this update is for a new feature Feature/feature_name_here
115
114
  - If this update is for bug fix Fix/bug_name_here
116
115
  - If this update is for documentation Documentation/doc_name_here
@@ -124,7 +123,6 @@ To set up jsthermalcomfort for local development:
124
123
  Now you can make your changes locally.
125
124
 
126
125
  4. When you’re done making changes run all tests using Jest:
127
-
128
126
  - Install dependencies
129
127
 
130
128
  ```bash
@@ -141,6 +139,15 @@ To set up jsthermalcomfort for local development:
141
139
  npm run format
142
140
  ```
143
141
 
142
+ - A pre-commit hook now runs automatically on every commit and executes:
143
+
144
+ ```bash
145
+ npm run check:format
146
+ npm run build
147
+ npm test
148
+ ```
149
+
150
+ If one of these checks fails, the commit is blocked until the issue is fixed.
144
151
  - Commit your changes:
145
152
 
146
153
  ```bash
@@ -182,12 +189,21 @@ For merging, you should:
182
189
  - Include passing tests (run `npm run test`).
183
190
  - Update documentation when there’s new API, functionality etc.
184
191
 
185
- ### Documentation
192
+ ## Documentation
186
193
 
187
194
  We are using [JSDoc](https://jsdoc.app/) and [documentation.js](https://github.com/documentationjs/documentation) to
188
195
  automatically build the documentation.
189
196
 
190
- ### To add a function
197
+ All the files needed to generate the documentation can be found in the `docs_theme` repository.
198
+ After updating the Markdown files, please run the command:
199
+
200
+ ```bash
201
+ npm run docs
202
+ ```
203
+
204
+ Please ignore the `docs` folder, this folder contains all the files generated by the above command.
205
+
206
+ ## How to add a new model to jsthermalcomfort
191
207
 
192
208
  1. Add a file under `src/models/` with the name of the function/model and document it.
193
209
  2. Add any related functions that are used by your function either in `src/utilities/utilities.js`
@@ -197,20 +213,17 @@ automatically build the documentation.
197
213
  proper name for the documentation with `@docname`, for example: `@docname Clothing prediction`. It is important to
198
214
  note that you should also add the `@public` tag to any types the function exposes/uses.
199
215
  3. Test your function by writing a test in `tests/models/<name_of_model>.test.js`.
216
+ 4. To run a subset of tests you can do the following:
200
217
 
201
- ### Tips
202
-
203
- To run a subset of tests you can do the following:
204
-
205
- ```bash
206
- npm run test -- '<path_to_test_file>' -t '<test_pattern/name>'
207
- ```
218
+ ```bash
219
+ npm run test -- '<path_to_test_file>' -t '<test_pattern/name>'
220
+ ```
208
221
 
209
222
  If you are using VSCode you can use
210
223
  the [Jest Runner extension](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) to easily
211
224
  run subset of tests.
212
225
 
213
- ### Releases
226
+ ## How to publish a new version of jsthermalcomfort
214
227
 
215
228
  To create a new release do the following:
216
229
 
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const JOS3Defaults = {
4
+ // Body information
5
+ height: 1.72, // [m]
6
+ weight: 74.43, // [kg]
7
+ age: 20, // [-]
8
+ body_fat: 15, // [%]
9
+ cardiac_index: 2.59, // [L/min/m2]
10
+ blood_flow_rate: 290, // [L/h]
11
+ physical_activity_ratio: 1.25, // [-]
12
+ metabolic_rate: 1.0, // [met]
13
+ sex: "male",
14
+ posture: "standing",
15
+ bmr_equation: "harris-benedict",
16
+ bsa_equation: "dubois",
17
+ local_bsa: [
18
+ 0.11, 0.029, 0.175, 0.161, 0.221, 0.096, 0.063, 0.05, 0.096, 0.063, 0.05,
19
+ 0.209, 0.112, 0.056, 0.209, 0.112, 0.056,
20
+ ], // body surface area [m2]
21
+ // Environment information
22
+ core_temperature: 37, // [°C]
23
+ skin_temperature: 34, // [°C]
24
+ other_body_temperature: 36, // [°C]
25
+ dry_bulb_air_temperature: 28.8, // [°C]
26
+ mean_radiant_temperature: 28.8, // [°C]
27
+ relative_humidity: 50, // [%]
28
+ air_speed: 0.1, // [m/s]
29
+ // Clothing information
30
+ clothing_insulation: 0, // [clo]
31
+ clothing_vapor_permeation_efficiency: 0.45, // [-]
32
+ lewis_rate: 16.5, // [K/kPa]
33
+ };
34
+ exports.default = JOS3Defaults;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.bfb_rate = bfb_rate;
40
+ const JOS3Defaults_js_1 = __importDefault(require("./JOS3Defaults.js"));
41
+ const bsa_rate_js_1 = require("./bsa_rate.js");
42
+ const validate_body_parameters_js_1 = require("./validate_body_parameters.js");
43
+ const math = __importStar(require("mathjs"));
44
+ /**
45
+ * Calculate the ratio of basal blood flow (BFB) of the standard body (290 L/h).
46
+ *
47
+ * @param {number} height - Body height [m]. The default is 1.72.
48
+ * @param {number} weight - Body weight [kg]. The default is 74.43.
49
+ * @param {string} bsa_equation - The equation name of bsa calculation. Choose a name from "dubois", "takahira", "fujimoto", or "kurazumi". The default is "dubois".
50
+ * @param {number} age - age [years]. The default is 20.
51
+ * @param {number} ci - Cardiac index [L/min/㎡]. The default is 2.59.
52
+ *
53
+ * @returns {number} - Basal blood flow rate.
54
+ */
55
+ function bfb_rate(height = JOS3Defaults_js_1.default.height, weight = JOS3Defaults_js_1.default.weight, bsa_equation = JOS3Defaults_js_1.default.bsa_equation, age = JOS3Defaults_js_1.default.age, ci = JOS3Defaults_js_1.default.cardiac_index) {
56
+ (0, validate_body_parameters_js_1.validate_body_parameters)(height, weight, age);
57
+ ci *= 60;
58
+ if (age < 50) {
59
+ ci *= 1;
60
+ }
61
+ else if (age < 60) {
62
+ ci *= 0.85;
63
+ }
64
+ else if (age < 70) {
65
+ ci *= 0.75;
66
+ }
67
+ else {
68
+ // age >= 70
69
+ ci *= 0.7;
70
+ }
71
+ const bfb_all = ci *
72
+ (0, bsa_rate_js_1.bsa_rate)(height, weight, bsa_equation) *
73
+ math.sum(JOS3Defaults_js_1.default.local_bsa);
74
+ return bfb_all / JOS3Defaults_js_1.default.blood_flow_rate;
75
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.bsa_rate = bsa_rate;
7
+ const JOS3Defaults_js_1 = __importDefault(require("../jos3_functions/JOS3Defaults.js"));
8
+ const validate_body_parameters_js_1 = require("./validate_body_parameters.js");
9
+ const utilities_js_1 = require("../utilities/utilities.js");
10
+ /**
11
+ * Calculates the body surface area rate based on the given height, weight and
12
+ * BSA equation.
13
+ *
14
+ * @param {number} [height=JOS3Defaults.height] - The height of the person in
15
+ * meters.
16
+ * @param {number} [weight=JOS3Defaults.weight] - The weight of the person in
17
+ * kilograms.
18
+ * @param {string} [bsa_equation=JOS3Defaults.bsa_equation] - The BSA equation
19
+ * to use for calculation.
20
+ *
21
+ * @returns {number} The body surface area rate.
22
+ */
23
+ function bsa_rate(height = JOS3Defaults_js_1.default.height, weight = JOS3Defaults_js_1.default.weight, bsa_equation = JOS3Defaults_js_1.default.bsa_equation) {
24
+ (0, validate_body_parameters_js_1.validate_body_parameters)(height, weight, bsa_equation);
25
+ const bsa_all = (0, utilities_js_1.body_surface_area)(weight, height, bsa_equation);
26
+ return bsa_all / JOS3Defaults_js_1.default.local_bsa.reduce((t, c) => t + c, 0);
27
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.capacity = capacity;
7
+ const JOS3Defaults_js_1 = __importDefault(require("./JOS3Defaults.js"));
8
+ const validate_body_parameters_js_1 = require("./validate_body_parameters.js");
9
+ const bfb_rate_js_1 = require("./bfb_rate.js");
10
+ const weight_rate_js_1 = require("./weight_rate.js");
11
+ const matrix_js_1 = require("./matrix.js");
12
+ /**
13
+ * Calculate thermal capacity in Joules per Kelvin (J/K).
14
+ * Derived from Yokoyama's model, assuming blood's heat as 1.0 [kcal/L.K].
15
+ *
16
+ * @param {number} [height=JOS3Defaults.height] - Body height in meters. Default
17
+ * is 1.72.
18
+ * @param {number} [weight=JOS3Defaults.weight] - Body weight in kg. Default is
19
+ * 74.43.
20
+ * @param {string} [bsa_equation=JOS3Defaults.bsa_equation] - Equation name for
21
+ * bsa calc. Must be from "dubois","takahira", "fujimoto", "kurazumi".
22
+ * Default is "dubois".
23
+ * @param {number} [age=JOS3Defaults.age] - Age in years. Default is 20.
24
+ * @param {number} [ci=JOS3Defaults.cardiac_index] - Cardiac index in L/min/㎡.
25
+ * Default is 2.59.
26
+
27
+ * @returns {number[]} - Thermal capacity in W/K. Shape is (NUM_NODES).
28
+ */
29
+ function capacity(height = JOS3Defaults_js_1.default.height, weight = JOS3Defaults_js_1.default.weight, bsa_equation = JOS3Defaults_js_1.default.bsa_equation, age = JOS3Defaults_js_1.default.age, ci = JOS3Defaults_js_1.default.cardiac_index) {
30
+ (0, validate_body_parameters_js_1.validate_body_parameters)(height, weight, age);
31
+ // artery [Wh/K]
32
+ let cap_art = [
33
+ 0.096, 0.025, 0.12, 0.111, 0.265, 0.0186, 0.0091, 0.0044, 0.0186, 0.0091,
34
+ 0.0044, 0.0813, 0.04, 0.0103, 0.0813, 0.04, 0.0103,
35
+ ];
36
+ // vein [Wh/K]
37
+ let cap_vein = [
38
+ 0.321, 0.085, 0.424, 0.39, 0.832, 0.046, 0.024, 0.01, 0.046, 0.024, 0.01,
39
+ 0.207, 0.1, 0.024, 0.207, 0.1, 0.024,
40
+ ];
41
+ // superficial vein [Wh/K]
42
+ let cap_sfv = [
43
+ 0, 0, 0, 0, 0, 0.025, 0.015, 0.011, 0.025, 0.015, 0.011, 0.074, 0.05, 0.021,
44
+ 0.074, 0.05, 0.021,
45
+ ];
46
+ // central blood [Wh/K]
47
+ let cap_cb = 1.999;
48
+ // core [Wh/K]
49
+ let cap_cr = [
50
+ 1.7229, 0.564, 10.2975, 9.3935, 4.488, 1.6994, 1.1209, 0.1536, 1.6994,
51
+ 1.1209, 0.1536, 5.3117, 2.867, 0.2097, 5.3117, 2.867, 0.2097,
52
+ ];
53
+ // muscle [Wh/K]
54
+ let cap_ms = [
55
+ 0.305, 0.0, 0.0, 0.0, 7.409, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
56
+ 0.0, 0.0, 0.0,
57
+ ];
58
+ // fat [Wh/K]
59
+ let cap_fat = [
60
+ 0.203, 0.0, 0.0, 0.0, 1.947, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
61
+ 0.0, 0.0, 0.0,
62
+ ];
63
+ // skin [Wh/K]
64
+ let cap_sk = [
65
+ 0.1885, 0.058, 0.441, 0.406, 0.556, 0.126, 0.084, 0.088, 0.126, 0.084,
66
+ 0.088, 0.334, 0.169, 0.107, 0.334, 0.169, 0.107,
67
+ ];
68
+ // Changes the values based on the standard body
69
+ const bfbr = (0, bfb_rate_js_1.bfb_rate)(height, weight, bsa_equation, age, ci);
70
+ const wr = (0, weight_rate_js_1.weight_rate)(weight);
71
+ cap_art = cap_art.map((x) => x * bfbr);
72
+ cap_vein = cap_vein.map((x) => x * bfbr);
73
+ cap_sfv = cap_sfv.map((x) => x * bfbr);
74
+ cap_cb = cap_cb * bfbr;
75
+ cap_cr = cap_cr.map((x) => x * wr);
76
+ cap_ms = cap_ms.map((x) => x * wr);
77
+ cap_fat = cap_fat.map((x) => x * wr);
78
+ cap_sk = cap_sk.map((x) => x * wr);
79
+ let cap_whole = Array(matrix_js_1.NUM_NODES).fill(0);
80
+ cap_whole[0] = cap_cb;
81
+ for (let i = 0; i < matrix_js_1.BODY_NAMES.length; i++) {
82
+ // Dictionary of indices in each body segment
83
+ // key = layer name, value = index of matrix
84
+ let bn = matrix_js_1.BODY_NAMES[i];
85
+ let index_of = matrix_js_1.IDICT[bn];
86
+ // Common
87
+ cap_whole[index_of["artery"]] = cap_art[i];
88
+ cap_whole[index_of["vein"]] = cap_vein[i];
89
+ cap_whole[index_of["core"]] = cap_cr[i];
90
+ cap_whole[index_of["skin"]] = cap_sk[i];
91
+ // Only limbs
92
+ if (i >= 5) {
93
+ cap_whole[index_of["sfvein"]] = cap_sfv[i];
94
+ }
95
+ // If the segment has a muscle or fat layer
96
+ if (index_of["muscle"] !== null || index_of["fat"] !== null) {
97
+ cap_whole[index_of["muscle"]] = cap_ms[i];
98
+ cap_whole[index_of["fat"]] = cap_fat[i];
99
+ }
100
+ }
101
+ return cap_whole.map((x) => x * 3600);
102
+ }
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.conductance = conductance;
40
+ const JOS3Defaults_js_1 = __importDefault(require("./JOS3Defaults.js"));
41
+ const validate_body_parameters_js_1 = require("./validate_body_parameters.js");
42
+ const weight_rate_js_1 = require("./weight_rate.js");
43
+ const bsa_rate_js_1 = require("./bsa_rate.js");
44
+ const matrix_js_1 = require("./matrix.js");
45
+ const math = __importStar(require("mathjs"));
46
+ /**
47
+ * Calculate thermal conductance between layers.
48
+
49
+ * @param {number} height - Body height in [m]. Default is 1.72.
50
+ * @param {number} weight - Body weight in [kg]. Default is 74.43.
51
+ * @param {string} bsa_equation - The equation name (str) of bsa calculation. Choose a name from "dubois", "takahira", "fujimoto", or "kurazumi". Default is "dubois".
52
+ * @param {number} fat - Body fat rate in [%]. Default is 15.
53
+
54
+ * @returns {math.Matrix} conductance - Thermal conductance between layers in [W/K]. The shape is (NUM_NODES, NUM_NODES).
55
+ */
56
+ function conductance(height = JOS3Defaults_js_1.default.height, weight = JOS3Defaults_js_1.default.weight, bsa_equation = JOS3Defaults_js_1.default.bsa_equation, fat = JOS3Defaults_js_1.default.body_fat) {
57
+ (0, validate_body_parameters_js_1.validate_body_parameters)(height, weight, undefined, fat);
58
+ let cdt_cr_sk;
59
+ if (fat < 12.5) {
60
+ cdt_cr_sk = math.matrix([
61
+ 1.341, 0.93, 1.879, 1.729, 2.37, 1.557, 1.018, 2.21, 1.557, 1.018, 2.21,
62
+ 2.565, 1.378, 3.404, 2.565, 1.378, 3.404,
63
+ ]);
64
+ }
65
+ else if (fat < 17.5) {
66
+ cdt_cr_sk = math.matrix([
67
+ 1.311, 0.909, 1.785, 1.643, 2.251, 1.501, 0.982, 2.183, 1.501, 0.982,
68
+ 2.183, 2.468, 1.326, 3.37, 2.468, 1.326, 3.37,
69
+ ]);
70
+ }
71
+ else if (fat < 22.5) {
72
+ cdt_cr_sk = math.matrix([
73
+ 1.282, 0.889, 1.698, 1.563, 2.142, 1.448, 0.947, 2.156, 1.448, 0.947,
74
+ 2.156, 2.375, 1.276, 3.337, 2.375, 1.276, 3.337,
75
+ ]);
76
+ }
77
+ else if (fat < 27.5) {
78
+ cdt_cr_sk = math.matrix([
79
+ 1.255, 0.87, 1.618, 1.488, 2.04, 1.396, 0.913, 2.13, 1.396, 0.913, 2.13,
80
+ 2.285, 1.227, 3.304, 2.285, 1.227, 3.304,
81
+ ]);
82
+ }
83
+ else {
84
+ // fat >= 27.5
85
+ cdt_cr_sk = math.matrix([
86
+ 1.227, 0.852, 1.542, 1.419, 1.945, 1.346, 0.88, 1.945, 1.346, 0.88, 1.945,
87
+ 2.198, 1.181, 3.271, 2.198, 1.181, 3.271,
88
+ ]);
89
+ }
90
+ let cdt_cr_ms = math.zeros(17); // core to muscle [W/K]
91
+ let cdt_ms_fat = math.zeros(17); // muscle to fat [W/K]
92
+ let cdt_fat_sk = math.zeros(17); // fat to skin [W/K]
93
+ // head and pelvis consists of 65MN's conductances
94
+ cdt_cr_ms.set([0], 1.601); // head
95
+ cdt_ms_fat.set([0], 13.222);
96
+ cdt_fat_sk.set([0], 16.008);
97
+ cdt_cr_ms.set([4], 3.0813); // pelvis
98
+ cdt_ms_fat.set([4], 10.3738);
99
+ cdt_fat_sk.set([4], 41.4954);
100
+ // vessel to core
101
+ // The shape is a cylinder.
102
+ // It is assumed that the inner is vascular radius, 2.5mm and the outer is
103
+ // stolwijk's core radius.
104
+ // The heat transfer coefficient of the core is assumed as the Michel's
105
+ // counter-flow model 0.66816 [W/(m・K)].
106
+ let cdt_ves_cr = math.matrix([
107
+ 0, 0, 0, 0, 0, 0.586, 0.383, 1.534, 0.586, 0.383, 1.534, 0.81, 0.435, 1.816,
108
+ 0.81, 0.435, 1.816,
109
+ ]);
110
+ // superficial vein to skin
111
+ let cdt_sfv_sk = math.matrix([
112
+ 0, 0, 0, 0, 0, 57.735, 37.768, 16.634, 57.735, 37.768, 16.634, 102.012,
113
+ 54.784, 24.277, 102.012, 54.784, 24.277,
114
+ ]);
115
+ // art to vein (counter-flow) [W/K]
116
+ // The data has been derived Mitchell's model.
117
+ // The values = 15.869 [W/(m・K)] * the segment length [m]
118
+ let cdt_art_vein = math.matrix([
119
+ 0, 0, 0, 0, 0, 0.537, 0.351, 0.762, 0.537, 0.351, 0.762, 0.826, 0.444,
120
+ 0.992, 0.826, 0.444, 0.992,
121
+ ]);
122
+ // Changes values by body size based on the standard body.
123
+ const wr = (0, weight_rate_js_1.weight_rate)(weight);
124
+ const bsar = (0, bsa_rate_js_1.bsa_rate)(height, weight, bsa_equation);
125
+ const adjustSphere = (matrix, range) => {
126
+ let index = math.index(math.range(0, 2));
127
+ let subset = math.subset(matrix, index);
128
+ subset = math.dotDivide(math.dotMultiply(subset, wr), bsar);
129
+ return math.subset(matrix, index, subset);
130
+ };
131
+ const adjustCylinder = (matrix) => {
132
+ let index = math.index(math.range(2, matrix.size()[0]));
133
+ let subset = math.subset(matrix, index);
134
+ subset = math.dotDivide(math.dotMultiply(subset, Math.pow(bsar, 2)), wr);
135
+ return math.subset(matrix, index, subset);
136
+ };
137
+ // head, neck (Sphere shape)
138
+ cdt_cr_sk = adjustSphere(cdt_cr_sk);
139
+ cdt_cr_ms = adjustSphere(cdt_cr_ms);
140
+ cdt_ms_fat = adjustSphere(cdt_ms_fat);
141
+ cdt_fat_sk = adjustSphere(cdt_fat_sk);
142
+ cdt_ves_cr = adjustSphere(cdt_ves_cr);
143
+ cdt_sfv_sk = adjustSphere(cdt_sfv_sk);
144
+ cdt_art_vein = adjustSphere(cdt_art_vein);
145
+ // Others (Cylinder shape)
146
+ cdt_cr_sk = adjustCylinder(cdt_cr_sk);
147
+ cdt_cr_ms = adjustCylinder(cdt_cr_ms);
148
+ cdt_ms_fat = adjustCylinder(cdt_ms_fat);
149
+ cdt_fat_sk = adjustCylinder(cdt_fat_sk);
150
+ cdt_ves_cr = adjustCylinder(cdt_ves_cr);
151
+ cdt_sfv_sk = adjustCylinder(cdt_sfv_sk);
152
+ cdt_art_vein = adjustCylinder(cdt_art_vein);
153
+ const cdt_whole = math.zeros(matrix_js_1.NUM_NODES, matrix_js_1.NUM_NODES);
154
+ for (let i = 0; i < matrix_js_1.BODY_NAMES.length; i++) {
155
+ const bn = matrix_js_1.BODY_NAMES[i];
156
+ // Dictionary of indices in each body segment
157
+ // key = layer name, value = index of matrix
158
+ const index_of = matrix_js_1.IDICT[bn];
159
+ // Common
160
+ cdt_whole.set([index_of["artery"], index_of["vein"]], cdt_art_vein.get([i])); // art to vein
161
+ cdt_whole.set([index_of["artery"], index_of["core"]], cdt_ves_cr.get([i])); // art to cr
162
+ cdt_whole.set([index_of["vein"], index_of["core"]], cdt_ves_cr.get([i])); // vein to cr
163
+ // Only limbs
164
+ if (i >= 5) {
165
+ cdt_whole.set([index_of["sfvein"], index_of["skin"]], cdt_sfv_sk.get([i])); // sfv to sk
166
+ }
167
+ // If the segment has a muscle or fat layer
168
+ if (index_of["muscle"] !== null) {
169
+ // or not indexof["fat"] is None
170
+ cdt_whole.set([index_of["core"], index_of["muscle"]], cdt_cr_ms.get([i])); // cr to ms
171
+ cdt_whole.set([index_of["muscle"], index_of["fat"]], cdt_ms_fat.get([i])); // ms to fat
172
+ cdt_whole.set([index_of["fat"], index_of["skin"]], cdt_fat_sk.get([i])); // fat to sk
173
+ }
174
+ else {
175
+ cdt_whole.set([index_of["core"], index_of["skin"]], cdt_cr_sk.get([i])); // cr to sk
176
+ }
177
+ }
178
+ // Creates a symmetrical matrix
179
+ return math.add(cdt_whole, math.transpose(cdt_whole));
180
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.local_bsa = local_bsa;
40
+ const JOS3Defaults_js_1 = __importDefault(require("./JOS3Defaults.js"));
41
+ const validate_body_parameters_js_1 = require("./validate_body_parameters.js");
42
+ const bsa_rate_js_1 = require("./bsa_rate.js");
43
+ const math = __importStar(require("mathjs"));
44
+ /**
45
+ * Calculate local body surface area (bsa) [m2].
46
+ *
47
+ * The local body surface area has been derived from 65MN.
48
+ * The head have been divided to head and neck based on Smith's model.
49
+ * head = 0.1396*0.1117/0.1414 (65MN_Head * Smith_Head / Smith_Head+neck)
50
+ * neck = 0.1396*0.0297/0.1414 (65MN_Head * Smith_Neck / Smith_Head+neck)
51
+ *
52
+ * @param {number} [height=JOS3Defaults.height] - Body height [m]
53
+ * @param {number} [weight=JOS3Defaults.weight] - Body weight [kg]
54
+ * @param {string} [bsa_equation=JOS3Defaults.bsa_equation] - The equation name
55
+ * of bsa calculation. Choose a name from "dubois", "takahira", "fujimoto",
56
+ * or "kurazumi".
57
+ *
58
+ * @returns {math.Matrix} local_bsa of length 17 - Local body surface area (bsa) [m2]
59
+ */
60
+ function local_bsa(height = JOS3Defaults_js_1.default.height, weight = JOS3Defaults_js_1.default.weight, bsa_equation = JOS3Defaults_js_1.default.bsa_equation) {
61
+ (0, validate_body_parameters_js_1.validate_body_parameters)(height, weight);
62
+ const bsa = (0, bsa_rate_js_1.bsa_rate)(height, weight, bsa_equation);
63
+ return math.matrix(math.dotMultiply(JOS3Defaults_js_1.default.local_bsa, bsa));
64
+ }