0.1.4 • Published 2 years ago
hotstuff-network v0.1.4
hotstuff-network
This is the thermal model core logic that powers thermalmodel.com.
Installation
npm i hotstuff-network
Usage
import { run, makeNode, makeConnection } from "hotstuff-network";
const firstNode = makeNode({
name: "first",
temperatureDegC: 10,
capacitanceJPerDegK: 10000,
powerGenW: 80,
isBoundary: false,
});
const secondNode = makeNode({
name: "second",
temperatureDegC: 40,
capacitanceJPerDegK: 40000,
powerGenW: -10,
isBoundary: true,
});
const connection = makeConnection({
firstNode: firstNode,
secondNode: secondNode,
resistanceDegKPerW: 100,
kind: "bi",
});
const results = run({
nodes: [firstNode, secondNode],
connections: [connection],
timeStepS: 0.01,
totalTimeS: 0.03,
});
console.log(JSON.stringify(results, null, 2)); // output below:
/*
{
"timeSeriesS": [
0,
0.01,
0.02,
0.03
],
"timeStepS": 0.01,
"totalTimeS": 0.03,
"numTimeSteps": 4,
"nodeResults": [
{
"node": {
"id": "KN67LAR1MXNXS",
"name": "first",
"temperatureDegC": 10,
"capacitanceJPerDegK": 10000,
"powerGenW": 80,
"isBoundary": false
},
"tempDegC": [
10,
10.00008029999998,
10.000160599999163,
10.00024089999755
]
},
{
"node": {
"id": "KN67LAR1ZBD56",
"name": "second",
"temperatureDegC": 40,
"capacitanceJPerDegK": 40000,
"powerGenW": -10,
"isBoundary": true
},
"tempDegC": [
40,
40,
40,
40
]
}
],
"connectionResults": [
{
"connection": {
"id": "KN67LAR1ZSRZK",
"firstNode": {
"id": "KN67LAR1MXNXS",
"name": "first",
"temperatureDegC": 10,
"capacitanceJPerDegK": 10000,
"powerGenW": 80,
"isBoundary": false
},
"secondNode": {
"id": "KN67LAR1ZBD56",
"name": "second",
"temperatureDegC": 40,
"capacitanceJPerDegK": 40000,
"powerGenW": -10,
"isBoundary": true
},
"resistanceDegKPerW": 100,
"kind": "bi"
},
"heatTransferW": [
-0.3,
-0.2999991970000002,
-0.2999983940000084,
-0.2999975910000245
]
}
]
}
*/
Development
Running tests:
npm run test
Releasing a new version:
npm version patch/minor/major
npm publish
0.1.4
2 years ago
0.1.3
2 years ago
0.0.30
2 years ago
0.0.31
2 years ago
0.0.32
2 years ago
0.0.33
2 years ago
0.1.0
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.0.28
3 years ago
0.0.29
2 years ago
0.0.27
3 years ago
0.0.23
3 years ago
0.0.24
3 years ago
0.0.25
3 years ago
0.0.26
3 years ago
0.0.20
3 years ago
0.0.21
3 years ago
0.0.22
3 years ago
0.0.18
3 years ago
0.0.19
3 years ago
0.0.16
3 years ago
0.0.17
3 years ago
0.0.10
3 years ago
0.0.11
3 years ago
0.0.12
3 years ago
0.0.13
3 years ago
0.0.14
3 years ago
0.0.15
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.3
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago