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


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

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


