-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtfer_tri.m
29 lines (23 loc) · 1.05 KB
/
tfer_tri.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
% TFER_TRI Evaluates the transfer function for a PMA as a triangular function.
% Author: Timothy Sipkens, 2018-12-27
%
% Inputs:
% sp Structure defining various setpoint parameters
% (e.g. m_star, V). Use 'get_setpoint' method to generate
% this structure.
% m Particle mass
% ~ Placeholder for mobility diameter
% ~ Placeholder for integer charge state
% ~ Placeholder for device properties (e.g. classifier length)
%
% Outputs:
% Lambda Transfer function
%=========================================================================%
function [Lambda] = tfer_tri(sp,m,~,~,~)
m_del = [sp.m_max]' - [sp.m_star]'; % FWHM of the transfer function (related to resolution)
m_min = 2 .* [sp.m_star]' - [sp.m_max]'; % lower end of the transfer function
% Evaluate the transfer function.
Lambda = zeros(length(sp), length(m))+...
(m <= [sp.m_star]') .* (m > m_min) .* (m - m_min) ./ m_del + ...
(m > [sp.m_star]') .* (m < [sp.m_max]') .* (([sp.m_star]' - m) ./ m_del + 1);
end