tfer-pma
Code in multiple languages to evaluate the transfer function for particle mass analyzers (including the APM and CPMA), including a web app and Matlab version (cf. github.com/tsipkens/mat-tfer-pma).
Science Score: 77.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: researchgate.net -
✓Committers with academic emails
1 of 2 committers (50.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.0%) to scientific vocabulary
Keywords
Repository
Code in multiple languages to evaluate the transfer function for particle mass analyzers (including the APM and CPMA), including a web app and Matlab version (cf. github.com/tsipkens/mat-tfer-pma).
Basic Info
- Host: GitHub
- Owner: tsipkens
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://tsipkens.github.io/tfer-pma/
- Size: 724 KB
Statistics
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Tools for PMA transfer function evaluation
Available languages: Matlab, Python, Javscript
The attached code evaluates the transfer function of particle mass analyzers (PMAs), including the centrifugal particle mass analyzer (CPMA) and aerosol particle mass analyzer (APM), in multiple languages, including Python and Javascript (used to build a web app). This is primarily done using a novel set of expressions derived from particle tracking methods, information for which is given in an associated paper (Sipkens, Olfert, and Rogak, 2020a). Further information on the different methods in this program is given as header information for each function.
This repository includes mat-tfer-pma as a submodule, which incorporates a Matlab version from a separate repository. More information is available in the README in that repository. What follows mostly pertains to the Python version available in this code.
MATLAB
The Matlab version is included as a submodule in the matlab folder, with the original code located in the mat-tfer-pma repository. We refer the reader to the README associated with that repository for more details, both on the Matlab specific implementation and general details about the transfer functions.
PYTHON
The Python version is in the py folder. This program require numpy; scipy; and generally relies on matplotlib for plotting. Full function requires that these packages be installed.
A simple demonstration
NOTE: This demonstration is also included as a Jupyter Notebook at main.ipynb. Only very minor differences exist between that implementation and the one presented below (e.g. outputting the setpoint dictionary using the json package).
To start, import the numpy library and, since we will be plotting data, the matplotlib.pyplot module,
Python
import matplotlib.pyplot as plt
import numpy as np
Also, import the tfer_pma module, which contains the relevant functions to evaluate the transfer function using the analytical methods from Sipkens, Olfert, and Rogak (2020a), and prop_pma, which is used to load the relevant PMA properties (e.g., classifier length, flow rate):
Python
from prop_pma import prop_pma # import method to load PMA properties
import tfer_pma # import PMA transfer function methods
Now define some fundamental properties, including the mass setpoint, m_star; the masses at which to evaluate the transfer function, m; the mobility diameter of the particles, d (note, using d = None will result in using the mass-mobility relation, using the values in the prop dictionary defined below); and the integer charge state at which to evaluate the transfer function, z:
```Python
define input variables
m_star = 0.01e-18
numpy array spanning 80 to 120% m_star
m = np.arange(0.8,1.2,0.001) * m_star d = None # mobility diameter z = 1. # integer charge state ```
Next, generate a dictionary that contains the properties of the particle mass analyzer, such as its geometry dimensions. Here, we also modify the default mass-mobility parameters to be used in the remainder of the program:
```Python prop = prop_pma() # get default PMA properties
Modify some of the properties,
in this case for the mass-mobility relation.
rhoeff = 900; # effective density prop['m0'] = rhoeff * np.pi / 6 * 1e-27 # only used to find Rm prop['Dm'] = 3 ```
The default parameters here correspond to a centrifugal particle mass analyzer (CPMA), where the electrodes rotate at different speed. We could return an aerosol particle mass analyzer (APM) by setting the ratio of electrode speeds to unity, using:
Python
prop['omega_hat'] = 1; # ratio of angular speeds (CPMA < 1 vs APM = 1)
Now we generate a setpoint dictionary. This quantity is crucial in this program, taking the prop dictionary generated above and two name-value pair arguments that specify the setpoint for the PMA. For example, using the mass setpoint m_star above and a resolution (as defined by Reavell, Symonds, and Rushton (2011)) of 10, we can compute the other relevant parameters to describe the PMA setpoint using:
Python
sp,_ = tfer_pma.get_setpoint(prop, 'm_star', m_star, 'Rm', 10)
The output dictionary will also contain information like the voltage, sp['V']; angular speeds of the inner and outer electrodes, sp['omega1'] and sp['omega2'], respectively; among other relevant properties. One can also use other pairings, such as specifying the voltage and centerline rotation speed:
Python
sp,_ = tfer_pma.get_setpoint(prop, 'V', 24.44, 'omega', 2543.9)
This should give a similar setpoint to the preceding statement, but specifies the setpoint in a different way. It is worth noting that most combinations of two of these parameters will be sufficient to specify to setpoint, with the exception of combining the rotational speed or voltage with a resolution, which will result in an error.
Finally, let's evaluate the transfer function for some of the cases considered in Sipkens, Olfert, and Rogak (2020a). First, consider Case 1S, where the fluid velocity profile is approximated using a 1st-order Taylor series expansion about the equilibrium radius. To do so:
Python
Lambda_1S,_ = tfer_pma.tfer_1S(sp, m, d, z, prop)
Here, Lambda_1S will be a numpy array of the same length as m. The other expressions from Sipkens, Olfert, and Rogak (2020a) can be realized using different methods from tfer_pma module, generally adopting intuitive names corresponding to the case codes from that work. For example, for Case 1C:
Python
Lambda_1C,_ = tfer_pma.tfer_1C(sp, m, d, z, prop)
Adding diffusion to this scenario can be done by adding _diff to the end of the method name above:
Python
Lambda_1C_diff,_ = tfer_pma.tfer_1C_diff(sp, m, d, z, prop)
To finish, plot the evaluate transfer functions,, with the result resembling some of the plots in Sipkens, Olfert, and Rogak (2020a):
```Python
plot the various transfer functions
plt.plot(m, Lambda1S) plt.plot(m, Lambda1C) plt.plot(m, Lambda1Cdiff) plt.show() ```
This sample code is given in the main.py script that is provided with this program.
JAVASCRIPT & WEB APP
A Javascript version is available in the js folder, with dependencies on the math.js and optimization.js packages. That code is structured similarly to the other versions described below.
This version supports a web app available at https://tsipkens.github.io/tfer-pma, which allows the user to interact with basic versions of the transfer function. The corresponding Javascript file responsible for the plotting is available in the docs folder.
License
This software is licensed under an MIT license (see the corresponding file or details).
Contact
This program was written by Timothy A. Sipkens (tsipkens@mail.ubc.ca) while at the University of British Columbia. This program was written in close association with Steven Rogak (University of British Columbia) and Jason Olfert (University of Alberta).
How to cite
This code should be cited by:
citing the associated journal article describing the particle tracking methods used in this program (Sipkens, Olfert, and Rogak, 2020a), and
optionally citing the code directly (making reference to the GitHub repository at https://github.com/tsipkens/tfer-pma).
References
Owner
- Name: Timothy Sipkens
- Login: tsipkens
- Kind: user
- Location: Canada
- Company: National Research Council Canada
- Website: https://tsipkens.github.io
- Repositories: 23
- Profile: https://github.com/tsipkens
Aerosol scientist working with optical diagnostics and inverse analyses.
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Sipkens"
given-names: "Timothy"
orcid: "https://orcid.org/0000-0003-1719-7105"
title: "Tools for PMA transfer function evaluation"
url: "https://github.com/tsipkens/tfer-pma"
preferred-citation:
type: article
authors:
- family-names: "Sipkens"
given-names: "Timothy A."
orcid: "https://orcid.org/0000-0003-1719-7105"
- family-names: "Olfert"
given-names: "Jason S."
orcid: "https://orcid.org/0000-0002-9681-5428"
- family-names: "Rogak"
given-names: "Steven N."
orcid: "https://orcid.org/0000-0002-4418-517X"
doi: "10.1080/02786826.2019.1680794"
journal: "Aerosol Science and Technology"
month: 10
start: 111
end: 127
title: "New approaches to calculate the transfer function of particle mass analyzers"
issue: 1
volume: 54
year: 2019
GitHub Events
Total
- Watch event: 1
- Push event: 3
Last Year
- Watch event: 1
- Push event: 3
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| tsipkens | t****s@g****m | 147 |
| Timothy Sipkens | t****s@u****a | 19 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: almost 2 years ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- jupyter
- matplotlib
- pip
- python
- scipy