Skip to content

Commit

Permalink
Bug fixes: handling of V-omega input
Browse files Browse the repository at this point in the history
  • Loading branch information
tsipkens committed Oct 12, 2019
1 parent bdf52d3 commit 75eba8b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
1 change: 1 addition & 0 deletions +tfer_pma/get_setpoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
m_rat = @(Rm) 1/Rm+1;
fun = @(Rm) (m_rat(Rm))^(n_B+1)-(m_rat(Rm))^n_B;
sp.Rm = fminsearch(@(Rm) (t0-fun(Rm))^2,10);
sp.m_max = m_star*(1/sp.Rm+1);

elseif isfield(sp,'omega1') % if angular speed of inner electrode is specified

Expand Down
2 changes: 1 addition & 1 deletion +tfer_pma/prop_PMA.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
%-------------------------------------------------------------------------%


if ~exist('opt','var') % if properties set is not specified
if ~exist('opts','var') % if properties set is not specified
opts = 'Olfert';
elseif isempty(opts)
opts = 'Olfert';
Expand Down
4 changes: 2 additions & 2 deletions +tfer_pma/tfer_FD.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
%-- Speed computation using resolution to limit computation --------------%
ind = 1:length(m);
if isfield(sp,'Rm') % if resolution is specified, use to reduce necessary computation
cond0 = or(m>(z.*m_star+2.*sp.m_max),...
m<(z.*m_star-2.*sp.m_max));
cond0 = or(m>(z.*sp.m_star+2.*sp.m_max),...
m<(z.*sp.m_star-2.*sp.m_max));
% NOTE: conditions limits consideration of those regions where particles
% do not escape, speeding computation.
ind = ind(~cond0);
Expand Down
2 changes: 1 addition & 1 deletion main_charge.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
m = linspace(1e-10,5,801).*m_star; % vector of mass

z_max = 4;
z_vec = [1,4];%1:z_max;
z_vec = 1:z_max;
for zz=1:length(z_vec)
z = z_vec(zz); % integer charge state
disp(['Processing ',num2str(zz),' of ',num2str(length(z_vec)),'...']);
Expand Down
8 changes: 4 additions & 4 deletions main_ehara.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
clear;
close all;

V = 10; % voltage to replicate Ehara et al.
V = 1000; % voltage to replicate Ehara et al.
omega = 1000*0.1047; % angular speed, converted from rpm to rad/s

e = 1.60218e-19; % electron charge [C]
m = linspace(1e-10,7,601)*e; % vector of mass
m = linspace(260,340,601).*e; % vector of mass
% m = linspace(1e-10,6,601)*e; % vector of mass

z = 1; % integer charge state
Expand Down Expand Up @@ -46,7 +46,7 @@
%-- Method 1S ------------------------------%
tic;
[tfer_1S,G0_1S] = tfer_pma.tfer_1S([],m,d,z,prop,'V',V,'omega',omega);
t(2) = toc;
t(1) = toc;

%-- Method 1S, Ehara et al. ----------------%
tfer_Ehara = tfer_pma.tfer_Ehara([],m,d,z,prop,'V',V,'omega',omega);
Expand All @@ -57,7 +57,7 @@
%-- Method 1S ------------------------------%
tic;
[tfer_1S_pb,G0_1S_pb] = tfer_pma.tfer_1S_pb([],m,d,z,prop,'V',V,'omega',omega);
t(8) = toc;
t(2) = toc;



Expand Down
13 changes: 4 additions & 9 deletions main_olfert_collings.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
clear;
close all;

V = 10; % voltage to replicate Ehara et al.
V = 100; % voltage to replicate Ehara et al.
omega = 2500*0.1047; % angular speed, converted from rpm to rad/s

e = 1.60218e-19; % electron charge [C]
m = linspace(1e-10,1,601)*e; % vector of mass
m = linspace(4,6,601)*e; % vector of mass
% m = linspace(1e-10,6,601)*e; % vector of mass

z = 1; % integer charge state
Expand Down Expand Up @@ -42,21 +42,17 @@
%=========================================================================%
%-- Transfer functions for different cases -------------------------------%
%-- Setup for centriputal force ------------------------------------------%
prop = tfer_pma.prop_CPMA('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;

%-- Particle tracking approaches -----------------------------------------%
%-- Plug flow ------------------------------------------------------------%
%-- Method 1S ------------------------------%
prop.omega_hat = 1; % NOTE: Uncomment for APM condition
prop.omega_hat = 1;
[tfer_1S_w1] = ...
tfer_pma.tfer_1S_pb([],m,d,z,prop,'V',V,'omega',omega);

prop.omega_hat = omega_hat;
[tfer_1S] = ...
tfer_pma.tfer_1S_pb([],m,d,z,prop,'V',V,'omega',omega);



%=========================================================================%
Expand All @@ -67,7 +63,6 @@
plot(m_plot,min(tfer_FD,1));
hold on;
plot(m_plot,min(tfer_FD_w1,1));
plot(m_plot,min(tfer_1S,1));
plot(m_plot,min(tfer_1S_w1,1));
hold off;

Expand Down

0 comments on commit 75eba8b

Please sign in to comment.