RC = 1e-6;

t = linspace(0,2e-5,1000);
ramp_factor = tf(1e6,[1 0]);

% Part (b)
CR = tf([-RC 0],1);
subplot(311);
step(ramp_factor*CR,t);
title('6.302, Problem 2. Part (b): ideal op-amp');

% Part (d)
A = tf(200000,[1/(2*pi*5) 1]);
H = tf(1,[RC 1]);
G = tf([RC 0],[RC 1]); % Prefactor multiplying V_i
CR2 = G*-A/(1+A*H);
subplot(312);
step(ramp_factor*CR2,t);
title('Part (d): single pole at f = 5Hz');

% Part (e)
t3 = linspace(0,1.5e-4,1000);
d = conv([1/(2*pi*5) 1],[1/(6e6) 1]);
A = tf(200000,d);
CR3 = G*-A/(1+A*H);
subplot(313);
step(ramp_factor*CR3,t3);
title('Part (f): second pole at \omega = 6*10^6');