clear
K = 1;
Kp = 5.024740183063027;
Ki = 2.739663529403798;
p=2.75;
q=1;
VarKd = [3.5:0.1:4.5];
k = 0;
N = length(VarKd);
for I = 1:N,
    clc
    k = k+1
    Kd = VarKd(I);
    sim('DC_Motor_Simulation');
    n = length(J);
    J_Kd(I) = J(n);
    U_Kd(I) = U(n);
    E_Kd(I) = E(n);
end
clf
plot(VarKd,J_Kd,VarKd,E_Kd,VarKd,U_Kd),grid on, xlabel('Kd'), ylabel('J, E and U')