function [Dzero] = fun(kc)

global gc gp y t


gc = controller(0,kc,0);

sim('model_approx')

[pks,locs] = findpeaks(y);

t_yp = t(locs(1));

y_max = pks(1);

y_inf = y(end);

D = (y_max-y_inf)/y_inf;

Dzero = D-0.3;

end
