
% This is function funiaepiki.m
% Minimizes IAE
% uses Ki = x(1) during minimization


function funiaepi = f(x)
global Tid y ys Kc taui taud 


Kc=x(1)
taui=x(2)
   
  sim('tunepid');
  funiaepi = iae(Tid,y-ys)


