function friction_force = fcn(v)


%parameters
    F_pos = 1.4e-5; %'N*m'};   % F coefficient (w>0)  (L)
    K_pos = 1.4e-5; %'(N*m)*s/rad'};   % K coefficient (w>0.05)  (L)
    m_pos = 1.4e-5; %'(N*m)*s/rad'};   % m coefficient (0.05>w>0)  (L)
    F_neg = 5e-5;   %'N*m'};   % F coefficient (w<=0) (U)
    K_neg = 5e-5;   %'(N*m)*s/rad'};   % K coefficient (w<=-0.05) (U)  
    m_neg = 5e-5;   %'(N*m)*s/rad'};   % m coefficient (-0.05<w<=0) (U)  
    w_pos = 0.05;   %'rad/s'};   % w positive 
    w_neg = -0.05;  %'rad/s'};   % w negative 
   
    r = 1; %m, wheel radius 
    w = v/r;

% variables
%    w = { value = { 0, 'rad/s' }, priority = priority.high };   % Rotational velocity
%    t = { 0, 'N*m' };                                           % Torque
%  branches
%    t : R.t -> C.t; % torque through from node R to node C


%     assert(F_pos >= 0)
%     assert(K_pos >= 0)
%     assert(m_pos >= 0)
%     assert(w_pos > 0)
%     assert(F_neg <= 0)
%     assert(K_neg >= 0)
%     assert(m_neg >= 0)
%     assert(w_neg < 0)
    %
   % w == R.w - C.w;
    if  w < w_neg  % ADD EQUAL??????
        torque = F_neg - K_neg * abs(w) ; % (U)
    elseif (w_neg < w) && (w <= 0)
        torque = - m_neg * abs(w) ;
    elseif (0 < w) && (w < w_pos)
        torque = m_pos * abs(w) ; 
    else
        torque = F_pos + K_pos * abs(w) ;  % (L)
    end

   friction_force = torque/r;
 
end % end component
