0.1.4 • Published 3 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
3 years ago
0.1.3
4 years ago
0.0.30
4 years ago
0.0.31
4 years ago
0.0.32
4 years ago
0.0.33
4 years ago
0.1.0
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago
0.0.28
4 years ago
0.0.29
4 years ago
0.0.27
4 years ago
0.0.23
4 years ago
0.0.24
4 years ago
0.0.25
4 years ago
0.0.26
4 years ago
0.0.20
4 years ago
0.0.21
4 years ago
0.0.22
4 years ago
0.0.18
4 years ago
0.0.19
4 years ago
0.0.16
4 years ago
0.0.17
4 years ago
0.0.10
4 years ago
0.0.11
4 years ago
0.0.12
4 years ago
0.0.13
4 years ago
0.0.14
4 years ago
0.0.15
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.3
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago