@datagrok/compute 0.5.1 → 0.6.1
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/package.json +2 -2
- package/scripts/pMax.js +42 -29
- package/scripts/vMaxJS.js +83 -92
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/compute",
|
|
3
3
|
"friendlyName": "Compute",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"cash-dom": "latest",
|
|
8
8
|
"codemirror": "^5.64.0",
|
|
9
|
-
"datagrok-api": ">=0.
|
|
9
|
+
"datagrok-api": ">=0.99.0",
|
|
10
10
|
"dayjs": "latest",
|
|
11
11
|
"exceljs": "^4.3.0",
|
|
12
12
|
"file-saver": "^2.0.5",
|
package/scripts/pMax.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
//description: pMax Filtration Model
|
|
3
3
|
//language: javascript
|
|
4
4
|
//tags: model, filtration
|
|
5
|
-
//input: dataframe inputTable [Should contain columns Time (min), Vol (mL), P1 (psi), P2 (psi)]
|
|
6
|
-
//input: dataframe
|
|
5
|
+
//input: dataframe inputTable {caption: Input Table; viewer: Grid()} [Should contain columns Time (min), Vol (mL), P1 (psi), P2 (psi)]
|
|
6
|
+
//input: dataframe reportingParameters {caption: Reporting Parameters; viewer: Grid()}
|
|
7
7
|
//input: double batchVolume = 100 {units: L} [Batch Volume]
|
|
8
8
|
//input: double batchTime = 2 {units: hours} [Batch Time]
|
|
9
9
|
//input: double targetPressure = 20 {units: psi} [Target Pressure]
|
|
@@ -12,13 +12,12 @@
|
|
|
12
12
|
//input: double filterArea1 = 23 {units: m²; caption: A_trial Filter 1} [A_trial Filter 1]
|
|
13
13
|
//input: double filterArea2 = 23 {units: m²; caption: A_trial Filter 2} [A_trial Filter 2]
|
|
14
14
|
//input: double sf = 1.5 {caption: Safety Factor}
|
|
15
|
-
//
|
|
16
|
-
//output: dataframe
|
|
17
|
-
//output: dataframe
|
|
18
|
-
//output: dataframe
|
|
19
|
-
//output: dataframe
|
|
20
|
-
//output: dataframe
|
|
21
|
-
//output: dataframe Guessed2 {category: OUTPUT}
|
|
15
|
+
//output: dataframe Filter1 {caption: Primary Filter; viewer: Scatter Plot(showDataframeFormulaLines: "true"); category: OUTPUT}
|
|
16
|
+
//output: dataframe t1 {caption: Primary Filter Results; category: OUTPUT}
|
|
17
|
+
//output: dataframe Guessed1 {caption: Guessed Primary Filter; category: OUTPUT}
|
|
18
|
+
//output: dataframe Filter2 {caption: Secondary Filter; viewer: Scatter Plot(showDataframeFormulaLines: "true"); category: OUTPUT}
|
|
19
|
+
//output: dataframe t2 {caption: Secondary Filter Results; category: OUTPUT}
|
|
20
|
+
//output: dataframe Guessed2 {caption: Guessed Secondary Filter; category: OUTPUT}
|
|
22
21
|
|
|
23
22
|
function gaussianElimination(input, orderOfPolynomialRegression) {
|
|
24
23
|
const n = input.length - 1, coefficients = [orderOfPolynomialRegression];
|
|
@@ -67,13 +66,13 @@ function polynomialRegressionCoefficients(xCol, yCol, orderOfPolynomialRegressio
|
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
function predictPolynomialRegression(coefficients, x) {
|
|
70
|
-
let
|
|
69
|
+
let y = coefficients[0];
|
|
71
70
|
for (let i = coefficients.length - 1; i > 0; i--)
|
|
72
|
-
|
|
73
|
-
return
|
|
71
|
+
y += coefficients[i] * Math.pow(x, i);
|
|
72
|
+
return y;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
function
|
|
75
|
+
function equationString(xColName, yColName, coefficients) {
|
|
77
76
|
let s = '';
|
|
78
77
|
for (let [index, coefficient] of coefficients.slice(1).reverse().entries()) {
|
|
79
78
|
s += String(coefficient);
|
|
@@ -120,23 +119,21 @@ Filter1 = DG.DataFrame.fromColumns([df1.col(colNames1['tp1']), df1.col(colNames1
|
|
|
120
119
|
Filter2 = DG.DataFrame.fromColumns([df1.col(colNames1['tp2']), df1.col(colNames1['res2'])]);
|
|
121
120
|
const coefficients1 = polynomialRegressionCoefficients(df1.col(colNames1['tp1']), df1.col(colNames1['res1']), orderOfPolynomialRegression);
|
|
122
121
|
const coefficients2 = polynomialRegressionCoefficients(df1.col(colNames1['tp2']), df1.col(colNames1['res2']), orderOfPolynomialRegression);
|
|
123
|
-
// alert(equasionString(colNames1['tp1'], colNames1['res1'], coefficients1))
|
|
124
|
-
// alert(equasionString(colNames1['tp2'], colNames1['res2'], coefficients2))
|
|
125
122
|
|
|
126
123
|
Filter1.meta.addFormulaLine({
|
|
127
|
-
title: '
|
|
128
|
-
equation:
|
|
124
|
+
title: 'Third-order polynomial regression',
|
|
125
|
+
equation: equationString(colNames1['tp1'], colNames1['res1'], coefficients1),
|
|
129
126
|
zindex: -30,
|
|
130
127
|
color: '#ff0000',
|
|
131
|
-
width:
|
|
128
|
+
width: 3
|
|
132
129
|
});
|
|
133
130
|
|
|
134
131
|
Filter2.meta.addFormulaLine({
|
|
135
|
-
title: '
|
|
136
|
-
equation:
|
|
132
|
+
title: 'Third-order polynomial regression',
|
|
133
|
+
equation: equationString(colNames1['tp2'], colNames1['res2'], coefficients2),
|
|
137
134
|
zindex: -30,
|
|
138
135
|
color: '#ff0000',
|
|
139
|
-
width:
|
|
136
|
+
width: 3
|
|
140
137
|
});
|
|
141
138
|
|
|
142
139
|
const df2 = DG.DataFrame.create(lengthOfSecondTable);
|
|
@@ -171,21 +168,37 @@ guessedMaxP2 = predictPolynomialRegression(coefficients2, processLoading2) * pro
|
|
|
171
168
|
guessedProcessFlux1 = processFlow1 / aMinFilter1Guessed, guessedProcessFlux2 = processFlow2 / aMinFilter2Guessed;
|
|
172
169
|
|
|
173
170
|
t1 = DG.DataFrame.fromColumns([
|
|
174
|
-
DG.Column.
|
|
175
|
-
DG.Column.
|
|
171
|
+
DG.Column.fromFloat32Array('Amin (m²)', [amin1]),
|
|
172
|
+
DG.Column.fromFloat32Array('Amin w SF (m²)', [aminSF1]),
|
|
173
|
+
DG.Column.fromFloat32Array('Trial Loading (L/m²)', [trialLoading1]),
|
|
174
|
+
DG.Column.fromFloat32Array('Process Loading (L/m²)', [processLoading1]),
|
|
175
|
+
DG.Column.fromFloat32Array('Max P (psi)', [maxP1]),
|
|
176
|
+
DG.Column.fromFloat32Array('Trial Flux (LMH)', [trialFlux1]),
|
|
177
|
+
DG.Column.fromFloat32Array('Process Flux (LMH)', [processFlux1]),
|
|
178
|
+
DG.Column.fromFloat32Array('Process Flow (L/hr)', [processFlow1])
|
|
176
179
|
]);
|
|
177
180
|
|
|
178
181
|
t2 = DG.DataFrame.fromColumns([
|
|
179
|
-
DG.Column.
|
|
180
|
-
DG.Column.
|
|
182
|
+
DG.Column.fromFloat32Array('Amin (m²)', [amin2]),
|
|
183
|
+
DG.Column.fromFloat32Array('Amin w SF (m²)', [aminSF2]),
|
|
184
|
+
DG.Column.fromFloat32Array('Trial Loading (L/m²)', [trialLoading2]),
|
|
185
|
+
DG.Column.fromFloat32Array('Process Loading (L/m²)', [processLoading2]),
|
|
186
|
+
DG.Column.fromFloat32Array('Max P (psi)', [maxP2]),
|
|
187
|
+
DG.Column.fromFloat32Array('Trial Flux (LMH)', [trialFlux2]),
|
|
188
|
+
DG.Column.fromFloat32Array('Process Flux (LMH)', [processFlux2]),
|
|
189
|
+
DG.Column.fromFloat32Array('Process Flow (L/hr)', [processFlow2])
|
|
181
190
|
]);
|
|
182
191
|
|
|
183
192
|
Guessed1 = DG.DataFrame.fromColumns([
|
|
184
|
-
DG.Column.
|
|
185
|
-
DG.Column.
|
|
193
|
+
DG.Column.fromFloat32Array('Amin (m²)', [guessedAmin1]),
|
|
194
|
+
DG.Column.fromFloat32Array('Process Loading (L/m²)', [guessedProcessLoading1]),
|
|
195
|
+
DG.Column.fromFloat32Array('Max P (psi)', [guessedMaxP1]),
|
|
196
|
+
DG.Column.fromFloat32Array('Process Flux (LMH)', [guessedProcessFlux1]),
|
|
186
197
|
]);
|
|
187
198
|
|
|
188
199
|
Guessed2 = DG.DataFrame.fromColumns([
|
|
189
|
-
DG.Column.
|
|
190
|
-
DG.Column.
|
|
200
|
+
DG.Column.fromFloat32Array('Amin (m²)', [guessedAmin2]),
|
|
201
|
+
DG.Column.fromFloat32Array('Process Loading (L/m²)', [guessedProcessLoading2]),
|
|
202
|
+
DG.Column.fromFloat32Array('Max P (psi)', [guessedMaxP2]),
|
|
203
|
+
DG.Column.fromFloat32Array('Process Flux (LMH)', [guessedProcessFlux2]),
|
|
191
204
|
]);
|
package/scripts/vMaxJS.js
CHANGED
|
@@ -2,68 +2,58 @@
|
|
|
2
2
|
//description: Predict the minimum filter size required for the separation of effluent from bioreactors, given the constraints of batch size and total batch time based on a training dataset of time vs filtrate volume for a given filter type, filter area and pressure
|
|
3
3
|
//language: javascript
|
|
4
4
|
//tags: model, filtration
|
|
5
|
-
//input: dataframe inputTable {viewer: OutliersSelectionViewer() | Scatter Plot(
|
|
6
|
-
//input: dataframe
|
|
7
|
-
//input: double
|
|
8
|
-
//input: double
|
|
9
|
-
//input: double
|
|
5
|
+
//input: dataframe inputTable {viewer: OutliersSelectionViewer() | Scatter Plot(filter: "!${isOutlier}", showFilteredOutPoints: "true", filteredOutRowsColor: 4293991195, showRegressionLine: "true") | Grid()}
|
|
6
|
+
//input: dataframe reportingParameters {viewer: Grid()}
|
|
7
|
+
//input: double testFilterArea = 3.5 {caption: Test Filter Area; units: cm²} [Test Filter Area]
|
|
8
|
+
//input: double desiredVolumeOfBatch = 25 {caption: Desired Batch Volume; units: L} [Desired Batch Volume]
|
|
9
|
+
//input: double desiredProcessTime = 0.5 {caption: Desired Process Time; units: hr} [Desired Process Time]
|
|
10
10
|
//input: double sf = 1.5 {caption: Safety Factor} [Safety Factor]
|
|
11
11
|
//help-url: https://github.com/datagrok-ai/public/blob/master/packages/Compute/src/help.md
|
|
12
|
-
//output: dataframe regressionTable {viewer: Scatter Plot(filter: "!${isOutlier}", showFilteredOutPoints: "true", filteredOutRowsColor: 4293991195, showRegressionLine: "true"); category: OUTPUT}
|
|
13
|
-
//output: dataframe
|
|
14
|
-
//output: dataframe
|
|
15
|
-
//output: dataframe
|
|
16
|
-
//output: dataframe
|
|
17
|
-
//output: dataframe
|
|
18
|
-
//output: dataframe
|
|
19
|
-
//output: dataframe sampleCharacteristics {category: OUTPUT}
|
|
20
|
-
//output: dataframe filter {category: OUTPUT}
|
|
12
|
+
//output: dataframe regressionTable {caption: Regression Table; viewer: Scatter Plot(filter: "!${isOutlier}", showFilteredOutPoints: "true", filteredOutRowsColor: 4293991195, showRegressionLine: "true"); category: OUTPUT}
|
|
13
|
+
//output: dataframe trialData {caption: Trial Data; category: OUTPUT}
|
|
14
|
+
//output: dataframe fluxDecayDf {caption: Flux Decay Experimental Results; viewer: Scatter Plot(filter: "!${isOutlier}", showFilteredOutPoints: "true", filteredOutRowsColor: 4293991195) | Grid(); category: OUTPUT}
|
|
15
|
+
//output: dataframe experimentalResultsSummary {caption: Experimental Results Summary; category: OUTPUT}
|
|
16
|
+
//output: dataframe recommendations {caption: Recommendations; category: OUTPUT}
|
|
17
|
+
//output: dataframe sampleCharacteristics {caption: Sample Characteristics; category: OUTPUT}
|
|
18
|
+
//output: dataframe filter {caption: Filter; category: OUTPUT}
|
|
21
19
|
|
|
22
|
-
volume = vbatch;
|
|
23
20
|
function gaussianElimination(input, orderOfPolynomialRegression) {
|
|
24
|
-
const n = input.length - 1
|
|
21
|
+
const n = input.length - 1, coefficients = [orderOfPolynomialRegression];
|
|
25
22
|
for (let i = 0; i < n; i++) {
|
|
26
23
|
let maxrow = i;
|
|
27
|
-
for (let j = i + 1; j < n; j++)
|
|
28
|
-
if (Math.abs(input[i][j]) > Math.abs(input[i][maxrow]))
|
|
24
|
+
for (let j = i + 1; j < n; j++)
|
|
25
|
+
if (Math.abs(input[i][j]) > Math.abs(input[i][maxrow]))
|
|
29
26
|
maxrow = j;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
27
|
for (let k = i; k < n + 1; k++) {
|
|
33
28
|
const tmp = input[k][i];
|
|
34
29
|
input[k][i] = input[k][maxrow];
|
|
35
30
|
input[k][maxrow] = tmp;
|
|
36
31
|
}
|
|
37
|
-
for (let j = i + 1; j < n; j++)
|
|
38
|
-
for (let k = n; k >= i; k--)
|
|
32
|
+
for (let j = i + 1; j < n; j++)
|
|
33
|
+
for (let k = n; k >= i; k--)
|
|
39
34
|
input[k][j] -= (input[k][i] * input[i][j]) / input[i][i];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
35
|
}
|
|
43
36
|
for (let j = n - 1; j >= 0; j--) {
|
|
44
37
|
let total = 0;
|
|
45
|
-
for (let k = j + 1; k < n; k++)
|
|
38
|
+
for (let k = j + 1; k < n; k++)
|
|
46
39
|
total += input[k][j] * coefficients[k];
|
|
47
|
-
}
|
|
48
40
|
coefficients[j] = (input[n][j] - total) / input[j][j];
|
|
49
41
|
}
|
|
50
42
|
return coefficients;
|
|
51
43
|
}
|
|
52
44
|
|
|
53
45
|
function polynomialRegressionCoefficients(xCol, yCol, orderOfPolynomialRegression) {
|
|
54
|
-
const lhs = []
|
|
55
|
-
let a = 0
|
|
46
|
+
const lhs = [], rhs = [], len = xCol.length, k = orderOfPolynomialRegression + 1;
|
|
47
|
+
let a = 0, b = 0;
|
|
56
48
|
for (let i = 0; i < k; i++) {
|
|
57
|
-
for (let l = 0; l < len; l++)
|
|
49
|
+
for (let l = 0; l < len; l++)
|
|
58
50
|
a += (xCol.get(l) ** i) * yCol.get(l);
|
|
59
|
-
}
|
|
60
51
|
lhs.push(a);
|
|
61
52
|
a = 0;
|
|
62
53
|
const c = [];
|
|
63
54
|
for (let j = 0; j < k; j++) {
|
|
64
|
-
for (let l = 0; l < len; l++)
|
|
55
|
+
for (let l = 0; l < len; l++)
|
|
65
56
|
b += xCol.get(l) ** (i + j);
|
|
66
|
-
}
|
|
67
57
|
c.push(b);
|
|
68
58
|
b = 0;
|
|
69
59
|
}
|
|
@@ -84,16 +74,17 @@ for (let i = 0; i < isOutlierCol.length; i++) {
|
|
|
84
74
|
vol.push(inputTable.col('filtrate volume (mL)').get(i));
|
|
85
75
|
}
|
|
86
76
|
}
|
|
87
|
-
dfWithoutOutliers =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
77
|
+
dfWithoutOutliers = inputTable;
|
|
78
|
+
// DG.DataFrame.fromColumns([
|
|
79
|
+
// DG.Column.fromList('double', 'time (min)', timeMin),
|
|
80
|
+
// DG.Column.fromList('double', 'filtrate volume (mL)', vol),
|
|
81
|
+
// ]);
|
|
91
82
|
const timeInMinutes = dfWithoutOutliers.col('time (min)');
|
|
92
83
|
const volumeInMilliliters = dfWithoutOutliers.col('filtrate volume (mL)');
|
|
93
84
|
dfWithoutOutliers.columns.addNewFloat('time (hr)').init((i) => timeInMinutes.get(i) / 60);
|
|
94
85
|
const timeInHours = dfWithoutOutliers.col('time (hr)');
|
|
95
86
|
|
|
96
|
-
dfWithoutOutliers.columns.addNewFloat('V (L/m2)').init((i) => 10 * volumeInMilliliters.get(i) /
|
|
87
|
+
dfWithoutOutliers.columns.addNewFloat('V (L/m2)').init((i) => 10 * volumeInMilliliters.get(i) / testFilterArea);
|
|
97
88
|
const newVolume = dfWithoutOutliers.col('V (L/m2)');
|
|
98
89
|
|
|
99
90
|
dfWithoutOutliers.columns.addNewFloat('t/V (hr/(L/m2))').init((i) => 100 * timeInHours.get(i) / newVolume.get(i));
|
|
@@ -104,88 +95,88 @@ const volumeInLiters = dfWithoutOutliers.col('V (L)');
|
|
|
104
95
|
const timeInSeconds = dfWithoutOutliers.col('Time (s)');
|
|
105
96
|
dfWithoutOutliers.columns.addNewFloat('V/A (L/m2)').init((i) => volumeInLiters.get(i) / area);
|
|
106
97
|
const va = dfWithoutOutliers.col('V/A (L/m2)');
|
|
107
|
-
const
|
|
108
|
-
const cb = [];
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const
|
|
98
|
+
// const va = inputTable.
|
|
99
|
+
const ca = [], cb = [];
|
|
100
|
+
const windowLength = 3;
|
|
101
|
+
for (let i = 0; i < va.length - windowLength; i++) {
|
|
102
|
+
const xCol = DG.Column.fromList('double', 'name', timeInSeconds.toList().slice(i, i + windowLength));
|
|
103
|
+
const yCol = DG.Column.fromList('double', 'name', va.toList().slice(i, i + windowLength));
|
|
112
104
|
const coefficients = polynomialRegressionCoefficients(xCol, yCol, orderOfPolynomialRegression);
|
|
113
105
|
ca.push(coefficients[orderOfPolynomialRegression]);
|
|
114
106
|
cb.push(coefficients[orderOfPolynomialRegression - 1]);
|
|
115
107
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const j =
|
|
121
|
-
|
|
122
|
-
const jj0 =
|
|
123
|
-
|
|
124
|
-
|
|
108
|
+
let newDf = DG.DataFrame.create(dfWithoutOutliers.rowCount - windowLength);
|
|
109
|
+
newDf.columns.addNewFloat('a2').init((i) => (i > 0) ? 3600 * (2 * ca[i] * timeInSeconds.get(i) + cb[i]) : 0);
|
|
110
|
+
newDf.columns.addNewFloat('a1').init((i) => (i > 0) ? 3600 * (2 * ca[i] * timeInSeconds.get(i) + cb[i]) : 0);
|
|
111
|
+
newDf.columns.addNewFloat('J (LMH)').init((i) => (i > 0) ? 3600 * (2 * ca[i] * timeInSeconds.get(i) + cb[i]) : 0);
|
|
112
|
+
const j = newDf.col('J (LMH)');
|
|
113
|
+
newDf.columns.addNewFloat('J/Jo').init((i) => (i > 0) ? j.get(i) / (3600 * area) : 0);
|
|
114
|
+
const jj0 = newDf.col('J/Jo');
|
|
115
|
+
fluxDecayDf = DG.DataFrame.fromColumns([
|
|
116
|
+
DG.Column.fromStrings('Run', Array(jj0.length - 1).fill('1')),
|
|
117
|
+
DG.Column.fromFloat32Array(va.name, va.toList().slice(1, va.length - windowLength)),
|
|
118
|
+
DG.Column.fromFloat32Array(j.name, j.toList().slice(1, j.length)),
|
|
119
|
+
DG.Column.fromFloat32Array(jj0.name, jj0.toList().slice(1, jj0.length)),
|
|
120
|
+
DG.Column.fromList('bool', isOutlierCol.name, isOutlierCol.toList().slice(1, isOutlierCol.length - windowLength))
|
|
121
|
+
]);
|
|
125
122
|
|
|
126
123
|
regressionTable = inputTable;
|
|
127
124
|
coefficients = [1.8, 4.32];//[4.32, 1.8];//polynomialRegressionCoefficients(inputTable.col("time (min)"), dfWithoutOutliers.col("t/V (hr/(L/m2))"), 1);
|
|
128
125
|
const trialThroughput = va.max;
|
|
129
126
|
const flux = 9372.11;
|
|
130
127
|
const ff0 = flux / j.get(1);
|
|
131
|
-
experimentalResults = DG.DataFrame.fromColumns([
|
|
132
|
-
DG.Column.fromList('string', 'Run', ['1']),
|
|
133
|
-
DG.Column.fromList('double', 'Trial Throughput (L/m²)', [trialThroughput]),
|
|
134
|
-
DG.Column.fromList('double', 'Flux (LMH)', [flux]),
|
|
135
|
-
DG.Column.fromList('double', 'Flux/Flux0 (LMH)', [ff0]),
|
|
136
|
-
]);
|
|
137
128
|
const meanFlux = j.stats.avg;
|
|
138
129
|
const vmax = 0.28;//Math.round(1 / coefficients[1]);
|
|
139
130
|
const instantaneousFlux = j.get(j.length - 1);
|
|
140
131
|
const initialFlux = j.get(1);
|
|
141
132
|
const fluxDecay = (1 - instantaneousFlux / initialFlux) * 100;
|
|
133
|
+
const names = reportingParameters.col('Parameter').toList();
|
|
134
|
+
const values = reportingParameters.col('Value').toList();
|
|
142
135
|
experimentalResultsSummary = DG.DataFrame.fromColumns([
|
|
143
|
-
DG.Column.
|
|
144
|
-
DG.Column.
|
|
145
|
-
DG.Column.
|
|
146
|
-
DG.Column.
|
|
147
|
-
|
|
148
|
-
DG.Column.
|
|
149
|
-
DG.Column.
|
|
150
|
-
DG.Column.fromList('double', 'Flux Decay (%)', [fluxDecay]),
|
|
136
|
+
DG.Column.fromStrings('Run', ['1']),
|
|
137
|
+
DG.Column.fromStrings('Filter', [values[names.indexOf('Filter Name')]]),
|
|
138
|
+
DG.Column.fromFloat32Array('Trial Throughput (L/m²)', [trialThroughput]),
|
|
139
|
+
DG.Column.fromFloat32Array('Flux0 (LMH)', [j.get(1)]),
|
|
140
|
+
DG.Column.fromFloat32Array('Mean Flux (LMH)', [meanFlux]),
|
|
141
|
+
DG.Column.fromFloat32Array('Vmax (L/m²)', [vmax]),
|
|
142
|
+
DG.Column.fromFloat32Array('Flux Decay (%)', [fluxDecay]),
|
|
151
143
|
]);
|
|
152
144
|
const q0 = Math.round(1 / coefficients[0]);
|
|
153
|
-
const amin = (
|
|
145
|
+
const amin = (desiredVolumeOfBatch / vmax) + (desiredVolumeOfBatch / desiredProcessTime / q0);
|
|
154
146
|
const installedArea = sf * amin;
|
|
155
147
|
const processLoading = volumeInLiters.get(volumeInLiters.length - 1) / installedArea;
|
|
156
148
|
recommendations = DG.DataFrame.fromColumns([
|
|
157
|
-
DG.Column.
|
|
158
|
-
DG.Column.
|
|
159
|
-
DG.Column.
|
|
160
|
-
DG.Column.
|
|
161
|
-
DG.Column.
|
|
162
|
-
DG.Column.
|
|
163
|
-
DG.Column.
|
|
164
|
-
DG.Column.
|
|
149
|
+
DG.Column.fromFloat32Array('Volume (L)', [desiredVolumeOfBatch]),
|
|
150
|
+
DG.Column.fromFloat32Array('Time (h)', [desiredProcessTime]),
|
|
151
|
+
DG.Column.fromFloat32Array('Amin (m²)', [amin]),
|
|
152
|
+
DG.Column.fromFloat32Array('Safety Factor', [sf]),
|
|
153
|
+
DG.Column.fromFloat32Array('Installed Area', [installedArea]),
|
|
154
|
+
DG.Column.fromFloat32Array('Process Loading (L/m²)', [processLoading]),
|
|
155
|
+
DG.Column.fromStrings('Filter', [values[names.indexOf('Filter Name')]]),
|
|
156
|
+
DG.Column.fromStrings('Installed Device', [values[names.indexOf('Installed Device')]]),
|
|
165
157
|
]);
|
|
166
158
|
|
|
167
159
|
const v90 = vmax * 0.68;
|
|
168
|
-
const
|
|
160
|
+
const initialFlowRate = coefficients[0];
|
|
169
161
|
trialData = DG.DataFrame.fromColumns([
|
|
170
|
-
DG.Column.
|
|
171
|
-
DG.Column.
|
|
172
|
-
DG.Column.
|
|
173
|
-
DG.Column.
|
|
162
|
+
DG.Column.fromFloat32Array('Test Filter Area (m²)', [testFilterArea]),
|
|
163
|
+
DG.Column.fromFloat32Array('Initial Flow Rate (L/h)', [initialFlowRate]),
|
|
164
|
+
DG.Column.fromFloat32Array('Vmax (m²)', [vmax]),
|
|
165
|
+
DG.Column.fromFloat32Array('V90 (m²)', [v90]),
|
|
174
166
|
]);
|
|
175
167
|
|
|
176
168
|
filter = DG.DataFrame.fromColumns([
|
|
177
|
-
DG.Column.
|
|
178
|
-
DG.Column.
|
|
179
|
-
DG.Column.
|
|
180
|
-
DG.Column.
|
|
181
|
-
DG.Column.
|
|
182
|
-
DG.Column.
|
|
169
|
+
DG.Column.fromStrings('Filter Family', [values[names.indexOf('Filter Family')]]),
|
|
170
|
+
DG.Column.fromStrings('Filter Name', [values[names.indexOf('Filter Name')]]),
|
|
171
|
+
DG.Column.fromStrings('Pore Rating (μm)', [values[names.indexOf('Pore rating (μm)')]]),
|
|
172
|
+
DG.Column.fromStrings('Effective Membr. Area (cm^2)', [values[names.indexOf('Effective Membr. Area (cm^2)')]]),
|
|
173
|
+
DG.Column.fromStrings('Membr material', [values[names.indexOf('Membr material')]]),
|
|
174
|
+
DG.Column.fromStrings('Catalog Nr', [values[names.indexOf('Catalog Nr')]]),
|
|
183
175
|
]);
|
|
184
|
-
|
|
185
176
|
sampleCharacteristics = DG.DataFrame.fromColumns([
|
|
186
|
-
DG.Column.
|
|
187
|
-
DG.Column.
|
|
188
|
-
DG.Column.
|
|
189
|
-
DG.Column.
|
|
190
|
-
DG.Column.
|
|
191
|
-
]);
|
|
177
|
+
DG.Column.fromStrings('Date', [values[names.indexOf('date ')]]),
|
|
178
|
+
DG.Column.fromStrings('Prior Step', [values[names.indexOf('Prior Step')]]),
|
|
179
|
+
DG.Column.fromStrings('Prot conc. (mg/mL)', [values[names.indexOf('Prot conc. (mg/mL)')]]),
|
|
180
|
+
DG.Column.fromStrings('Density (g/L)', [values[names.indexOf('Density (g/L)')]]),
|
|
181
|
+
DG.Column.fromStrings('Turbidity (NTU)', [values[names.indexOf('Turbidity (NTU)')]]),
|
|
182
|
+
]);
|