Skip to content

Commit

Permalink
Update to mp2zp to consider prop
Browse files Browse the repository at this point in the history
Updates to mp2zp to take prop structure as an input, which allows for specifying the mass-mobility exponent and prefactor.

Also, renamed prop_pma.
  • Loading branch information
tsipkens committed Nov 1, 2019
1 parent 2299a0e commit 0118d03
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 25 deletions.
8 changes: 4 additions & 4 deletions +tfer_pma/get_setpoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

if isempty(d) % evaluate mechanical mobility
warning('Invoking mass-mobility relation to determine Zp.');
B = tfer_pma.mp2zp(m,z,prop.T,prop.p);
B = tfer_pma.mp2zp(m,z,prop.T,prop.p,prop);
else
B = tfer_pma.dm2zp(d,z,prop.T,prop.p);
end
Expand All @@ -77,7 +77,7 @@

%-- Calculate resolution ---------------------------------------------%
n_B = -0.6436;
B_star = tfer_pma.mp2zp(m_star,1,prop.T,prop.p);
B_star = tfer_pma.mp2zp(m_star,1,prop.T,prop.p,prop);
t0 = prop.Q/(m_star*B_star*2*pi*prop.L*...
sp.omega^2*prop.rc^2);
m_rat = @(Rm) 1/Rm+1;
Expand Down Expand Up @@ -127,7 +127,7 @@
%-- Use definition of Rm to derive angular speed at centerline -------%
%-- See Reavell et al. (2011) for resolution definition --%
n_B = -0.6436;
B_star = tfer_pma.mp2zp(m_star,1,prop.T,prop.p);
B_star = tfer_pma.mp2zp(m_star,1,prop.T,prop.p,prop);
% involves invoking mass-mobility relation
% z = 1 for the setpoint

Expand Down Expand Up @@ -155,7 +155,7 @@
% copy center mass to sp
% center mass is for a singly charged particle

% B_star = tfer_pma.mp2zp(m_star,1,prop.T,prop.p);
% B_star = tfer_pma.mp2zp(m_star,1,prop.T,prop.p,prop);
C0 = sp.V.*q./log(1/prop.r_hat); % calcualte recurring C0 parameter

end
26 changes: 21 additions & 5 deletions +tfer_pma/mp2zp.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
% Author: Timothy Sipkens, 2019-01-02
%=========================================================================%

function [Zp,B,d] = mp2zp(m,z,T,P)
function [Zp,B,d] = mp2zp(m,z,T,P,prop)

%-------------------------------------------------------------------------%
% Inputs:
% m Particle mass
% z Integer charge state
% T System temperature
% P System pressure
% prop CPMA/DMA properties structure
%
% Outputs:
% Zp Electromobility
Expand All @@ -23,15 +24,30 @@
%-------------------------------------------------------------------------%


%-- Invoke mass-mobility relation ----------------------------------------%
mass_mob_pref = 0.0612; %524;
mass_mob_exp = 2.48; %3;
%-- 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,'mass_mob_pref'),...
isfield(prop,'mass_mob_exp'))) % get parameters for the mass-mobility relation
mass_mob_pref = 0.0612;
mass_mob_exp = 2.48;
else
mass_mob_pref = prop.mass_mob_pref;
mass_mob_exp = prop.mass_mob_exp;
end
% if isempty(prop); mass_mob_pref = 524; mass_mob_exp = 3; end
%-------------------------------------------------------------------------%


d = (m./mass_mob_pref).^(1/mass_mob_exp);
% use mass-mobility relationship to get mobility diameter


%-- Use mobility diameter to get particle electro and mechanical mobl. ---%
if nargin<3
if or(isempty(T),isempty(P))
[Zp,B] = tfer_pma.dm2zp(d,z);
else
[Zp,B] = tfer_pma.dm2zp(d,z,T,P);
Expand Down
2 changes: 1 addition & 1 deletion +tfer_pma/prop_PMA.m → +tfer_pma/prop_pma.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
% Author: Timothy Sipkens, 2019-06-26
%=========================================================================%

function [prop] = prop_PMA(opts)
function [prop] = prop_pma(opts)
%-------------------------------------------------------------------------%
% Input:
% opt Options string specifying parameter set
Expand Down
2 changes: 1 addition & 1 deletion +tfer_pma/tfer_1C_diff.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

%-- Evaluate mechanical mobility for diffusion calc. ---------------------%
if ~exist('d','var')
B = tfer_pma.mp2zp(m,z,prop.T,prop.p);
B = tfer_pma.mp2zp(m,z,prop.T,prop.p,prop);
% if mobility is not specified, use mass-mobility relation to estimate
else
B = tfer_pma.dm2zp(d,z,prop.T,prop.p);
Expand Down
2 changes: 1 addition & 1 deletion +tfer_pma/tfer_1S_diff.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

%-- Evaluate mechanical mobility for diffusion calc. ---------------------%
if ~exist('d','var')
B = tfer_pma.mp2zp(m,z,prop.T,prop.p);
B = tfer_pma.mp2zp(m,z,prop.T,prop.p,prop);
% if mobility is not specified, use mass-mobility relation to estimate
else
B = tfer_pma.dm2zp(d,z,prop.T,prop.p);
Expand Down
2 changes: 1 addition & 1 deletion +tfer_pma/tfer_2C_diff.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

%-- Evaluate mechanical mobility for diffusion calc. ---------------------%
if ~exist('d','var')
B = tfer_pma.mp2zp(m,z,prop.T,prop.p);
B = tfer_pma.mp2zp(m,z,prop.T,prop.p,prop);
% if mobility is not specified, use mass-mobility relation to estimate
else
B = tfer_pma.dm2zp(d,z,prop.T,prop.p);
Expand Down
2 changes: 1 addition & 1 deletion +tfer_pma/tfer_2S_diff.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

%-- Evaluate mechanical mobility for diffusion calc. ---------------------%
if ~exist('d','var')
B = tfer_pma.mp2zp(m,z,prop.T,prop.p);
B = tfer_pma.mp2zp(m,z,prop.T,prop.p,prop);
% if mobility is not specified, use mass-mobility relation to estimate
else
B = tfer_pma.dm2zp(d,z,prop.T,prop.p);
Expand Down
2 changes: 1 addition & 1 deletion +tfer_pma/tfer_GE_diff.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

%-- Evaluate mechanical mobility for diffusion calc. ---------------------%
if ~exist('d','var')
B = tfer_pma.mp2zp(m,z,prop.T,prop.p);
B = tfer_pma.mp2zp(m,z,prop.T,prop.p,prop);
% if mobility is not specified, use mass-mobility relation to estimate
else
B = tfer_pma.dm2zp(d,z,prop.T,prop.p);
Expand Down
2 changes: 1 addition & 1 deletion +tfer_pma/tfer_W1_diff.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

%-- Evaluate mechanical mobility for diffusion calc. ---------------------%
if ~exist('d','var')
B = tfer_pma.mp2zp(m,z,prop.T,prop.p);
B = tfer_pma.mp2zp(m,z,prop.T,prop.p,prop);
% if mobility is not specified, use mass-mobility relation to estimate
else
B = tfer_pma.dm2zp(d,z,prop.T,prop.p);
Expand Down
6 changes: 3 additions & 3 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
d = (6.*m./(rho_eff.*pi)).^(1/3);
% specify mobility diameter vector with constant effective density

prop = tfer_pma.prop_PMA('Olfert'); % get properties of the CPMA
prop.omega_hat = 1; % NOTE: Uncomment for APM condition
prop = tfer_pma.prop_pma('Olfert'); % get properties of the CPMA
% prop.omega_hat = 1; % NOTE: Uncomment for APM condition


%=========================================================================%
Expand All @@ -35,7 +35,7 @@
%-- Transfer functions for different cases -------------------------------%
%-- Setup for centriputal force ------------------------------------------%
if ~exist('d','var')
B = tfer_pma.mp2zp(m,z,prop.T,prop.p);
B = tfer_pma.mp2zp(m,z,prop.T,prop.p,prop);
else
B = tfer_pma.dm2zp(d,z,prop.T,prop.p);
end
Expand Down
4 changes: 2 additions & 2 deletions main_charge.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
d = (6.*m./(rho_eff.*pi)).^(1/3);
% specify mobility diameter vector with constant effective density

prop = tfer_pma.prop_PMA('Olfert'); % get properties of the CPMA
prop = tfer_pma.prop_pma('Olfert'); % get properties of the CPMA
% prop.omega_hat = 1; % NOTE: Uncomment for APM condition


Expand All @@ -39,7 +39,7 @@
%-- Transfer functions for different cases -------------------------------%
%-- Setup for centriputal force ------------------------------------------%
if ~exist('d','var')
B = tfer_pma.mp2zp(m,z,prop.T,prop.p);
B = tfer_pma.mp2zp(m,z,prop.T,prop.p,prop);
else
B = tfer_pma.dm2zp(d,z,prop.T,prop.p);
end
Expand Down
2 changes: 1 addition & 1 deletion main_ehara.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
d = (6.*m./(rho_eff.*pi)).^(1/3);
% specify mobility diameter vector with constant effective density

prop = tfer_pma.prop_PMA('Ehara'); % get properties of the CPMA
prop = tfer_pma.prop_pma('Ehara'); % get properties of the CPMA

%=========================================================================%
%-- Finite difference solution -------------------------------------------%
Expand Down
2 changes: 1 addition & 1 deletion main_kuwata.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
d = 100e-9.*ones(size(m));
% specify mobility diameter vector with constant effective density

prop = tfer_pma.prop_PMA('Kuwata'); % get properties of the CPMA
prop = tfer_pma.prop_pma('Kuwata'); % get properties of the CPMA
prop.D = @(B) 1e-10.*ones(size(B));


Expand Down
4 changes: 2 additions & 2 deletions main_olfert_collings.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
d = (6.*m./(rho_eff.*pi)).^(1/3);
% specify mobility diameter vector with constant effective density

prop = tfer_pma.prop_PMA('Olfert-Collings'); % get properties of the CPMA
prop = tfer_pma.prop_pma('Olfert-Collings'); % get properties of the CPMA
prop.D = @(B) 1e-10.*ones(size(B));
omega_hat = prop.omega_hat; % only valid for CPMA

Expand All @@ -42,7 +42,7 @@
%=========================================================================%
%-- Transfer functions for different cases -------------------------------%
%-- Setup for centriputal force ------------------------------------------%
prop = tfer_pma.prop_PMA('Olfert-Collings'); % get properties of the CPMA
prop = tfer_pma.prop_pma('Olfert-Collings'); % get properties of the CPMA
B = tfer_pma.dm2zp(d,z,prop.T,prop.p);
tau = B.*m;

Expand Down

0 comments on commit 0118d03

Please sign in to comment.