-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmp2zp.m
51 lines (40 loc) · 1.48 KB
/
mp2zp.m
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
% MP2ZP Calculate electric mobility from a vector of particle mass.
% Author: Timothy Sipkens, 2019-01-02
%
% Inputs:
% m Particle mass
% z Integer charge state
% T System temperature
% P System pressure
% prop CPMA/DMA properties structure
%
% Outputs:
% B Mechanical mobility
% Zp Electromobility
% d Mobility diameter (implied by mass-mobility relation)
%
% Note:
% Uses mass-mobility relationship to first convert to a mobility
% diameter and then estimates the mobility using dm2zp.
%=========================================================================%
function [B,Zp,d] = mp2zp(m,z,T,P,prop)
%-- Parse inputs ---------------------------------------------------------%
if ~exist('T', 'var'); T = []; end
if ~exist('P', 'var'); P = []; end
if ~exist('prop', 'var'); prop = []; end
if or(isempty(prop),...
~and(isfield(prop,'m0'),...
isfield(prop,'Dm'))) % get parameters for the mass-mobility relation
error(['Please specify the mass-mobility relation parameters ',...
'in the prop structure.']);
end
%-------------------------------------------------------------------------%
d = 1e-9 .* (m ./ prop.m0) .^ (1 / prop.Dm);
% use mass-mobility relationship to get mobility diameter
%-- Use mobility diameter to get particle electro and mechanical mobl. ---%
if or(isempty(T),isempty(P))
[B, Zp] = dm2zp(d, z);
else
[B, Zp] = dm2zp(d, z, T, P);
end
end