Skip to content

Commit

Permalink
Fix issues with JOS3, migrate most functions to use math.Matrix ins…
Browse files Browse the repository at this point in the history
…tead of plain arrays (#125)
  • Loading branch information
jordanocokoljic authored Feb 6, 2024
1 parent 8825a4f commit b4d40d8
Show file tree
Hide file tree
Showing 59 changed files with 9,004 additions and 1,312 deletions.
368 changes: 280 additions & 88 deletions docs/index.html

Large diffs are not rendered by default.

165 changes: 83 additions & 82 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsthermalcomfort",
"version": "0.1.5",
"version": "0.2.0",
"description": "A JavaScript package to calculate thermophysiological, thermal comfort, thermal stress indices",
"type": "module",
"files": [
Expand Down Expand Up @@ -51,7 +51,8 @@
"jsdoc": "^4.0.2",
"lodash": "^4.17.21",
"prettier": "3.0.2",
"typescript": "^5.1.6"
"typescript": "^5.1.6",
"@jest/globals": "^29.7.0"
},
"dependencies": {
"mathjs": "^11.11.2"
Expand Down
4 changes: 3 additions & 1 deletion src/jos3_functions/bfb_rate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import JOS3Defaults from "./JOS3Defaults.js";
import { bsa_rate } from "./bsa_rate.js";
import { validate_body_parameters } from "./validate_body_parameters.js";
import * as math from "mathjs";

/**
* Calculate the ratio of basal blood flow (BFB) of the standard body (290 L/h).
Expand Down Expand Up @@ -38,6 +39,7 @@ export function bfb_rate(
const bfb_all =
ci *
bsa_rate(height, weight, bsa_equation) *
JOS3Defaults.local_bsa.reduce((t, c) => t + c, 0);
math.sum(JOS3Defaults.local_bsa);

return bfb_all / JOS3Defaults.blood_flow_rate;
}
Loading

0 comments on commit b4d40d8

Please sign in to comment.