clc,close all,clear;

%% a) 
s = tf('s');
G = 10/(s*(s+5));
SteadyStateError([1,1,1],G)

ess_ramp = 2;
Kv = 1/(ess_ramp/100);
Kc = Kv/dcgain(G*s);

figure;
step(feedback(Kc*G,1))

SteadyStateError([1,1,1],Kc*G)

%% b)
s = tf('s');
G = (s+12)/((s+14)*(s+18));
SteadyStateError([1,1,1],G)

ess = 10;
Kp = 1/(ess/100)-1;
Kc = Kp/dcgain(minreal(G));

figure;
step(feedback(Kc*G,1))

SteadyStateError([1,1,1],Kc*G)