-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
429 lines (348 loc) · 16.5 KB
/
index.html
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tfer-pma | PMA transfer function evaluator</title>
<meta name="description"
content="Viz demonstrating the transfer function of the particle mass analyer (PMA) from Sipkens et al. (2020).">
<meta name="keywords"
content="aerosol, particle mass analyzer, PMA, centrifugal particle mass analyzer, CPMA, aerosol particle mass analyzer, APM, particle mass, sipkens">
<meta name="title" property="og:title" content="PMA transfer function evaluator">
<meta name="image" property="og:image" content="docs/imgs/pytferpma_preview.png">
<meta name="author" content="Timothy Sipkens">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="docs/imgs/favicon.png">
<!-- Load d3.js -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://d3js.org/d3.v4.js"></script>
<script src="https://unpkg.com/mathjs/lib/browser/math.js" type="text/javascript"></script>
<!-- Used for mathematical optimization -->
<script src="https://unpkg.com/optimization-js@latest/dist/optimization.js" type="text/javascript"></script>
<script src="js/tfer_pma.js"></script>
<!-- Import font awesome icons -->
<script src="https://kit.fontawesome.com/58cf1bb60d.js" crossorigin="anonymous"></script>
<!-- Load fonts -->
<link href="https://fonts.cdnfonts.com/css/gotham-narrow" rel="stylesheet">
<link href="https://fonts.cdnfonts.com/css/gotham" rel="stylesheet">
<link href="index.css" rel="stylesheet">
<meta name="theme-color" content="#121212">
<meta name="color-scheme" content="light dark" />
<script>
// Initialize light/dark mode.
const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)");
var dark = prefersDarkScheme.matches;
// Apply appropriate theme.
function toggleNight() {
dark = !dark;
// Swap CSS.
document.body.classList.toggle("dark-theme");
// Update background color
if (dark) {
document.querySelector(':root').style.setProperty('--background-color', '#0D1117');
} else {
document.querySelector(':root').style.setProperty('--background-color', '#FDFDFD');
}
scrollFunction();
};
</script>
</head>
<body onload="if (dark) { dark = !dark; toggleNight(); }">
<div id="header">
<div id="colorbar"></div>
<div class="pre-main">
<div class="post-header">
<div>
<a href="#h1" id="header-logo"><b>tfer-pma.</b></a>
<a href="https://www.tandfonline.com/doi/full/10.1080/02786826.2019.1680794" id="data-link-a">
<span><i class="fa-solid fa-file-lines"></i></span>
<span style="padding-left:4px;">Link to paper</span>
</a>
<a href="https://github.com/tsipkens">
<span><i class="fa-brands fa-github"></i></span>
<span style="padding-left:4px;">@tsipkens</span>
</a>
</div>
<button onclick="toggleNight()" class="light-dark-toggle" id="light-dark-toggle-bar">
<span><i class="fas fa-moon" id="moon"></i></span>
<span><i class="fas fa-sun" id="sun"></i></span>
</button>
</div>
</div>
</div>
<div class="pre-main">
<div class="main">
<div style="margin-bottom:20px;" id="light-dark-toggle-inpage">
<button onclick="toggleNight()" class="light-dark-toggle">
<span><i class="fas fa-moon" id="moon"></i></span>
<span><i class="fas fa-sun" id="sun"></i></span>
</button>
</div>
<a class="anchor" id="h1"></a>
<h1 class="title">tfer-pma.</h1>
<h2 class="subtitle">A particle mass analyzer<br>transfer function<br>evaluator.</h2>
<div class="imgwrap">
<img src="docs/imgs/top_a.svg" id="img1">
<img src="docs/imgs/top_b.svg" id="img2">
<img src="docs/imgs/top_a_dark.svg" id="img1d">
<img src="docs/imgs/top_b_dark.svg" id="img2d">
</div>
<p align="justify">
This web app examines the transfer function of particle mass analyzers,
like the centrifugal particle mass analyer (CPMA) or aerosol particle
mass analyzer (APM).
We refer the reader to
<a href="https://doi.org/10.1080/02786826.2019.1680794">
Sipkens et al. (2020)</a>
for more information on the underlying analytical transfer functions. A
supporting repository with code to evaluate the PMA transfer functions is available
<a href="https://github.com/tsipkens/tfer-pma">here</a>
— including
<a href="https://github.com/tsipkens/mat-tfer-pma">Matlab</a>,
<a href="https://github.com/tsipkens/tfer-pma/tree/master/py">Python</a>, and
<a href="https://github.com/tsipkens/tfer-pma/tree/master/js">Javacsript</a> versions.
A separate Matlab version, which can be imported into larger projects
is also available
<a href="https://github.com/tsipkens/mat-tfer-pma">here</a>
(e.g., this package is imported into
<a href="https://github.com/tsipkens/mat-2d-aerosol-inversion">mat-2d-aerosol-inversion</a>).
</p>
<p align="justify">
<b>APM</b> (aerosol particle mass analyzer) conditions are achieved
when ω<sub>2</sub>/ω<sub>1</sub> = 1.
Typcialy <b>CPMA</b> (centrifugal particle mass analyzer) conditions
are achieved when ω<sub>2</sub>/ω<sub>1</sub> = 0.9696.
Another interesting condition occurs when doubling the length to 40 cm,
a scenario that can (very, very roughly) approximate two devices in series.
In this case, diffusion is much larger, resulting in smooth, Gaussian-like
curves even for m* ≈ 5 fg with distinct charging peaks.
</p>
<p align="justify">
We note that Case 1S, following from the approach proposed
<a href="https://doi.org/10.1016/0021-8502(95)00562-5">Ehara et al. (1996)</a>,
results in various anomalies. For example, in the default app settings, there is
an anomaly for the z = 1 transfer function, which appears as a linear increase
in the transfer function for m/m* > 2 (enable Case 1S below to see this).
This artifact is a consequence
of solving for the equilibrium raidus and demonstrates a limitation
of that approach. Other anomalies include problems with calculating the
uncharged (z = 0) contributions. The method is generally stable
for the ω<sub>2</sub>/ω<sub>1</sub> = 1, the case originally intended by
<a href="https://doi.org/10.1016/0021-8502(95)00562-5">Ehara et al. (1996)</a>.
</p>
<p>
The default view shows contributions from
integer charge states z = 1 through 3.
All cases correspond to uniform flow
— for parabolic transfer functions see
<a href="https://doi.org/10.1080/02786826.2019.1680794">
Sipkens et al. (2020)</a>.
A few preset conditions:
<ol style="padding-bottom:40px;">
<li><a href="#hgraphic" id="setapm">APM conditions</a></li>
<li><a href="#hgraphic" id="setcpma">CPMA conditions</a></li>
<li><a href="#hgraphic" id="setehara_c">Ehara, Fig. 8c</a> (uniform flow only)</li>
<li><a href="#hgraphic" id="setolfertcollings_a">Olfert and Collings, Fig. 5a</a> (Couette CPMA curve)</li>
</ol>
</p>
<div class="head-div">
<h2>Visualization</h2>
</div>
<h3>Classifier and particle properties</h3>
<div class="control">
<span class="control-label">Inner radius</span>
<span class="control-unit">cm</span> <br>
<input class="textinput" id="r1num" type="number" min="1" max="20" step="0.01" value="0">
</div>
<div class="control">
<span class="control-label">Outer radius</span>
<span class="control-unit">cm</span> <br>
<input class="textinput" id="r2num" type="number" min="1" max="20" step="0.01" value="0">
</div>
<div class="control">
<span class="control-label">Length</span>
<span class="control-unit">cm</span> <br>
<input class="textinput" id="Lnum" type="number" value="20" min="1">
</div>
<br>
<div class="control">
<span class="control-label">Flow rate</span>
<span class="control-unit">LPM</span> <br>
<input class="textinput" id="Qnum" type="number" min="0.5" max="100" step="0.1" value="3">
</div>
<div class="control">
<span class="control-label">ω<sub>2</sub>/ω<sub>1</sub></span> <br>
<input class="textinput" id="omegahnum" type="number" min="0.5" max="1.1" step="0.001" value="0"> <br>
<span class="control-unit" style="line-height:10pt"></span>
</div>
<div class="control">
<span class="control-label">D<sub>m</sub></span> <br>
<input class="textinput" id="Dmnum" type="number" min="0.1" max="4" step="0.05" value="0.1">
</div>
<div class="control">
<span class="control-label">ρ<sub>eff,100</sub></span>
<span class="control-unit">kg/m³</span> <br>
<input class="textinput" id="rhonum" type="number" min="20" max="1e4" step="20" value="20">
</div>
<br>
<div class="control">
<span class="control-label">Integer charge states </span> <br>
<label class="cb" for="cbZ0">
<input type="checkbox" class="cbZ" id="cbZ0" value="0" checked>
<span class="cbspan">Uncharged</span>
</label> <br>
<label class="cb" for="cbZ1">
<input type="checkbox" class="cbZ" id="cbZ1" value="1" checked>
<span class="cbspan">z = 1</span>
</label> <br>
<label class="cb" for="cbZ2">
<input type="checkbox" class="cbZ" id="cbZ2" value="2" checked>
<span class="cbspan">z = 2</span>
</label> <br>
<label class="cb" for="cbZ3">
<input type="checkbox" class="cbZ" id="cbZ3" value="3" checked>
<span class="cbspan">z = 3</span>
</label> <br>
<label class="cb" for="cbZ4">
<input type="checkbox" class="cbZ" id="cbZ4" value="4" checked>
<span class="cbspan">z = 4</span>
</label>
</div>
<div class="control">
<span class="control-label">Include charging? </span>
<div style="line-height:11pt;">
<span class="control-unit" style="padding:0px;line-height:7pt;">Wiedensohler, z = 3
<br> Gopalakrishnan, z < 3 </span> </div> <label class="cb" for="fCharge">
<input type="checkbox" class="fCharge" id="fCharge" value="0" unchecked>
</label> <br>
</div>
<div class="control">
<span class="control-label" style="padding-top:0px;">Include Case 1S? </span>
<div style="line-height:11pt;">
<span class="control-unit">(Removed for clarity)</span> <br>
</div>
<label class="cb" for="f1S">
<input type="checkbox" class="fCharge" id="f1S" value="0" unchecked>
</label> <br>
</div>
<a class="anchor" id="hgraphic"></a>
<h3>Setpoint</h3>
<!-- Add sliders etc. -->
<div class="control" id="select-div">
<span class="control-label">Setpoint mode </span> <br>
<select id="sp-mode">
<option>Mass + Resolution</option>
<option>Mass + Voltage</option>
<option>Mass + Angular speed</option>
</select> <br>
</div>
<div class="control">
<span class="control-label" id="var1-name">Mass setpoint </span>
<span class="control-unit">fg</span> <br>
<input class="textinput" name="mSlider" id="mSlider" type="number" value="0.01" step="0.002" min="0.002">
<!-- <input type="range" name="mSlider" id="mSlider" min="1" max="23" value="8" class="slider"> -->
</div>
<div class="control">
<span class="control-label" id="var2-name">Resolution</span>
<span class="control-unit" id="var2-units"></span> <br>
<input class="textinput" name="RmSlider" id="RmSlider" type="number" value="5" step="0.5" min="0">
<!-- <input type="range" name="RmSlider" id="RmSlider" min="1" max="14" value="8" onchange="displayRmval(this.value);" class="slider"> <br> -->
</div>
<br>
<div class="control">
<span class="control-label" id="var3-name">Angular speed </span> <br>
ω = <div class="output-div" id="Wval">-</div> rad/s <br>
ω = <div class="output-div" id="Wrpmval">-</div> RPM
</div>
<div class="control">
<span class="control-label" id="var4-name">Voltage </span> <br>
V = <div class="output-div" id="Vval">-</div> V
</div>
<div class="control">
<span class="control-label" id="var5-name">Resolution </span> <br>
R<sub>m</sub> = <div class="output-div" id="Rmval2">-</div>
</div>
<div class="control" style="width:95%;display:inline-block">
<span class="control-label" style="padding-bottom:0px;">Mobility diameter @ (m*, 2m*, 3m*) </span>
<span class="control-unit"> nm</span> <br>
(<div class="output-div" id="dmval1">-</div>,
<div class="output-div" id="dmval2">-</div>,
<div class="output-div" id="dmval3">-</div>)
</div>
<div class="control" style="width:95%;display:inline-block">
<span class="control-label" style="padding-bottom:0px;">Specific mass @ (m*, 2m*, 3m*) </span>
<span class="control-unit"> kg/C</span> <br>
(<div class="output-div" id="sval1">-</div>,
<div class="output-div" id="sval2">-</div>,
<div class="output-div" id="sval3">-</div>)
</div>
<div id="myz" style="margin-top:10px;"></div>
<!-- Create a div where the graph will take place -->
<div id="my_dataviz"></div>
<h3>Legend</h3>
<div>
<div id="my_legend"></div>
</div>
<script src="docs/index.js"></script>
<div class="head-div">
<h2>References and resources</h2>
</div>
<ol>
<h3>Citing this work</h3>
<p>
The analytical transfer functions are given in a journal article:
</p>
<p>
<li>
T. A. Sipkens, J. S. Olfert, S. N. Rogak.
New approaches to calculate the transfer function of particle mass analyzers.
<i>Aerosol Science and Technology</i> <b>54</b>, 111-127 (2020).
<a style="display:inline-block;" href="https://doi.org/10.1080/02786826.2019.1680794">10.1080/02786826.2019.1680794</a>
</li>
</p>
<p>
This paper should be cited when referring to the underlying functions.
</p>
<p>
Code supporting this viz is open source and available in an
<a href="https://github.com/tsipkens/tfer-pma">associated repository</a> on GitHub.
</p>
<h3>Other resources</h3>
<p>
<li>
K. Ehara, C. Hagwood, K. J. Coakley.
Novel method to classify aerosol particles according to their mass-to-charge ratio—aerosol particle mass analyser.
<i>Journal of Aerosol Science</i> <b>27</b>, 217-234 (1996).
<a style="display:inline-block;" href="https://doi.org/10.1016/0021-8502(95)00562-5">10.1016/0021-8502(95)00562-5</a>
</li>
</p>
</ol>
</div>
</div>
</body>
<script>
// When the user scrolls down 50px from the top of the document, reformat header
window.onscroll = function () {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 60) {
if (dark) {
document.getElementById("header").style.borderBottom = "1px #242526 solid";
document.getElementById("header").style.boxShadow = "0px 0px 10px #111";
} else {
document.getElementById("header").style.borderBottom = "1px #DDD solid";
document.getElementById("header").style.boxShadow = "0px 0px 10px #F0F0F0";
}
} else {
if (dark) {
document.getElementById("header").style.borderBottom = "1px var(--background-color) solid";
document.getElementById("header").style.boxShadow = "none";
} else {
document.getElementById("header").style.borderBottom = "1px var(--background-color) solid";
document.getElementById("header").style.boxShadow = "none";
}
}
}
scrollFunction(); // initialize
</script>
</html>