Skip to content

Commit 497a53f

Browse files
committed
Change FC to FD and remove the dot in the formula.
1 parent c940dbb commit 497a53f

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/component/TransferFunc.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -218,29 +218,29 @@ class TransferFunc extends Component {
218218
}
219219
};
220220

221-
calculatePO = (FC, A, B, C) => {
222-
return A / (1 + B * Math.pow(FC, C)); // Formula PO = A / (1 + B * (FC)^C)
221+
calculatePO = (FD, A, B, C) => {
222+
return A / (1 + B * Math.pow(FD, C)); // Formula PO = A / (1 + B * (FD)^C)
223223
};
224224

225-
calculateRedPO = (FC) => {
225+
calculateRedPO = (FD) => {
226226
const A_red = 18.99;
227227
const B_red = 29.34;
228228
const C_red = -1.33;
229-
return this.calculatePO(FC, A_red, B_red, C_red);
229+
return this.calculatePO(FD, A_red, B_red, C_red);
230230
};
231231

232-
calculateBlackPO = (FC) => {
233-
return this.calculatePO(FC, TransferFuncVar.A, TransferFuncVar.B, TransferFuncVar.C);
232+
calculateBlackPO = (FD) => {
233+
return this.calculatePO(FD, TransferFuncVar.A, TransferFuncVar.B, TransferFuncVar.C);
234234
};
235235

236236
render() {
237237
const { A, B, C, token, version, errorA, errorB, errorC, errorToken, errorVersion, loading} = this.state;
238238

239-
// Generate FC values and PO values
240-
const FCValues = Array.from({ length: 1000 }, (_, i) => Math.pow(10, -3 + (i * 6) / 999)); // From 1e-3 to 1e3
241-
const POValues = FCValues.map(FC => this.calculatePO(FC, A, B, C)); // New PO values (using dynamic A, B, C)
242-
const RedPOValues = FCValues.map(FC => this.calculateRedPO(FC)); // 0-6274
243-
const BlackPOValues = FCValues.map(FC => this.calculateBlackPO(FC)); // Current PO value
239+
// Generate FD values and PO values
240+
const FDValues = Array.from({ length: 1000 }, (_, i) => Math.pow(10, -3 + (i * 6) / 999)); // From 1e-3 to 1e3
241+
const POValues = FDValues.map(FD => this.calculatePO(FD, A, B, C)); // New PO values (using dynamic A, B, C)
242+
const RedPOValues = FDValues.map(FD => this.calculateRedPO(FD)); // 0-6274
243+
const BlackPOValues = FDValues.map(FD => this.calculateBlackPO(FD)); // Current PO value
244244

245245
return (
246246
<MathJaxContext>
@@ -275,20 +275,20 @@ class TransferFunc extends Component {
275275
<Grid item xs={12} xl={4}>
276276
<Typography variant="body1" align="center" gutterBottom style={{ color: '#e53935', fontSize: '1.7rem' }}>
277277
<MathJax style={{ fontSize: '1.7rem', textAlign: 'center' }}>
278-
{`\\( (0-6274) \\ PO_{Texas} = \\frac{18.99}{1 + 29.34 \\cdot (FC)^{-1.33}} \\)`}
278+
{`\\( (0-6274) \\ PO_{Texas} = \\frac{18.99}{1 + 29.34(FD)^{-1.33}} \\)`}
279279
</MathJax>
280280
</Typography></Grid>
281281
<Grid item xs={12} xl={4}>
282282
<Typography variant="body1" align="center" gutterBottom style={{ fontSize: '1.7rem', color: '#444' }}>
283283
<MathJax style={{ fontSize: '1.7rem', textAlign: 'center' }}>
284-
{`\\( Current \\ PO_{Texas} = \\frac{${TransferFuncVar.A}}{1 + ${TransferFuncVar.B} \\cdot (FC)^{${TransferFuncVar.C}}} \\)`}
284+
{`\\( Current \\ PO_{Texas} = \\frac{${TransferFuncVar.A}}{1 + ${TransferFuncVar.B}(FD)^{${TransferFuncVar.C}}} \\)`}
285285
</MathJax>
286286
</Typography>
287287
</Grid>
288288
<Grid item xs={12} xl={4}>
289289
<Typography variant="body1" align="center" gutterBottom style={{ color: '#1976d2', fontSize: '2rem' }}>
290290
<MathJax key={`${A}-${B}-${C}`} style={{ fontSize: '2rem', textAlign: 'center' }}>
291-
{`\\( New \\ PO_{Texas} = \\frac{${A}}{1 + ${B} \\cdot (FC)^{${C}}} \\)`}
291+
{`\\( New \\ PO_{Texas} = \\frac{${A}}{1 + ${B}(FD)^{${C}}} \\)`}
292292
</MathJax>
293293
</Typography>
294294
</Grid>
@@ -312,9 +312,9 @@ class TransferFunc extends Component {
312312
}}>
313313
<Plot
314314
data={[
315-
{ x: FCValues, y: RedPOValues, type: 'scatter', mode: 'lines', name: '0-6274', line: { color: '#e53935' } },
316-
{ x: FCValues, y: BlackPOValues, type: 'scatter', mode: 'lines', name: 'Current PO', line: { color: 'black' } },
317-
{ x: FCValues, y: POValues, type: 'scatter', mode: 'lines', name: 'New PO', line: { color: '#1976d2' } },
315+
{ x: FDValues, y: RedPOValues, type: 'scatter', mode: 'lines', name: '0-6274', line: { color: '#e53935' } },
316+
{ x: FDValues, y: BlackPOValues, type: 'scatter', mode: 'lines', name: 'Current PO', line: { color: 'black' } },
317+
{ x: FDValues, y: POValues, type: 'scatter', mode: 'lines', name: 'New PO', line: { color: '#1976d2' } },
318318
]}
319319
layout={{
320320
autosize: true,
@@ -327,7 +327,7 @@ class TransferFunc extends Component {
327327
tickmode: 'array',
328328
tickvals: [1e-3, 1e-2, 1e-1, 1e0, 1e1, 1e2, 1e3],
329329
ticktext: ['1e-3', '1e-2', '1e-1', '1e0', '1e1', '1e2', '1e3'],
330-
title: 'Cumulative Damage (FC)',
330+
title: 'Cumulative Damage (FD)',
331331
titlefont: { size: 18, color: '#333' },
332332
},
333333
yaxis: {

0 commit comments

Comments
 (0)