-
Notifications
You must be signed in to change notification settings - Fork 0
/
dm2da.m
46 lines (39 loc) · 1.43 KB
/
dm2da.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
% DM2DA Convert the mobility diameter to an aerodynamic diameter.
%
% DA = dm2da(DM,PROP) converts the mobility diameter, DM, to an
% aerodynamic diameter, DA, using the properties in PROP.
% Expects diameters to be in m.
%
% DA = dm2da(...,F_ITER) adds a flag indicating whether
% to use the simple (F_ITER = 0) or iterative (F_ITER = 2)
% evaluation. The former is less accurate but faster.
% Default is F_ITER = 1.
%
% NOTE: Does not require PROP.rhom, which is avoided by using
% an "representative" volume-equivalent diameter that ignores the
% shape factor.
%
% ------------------------------------------------------------------------
%
% AUTHOR: Timothy Sipkens, 2019-01-02
function da = dm2da(dm, prop, f_iter, varargin)
%-- Parse inputs --------------------------%
if ~exist('f_iter', 'var'); f_iter = []; end
if isempty(f_iter); f_iter = 1; end
%-----------------------------------------%
rho0 = 1e3; % density of water
% Compute simple volume-equivalent and aerodynamic diameters,
% that is without iteration.
rhoeff = dm2rhoeff(dm, prop); % effective density
da = dm .* sqrt(rhoeff ./ rho0); % aerodynamic diameter (simple)
%-{
% Alternate, iterative method that is more precise.
opts = optimset('Display', 'off');
if f_iter
% Solve for aerodynamic diameter.
fun = @(da1) 1e9 .* ...
(da .* sqrt(Cc(dm, varargin{:}) ./ Cc(da1, varargin{:})) - da1);
da = fsolve(fun, da, opts);
end
%}
end