0% found this document useful (0 votes)
2 views3 pages

Document

The document contains MATLAB code for simulating control systems using transfer functions and feedback. It includes plotting system responses to different inputs and calculating key performance metrics such as time delay, peak time, rise time, peak overshoot, and settling time. The results are visualized through various plots to analyze the system behavior over time.

Uploaded by

ishwaripadale6
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Document

The document contains MATLAB code for simulating control systems using transfer functions and feedback. It includes plotting system responses to different inputs and calculating key performance metrics such as time delay, peak time, rise time, peak overshoot, and settling time. The results are visualized through various plots to analyze the system behavior over time.

Uploaded by

ishwaripadale6
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Anushka Ghodekar 3024120 SIMLAB EXAM 5/5/26

clc;
clear all;
close all;
pkg load control;

s=tf('s');
G=(s+1)/(ss((s+2)*(s+3)));
sys_cl= feedback(G,1);
t=0:0.1:20;

u=ones(1,length(t));
[y,x]=lsim(sys_cl,u,t);
figure();
subplot(2,2,1);
pzmap(sys_cl);
xlim([-10,10]); ylim([-10,10]);
xlabel('sigma'); ylabel('jomega');
subplot(2,2,2);
plot(t,y,'b',t,u,'g');
xlabel('time(secs)'); ylabel('amplitude');
title('input-blue, output-green');

r=t;
[y,x]=lsim(sys_cl,r,t);
subplot(2,2,3);
plot(t,y,'b',t,r,'g');
xlabel('time(secs)'); ylabel('amplitude');
title('input-blue, output-green');

p=0.5*t.^2;
[y,x]=lsim(sys_cl,p,t);
subplot(2,2,4);
plot(t,y,'b',t,p,'g');
xlabel('time(secs)'); ylabel('amplitude');
title('input-blue, output-green');
clc;
clear all;
close all;

s=tf('s');
G=4*(s+1)/s;
T= feedback(G,1);
step(T,25);
[x,y]=ginput(4);
figure();

t=0:0.1:20;
zeta=0.25;
wn=2;
wd=wn*(sqrt(1-(zeta^2)));
theta=atan(sqrt(1-(zeta^2))/zeta);
td=(1+(0.7*(zeta))/wn);
tp=pi/wd; tr=pi-theta/wd;
ts=4/zetawn;
mp=exp(-pizeta/(sqrt(1-(zeta^2))))*100;
printf("time delay = %d\n",td);
printf("peak time = %d\n",tp);
printf("rise time = %d\n",tr);
printf("peak overshoot = %d\n",mp);
printf("settling time = %d\n",ts);

You might also like