Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with JOS3, migrate most functions to use math.Matrix instead of plain arrays #125

Merged
merged 7 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading