Hi Cesar,
I understand that you want to generate the discrete time series for part D using the results of the variables in part C.
Please find the code below for the solution of part C in which the values A, B, C, D are used as calculated in the part C :
% Define the parameters
omega = sqrt(2);
zeta = 1/sqrt(2);
w = 2*pi/100;
N_TI = 100;
N_T2 = 50;
% Initialize variables
x_TI = zeros(1, N_TI);
x_T2 = zeros(1, N_T2);
% Generate discrete-time histories for TI system
for k = 3:N_TI
u = sign(cos(2*w*k)); % Input signal
x_TI(k) = -2*x_TI(k-1) - 2*x_TI(k-2) + 2*u; % Update state variable
end
% Generate discrete-time histories for T2 system
for k = 3:N_T2
u = sign(cos(2*w*k)); % Input signal
x_T2(k) = -2*x_T2(k-1) - 2*x_T2(k-2) + 2*u; % Update state variable
end
% Plot the results
k_TI = 0:N_TI-1;
k_T2 = 0:N_T2-1;
figure;
hold on;
plot(k_TI, x_TI, 'b', 'LineWidth', 1.5);
plot(k_T2, x_T2, 'r', 'LineWidth', 1.5);
xlabel('k');
ylabel('x(k)');
legend('TI system', 'T2 system');
title('Discrete-time histories');
Hope this answer helps.