function [g,factor,power] = dcgain(PID)
% Computes DC gain and DC equivalent.

%   Author(s): Rong Chen
%   Copyright 2009 MathWorks, Inc.

% convert to internal parameterization
[P,I,~,~,b] = utGetInternalParams(PID);
% s=0 or z=1
if I==0
    % no integrator
    g = [P*b -P];
    factor = [P*b -P];
    power = [0 0];
else
    % has integrator
    g = [inf inf];
    factor = I*(abs(PID.Ts))^(PID.Ts~=0)*[1 -1]; % I times Ts if discrete time
    power = [-1 -1];
end

