jsthermalcomfort 0.1.5 → 0.2.0
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.
- package/README.md +26 -14
- package/lib/cjs/jos3_functions/JOS3Defaults.js +34 -0
- package/lib/cjs/jos3_functions/bfb_rate.js +66 -0
- package/lib/cjs/jos3_functions/bsa_rate.js +28 -0
- package/lib/cjs/jos3_functions/capacity.js +103 -0
- package/lib/cjs/jos3_functions/conductance.js +171 -0
- package/lib/cjs/jos3_functions/local_bsa.js +55 -0
- package/lib/cjs/jos3_functions/matrix.js +341 -0
- package/lib/cjs/jos3_functions/thermoregulation/ava_blood_flow.js +75 -0
- package/lib/cjs/jos3_functions/thermoregulation/basal_met.js +55 -0
- package/lib/cjs/jos3_functions/thermoregulation/clo_area_factor.js +14 -0
- package/lib/cjs/jos3_functions/thermoregulation/conv_coef.js +127 -0
- package/lib/cjs/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.js +86 -0
- package/lib/cjs/jos3_functions/thermoregulation/dry_r.js +47 -0
- package/lib/cjs/jos3_functions/thermoregulation/error_signals.js +55 -0
- package/lib/cjs/jos3_functions/thermoregulation/evaporation.js +94 -0
- package/lib/cjs/jos3_functions/thermoregulation/fixed_hc.js +42 -0
- package/lib/cjs/jos3_functions/thermoregulation/fixed_hr.js +43 -0
- package/lib/cjs/jos3_functions/thermoregulation/local_mbase.js +70 -0
- package/lib/cjs/jos3_functions/thermoregulation/local_q_work.js +48 -0
- package/lib/cjs/jos3_functions/thermoregulation/nonshivering.js +95 -0
- package/lib/cjs/jos3_functions/thermoregulation/operative_temp.js +42 -0
- package/lib/cjs/jos3_functions/thermoregulation/rad_coef.js +74 -0
- package/lib/cjs/jos3_functions/thermoregulation/resp_heat_loss.js +24 -0
- package/lib/cjs/jos3_functions/thermoregulation/shivering.js +133 -0
- package/lib/cjs/jos3_functions/thermoregulation/skin_blood_flow.js +75 -0
- package/lib/cjs/jos3_functions/thermoregulation/sum_bf.js +50 -0
- package/lib/cjs/jos3_functions/thermoregulation/sum_m.js +66 -0
- package/lib/cjs/jos3_functions/thermoregulation/wet_r.js +53 -0
- package/lib/cjs/jos3_functions/validate_body_parameters.js +32 -0
- package/lib/cjs/jos3_functions/weight_rate.js +31 -0
- package/lib/cjs/models/JOS3.js +953 -0
- package/lib/cjs/models/index.js +29 -27
- package/lib/cjs/supa.js +74 -0
- package/lib/cjs/types/jos3_functions/JOS3Defaults.d.ts +27 -0
- package/lib/cjs/types/jos3_functions/JOS3Defaults.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/bfb_rate.d.ts +13 -0
- package/lib/cjs/types/jos3_functions/bfb_rate.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/bsa_rate.d.ts +15 -0
- package/lib/cjs/types/jos3_functions/bsa_rate.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/capacity.d.ts +19 -0
- package/lib/cjs/types/jos3_functions/capacity.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/conductance.d.ts +13 -0
- package/lib/cjs/types/jos3_functions/conductance.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/local_bsa.d.ts +19 -0
- package/lib/cjs/types/jos3_functions/local_bsa.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/matrix.d.ts +63 -0
- package/lib/cjs/types/jos3_functions/matrix.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts +33 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/basal_met.d.ts +13 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/basal_met.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/clo_area_factor.d.ts +9 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/clo_area_factor.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/conv_coef.d.ts +16 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/conv_coef.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts +37 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/dry_r.d.ts +12 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/dry_r.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/error_signals.d.ts +27 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/error_signals.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/evaporation.d.ts +46 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/evaporation.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hc.d.ts +5 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hc.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hr.d.ts +9 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/fixed_hr.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/local_mbase.d.ts +14 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/local_mbase.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/local_q_work.d.ts +12 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/local_q_work.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/nonshivering.d.ts +16 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/nonshivering.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/operative_temp.d.ts +13 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/operative_temp.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/rad_coef.d.ts +10 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/rad_coef.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/resp_heat_loss.d.ts +27 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/resp_heat_loss.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/shivering.d.ts +27 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/shivering.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts +15 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/sum_bf.d.ts +15 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/sum_bf.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/sum_m.d.ts +39 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/sum_m.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/wet_r.d.ts +13 -0
- package/lib/cjs/types/jos3_functions/thermoregulation/wet_r.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/validate_body_parameters.d.ts +12 -0
- package/lib/cjs/types/jos3_functions/validate_body_parameters.d.ts.map +1 -0
- package/lib/cjs/types/jos3_functions/weight_rate.d.ts +20 -0
- package/lib/cjs/types/jos3_functions/weight_rate.d.ts.map +1 -0
- package/lib/cjs/types/models/JOS3.d.ts +385 -0
- package/lib/cjs/types/models/JOS3.d.ts.map +1 -0
- package/lib/cjs/types/models/index.d.ts +56 -54
- package/lib/cjs/types/models/index.d.ts.map +1 -1
- package/lib/cjs/types/supa.d.ts +25 -0
- package/lib/cjs/types/supa.d.ts.map +1 -0
- package/lib/esm/jos3_functions/JOS3Defaults.js +32 -0
- package/lib/esm/jos3_functions/bfb_rate.js +36 -0
- package/lib/esm/jos3_functions/bsa_rate.js +21 -0
- package/lib/esm/jos3_functions/capacity.js +96 -0
- package/lib/esm/jos3_functions/conductance.js +141 -0
- package/lib/esm/jos3_functions/local_bsa.js +25 -0
- package/lib/esm/jos3_functions/matrix.js +311 -0
- package/lib/esm/jos3_functions/thermoregulation/ava_blood_flow.js +45 -0
- package/lib/esm/jos3_functions/thermoregulation/basal_met.js +48 -0
- package/lib/esm/jos3_functions/thermoregulation/clo_area_factor.js +10 -0
- package/lib/esm/jos3_functions/thermoregulation/conv_coef.js +97 -0
- package/lib/esm/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.js +56 -0
- package/lib/esm/jos3_functions/thermoregulation/dry_r.js +20 -0
- package/lib/esm/jos3_functions/thermoregulation/error_signals.js +28 -0
- package/lib/esm/jos3_functions/thermoregulation/evaporation.js +63 -0
- package/lib/esm/jos3_functions/thermoregulation/fixed_hc.js +12 -0
- package/lib/esm/jos3_functions/thermoregulation/fixed_hr.js +13 -0
- package/lib/esm/jos3_functions/thermoregulation/local_mbase.js +40 -0
- package/lib/esm/jos3_functions/thermoregulation/local_q_work.js +21 -0
- package/lib/esm/jos3_functions/thermoregulation/nonshivering.js +65 -0
- package/lib/esm/jos3_functions/thermoregulation/operative_temp.js +15 -0
- package/lib/esm/jos3_functions/thermoregulation/rad_coef.js +44 -0
- package/lib/esm/jos3_functions/thermoregulation/resp_heat_loss.js +20 -0
- package/lib/esm/jos3_functions/thermoregulation/shivering.js +102 -0
- package/lib/esm/jos3_functions/thermoregulation/skin_blood_flow.js +45 -0
- package/lib/esm/jos3_functions/thermoregulation/sum_bf.js +23 -0
- package/lib/esm/jos3_functions/thermoregulation/sum_m.js +39 -0
- package/lib/esm/jos3_functions/thermoregulation/wet_r.js +23 -0
- package/lib/esm/jos3_functions/validate_body_parameters.js +25 -0
- package/lib/esm/jos3_functions/weight_rate.js +24 -0
- package/lib/esm/models/JOS3.js +923 -0
- package/lib/esm/models/index.js +29 -27
- package/lib/esm/supa.js +62 -0
- package/lib/esm/types/jos3_functions/JOS3Defaults.d.ts +27 -0
- package/lib/esm/types/jos3_functions/JOS3Defaults.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/bfb_rate.d.ts +13 -0
- package/lib/esm/types/jos3_functions/bfb_rate.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/bsa_rate.d.ts +15 -0
- package/lib/esm/types/jos3_functions/bsa_rate.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/capacity.d.ts +19 -0
- package/lib/esm/types/jos3_functions/capacity.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/conductance.d.ts +13 -0
- package/lib/esm/types/jos3_functions/conductance.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/local_bsa.d.ts +19 -0
- package/lib/esm/types/jos3_functions/local_bsa.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/matrix.d.ts +63 -0
- package/lib/esm/types/jos3_functions/matrix.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts +33 -0
- package/lib/esm/types/jos3_functions/thermoregulation/ava_blood_flow.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/basal_met.d.ts +13 -0
- package/lib/esm/types/jos3_functions/thermoregulation/basal_met.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/clo_area_factor.d.ts +9 -0
- package/lib/esm/types/jos3_functions/thermoregulation/clo_area_factor.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/conv_coef.d.ts +16 -0
- package/lib/esm/types/jos3_functions/thermoregulation/conv_coef.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts +37 -0
- package/lib/esm/types/jos3_functions/thermoregulation/cr_ms_fat_blood_flow.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/dry_r.d.ts +12 -0
- package/lib/esm/types/jos3_functions/thermoregulation/dry_r.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/error_signals.d.ts +27 -0
- package/lib/esm/types/jos3_functions/thermoregulation/error_signals.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/evaporation.d.ts +46 -0
- package/lib/esm/types/jos3_functions/thermoregulation/evaporation.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/fixed_hc.d.ts +5 -0
- package/lib/esm/types/jos3_functions/thermoregulation/fixed_hc.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/fixed_hr.d.ts +9 -0
- package/lib/esm/types/jos3_functions/thermoregulation/fixed_hr.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/local_mbase.d.ts +14 -0
- package/lib/esm/types/jos3_functions/thermoregulation/local_mbase.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/local_q_work.d.ts +12 -0
- package/lib/esm/types/jos3_functions/thermoregulation/local_q_work.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/nonshivering.d.ts +16 -0
- package/lib/esm/types/jos3_functions/thermoregulation/nonshivering.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/operative_temp.d.ts +13 -0
- package/lib/esm/types/jos3_functions/thermoregulation/operative_temp.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/rad_coef.d.ts +10 -0
- package/lib/esm/types/jos3_functions/thermoregulation/rad_coef.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/resp_heat_loss.d.ts +27 -0
- package/lib/esm/types/jos3_functions/thermoregulation/resp_heat_loss.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/shivering.d.ts +27 -0
- package/lib/esm/types/jos3_functions/thermoregulation/shivering.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts +15 -0
- package/lib/esm/types/jos3_functions/thermoregulation/skin_blood_flow.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/sum_bf.d.ts +15 -0
- package/lib/esm/types/jos3_functions/thermoregulation/sum_bf.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/sum_m.d.ts +39 -0
- package/lib/esm/types/jos3_functions/thermoregulation/sum_m.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/thermoregulation/wet_r.d.ts +13 -0
- package/lib/esm/types/jos3_functions/thermoregulation/wet_r.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/validate_body_parameters.d.ts +12 -0
- package/lib/esm/types/jos3_functions/validate_body_parameters.d.ts.map +1 -0
- package/lib/esm/types/jos3_functions/weight_rate.d.ts +20 -0
- package/lib/esm/types/jos3_functions/weight_rate.d.ts.map +1 -0
- package/lib/esm/types/models/JOS3.d.ts +385 -0
- package/lib/esm/types/models/JOS3.d.ts.map +1 -0
- package/lib/esm/types/models/index.d.ts +56 -54
- package/lib/esm/types/models/index.d.ts.map +1 -1
- package/lib/esm/types/supa.d.ts +25 -0
- package/lib/esm/types/supa.d.ts.map +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ 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), [
|
|
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
|
|
@@ -23,7 +23,7 @@ Please cite us if you use this package: [Tartarini, F., Schiavon, S., 2020. pyth
|
|
|
23
23
|
[synk_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
|
|
|
@@ -61,7 +61,7 @@ You can also import it in the website directly, and caution that you need to mar
|
|
|
61
61
|
|
|
62
62
|
# Examples and Tutorials
|
|
63
63
|
|
|
64
|
-
|
|
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,7 +98,7 @@ 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
|
-
##
|
|
101
|
+
## Local development
|
|
102
102
|
|
|
103
103
|
To set up jsthermalcomfort for local development:
|
|
104
104
|
|
|
@@ -109,6 +109,12 @@ To set up jsthermalcomfort for local development:
|
|
|
109
109
|
git clone git@github.com:FedericoTartarini/jsthermalcomfort.git
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
We use git submodules to pull validation data for the tests, to ensure tests are successful please run:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
git submodule update --init --recursive
|
|
116
|
+
```
|
|
117
|
+
|
|
112
118
|
3. Create a branch for local development. The naming rule for new branch are, as follows:
|
|
113
119
|
|
|
114
120
|
- If this update is for a new feature Feature/feature_name_here
|
|
@@ -182,12 +188,21 @@ For merging, you should:
|
|
|
182
188
|
- Include passing tests (run `npm run test`).
|
|
183
189
|
- Update documentation when there’s new API, functionality etc.
|
|
184
190
|
|
|
185
|
-
|
|
191
|
+
## Documentation
|
|
186
192
|
|
|
187
193
|
We are using [JSDoc](https://jsdoc.app/) and [documentation.js](https://github.com/documentationjs/documentation) to
|
|
188
194
|
automatically build the documentation.
|
|
189
195
|
|
|
190
|
-
|
|
196
|
+
All the files needed to generate the documentation can be found in the `docs_theme` repository.
|
|
197
|
+
After updating the Markdown files, please run the command:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
npm run docs
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Please ignore the `docs` folder, this folder contains all the files generated by the above command.
|
|
204
|
+
|
|
205
|
+
## How to add a new model to jsthermalcomfort
|
|
191
206
|
|
|
192
207
|
1. Add a file under `src/models/` with the name of the function/model and document it.
|
|
193
208
|
2. Add any related functions that are used by your function either in `src/utilities/utilities.js`
|
|
@@ -197,20 +212,17 @@ automatically build the documentation.
|
|
|
197
212
|
proper name for the documentation with `@docname`, for example: `@docname Clothing prediction`. It is important to
|
|
198
213
|
note that you should also add the `@public` tag to any types the function exposes/uses.
|
|
199
214
|
3. Test your function by writing a test in `tests/models/<name_of_model>.test.js`.
|
|
215
|
+
4. To run a subset of tests you can do the following:
|
|
200
216
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
```bash
|
|
206
|
-
npm run test -- '<path_to_test_file>' -t '<test_pattern/name>'
|
|
207
|
-
```
|
|
217
|
+
```bash
|
|
218
|
+
npm run test -- '<path_to_test_file>' -t '<test_pattern/name>'
|
|
219
|
+
```
|
|
208
220
|
|
|
209
221
|
If you are using VSCode you can use
|
|
210
222
|
the [Jest Runner extension](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) to easily
|
|
211
223
|
run subset of tests.
|
|
212
224
|
|
|
213
|
-
|
|
225
|
+
## How to publish a new version of jsthermalcomfort
|
|
214
226
|
|
|
215
227
|
To create a new release do the following:
|
|
216
228
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const JOS3Defaults = {
|
|
4
|
+
// Body information
|
|
5
|
+
height: 1.72,
|
|
6
|
+
weight: 74.43,
|
|
7
|
+
age: 20,
|
|
8
|
+
body_fat: 15,
|
|
9
|
+
cardiac_index: 2.59,
|
|
10
|
+
blood_flow_rate: 290,
|
|
11
|
+
physical_activity_ratio: 1.25,
|
|
12
|
+
metabolic_rate: 1.0,
|
|
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
|
+
],
|
|
21
|
+
// Environment information
|
|
22
|
+
core_temperature: 37,
|
|
23
|
+
skin_temperature: 34,
|
|
24
|
+
other_body_temperature: 36,
|
|
25
|
+
dry_bulb_air_temperature: 28.8,
|
|
26
|
+
mean_radiant_temperature: 28.8,
|
|
27
|
+
relative_humidity: 50,
|
|
28
|
+
air_speed: 0.1,
|
|
29
|
+
// Clothing information
|
|
30
|
+
clothing_insulation: 0,
|
|
31
|
+
clothing_vapor_permeation_efficiency: 0.45,
|
|
32
|
+
lewis_rate: 16.5, // [K/kPa]
|
|
33
|
+
};
|
|
34
|
+
exports.default = JOS3Defaults;
|
|
@@ -0,0 +1,66 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.bfb_rate = void 0;
|
|
30
|
+
const JOS3Defaults_js_1 = __importDefault(require("./JOS3Defaults.js"));
|
|
31
|
+
const bsa_rate_js_1 = require("./bsa_rate.js");
|
|
32
|
+
const validate_body_parameters_js_1 = require("./validate_body_parameters.js");
|
|
33
|
+
const math = __importStar(require("mathjs"));
|
|
34
|
+
/**
|
|
35
|
+
* Calculate the ratio of basal blood flow (BFB) of the standard body (290 L/h).
|
|
36
|
+
*
|
|
37
|
+
* @param {number} height - Body height [m]. The default is 1.72.
|
|
38
|
+
* @param {number} weight - Body weight [kg]. The default is 74.43.
|
|
39
|
+
* @param {string} bsa_equation - The equation name of bsa calculation. Choose a name from "dubois", "takahira", "fujimoto", or "kurazumi". The default is "dubois".
|
|
40
|
+
* @param {number} age - age [years]. The default is 20.
|
|
41
|
+
* @param {number} ci - Cardiac index [L/min/㎡]. The default is 2.59.
|
|
42
|
+
*
|
|
43
|
+
* @returns {number} - Basal blood flow rate.
|
|
44
|
+
*/
|
|
45
|
+
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) {
|
|
46
|
+
(0, validate_body_parameters_js_1.validate_body_parameters)(height, weight, age);
|
|
47
|
+
ci *= 60;
|
|
48
|
+
if (age < 50) {
|
|
49
|
+
ci *= 1;
|
|
50
|
+
}
|
|
51
|
+
else if (age < 60) {
|
|
52
|
+
ci *= 0.85;
|
|
53
|
+
}
|
|
54
|
+
else if (age < 70) {
|
|
55
|
+
ci *= 0.75;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
// age >= 70
|
|
59
|
+
ci *= 0.7;
|
|
60
|
+
}
|
|
61
|
+
const bfb_all = ci *
|
|
62
|
+
(0, bsa_rate_js_1.bsa_rate)(height, weight, bsa_equation) *
|
|
63
|
+
math.sum(JOS3Defaults_js_1.default.local_bsa);
|
|
64
|
+
return bfb_all / JOS3Defaults_js_1.default.blood_flow_rate;
|
|
65
|
+
}
|
|
66
|
+
exports.bfb_rate = bfb_rate;
|
|
@@ -0,0 +1,28 @@
|
|
|
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 = void 0;
|
|
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
|
+
}
|
|
28
|
+
exports.bsa_rate = bsa_rate;
|
|
@@ -0,0 +1,103 @@
|
|
|
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 = void 0;
|
|
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
|
+
}
|
|
103
|
+
exports.capacity = capacity;
|
|
@@ -0,0 +1,171 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.conductance = void 0;
|
|
30
|
+
const JOS3Defaults_js_1 = __importDefault(require("./JOS3Defaults.js"));
|
|
31
|
+
const validate_body_parameters_js_1 = require("./validate_body_parameters.js");
|
|
32
|
+
const weight_rate_js_1 = require("./weight_rate.js");
|
|
33
|
+
const bsa_rate_js_1 = require("./bsa_rate.js");
|
|
34
|
+
const matrix_js_1 = require("./matrix.js");
|
|
35
|
+
const math = __importStar(require("mathjs"));
|
|
36
|
+
/**
|
|
37
|
+
* Calculate thermal conductance between layers.
|
|
38
|
+
|
|
39
|
+
* @param {number} height - Body height in [m]. Default is 1.72.
|
|
40
|
+
* @param {number} weight - Body weight in [kg]. Default is 74.43.
|
|
41
|
+
* @param {string} bsa_equation - The equation name (str) of bsa calculation. Choose a name from "dubois", "takahira", "fujimoto", or "kurazumi". Default is "dubois".
|
|
42
|
+
* @param {number} fat - Body fat rate in [%]. Default is 15.
|
|
43
|
+
|
|
44
|
+
* @returns {math.Matrix} conductance - Thermal conductance between layers in [W/K]. The shape is (NUM_NODES, NUM_NODES).
|
|
45
|
+
*/
|
|
46
|
+
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) {
|
|
47
|
+
(0, validate_body_parameters_js_1.validate_body_parameters)(height, weight, undefined, fat);
|
|
48
|
+
let cdt_cr_sk;
|
|
49
|
+
if (fat < 12.5) {
|
|
50
|
+
cdt_cr_sk = math.matrix([
|
|
51
|
+
1.341, 0.93, 1.879, 1.729, 2.37, 1.557, 1.018, 2.21, 1.557, 1.018, 2.21,
|
|
52
|
+
2.565, 1.378, 3.404, 2.565, 1.378, 3.404,
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
|
+
else if (fat < 17.5) {
|
|
56
|
+
cdt_cr_sk = math.matrix([
|
|
57
|
+
1.311, 0.909, 1.785, 1.643, 2.251, 1.501, 0.982, 2.183, 1.501, 0.982,
|
|
58
|
+
2.183, 2.468, 1.326, 3.37, 2.468, 1.326, 3.37,
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
else if (fat < 22.5) {
|
|
62
|
+
cdt_cr_sk = math.matrix([
|
|
63
|
+
1.282, 0.889, 1.698, 1.563, 2.142, 1.448, 0.947, 2.156, 1.448, 0.947,
|
|
64
|
+
2.156, 2.375, 1.276, 3.337, 2.375, 1.276, 3.337,
|
|
65
|
+
]);
|
|
66
|
+
}
|
|
67
|
+
else if (fat < 27.5) {
|
|
68
|
+
cdt_cr_sk = math.matrix([
|
|
69
|
+
1.255, 0.87, 1.618, 1.488, 2.04, 1.396, 0.913, 2.13, 1.396, 0.913, 2.13,
|
|
70
|
+
2.285, 1.227, 3.304, 2.285, 1.227, 3.304,
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
// fat >= 27.5
|
|
75
|
+
cdt_cr_sk = math.matrix([
|
|
76
|
+
1.227, 0.852, 1.542, 1.419, 1.945, 1.346, 0.88, 1.945, 1.346, 0.88, 1.945,
|
|
77
|
+
2.198, 1.181, 3.271, 2.198, 1.181, 3.271,
|
|
78
|
+
]);
|
|
79
|
+
}
|
|
80
|
+
let cdt_cr_ms = math.zeros(17); // core to muscle [W/K]
|
|
81
|
+
let cdt_ms_fat = math.zeros(17); // muscle to fat [W/K]
|
|
82
|
+
let cdt_fat_sk = math.zeros(17); // fat to skin [W/K]
|
|
83
|
+
// head and pelvis consists of 65MN's conductances
|
|
84
|
+
cdt_cr_ms.set([0], 1.601); // head
|
|
85
|
+
cdt_ms_fat.set([0], 13.222);
|
|
86
|
+
cdt_fat_sk.set([0], 16.008);
|
|
87
|
+
cdt_cr_ms.set([4], 3.0813); // pelvis
|
|
88
|
+
cdt_ms_fat.set([4], 10.3738);
|
|
89
|
+
cdt_fat_sk.set([4], 41.4954);
|
|
90
|
+
// vessel to core
|
|
91
|
+
// The shape is a cylinder.
|
|
92
|
+
// It is assumed that the inner is vascular radius, 2.5mm and the outer is
|
|
93
|
+
// stolwijk's core radius.
|
|
94
|
+
// The heat transfer coefficient of the core is assumed as the Michel's
|
|
95
|
+
// counter-flow model 0.66816 [W/(m・K)].
|
|
96
|
+
let cdt_ves_cr = math.matrix([
|
|
97
|
+
0, 0, 0, 0, 0, 0.586, 0.383, 1.534, 0.586, 0.383, 1.534, 0.81, 0.435, 1.816,
|
|
98
|
+
0.81, 0.435, 1.816,
|
|
99
|
+
]);
|
|
100
|
+
// superficial vein to skin
|
|
101
|
+
let cdt_sfv_sk = math.matrix([
|
|
102
|
+
0, 0, 0, 0, 0, 57.735, 37.768, 16.634, 57.735, 37.768, 16.634, 102.012,
|
|
103
|
+
54.784, 24.277, 102.012, 54.784, 24.277,
|
|
104
|
+
]);
|
|
105
|
+
// art to vein (counter-flow) [W/K]
|
|
106
|
+
// The data has been derived Mitchell's model.
|
|
107
|
+
// The values = 15.869 [W/(m・K)] * the segment length [m]
|
|
108
|
+
let cdt_art_vein = math.matrix([
|
|
109
|
+
0, 0, 0, 0, 0, 0.537, 0.351, 0.762, 0.537, 0.351, 0.762, 0.826, 0.444,
|
|
110
|
+
0.992, 0.826, 0.444, 0.992,
|
|
111
|
+
]);
|
|
112
|
+
// Changes values by body size based on the standard body.
|
|
113
|
+
const wr = (0, weight_rate_js_1.weight_rate)(weight);
|
|
114
|
+
const bsar = (0, bsa_rate_js_1.bsa_rate)(height, weight, bsa_equation);
|
|
115
|
+
const adjustSphere = (matrix, range) => {
|
|
116
|
+
let index = math.index(math.range(0, 2));
|
|
117
|
+
let subset = math.subset(matrix, index);
|
|
118
|
+
subset = math.dotDivide(math.dotMultiply(subset, wr), bsar);
|
|
119
|
+
return math.subset(matrix, index, subset);
|
|
120
|
+
};
|
|
121
|
+
const adjustCylinder = (matrix) => {
|
|
122
|
+
let index = math.index(math.range(2, matrix.size()[0]));
|
|
123
|
+
let subset = math.subset(matrix, index);
|
|
124
|
+
subset = math.dotDivide(math.dotMultiply(subset, Math.pow(bsar, 2)), wr);
|
|
125
|
+
return math.subset(matrix, index, subset);
|
|
126
|
+
};
|
|
127
|
+
// head, neck (Sphere shape)
|
|
128
|
+
cdt_cr_sk = adjustSphere(cdt_cr_sk);
|
|
129
|
+
cdt_cr_ms = adjustSphere(cdt_cr_ms);
|
|
130
|
+
cdt_ms_fat = adjustSphere(cdt_ms_fat);
|
|
131
|
+
cdt_fat_sk = adjustSphere(cdt_fat_sk);
|
|
132
|
+
cdt_ves_cr = adjustSphere(cdt_ves_cr);
|
|
133
|
+
cdt_sfv_sk = adjustSphere(cdt_sfv_sk);
|
|
134
|
+
cdt_art_vein = adjustSphere(cdt_art_vein);
|
|
135
|
+
// Others (Cylinder shape)
|
|
136
|
+
cdt_cr_sk = adjustCylinder(cdt_cr_sk);
|
|
137
|
+
cdt_cr_ms = adjustCylinder(cdt_cr_ms);
|
|
138
|
+
cdt_ms_fat = adjustCylinder(cdt_ms_fat);
|
|
139
|
+
cdt_fat_sk = adjustCylinder(cdt_fat_sk);
|
|
140
|
+
cdt_ves_cr = adjustCylinder(cdt_ves_cr);
|
|
141
|
+
cdt_sfv_sk = adjustCylinder(cdt_sfv_sk);
|
|
142
|
+
cdt_art_vein = adjustCylinder(cdt_art_vein);
|
|
143
|
+
const cdt_whole = math.zeros(matrix_js_1.NUM_NODES, matrix_js_1.NUM_NODES);
|
|
144
|
+
for (let i = 0; i < matrix_js_1.BODY_NAMES.length; i++) {
|
|
145
|
+
const bn = matrix_js_1.BODY_NAMES[i];
|
|
146
|
+
// Dictionary of indices in each body segment
|
|
147
|
+
// key = layer name, value = index of matrix
|
|
148
|
+
const index_of = matrix_js_1.IDICT[bn];
|
|
149
|
+
// Common
|
|
150
|
+
cdt_whole.set([index_of["artery"], index_of["vein"]], cdt_art_vein.get([i])); // art to vein
|
|
151
|
+
cdt_whole.set([index_of["artery"], index_of["core"]], cdt_ves_cr.get([i])); // art to cr
|
|
152
|
+
cdt_whole.set([index_of["vein"], index_of["core"]], cdt_ves_cr.get([i])); // vein to cr
|
|
153
|
+
// Only limbs
|
|
154
|
+
if (i >= 5) {
|
|
155
|
+
cdt_whole.set([index_of["sfvein"], index_of["skin"]], cdt_sfv_sk.get([i])); // sfv to sk
|
|
156
|
+
}
|
|
157
|
+
// If the segment has a muscle or fat layer
|
|
158
|
+
if (index_of["muscle"] !== null) {
|
|
159
|
+
// or not indexof["fat"] is None
|
|
160
|
+
cdt_whole.set([index_of["core"], index_of["muscle"]], cdt_cr_ms.get([i])); // cr to ms
|
|
161
|
+
cdt_whole.set([index_of["muscle"], index_of["fat"]], cdt_ms_fat.get([i])); // ms to fat
|
|
162
|
+
cdt_whole.set([index_of["fat"], index_of["skin"]], cdt_fat_sk.get([i])); // fat to sk
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
cdt_whole.set([index_of["core"], index_of["skin"]], cdt_cr_sk.get([i])); // cr to sk
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Creates a symmetrical matrix
|
|
169
|
+
return math.add(cdt_whole, math.transpose(cdt_whole));
|
|
170
|
+
}
|
|
171
|
+
exports.conductance = conductance;
|
|
@@ -0,0 +1,55 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.local_bsa = void 0;
|
|
30
|
+
const JOS3Defaults_js_1 = __importDefault(require("./JOS3Defaults.js"));
|
|
31
|
+
const validate_body_parameters_js_1 = require("./validate_body_parameters.js");
|
|
32
|
+
const bsa_rate_js_1 = require("./bsa_rate.js");
|
|
33
|
+
const math = __importStar(require("mathjs"));
|
|
34
|
+
/**
|
|
35
|
+
* Calculate local body surface area (bsa) [m2].
|
|
36
|
+
*
|
|
37
|
+
* The local body surface area has been derived from 65MN.
|
|
38
|
+
* The head have been divided to head and neck based on Smith's model.
|
|
39
|
+
* head = 0.1396*0.1117/0.1414 (65MN_Head * Smith_Head / Smith_Head+neck)
|
|
40
|
+
* neck = 0.1396*0.0297/0.1414 (65MN_Head * Smith_Neck / Smith_Head+neck)
|
|
41
|
+
*
|
|
42
|
+
* @param {number} [height=JOS3Defaults.height] - Body height [m]
|
|
43
|
+
* @param {number} [weight=JOS3Defaults.weight] - Body weight [kg]
|
|
44
|
+
* @param {string} [bsa_equation=JOS3Defaults.bsa_equation] - The equation name
|
|
45
|
+
* of bsa calculation. Choose a name from "dubois", "takahira", "fujimoto",
|
|
46
|
+
* or "kurazumi".
|
|
47
|
+
*
|
|
48
|
+
* @returns {math.Matrix} local_bsa of length 17 - Local body surface area (bsa) [m2]
|
|
49
|
+
*/
|
|
50
|
+
function local_bsa(height = JOS3Defaults_js_1.default.height, weight = JOS3Defaults_js_1.default.weight, bsa_equation = JOS3Defaults_js_1.default.bsa_equation) {
|
|
51
|
+
(0, validate_body_parameters_js_1.validate_body_parameters)(height, weight);
|
|
52
|
+
const bsa = (0, bsa_rate_js_1.bsa_rate)(height, weight, bsa_equation);
|
|
53
|
+
return math.matrix(math.dotMultiply(JOS3Defaults_js_1.default.local_bsa, bsa));
|
|
54
|
+
}
|
|
55
|
+
exports.local_bsa = local_bsa;
|