function s = arb_base_function(t,w,flag,b1,b2,A,B,omega,NH);
%
Y=A(1)*cos(omega(1)*t)+B(1)*sin(omega(1)*t);
%
for(i=2:NH)
    Y=Y+A(i)*cos(omega(i)*t)+B(i)*sin(omega(i)*t);
end
%
s = zeros(2,1);
s(1) = w(2);
s(2) = b1*w(1) + b2*w(2)-Y;