-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe5.ts
More file actions
36 lines (33 loc) · 975 Bytes
/
e5.ts
File metadata and controls
36 lines (33 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/** Kintetic constants for the E5 model */
enum E5 {
K1 = 7.89e-10,
K2 = 1.13e9,
K3 = 1.1e7,
K4 = 1.13e3,
};
/** The E5 model (chemical pyrolysis: https://archimede.uniba.it/~testset/report/e5.pdf) */
export const e5 = {
name: 'E5',
arg: {name: 't', start: 0, finish: 1e13, step: 2.5e8},
initial: [0.00176, 0, 0, 0],
func: (t: number, y: Float64Array, output: Float64Array) => {
// extract function values
const y1 = y[0];
const y2 = y[1];
const y3 = y[2];
const y4 = y[3];
// compute output
output[0] = -E5.K1 * y1 - E5.K3 * y1 * y3;
output[1] = E5.K1 * y1 - E5.K2 * y2 * y3;
output[2] = E5.K1 * y1 - E5.K2 * y2 * y3 - E5.K3 * y1 * y3 + E5.K4 * y4;
output[3] = E5.K3 * y1 * y3 - E5.K4 * y4;
},
tolerance: 1e-6,
solutionColNames: ['y1', 'y2', 'y3', 'y4'],
};
export const e5ReferencePoint = new Float64Array([
0.1152903278711829E-290,
0.8867655517642120E-22,
0.8854814626268838E-22,
0,
]);