function PSET11 % Coded by NFR on 11.26.2018 % This code simulates the responses for individual problem #2 % s = tf('s'); % Part D (only FFC) Gp = 1/(s+1); Gd = 2/(s+1)/(4*s+1); Gv = 1; Gm = 1; Gt = 1; Gf = -2; Gc = 0; Gcl = (Gd+Gt*Gf*Gv*Gp)/(1+Gc*Gv*Gp*Gm); %Plot step unit response from steady state TF: impulse(Gcl) hold on Gp = 1/(s+1); Gd = 2/(s+1)/(4*s+1); Gv = 1; Gm = 1; Gt = 1; Gf = -2/(5*s+1); Gc = 0; Gcl = (Gd+Gt*Gf*Gv*Gp)/(1+Gc*Gv*Gp*Gm); impulse(Gcl) hold off title('Problem 2 - Part D - FFC only') legend('Steady State','Dynamic') % Part E (FFC and FB) figure Gp = 1/(s+1); Gd = 2/(s+1)/(4*s+1); Gv = 1; Gm = 1; Gt = 1; Gf = -2; Gc = 1/3*(s+1)/s; Gcl = (Gd+Gt*Gf*Gv*Gp)/(1+Gc*Gv*Gp*Gm); %Plot step unit response from steady state TF: impulse(Gcl) hold on Gp = 1/(s+1); Gd = 2/(s+1)/(4*s+1); Gv = 1; Gm = 1; Gt = 1; Gf = -2/(5*s+1); Gc = 1/3*(s+1)/s; Gcl = (Gd+Gt*Gf*Gv*Gp)/(1+Gc*Gv*Gp*Gm); impulse(Gcl) hold off title('Problem 2 - Part D - FFC and FB') legend('Steady State','Dynamic') % % % Group Problem 1 figure Gp = 2*exp(-20*s)/(95*s+1); Gd = 0.5*exp(-30*s)/(60*s+1); Gv = 1; Gm = 1; Gt = 1; Gf = -0.25; Gc = 0 Gcl = (Gd+Gt*Gf*Gv*Gp)/(1+Gc*Gv*Gp*Gm); %Plot step unit response from steady state TF: impulse(pade(Gcl)) hold on Gp = 2*exp(-20*s)/(95*s+1); Gd = 0.5*exp(-30*s)/(60*s+1); Gv = 1; Gm = 1; Gt = 1; Gf = -0.25*(95*s+1)/(60*s+1)*exp(-10*s); Gc = 0; Gcl = (Gd+Gt*Gf*Gv*Gp)/(1+Gc*Gv*Gp*Gm); impulse(pade(Gcl)) hold off title('GroupProb1 - Part d - FFC only') legend('Steady State','Dynamic') % Part E (FFC and FB) figure Gp = 2*exp(-20*s)/(95*s+1); Gd = 0.5*exp(-30*s)/(60*s+1); Gv = 1; Gm = 1; Gt = 1; Gf = -0.25; Gc = 0.95*(1+1/(95*s)); Gcl = (Gd+Gt*Gf*Gv*Gp)/(1+Gc*Gv*Gp*Gm); %Plot step unit response from steady state TF: impulse(pade(Gcl)) hold on Gp = 2*exp(-20*s)/(95*s+1); Gd = 0.5*exp(-30*s)/(60*s+1); Gv = 1; Gm = 1; Gt = 1; Gf = -0.25*(95*s+1)/(60*s+1)*exp(-10*s); Gc = 0.95*(1+1/(95*s)); Gcl = (Gd+Gt*Gf*Gv*Gp)/(1+Gc*Gv*Gp*Gm); impulse(pade(Gcl)) hold off title('GroupProb1 - Part e - FFC and FB') legend('Steady State','Dynamic') end